You are here

class ThemeRegistryLoaderTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php \Drupal\Tests\Core\Template\Loader\ThemeRegistryLoaderTest
  2. 9 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'));
  }

}

Members