Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class BlockTest extends TestCase |
||
10 | { |
||
11 | public function testBlock(): void |
||
12 | { |
||
13 | echo Block::begin() |
||
14 | ->id('testme') |
||
15 | ->start(); |
||
16 | |||
17 | echo '<block-testme>'; |
||
18 | |||
19 | Block::end(); |
||
20 | |||
21 | $this->assertStringContainsString('<block-testme>', $this->webView->getBlock('testme')); |
||
22 | } |
||
23 | |||
24 | public function testBlockRenderInPlaceTrue(): void |
||
25 | { |
||
26 | ob_start(); |
||
27 | ob_implicit_flush(0); |
||
28 | |||
29 | echo Block::begin() |
||
30 | ->id('testme') |
||
31 | ->renderInPlace(true) |
||
32 | ->start(); |
||
33 | |||
34 | echo '<block-testme>'; |
||
35 | |||
36 | echo Block::end(); |
||
37 | |||
38 | $this->assertStringContainsString('<block-testme>', ob_get_clean()); |
||
39 | } |
||
40 | |||
41 | public function testGetBlockException(): void |
||
42 | { |
||
43 | $this->expectException(\InvalidArgumentException::class); |
||
44 | $this->webView->getBlock('notfound'); |
||
45 | } |
||
47 |