Ejemplo n.º 1
0
 function testMocks()
 {
     $I = new CodeGuy($this->scenario);
     $I->testMethod('UserService.create');
     $I->haveFakeClass($user = Stub::makeEmpty('UserModel'));
     $service = new UserService($user);
     $I->executeTestedMethodOn($service, 'davert');
     $I->seeMethodInvoked($user, 'save');
     $I->seeMethodInvokedOnce($user, 'save');
     $I->seeMethodInvokedMultipleTimes($user, 'set', 2);
     $I->seeMethodNotInvoked($user, 'get');
     $this->runSteps();
 }