public function testNestedCapturingFails() { $this->helper->direct()->captureStart(); echo "Captured text"; try { $this->helper->direct()->captureStart(); $this->helper->direct()->captureEnd(); $this->fail('Nested capturing should fail'); } catch (View\Exception $e) { $this->helper->direct()->captureEnd(); $this->assertContains('Cannot nest', $e->getMessage()); } $this->helper->direct()->captureEnd(); }