コード例 #1
0
ファイル: SpyTest.php プロジェクト: aerisweather/Spy
 /** @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;
 }