1 | <?php |
||||||
2 | |||||||
3 | /* |
||||||
4 | * This file has been created by developers from BitBag. |
||||||
5 | * Feel free to contact us once you face any issues or want to start |
||||||
6 | * another great project. |
||||||
7 | * You can find more information about us on https://bitbag.shop and write us |
||||||
8 | * an email on [email protected]. |
||||||
9 | */ |
||||||
10 | |||||||
11 | declare(strict_types=1); |
||||||
12 | |||||||
13 | namespace spec\BitBag\SyliusMolliePlugin\Action; |
||||||
14 | |||||||
15 | use BitBag\SyliusMolliePlugin\Action\NotifyAction; |
||||||
16 | use BitBag\SyliusMolliePlugin\Client\MollieApiClient; |
||||||
17 | use BitBag\SyliusMolliePlugin\Repository\SubscriptionRepositoryInterface; |
||||||
18 | use Mollie\Api\Endpoints\PaymentEndpoint; |
||||||
19 | use Payum\Core\Action\ActionInterface; |
||||||
20 | use Payum\Core\ApiAwareInterface; |
||||||
21 | use Payum\Core\GatewayAwareInterface; |
||||||
22 | use Payum\Core\GatewayInterface; |
||||||
23 | use Payum\Core\Request\GetHttpRequest; |
||||||
24 | use Payum\Core\Request\Notify; |
||||||
25 | use PhpSpec\ObjectBehavior; |
||||||
26 | |||||||
27 | final class NotifyActionSpec extends ObjectBehavior |
||||||
28 | { |
||||||
29 | function let(GetHttpRequest $getHttpRequest, SubscriptionRepositoryInterface $subscriptionRepository): void |
||||||
0 ignored issues
–
show
|
|||||||
30 | { |
||||||
31 | $this->beConstructedWith($getHttpRequest, $subscriptionRepository); |
||||||
32 | } |
||||||
33 | |||||||
34 | function it_is_initializable(): void |
||||||
0 ignored issues
–
show
|
|||||||
35 | { |
||||||
36 | $this->shouldHaveType(NotifyAction::class); |
||||||
37 | } |
||||||
38 | |||||||
39 | function it_implements_action_interface(): void |
||||||
40 | { |
||||||
41 | $this->shouldHaveType(ActionInterface::class); |
||||||
42 | } |
||||||
43 | |||||||
44 | function it_implements_api_aware_interface(): void |
||||||
45 | { |
||||||
46 | $this->shouldHaveType(ApiAwareInterface::class); |
||||||
47 | } |
||||||
48 | |||||||
49 | function it_implements_gateway_aware_interface(): void |
||||||
50 | { |
||||||
51 | $this->shouldHaveType(GatewayAwareInterface::class); |
||||||
52 | } |
||||||
53 | |||||||
54 | function it_executes( |
||||||
55 | Notify $request, |
||||||
56 | \ArrayObject $arrayObject, |
||||||
57 | GatewayInterface $gateway, |
||||||
58 | GetHttpRequest $getHttpRequest, |
||||||
59 | MollieApiClient $mollieApiClient, |
||||||
60 | PaymentEndpoint $paymentEndpoint |
||||||
61 | ): void { |
||||||
62 | $this->setGateway($gateway); |
||||||
0 ignored issues
–
show
The method
setGateway() does not exist on spec\BitBag\SyliusMollie...Action\NotifyActionSpec . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
63 | |||||||
64 | $this->setApi($mollieApiClient); |
||||||
0 ignored issues
–
show
The method
setApi() does not exist on spec\BitBag\SyliusMollie...Action\NotifyActionSpec . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
65 | $getHttpRequest->request = ['id' => 1]; |
||||||
66 | $request->getModel()->willReturn($arrayObject); |
||||||
67 | $payment = \Mockery::mock('payment'); |
||||||
68 | $payment->id = 1; |
||||||
0 ignored issues
–
show
|
|||||||
69 | $payment->metadata = (object) [ |
||||||
0 ignored issues
–
show
|
|||||||
70 | 'order_id' => 1, |
||||||
71 | ]; |
||||||
72 | $payment->shouldReceive('getCheckoutUrl')->andReturn(''); |
||||||
73 | $paymentEndpoint->get(1)->willReturn($payment); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Mollie\Api\Resources\Payment .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
74 | $mollieApiClient->payments = $paymentEndpoint; |
||||||
75 | |||||||
76 | $this->execute($request); |
||||||
0 ignored issues
–
show
The method
execute() does not exist on spec\BitBag\SyliusMollie...Action\NotifyActionSpec . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
77 | } |
||||||
78 | |||||||
79 | function it_supports_only_notify_request_and_array_access( |
||||||
80 | Notify $request, |
||||||
81 | \ArrayAccess $arrayAccess |
||||||
82 | ): void { |
||||||
83 | $request->getModel()->willReturn($arrayAccess); |
||||||
84 | |||||||
85 | $this->supports($request)->shouldReturn(true); |
||||||
0 ignored issues
–
show
The method
supports() does not exist on spec\BitBag\SyliusMollie...Action\NotifyActionSpec . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
86 | } |
||||||
87 | } |
||||||
88 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.