Conditions | 1 |
Paths | 1 |
Total Lines | 36 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function testShouldTriggerInitEvent() |
||
18 | { |
||
19 | $initTriggered = false; |
||
20 | |||
21 | // adding some listeners |
||
22 | $this->listenerProvider->attach(function (BeforeRun $event) use (&$initTriggered) { |
||
|
|||
23 | $initTriggered = true; |
||
24 | }); |
||
25 | |||
26 | ob_start(); |
||
27 | ob_implicit_flush(0); |
||
28 | |||
29 | ContentDecorator::begin() |
||
30 | ->viewFile($this->aliases->get('@view/layout.php')) |
||
31 | ->params([]) |
||
32 | ->init(); |
||
33 | |||
34 | echo "\t\t<div class='left-column'>\n"; |
||
35 | echo "\t\t\t<p>This is a left bar!</p>\n"; |
||
36 | echo "\t\t</div>\n\n"; |
||
37 | echo "\t\t<div class='right-column'>\n"; |
||
38 | echo "\t\t\t<p>This is a right bar!</p>\n"; |
||
39 | echo "\t\t</div>\n"; |
||
40 | |||
41 | ContentDecorator::end(); |
||
42 | |||
43 | $this->assertTrue($initTriggered); |
||
44 | |||
45 | $expected = "\t\t<div class='left-column'>\n" . |
||
46 | "\t\t\t<p>This is a left bar!</p>\n" . |
||
47 | "\t\t</div>\n\n" . |
||
48 | "\t\t<div class='right-column'>\n" . |
||
49 | "\t\t\t<p>This is a right bar!</p>\n" . |
||
50 | "\t\t</div>\n"; |
||
51 | |||
52 | $this->assertStringContainsString($expected, ob_get_clean()); |
||
53 | } |
||
55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.