class ThemeRegistryLoaderTest

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

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

Hierarchy

Expanded class hierarchy of ThemeRegistryLoaderTest

File

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

Namespace

Drupal\Tests\Core\Template\Loader
View source
class ThemeRegistryLoaderTest extends UnitTestCase {
  
  /**
   * @covers ::findTemplate
   */
  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.