You are here

public function ProjectUnitTest::projectNameDetectionProvider in Coder 8.3

Same name and namespace in other branches
  1. 8.3.x tests/DrupalPractice/ProjectDetection/ProjectUnitTest.php \DrupalPractice\Test\ProjectDetection\ProjectUnitTest::projectNameDetectionProvider()

Data provider for testProjectNameDetection().

Return value

array<int, array<int, string|false>> An array of test cases, each test case an array with two elements:

  • The filename to check.
  • The expected project name.

File

tests/DrupalPractice/ProjectDetection/ProjectUnitTest.php, line 152

Class

ProjectUnitTest
Tests that project and version detection works.

Namespace

DrupalPractice\Test\ProjectDetection

Code

public function projectNameDetectionProvider() : array {
  return [
    [
      __DIR__ . '/drupal6/testmodule.info',
      'testmodule',
    ],
    [
      __DIR__ . '/drupal6/nested/test.php',
      'testmodule',
    ],
    [
      __DIR__ . '/drupal7/testmodule.info',
      'testmodule',
    ],
    [
      __DIR__ . '/drupal8/testmodule.info.yml',
      'testmodule',
    ],
    [
      __DIR__ . '/drupal8/testtheme/testtheme.info.yml',
      'testtheme',
    ],
    [
      __DIR__ . '/drupal8/testtheme/testtheme.theme',
      'testtheme',
    ],
    [
      'invalid',
      false,
    ],
  ];
}