| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class WidgetTest extends TestCase |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var Widget $widget |
||
| 21 | */ |
||
| 22 | protected $widget; |
||
| 23 | |||
| 24 | public function testWidget(): void |
||
| 25 | { |
||
| 26 | $output = TestWidget::widget()->id('w0')->run(); |
||
| 27 | |||
| 28 | $this->assertSame('<run-w0>', $output); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testBeginEnd(): void |
||
| 32 | { |
||
| 33 | ob_start(); |
||
| 34 | ob_implicit_flush(0); |
||
| 35 | |||
| 36 | $widget = TestWidgetA::begin()->id('test'); |
||
| 37 | |||
| 38 | $this->assertTrue($widget instanceof Widget); |
||
| 39 | |||
| 40 | TestWidgetA::end(); |
||
| 41 | $output = ob_get_clean(); |
||
| 42 | |||
| 43 | $this->assertSame('<run-test>', $output); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @depends testBeginEnd |
||
| 48 | */ |
||
| 49 | public function testStackTracking(): void |
||
| 50 | { |
||
| 51 | $this->expectException('BadFunctionCallException'); |
||
| 52 | TestWidget::end(); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @depends testBeginEnd |
||
| 57 | */ |
||
| 58 | public function testStackTrackingDisorder(): void |
||
| 63 | } |
||
| 64 | } |
||
| 65 |