* * 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:----K/QRunIZXl2xXTcTJxQk0lr4TugRdr3VC9HqHgnFqKlpzxyE3prDB5AKd0a9t0Vyik9yi/ds4ELOK64B0ujDK2HtV+86qIAV9yZJcsTzLKeCTNGHdk6uamKeRbFPaCjRPPnAxYa1sMgxzpX/erhGCOsqgfEQ6TIAfmi0sRdvMJRJWPr/K4SsH6lBn3NiOQNAuMk1kk9lCZihipfp4lbOh0rJ7KC7TC2GX6I6aEaCQbaBmSNIUoxIE6H3lg9+Sfzfbm/gqWk+rzKpK08FUmBA0j/wnEHZlwz0tzsmLzKiLGIlnq+xYt3399kCflRrDSYeA4iXbrqywmjEMbppi3WNenM1dFNPFf1M6KrSWq4XD+ZVb9mi/nCqegz1Gt8u9C5rdiUFoeKTOjYmCW1rp3PER+kf5UvQAxoB++KGQPWBgXP+Ahdu8Y1OEizlqt5X/ANwLou+tq3szUVUcjyHDZkHnijdWAvRppFkpQg+P24qCbiRbT1Pk/1mwFHHbXry7OouNyegUiEu4NcVnayoG9oMS5UfVYhW5aC09yzpGJ8jKsqCOw50FRSV8prT1Ja2hrriBaxaYYVDWYtJVdnoqYpnewLOsEMsSPmbJcq4iGx3Yiejt/gYarYEd9XS7znjXZ6YiBQWtgpFMOkF4zxxOv0ysq/sVPFvIhOY/nCHpGUNRz0=----ATTACHMENT:----MTUwNTYwNDA3NDg4MjU2MSA4MjQyMzcwOTE1MTIzNjkxIDE4ODA1NzI0ODE3MzE1OA==