ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FactoryRuntimeLoaderTest.php
Go to the documentation of this file.
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
12class 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
22 {
23 $loader = new Twig_FactoryRuntimeLoader();
24
25 $this->assertNull($loader->load('stdClass'));
26 }
27}
28
29function getRuntime()
30{
31 return new stdClass();
32}
An exception for terminatinating execution or to throw for unit testing.
Lazy loads the runtime implementations for a Twig element.