You are here

public function ComponentsLoaderTest::testAddPath in Components! 8.2

Tests adding paths to a namespace.

@covers ::addPath

@dataProvider providerTestAddPath

Parameters

string $path: Path to prepend.

string $namespace: Namespace to alter.

array $expected: Expected namespace paths.

Throws

\Twig\Error\LoaderError

File

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

Class

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

Namespace

Drupal\Tests\components\Unit

Code

public function testAddPath(string $path, string $namespace, array $expected) {
  $this->systemUnderTest
    ->addPath($path, $namespace);
  $result = $this->systemUnderTest
    ->getPaths($namespace);
  $this
    ->assertEquals($expected, $result);
}