function ThemeRegistryLoaderTest::testLoaderReturnsFalseForExistsOnNonexistent

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php \Drupal\Tests\Core\Template\Loader\ThemeRegistryLoaderTest::testLoaderReturnsFalseForExistsOnNonexistent()
  2. 10 core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php \Drupal\Tests\Core\Template\Loader\ThemeRegistryLoaderTest::testLoaderReturnsFalseForExistsOnNonexistent()
  3. 11.x core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php \Drupal\Tests\Core\Template\Loader\ThemeRegistryLoaderTest::testLoaderReturnsFalseForExistsOnNonexistent()

@covers ::findTemplate

File

core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php, line 17

Class

ThemeRegistryLoaderTest
@coversDefaultClass \Drupal\Core\Template\Loader\ThemeRegistryLoader @group Template

Namespace

Drupal\Tests\Core\Template\Loader

Code

public function testLoaderReturnsFalseForExistsOnNonexistent() {
    $registry = $this->prophesize('Drupal\\Core\\Theme\\Registry');
    $runtime = $this->prophesize('Drupal\\Core\\Utility\\ThemeRegistry');
    $runtime->has('foo')
        ->shouldBeCalled()
        ->willReturn(FALSE);
    $registry->getRuntime()
        ->willReturn($runtime);
    $loader = new ThemeRegistryLoader($registry->reveal());
    $this->assertFalse($loader->exists('foo'));
}

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