Пример #1
0
 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());
 }
Пример #2
0
 /**
  * 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());
 }
Пример #3
0
 /**
  * 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));
 }