function testExpectedCallCount()
 {
     $mock = new MockDummy();
     $mock->expectCallCount('aMethod', 2);
     $mock->aMethod();
     $mock->aMethod();
 }
Пример #2
0
 function testCanGenerateErrorOnParticularInvocation()
 {
     $mock = new MockDummy();
     $mock->errorAt(2, 'aMethod', 'Ouch!');
     $mock->aMethod();
     $mock->aMethod();
     $this->expectError();
     $mock->aMethod();
 }
Пример #3
0
 function testBadArgParameter()
 {
     $mock = new MockDummy($this);
     $mock->expectArguments("aMethod", "foo");
     $this->assertErrorPattern('/\\$args.*not an array/i');
     $mock->aMethod();
     $mock->tally();
 }