You are here

public function ComponentsLoaderTest::providerTestPrependPath in Components! 8.2

Data provider for testPrependPath().

See also

testPrependPath()

File

tests/src/Unit/ComponentsLoaderTest.php, line 325

Class

ComponentsLoaderTest
@coversDefaultClass \Drupal\components\Template\Loader\ComponentsLoader @group components

Namespace

Drupal\Tests\components\Unit

Code

public function providerTestPrependPath() : array {
  return [
    'basic prepend' => [
      'path' => '/test/templates',
      'namespace' => 'sol',
      'expected' => [
        '/test/templates',
        '/sol/templates',
      ],
    ],
    'Test prepending on a namespace that does not exist' => [
      'path' => '/pluto/templates',
      'namespace' => 'pluto',
      'expected' => [
        '/pluto/templates',
      ],
    ],
    'Test trimming the trailing slash off of the path' => [
      'path' => '/test/trim/',
      'namespace' => 'sol',
      'expected' => [
        '/test/trim',
        '/sol/templates',
      ],
    ],
  ];
}