Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / http-kernel / Tests / Fragment / HIncludeFragmentRendererTest.php
index 1be052e5e62fdbc37f1caaedbbacf301a64909e9..10fbccf0fa207df2be90c3837ef59e66f968aa63 100644 (file)
 namespace Symfony\Component\HttpKernel\Tests\Fragment;
 
 use PHPUnit\Framework\TestCase;
+use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Controller\ControllerReference;
 use Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer;
 use Symfony\Component\HttpKernel\UriSigner;
-use Symfony\Component\HttpFoundation\Request;
 
 class HIncludeFragmentRendererTest extends TestCase
 {
@@ -86,4 +86,17 @@ class HIncludeFragmentRendererTest extends TestCase
         $strategy = new HIncludeFragmentRenderer($engine);
         $this->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'default'))->getContent());
     }
+
+    public function testRenderWithEngineAndDefaultText()
+    {
+        $engine = $this->getMockBuilder('Symfony\\Component\\Templating\\EngineInterface')->getMock();
+        $engine->expects($this->once())
+            ->method('exists')
+            ->with('loading...')
+            ->will($this->throwException(new \RuntimeException()));
+
+        // only default
+        $strategy = new HIncludeFragmentRenderer($engine);
+        $this->assertEquals('<hx:include src="/foo">loading...</hx:include>', $strategy->render('/foo', Request::create('/'), array('default' => 'loading...'))->getContent());
+    }
 }