| Conditions | 1 |
| Paths | 1 |
| Total Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function testRender() |
||
| 11 | { |
||
| 12 | $twig = $this->getMockWithoutConstructor(\Twig_Environment::class); |
||
| 13 | $twig |
||
| 14 | ->expects($this->once()) |
||
| 15 | ->method('render') |
||
| 16 | ->with('test.html.twig', [ |
||
| 17 | 'text' => 'Some Title', |
||
| 18 | 'parameters' => [], |
||
| 19 | 'options' => [ |
||
| 20 | 'length' => null, |
||
| 21 | 'parameters' => [], |
||
| 22 | 'replace' => null, |
||
| 23 | 'template' => 'test.html.twig', |
||
| 24 | 'text' => null, |
||
| 25 | 'translation' => false, |
||
| 26 | 'title' => 'Some Title', |
||
| 27 | ], |
||
| 28 | ]) |
||
| 29 | ->willReturn('html content') |
||
| 30 | ; |
||
| 31 | |||
| 32 | $linkField = new Action('my-field'); |
||
| 33 | $linkField->setTwig($twig); |
||
| 34 | |||
| 35 | $this->setPrivateProperty($linkField, 'options', [ |
||
| 36 | 'length' => null, |
||
| 37 | 'parameters' => [], |
||
| 38 | 'replace' => null, |
||
| 39 | 'template' => 'test.html.twig', |
||
| 40 | 'text' => null, |
||
| 41 | 'translation' => false, |
||
| 42 | 'title' => 'Some Title', |
||
| 43 | ]); |
||
| 44 | |||
| 45 | $content = $linkField->render('a value'); |
||
| 46 | |||
| 47 | $this->assertEquals('html content', $content); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |