public function testVerifyClassMethodCalled() { $user = new UserModel(); $userProxy = new ClassProxy('demo\\UserModel'); double::registerClass('demo\\UserModel'); $user->setName('davert'); $user->setName('jon'); $userProxy->verifyInvokedMultipleTimes('setName', 2); $userProxy->verifyInvokedOnce('setName', ['jon']); $userProxy->verifyNeverInvoked('save'); $userProxy->verifyNeverInvoked('setName', ['bob']); verify($user->getName())->equals('jon'); }
public function testClassMethodInvoked() { $user = new UserModel(); $userProxy = $this->userProxy(); $user->setName(1111); $userProxy->verifyInvoked('setName', [2222]); }