Ejemplo n.º 1
0
 public function getNext_SameExpectationTwice_whenRepeatIs2()
 {
     $expect = new Expectation('method');
     $expect->setRepeat(2);
     $this->sut->add($expect);
     $this->assertEquals($expect, $this->sut->getNext([]));
     $this->assertEquals($expect, $this->sut->getNext([]));
     $this->assertNull($this->sut->getNext([]));
 }
Ejemplo n.º 2
0
 public function handleInvocation_ExpectationRepeatedTwice_returnExpectationsReturnValueTwice()
 {
     $myExpectation = new Expectation('foo');
     $myExpectation->setReturn('foobar');
     $myExpectation->setRepeat(2);
     $expectationsList = new ExpectationList();
     $expectationsList->add($myExpectation);
     $this->expectationMap->put('foo', $expectationsList);
     $this->assertEquals($myExpectation->getReturn(), $this->sut->handleInvocation('foo', null));
     $this->assertEquals($myExpectation->getReturn(), $this->sut->handleInvocation('foo', null));
     $this->assertNull($this->sut->handleInvocation('foo', null));
 }