/** * Tear down class mocker * * @return void */ public function tearDown() { $this->classMocker->disable(); $this->classMocker = null; }
/** * Test PHPUnit expects method * * @return void * @test */ public function testExpectationMethods() { $fwMocker = new ClassMocker(); $fwMocker->mock('Expect_*'); $fwMocker->enable(); $test = new \Expect_Something(); $test->expects($this->once())->method('hello')->will($this->returnValue('Hello World')); $this->assertEquals('Hello World', $test->hello()); $fwMocker->disable(); }