Exemplo n.º 1
0
 /** @test */
 public function andReturnUsing_shouldReturnACallbacksValue()
 {
     $spy = new Spy();
     $spy->andReturnUsing(function ($arg) {
         return strtoupper($arg);
     });
     $this->assertEquals('FOO', $spy('foo'));
 }
Exemplo n.º 2
0
 public static function returnsUsing(callable $cb)
 {
     $spy = new Spy();
     $spy->andReturnUsing($cb);
     return $spy;
 }