/** * @test */ public function shouldFinishWithFailed() { $factory = new OmnipayGatewayFactory('Dummy'); $gateway = $factory->create([]); $date = new \DateTime('now + 2 year'); $capture = new Capture(array('amount' => '1000.00', 'card' => array('number' => '4111111111111111', 'cvv' => 123, 'expiryMonth' => 6, 'expiryYear' => $date->format('y'), 'firstName' => 'foo', 'lastName' => 'bar'))); $gateway->execute($capture); $statusRequest = new GetHumanStatus($capture->getModel()); $gateway->execute($statusRequest); $this->assertTrue($statusRequest->isFailed()); }
/** * @test * * @expectedException \Payum\Core\Exception\LogicException * @expectedExceptionMessage Given omnipay gateway type Invalid or class is not supported. Supported: */ public function shouldThrowIfTypeNotValid() { $factory = new OmnipayGatewayFactory(); $factory->create(array('type' => 'Invalid')); }