tests/FactoryRuntimeLoaderTest.php
91c8d599
 <?php
 
2119e60c
 namespace Twig\Tests;
 
91c8d599
 /*
  * This file is part of Twig.
  *
  * (c) Fabien Potencier
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
  */
 
34bdab4d
 use PHPUnit\Framework\TestCase;
1ddb8253
 use Twig\RuntimeLoader\FactoryRuntimeLoader;
 
34bdab4d
 class FactoryRuntimeLoaderTest extends TestCase
91c8d599
 {
     public function testLoad()
     {
2119e60c
         $loader = new FactoryRuntimeLoader(['stdClass' => '\Twig\Tests\getRuntime']);
91c8d599
 
         $this->assertInstanceOf('stdClass', $loader->load('stdClass'));
     }
 
     public function testLoadReturnsNullForUnmappedRuntime()
     {
1ddb8253
         $loader = new FactoryRuntimeLoader();
91c8d599
 
         $this->assertNull($loader->load('stdClass'));
     }
 }
 
 function getRuntime()
 {
b8daa6c4
     return new \stdClass();
91c8d599
 }