public function testBindAnswerReturnsAnswerCollectionBinder() { $answer = $this->getMock('Phake_Stubber_IAnswer'); $newBinder = $this->binder->bindAnswer($answer); $this->assertInstanceOf('Phake_Proxies_AnswerCollectionProxy', $newBinder); $this->assertEquals($answer, $newBinder->getAnswer()); }
/** * Tests the thenDoNothing functionality of the proxy. * * It should result in the binder being called with no answer. */ public function testThenDoNothing() { $this->binder->expects($this->once())->method('bindAnswer')->with($this->isInstanceOf('Phake_Stubber_Answers_NoAnswer'))->will($this->returnValue($this->binder)); $this->assertSame($this->binder, $this->proxy->thenDoNothing()); }
/** * Tests the thenThrow functionality of the proxy. */ public function testThenThrow() { $exception = new RuntimeException(); $this->binder->expects($this->once())->method('bindAnswer')->with($this->logicalAnd($this->isInstanceOf('Phake_Stubber_Answers_ExceptionAnswer'), $this->attributeEqualTo('answer', $exception)))->will($this->returnValue($this->binder)); $this->assertSame($this->binder, $this->proxy->thenThrow($exception)); }