function it_should_not_charge_if_token_is_not_authorized(ChargeToken $request, APIClient $api, Payment $payment) { $model = new ArrayObject(array('PaymentOrder' => array('Status' => APIClient::STATUS_PROGRESS), 'PaymentOrderId' => 456, 'Amount' => 123, 'Currency' => 'EUR')); $request->getModel()->willReturn($model); $api->PaymentOrderCharge(Argument::any(), Argument::any(), Argument::any())->shouldNotBeCalled(); $payment->execute(Argument::any())->shouldNotBeCalled(); $this->execute($request); }