示例#1
0
 public function testMappingParameterSetter()
 {
     $matcher = new Phake_Matchers_MethodMatcher('method', new Phake_Matchers_ReferenceSetter(42));
     $stub = $this->getMock('Phake_Stubber_AnswerCollection', array(), array(), '', false);
     $value = 'blah';
     $arguments = array();
     $arguments[0] =& $value;
     $this->mapper->mapStubToMatcher($stub, $matcher);
     $this->assertEquals($stub, $this->mapper->getStubByCall('method', $arguments));
     $this->assertEquals(42, $value);
 }
示例#2
0
 /**
  * Binds an answer to the the classes
  *
  * @param Phake_Stubber_IAnswer $answer
  *
  * @return Phake_Proxies_AnswerCollectionProxy
  */
 public function bindAnswer(Phake_Stubber_IAnswer $answer)
 {
     $collection = new Phake_Stubber_AnswerCollection($answer);
     $this->stubMapper->mapStubToMatcher($collection, $this->matcher);
     return new Phake_Proxies_AnswerCollectionProxy($collection);
 }