summaryrefslogtreecommitdiffstatshomepage
path: root/core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php
blob: 2fcaeb8471c712a6036993444f5d82500e3da39f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

declare(strict_types=1);

namespace Drupal\FunctionalTests;

use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;

/**
 * Test for BrowserTestBase::getTestMethodCaller() in child classes.
 */
#[Group('browsertestbase')]
class GetTestMethodCallerExtendsTest extends GetTestMethodCallerTest {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * A test method that is not present in the parent class.
   */
  public function testGetTestMethodCallerChildClass(): void {
    $method_caller = $this->getTestMethodCaller();
    $expected = [
      'file' => __FILE__,
      'line' => 25,
      'function' => __CLASS__ . '->' . __FUNCTION__ . '()',
      'class' => BrowserTestBase::class,
      'object' => $this,
      'type' => '->',
      'args' => [],
    ];
    $this->assertEquals($expected, $method_caller);
  }

}