예제 #1
0
 public function convertWithException(\CodeGuy $I)
 {
     $I->wantTo("test if converting of different measure types fails.");
     $I->haveStub($converter = Stub::make($this->class));
     $I->amTestingMethod('\\Measure\\Converter.convert');
     $I->executeTestedMethodOn($converter, 1, 'liter', 'kg');
     $I->seeExceptionThrown('\\ErrorException');
 }
예제 #2
0
 function testExceptions()
 {
     $I = new CodeGuy($this->scenario);
     $I->testMethod('UserModel.get');
     $user = new UserModel();
     $I->executeTestedMethodOn($user, 'name');
     $I->seeExceptionThrown('Exception');
     $this->runSteps();
 }