Beispiel #1
0
 public function testLambdaAnswerAcceptsOldschoolLambda()
 {
     $func = create_function('$arg1', 'return $arg1;');
     $answer = new Phake_Stubber_Answers_LambdaAnswer($func);
     $callback = $answer->getCallback($this, 'foo', array('bar'));
     $result = call_user_func_array($callback, array('bar'));
     $this->assertSame("bar", $result);
 }
Beispiel #2
0
 public function testLambdaAnswerAcceptsOldschoolLambda()
 {
     $func = function ($arg1) {
         return $arg1;
     };
     $answer = new Phake_Stubber_Answers_LambdaAnswer($func);
     $result = call_user_func($answer->getAnswerCallback('someObject', 'testMethod'), 'bar');
     $this->assertSame("bar", $result);
 }