1 | <?php |
||
24 | class PhpTemplateTest extends AbstractTemplateTest |
||
25 | { |
||
26 | /** |
||
27 | * @var PhpEngine |
||
28 | */ |
||
29 | private $phpEngine; |
||
30 | |||
31 | /** |
||
32 | * @var FormHelper|\PHPUnit_Framework_MockObject_MockObject |
||
33 | */ |
||
34 | private $formHelper; |
||
35 | |||
36 | /** |
||
37 | * @var SlotsHelper|\PHPUnit_Framework_MockObject_MockObject |
||
38 | */ |
||
39 | private $slotsHelper; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | protected function setUp() |
||
45 | { |
||
46 | parent::setUp(); |
||
47 | |||
48 | $this->formHelper = $this->getMockBuilder(FormHelper::class) |
||
49 | ->disableOriginalConstructor() |
||
50 | ->getMock(); |
||
51 | |||
52 | $this->slotsHelper = $this->getMockBuilder(SlotsHelper::class) |
||
53 | ->disableOriginalConstructor() |
||
54 | ->getMock(); |
||
55 | |||
56 | $this->phpEngine = new PhpEngine( |
||
57 | new TemplateNameParser(), |
||
58 | new FilesystemLoader([__DIR__.'/../../src/Resources/views/Form/%name%']), |
||
59 | [ |
||
60 | 'form' => $this->formHelper, |
||
61 | 'slots' => $this->slotsHelper, |
||
62 | new CKEditorHelper($this->renderer), |
||
63 | ] |
||
64 | ); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | protected function renderTemplate(array $context = []) |
||
71 | { |
||
72 | return $this->phpEngine->render('ckeditor_widget.html.php', $context); |
||
73 | } |
||
74 | } |
||
75 |