php - PhpUnit @depends annotation and MockObject -
this code example: class testtest extends \phpunit_framework_testcase { public function testfirst() { $factory_mock = $this->getmockbuilder('factory') ->disableoriginalconstructor() ->disableoriginalclone() ->getmock(); $factory_mock ->expects($this->any()) ->method('getdata') ->will($this->returnvalue('123')); var_dump($factory_mock->getdata()); var_dump($factory_mock->getdata()); return $factory_mock; } /** * @depends testfirst */ public function testsecond(factory $factory) { var_dump($factory->getdata()); } } this result get: .string(3) "123" string(3) "123" .null i expect third "getdata" method invocation give me same result first two, won't happen. don't understand why. please, share knowled...