Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Template / Loader / ThemeRegistryLoaderTest.php
diff --git a/web/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php b/web/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php
new file mode 100644 (file)
index 0000000..9325eae
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\Tests\Core\Template\Loader;
+
+use Drupal\Core\Template\Loader\ThemeRegistryLoader;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @coversDefaultClass \Drupal\Core\Template\Loader\ThemeRegistryLoader
+ * @group Template
+ */
+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'));
+  }
+
+}