use Symfony\Component\Templating\EngineInterface;
use Symfony\Component\Templating\Tests\Fixtures\MyStreamingEngine;
use Symfony\Component\Templating\Tests\Fixtures\TestEngine;
/**
* @group legacy
*/
class DelegatingEngineTest extends TestCase
{ public function testRenderDelegatesToSupportedEngine() { $firstEngine =
$this->
getEngineMock('template.php', false
);
$secondEngine =
$this->
getEngineMock('template.php', true
);
$secondEngine->
expects($this->
once()) ->
method('render'
) ->
with('template.php',
['foo' => 'bar'
]) ->
willReturn('<html />'
);
$delegatingEngine =
new DelegatingEngine([$firstEngine,
$secondEngine]);
$result =
$delegatingEngine->
render('template.php',
['foo' => 'bar'
]);
$this->
assertSame('<html />',
$result);
}