| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class CaptureActionTest extends GenericActionTest |
||
| 13 | { |
||
| 14 | protected $requestClass = Capture::class; |
||
| 15 | |||
| 16 | protected $actionClass = CaptureAction::class; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @test |
||
| 20 | */ |
||
| 21 | public function shouldImplementsApiAwareInterface() |
||
| 25 | } |
||
| 26 | |||
| 27 | /** @test */ |
||
| 28 | public function shouldImplementsGatewayAwareInterface() |
||
| 29 | { |
||
| 30 | $rc = new \ReflectionClass(CaptureAction::class); |
||
| 31 | $this->assertTrue($rc->isSubclassOf(GatewayAwareInterface::class)); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @test |
||
| 36 | */ |
||
| 37 | public function shouldCallDoPayment() |
||
| 38 | { |
||
| 39 | $apiMock = $this->createMock(Api::class); |
||
| 40 | $action = new CaptureAction(); |
||
| 41 | $gateway = $this->createGatewayMock(); |
||
| 42 | $apiMock |
||
| 43 | ->expects($this->once()) |
||
| 44 | ->method('doPayment') |
||
| 45 | ; |
||
| 46 | $action->setGateway($gateway); |
||
| 47 | $action->setApi($apiMock); |
||
| 48 | $action->execute(new Capture([])); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @test |
||
| 53 | */ |
||
| 54 | public function couldBeConstructedWithoutAnyArguments() |
||
| 58 | } |
||
| 59 | } |