Security update for Core, with self-updated composer
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / FactoryRuntimeLoaderTest.php
1 <?php
2
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 class Twig_Tests_FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase
13 {
14     public function testLoad()
15     {
16         $loader = new Twig_FactoryRuntimeLoader(array('stdClass' => 'getRuntime'));
17
18         $this->assertInstanceOf('stdClass', $loader->load('stdClass'));
19     }
20
21     public function testLoadReturnsNullForUnmappedRuntime()
22     {
23         $loader = new Twig_FactoryRuntimeLoader();
24
25         $this->assertNull($loader->load('stdClass'));
26     }
27 }
28
29 function getRuntime()
30 {
31     return new stdClass();
32 }