function testOverOnce() { $this->test->expectOnce('assert', array(new IsAExpectation('CallCountExpectation'), 2)); $mock = new MockDummyWithInjectedTestCase(); $mock->expectOnce('aMethod'); $mock->aMethod(); $mock->aMethod(); $mock->atTestEnd('testSomething', $this->test); $this->swallowErrors(); }
function testOverOnce() { $this->test->expectOnce('assert', array(new LikeExpectation(new CallCountExpectation('aMethod', 1)), 2)); $mock = new MockDummyWithInjectedTestCase(); $mock->expectOnce('aMethod'); $mock->aMethod(); $mock->aMethod(); $mock->mock->atTestEnd('testSomething', $this->test); }
function testOverOnce() { $this->test->expectOnce("assertTrue", array(false, '*')); $mock = new MockDummyWithInjectedTestCase(); $mock->expectOnce("aMethod"); $mock->aMethod(); $mock->aMethod(); $mock->atTestEnd('testSomething'); $this->swallowErrors(); }