Dumplie\SharedKernel\Tests\Integration\Application\InMemory\CommandExtensionTest::createExtensionProphecy PHP Метод

createExtensionProphecy() приватный Метод

private createExtensionProphecy ( Dumplie\SharedKernel\Application\Command\Command $command, Closure $prePromise = null, Closure $postPromise = null ) : Prophecy\Prophecy\ObjectProphecy
$command Dumplie\SharedKernel\Application\Command\Command
$prePromise Closure
$postPromise Closure
Результат Prophecy\Prophecy\ObjectProphecy
    private function createExtensionProphecy(Command $command, \Closure $prePromise = null, \Closure $postPromise = null)
    {
        $extension = $this->prophesize(Extension::class);
        $extension->expands($command)->willReturn(true);
        if ($prePromise !== null) {
            $extension->pre($command, $this->serviceLocator)->will($prePromise);
        }
        if ($postPromise !== null) {
            $extension->post($command, $this->serviceLocator)->will($postPromise);
        }
        return $extension;
    }