예제 #1
0
 /** @test */
 public function andReturnUsing_shouldReturnACallbacksValue()
 {
     $spy = new Spy();
     $spy->andReturnUsing(function ($arg) {
         return strtoupper($arg);
     });
     $this->assertEquals('FOO', $spy('foo'));
 }
예제 #2
0
파일: Spy.php 프로젝트: aerisweather/Spy
 public static function returnsUsing(callable $cb)
 {
     $spy = new Spy();
     $spy->andReturnUsing($cb);
     return $spy;
 }