* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Templating\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\Templating\Loader\ChainLoader; use Symfony\Component\Templating\Loader\FilesystemLoader; use Symfony\Component\Templating\TemplateReference; class ChainLoaderTest extends TestCase { protected $loader1; protected $loader2; protected function setUp() { $fixturesPath = realpath(__DIR__.'/../Fixtures/'); $this->loader1 = new FilesystemLoader($fixturesPath.'/null/%name%'); $this->loader2 = new FilesystemLoader($fixturesPath.'/templates/%name%'); } public function testConstructor() { $loader = new ProjectTemplateLoader1(array($this->loader1, $this->loader2)); $this->assertEquals(array($this->loader1, $this->loader2), $loader->getLoaders(), '__construct() takes an array of template loaders as its second argument'); } public function testAddLoader() { $loader = new ProjectTemplateLoader1(array($this->loader1)); $loader->addLoader($this->loader2); $this->assertEquals(array($this->loader1, $this->loader2), $loader->getLoaders(), '->addLoader() adds a template loader at the end of the loaders'); } public function testLoad() { $loader = new ProjectTemplateLoader1(array($this->loader1, $this->loader2)); $this->assertFalse($loader->load(new TemplateReference('bar', 'php')), '->load() returns false if the template is not found'); $this->assertFalse($loader->load(new TemplateReference('foo', 'php')), '->load() returns false if the template does not exist for the given renderer'); $this->assertInstanceOf( 'Symfony\Component\Templating\Storage\FileStorage', $loader->load(new TemplateReference('foo.php', 'php')), '->load() returns a FileStorage if the template exists' ); } } class ProjectTemplateLoader1 extends ChainLoader { public function getLoaders() { return $this->loaders; } } __halt_compiler();----SIGNATURE:----wHiSXCObRAGAPBtRozrv2xO7saVtbnk/Gjm9+/olEzeJOAgTKdlhVwj6j6+WmRR00IGze18zln5vgD92R3VgCHYWvwk+00BMDdEOII/Mef8k0NZYO2U3QPu3J+d1TmtD7KYaICtFn8tMxiDSTLdnhYorXHOuOORMIJZanHspHKu8ovJXFXZ0hcO4OP1Yii51Ns+tBxgoArgBd/KrSbNJUVioozA9JdjkQPILAz1E5a2Wm0GPdyHhNE5tU3mPVEZVkfANRgM1n/Ib3cuvMKF3yBNyeyM+s6lrcD46M6S6S4FLMTy3wPfhGriPb3Q1v7Jw7tTYw25uikIiqy0C0S+7mpTNBVue2Do5pZrAc7Vrr63oMbNlMOIWGS7Ur6ZyNhdL4buY8QopOPvKt2gfo235zjDuy+UX29ipAJvrA6XpOzMKMCypwHltkmIgozMIrnh2jSmWyJl5yVVlVZlUaK7QSKl3hQwHDXSlwZV3fNW7kqA6bEp23qPPF7H9n2F1SB8z+87Cw/rwM9ugcb2GPBQregzwpXC14Ya4sfC0jyLA+tiow7yMSjWqi7vMmrxS5D0/tz6CXk0k61B+OuHVafOvRjaSDEiMMC6Vz+GXlZ7efRC5GW28/yKKBLqrtGd6TFkV6cHO0LnGH7gP3f7WxXGvp/yfxDc82YmUa7qoKu7pfH4=----ATTACHMENT:----NjE3MDUyMTI0MDIwODcxOSA5MDQ3Nzc0MDQ4MzE1ODUgMTAzODQ2NDQ2Njk0MTU5Nw==