| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class NotifyActionTest extends GenericActionTest |
||
| 14 | { |
||
| 15 | protected $requestClass = 'Payum\Core\Request\Notify'; |
||
| 16 | protected $actionClass = NotifyAction::class; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @test |
||
| 20 | */ |
||
| 21 | public function shouldBeSubClassOfGatewayAwareAction() |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @test |
||
| 29 | */ |
||
| 30 | public function shouldThrowExceptionWithWrongParams() |
||
| 31 | { |
||
| 32 | $this->expectException(\WebToPayException::class); |
||
| 33 | $expectedModel = array('foo' => 'fooVal'); |
||
| 34 | |||
| 35 | $apiMock = $this->createMock(Api::class); |
||
| 36 | $action = new NotifyAction(); |
||
| 37 | $gatewayMock = $this->createGatewayMock(); |
||
| 38 | $gatewayMock |
||
| 39 | ->expects($this->once()) |
||
| 40 | ->method('execute') |
||
| 41 | ->with($this->isInstanceOf(GetHttpRequest::class)); |
||
| 42 | $apiMock |
||
| 43 | ->expects($this->once()) |
||
| 44 | ->method('doNotify'); |
||
| 45 | |||
| 46 | $action->setGateway($gatewayMock); |
||
| 47 | $action->setApi($apiMock); |
||
| 48 | |||
| 49 | $action->execute(new Notify($expectedModel)); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @test |
||
| 54 | */ |
||
| 55 | public function couldBeConstructedWithoutAnyArguments() |
||
| 59 | } |
||
| 60 | |||
| 61 | } |