class PhpEngineTest extends TestCase
{ protected ProjectTemplateEngineLoader
$loader;
protected function setUp(): void
{ $this->loader =
new ProjectTemplateEngineLoader();
} public function testConstructor() { $engine =
new ProjectTemplateEngine(new TemplateNameParser(),
$this->loader
);
$this->
assertEquals($this->loader,
$engine->
getLoader(), '__construct() takes a loader instance as its second first argument'
);
} public function testOffsetGet() { $engine =
new ProjectTemplateEngine(new TemplateNameParser(),
$this->loader
);
$engine->
set($helper =
new \Symfony\Component\Templating\Tests\Fixtures\
SimpleHelper('bar'
), 'foo'
);
$this->
assertEquals($helper,
$engine['foo'
], '->offsetGet() returns the value of a helper'
);
try { $engine['bar'
];