function TestDiscoveryTest::infoParserProvider

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::infoParserProvider()
  2. 10 core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::infoParserProvider()
  3. 11.x core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php \Drupal\Tests\Core\Test\TestDiscoveryTest::infoParserProvider()

File

core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php, line 30

Class

TestDiscoveryTest
@coversDefaultClass \Drupal\Core\Test\TestDiscovery[[api-linebreak]] @group Test

Namespace

Drupal\Tests\Core\Test

Code

public function infoParserProvider() {
  // A module provided unit test.
  $tests[] = [
    // Expected result.
[
      'name' => static::class,
      'group' => 'Test',
      'groups' => [
        'Test',
      ],
      'description' => 'Tests \\Drupal\\Core\\Test\\TestDiscovery.',
      'type' => 'PHPUnit-Unit',
    ],
    // Classname.
static::class,
  ];
  // A core unit test.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\Tests\\Core\\DrupalTest',
      'group' => 'DrupalTest',
      'groups' => [
        'DrupalTest',
      ],
      'description' => 'Tests \\Drupal.',
      'type' => 'PHPUnit-Unit',
    ],
    // Classname.
'Drupal\\Tests\\Core\\DrupalTest',
  ];
  // Functional PHPUnit test.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\FunctionalTests\\BrowserTestBaseTest',
      'group' => 'browsertestbase',
      'groups' => [
        'browsertestbase',
      ],
      'description' => 'Tests BrowserTestBase functionality.',
      'type' => 'PHPUnit-Functional',
    ],
    // Classname.
'Drupal\\FunctionalTests\\BrowserTestBaseTest',
  ];
  // kernel PHPUnit test.
  $tests['phpunit-kernel'] = [
    // Expected result.
[
      'name' => '\\Drupal\\Tests\\file\\Kernel\\FileItemValidationTest',
      'group' => 'file',
      'groups' => [
        'file',
      ],
      'description' => 'Tests that files referenced in file and image fields are always validated.',
      'type' => 'PHPUnit-Kernel',
    ],
    // Classname.
'\\Drupal\\Tests\\file\\Kernel\\FileItemValidationTest',
  ];
  // Simpletest classes can not be autoloaded in a PHPUnit test, therefore
  // provide a docblock.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser.\n *\n * @group simpletest\n */\n ",
  ];
  // Test with a different amount of leading spaces.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n   * Tests the Simpletest UI internal browser.\n   *\n   * @group simpletest\n   */\n   */\n ",
  ];
  // Make sure that a "* @" inside a string does not get parsed as an
  // annotation.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
      'description' => 'Tests the Simpletest UI internal browser. * @',
      'type' => 'Simpletest',
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n   * Tests the Simpletest UI internal browser. * @\n   *\n   * @group simpletest\n   */\n ",
  ];
  // Multiple @group annotations.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'group' => 'Test',
      'groups' => [
        'Test',
        'simpletest',
      ],
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser.\n *\n * @group Test\n * @group simpletest\n */\n ",
  ];
  // A great number of @group annotations.
  $tests['many-group-annotations'] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'group' => 'Test',
      'groups' => [
        'Test',
        'simpletest',
        'another',
        'more',
        'many',
        'enough',
        'whoa',
      ],
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser.\n *\n * @group Test\n * @group simpletest\n * @group another\n * @group more\n * @group many\n * @group enough\n * @group whoa\n */\n ",
  ];
  // @dependencies annotation.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
      'requires' => [
        'module' => [
          'test',
        ],
      ],
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser.\n *\n * @dependencies test\n * @group simpletest\n */\n ",
  ];
  // Multiple @dependencies annotation.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'description' => 'Tests the Simpletest UI internal browser.',
      'type' => 'Simpletest',
      'requires' => [
        'module' => [
          'test',
          'test1',
          'test2',
        ],
      ],
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser.\n *\n * @dependencies test, test1, test2\n * @group simpletest\n */\n ",
  ];
  // Multi-line summary line.
  $tests[] = [
    // Expected result.
[
      'name' => 'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
      'description' => 'Tests the Simpletest UI internal browser. And the summary line continues an there is no gap to the annotation.',
      'type' => 'Simpletest',
      'group' => 'simpletest',
      'groups' => [
        'simpletest',
      ],
    ],
    // Classname.
'Drupal\\simpletest\\Tests\\ExampleSimpleTest',
    // Doc block.
"/**\n * Tests the Simpletest UI internal browser. And the summary line continues an\n * there is no gap to the annotation.\n *\n * @group simpletest\n */\n ",
  ];
  return $tests;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.