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(); }
function testBadArgParameter() { $mock = new MockDummy($this); $mock->expectArguments("aMethod", "foo"); $this->assertErrorPattern('/\\$args.*not an array/i'); $mock->aMethod(); $mock->tally(); }