You are here

function CallbackPromiseSpec::it_should_execute_closure_callback in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php \spec\Prophecy\Promise\CallbackPromiseSpec::it_should_execute_closure_callback()

Parameters

\Prophecy\Prophecy\ObjectProphecy $object:

\Prophecy\Prophecy\MethodProphecy $method:

File

vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php, line 23

Class

CallbackPromiseSpec

Namespace

spec\Prophecy\Promise

Code

function it_should_execute_closure_callback($object, $method) {
  $firstArgumentCallback = function ($args) {
    return $args[0];
  };
  $this
    ->beConstructedWith($firstArgumentCallback);
  $this
    ->execute(array(
    'one',
    'two',
  ), $object, $method)
    ->shouldReturn('one');
}