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();
 }
Пример #2
0
 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);
 }
Пример #3
0
 function testOverOnce()
 {
     $this->test->expectOnce("assertTrue", array(false, '*'));
     $mock = new MockDummyWithInjectedTestCase();
     $mock->expectOnce("aMethod");
     $mock->aMethod();
     $mock->aMethod();
     $mock->atTestEnd('testSomething');
     $this->swallowErrors();
 }