public function shouldSubExecuteCreateOrderRequestIfStatusAndLocationNotSet()
{
$orderMock = $this->createOrderMock();
$orderMock->expects($this->once())->method('marshal')->will($this->returnValue(array('foo' => 'fooVal', 'bar' => 'barVal')));
$orderMock->expects($this->once())->method('getLocation')->will($this->returnValue('theLocation'));
$gatewayMock = $this->createGatewayMock();
$gatewayMock->expects($this->at(0))->method('execute')->with($this->isInstanceOf(CreateOrder::class))->will($this->returnCallback(function (CreateOrder $request) use($orderMock) {
$request->setOrder($orderMock);
}));
$gatewayMock->expects($this->at(1))->method('execute')->with($this->isInstanceOf(Sync::class));
$action = new AuthorizeAction('aTemplate');
$action->setGateway($gatewayMock);
$action->setApi(new Config());
$model = new \ArrayObject(['merchant' => ['confirmation_uri' => 'theConfirmationUri', 'push_uri' => 'thePushUri', 'checkout_uri' => 'theCheckoutUri', 'terms_uri' => 'theTermsUri']]);
$action->execute(new Authorize($model));
$this->assertEquals('fooVal', $model['foo']);
$this->assertEquals('barVal', $model['bar']);
$this->assertEquals('theLocation', $model['location']);
}