/** * @test */ public function shouldAllowCreatePaymentWithStandardActionsAdded() { $gatewayMock = $this->createGatewayMock(); $payment = OnsitePaymentFactory::create($gatewayMock); $this->assertInstanceOf('Payum\\Core\\Payment', $payment); $this->assertAttributeCount(1, 'apis', $payment); $actions = $this->readAttribute($payment, 'actions'); $this->assertInternalType('array', $actions); $this->assertNotEmpty($actions); }
/** * @test */ public function shouldFinishWithFailed() { $payment = OnsitePaymentFactory::create(new Gateway()); $date = new \DateTime('now + 2 year'); $captureRequest = new CaptureRequest(array('amount' => '1000.00', 'card' => array('number' => '4111111111111111', 'cvv' => 123, 'expiryMonth' => 6, 'expiryYear' => $date->format('y'), 'firstName' => 'foo', 'lastName' => 'bar'))); $payment->execute($captureRequest); $statusRequest = new BinaryMaskStatusRequest($captureRequest->getModel()); $payment->execute($statusRequest); $this->assertTrue($statusRequest->isFailed()); }