function testExpectedCallCount()
 {
     $mock = new MockDummy();
     $mock->expectCallCount('aMethod', 2);
     $mock->aMethod();
     $mock->aMethod();
 }
 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();
 }