/** * Tests the example from the documentation. * * @expectedException Exception */ public function testExample4() { $function = function () { throw new \Exception(); }; $mock = new Mock(__NAMESPACE__, "time", $function); $mock->enable(); try { time(); } finally { $mock->disable(); } }
protected function tearDown() { if (!empty($this->mock)) { $this->mock->disable(); unset($this->mock); } }
protected function tearDown() { if (isset($this->mock)) { $this->mock->disable(); } }