function MockFileFinderTest::testFindFile

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php \Drupal\Tests\Component\Annotation\MockFileFinderTest::testFindFile()
  2. 10 core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php \Drupal\Tests\Component\Annotation\MockFileFinderTest::testFindFile()
  3. 11.x core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php \Drupal\Tests\Component\Annotation\MockFileFinderTest::testFindFile()

@covers ::create @covers ::findFile

File

core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php, line 18

Class

MockFileFinderTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Component%21Annotation%21Reflection%21MockFileFinder.php/class/MockFileFinder/8.9.x" title="Defines a mock file finder that only returns a single filename." class="local">\Drupal\Component\Annotation\Reflection\MockFileFinder</a> @group Annotation

Namespace

Drupal\Tests\Component\Annotation

Code

public function testFindFile() {
    $tmp = MockFileFinder::create('testfilename.txt');
    $this->assertEquals('testfilename.txt', $tmp->findFile('n/a'));
    $this->assertEquals('testfilename.txt', $tmp->findFile('someclass'));
}

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