GetTestMethodCallerExtendsTest.php 801 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Drupal\FunctionalTests;
  3. use Drupal\Tests\BrowserTestBase;
  4. /**
  5. * Test for BrowserTestBase::getTestMethodCaller() in child classes.
  6. *
  7. * @group browsertestbase
  8. */
  9. class GetTestMethodCallerExtendsTest extends GetTestMethodCallerTest {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. protected $defaultTheme = 'stark';
  14. /**
  15. * A test method that is not present in the parent class.
  16. */
  17. public function testGetTestMethodCallerChildClass() {
  18. $method_caller = $this->getTestMethodCaller();
  19. $expected = [
  20. 'file' => __FILE__,
  21. 'line' => 23,
  22. 'function' => __CLASS__ . '->' . __FUNCTION__ . '()',
  23. 'class' => BrowserTestBase::class,
  24. 'object' => $this,
  25. 'type' => '->',
  26. 'args' => [],
  27. ];
  28. $this->assertEquals($expected, $method_caller);
  29. }
  30. }