spec/Cerbero/Workflow/WorkflowSpec.php
public function it_resolves_the_proper_request_if_existing($pipelines, $container, Router $router, $inflector, $dispatcher, ExistingRequest $request)
    {
    	$pipelines->exists('registerUser')->willReturn(true);

    	$inflector->of('registerUser')->shouldBeCalled();

    	$inflector->getRequest()->willReturn('spec\Cerbero\Workflow\ExistingRequest');

    	$container->make('spec\Cerbero\Workflow\ExistingRequest')->shouldBeCalled()->willReturn($request);

        $container->make('router')->willReturn($router);

        $router->current()->willReturn($router);

        $router->parameters()->willReturn(['foo' => 'bar']);

    	$inflector->getJob()->willReturn('job');

    	$pipelines->getPipesByPipeline('registerUser')->willReturn(['pipe']);

    	$dispatcher->pipeThrough(['pipe'])->willReturn($dispatcher);

    	$dispatcher->dispatchFrom('job', $request, ['foo' => 'bar'])->shouldBeCalled();

    	$this->registerUser();
    }
public function it_resolves_the_proper_request_if_existing($pipelines, $container, Router $router, $inflector, $dispatcher, ExistingRequest $request)
    {
    	$pipelines->exists('registerUser')->willReturn(true);

    	$inflector->of('registerUser')->shouldBeCalled();

    	$inflector->getRequest()->willReturn('spec\Cerbero\Workflow\ExistingRequest');

    	$container->make('spec\Cerbero\Workflow\ExistingRequest')->shouldBeCalled()->willReturn($request);

        $container->make('router')->willReturn($router);

        $router->current()->willReturn($router);

        $router->parameters()->willReturn(['foo' => 'bar']);

    	$inflector->getJob()->willReturn('job');

    	$pipelines->getPipesByPipeline('registerUser')->willReturn(['pipe']);

    	$dispatcher->pipeThrough(['pipe'])->willReturn($dispatcher);

    	$dispatcher->dispatchFrom('job', $request, ['foo' => 'bar'])->shouldBeCalled();

    	$this->registerUser();
    }
@testdox	It resolves the proper request if existing.

@author	Andrea Marco Sartori
@return	void