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\PaymentProcessing; |
||||||
14 | |||||||
15 | use BitBag\SyliusMolliePlugin\Entity\SubscriptionInterface; |
||||||
16 | use BitBag\SyliusMolliePlugin\MollieSubscriptionGatewayFactory; |
||||||
0 ignored issues
–
show
|
|||||||
17 | use BitBag\SyliusMolliePlugin\PaymentProcessing\CancelRecurringSubscriptionProcessor; |
||||||
18 | use BitBag\SyliusMolliePlugin\PaymentProcessing\CancelRecurringSubscriptionProcessorInterface; |
||||||
19 | use Payum\Core\GatewayInterface; |
||||||
20 | use Payum\Core\Model\GatewayConfigInterface; |
||||||
21 | use Payum\Core\Payum; |
||||||
22 | use PhpSpec\ObjectBehavior; |
||||||
23 | use Prophecy\Argument; |
||||||
24 | use Sylius\Component\Core\Model\OrderInterface; |
||||||
25 | use Sylius\Component\Core\Model\PaymentInterface; |
||||||
26 | use Sylius\Component\Core\Model\PaymentMethodInterface; |
||||||
27 | use Symfony\Component\HttpFoundation\Session\Session; |
||||||
28 | |||||||
29 | final class CancelRecurringSubscriptionProcessorSpec extends ObjectBehavior |
||||||
30 | { |
||||||
31 | function let(Payum $payum, Session $session): void |
||||||
0 ignored issues
–
show
|
|||||||
32 | { |
||||||
33 | $this->beConstructedWith($payum, $session); |
||||||
34 | } |
||||||
35 | |||||||
36 | function it_is_initializable(): void |
||||||
0 ignored issues
–
show
|
|||||||
37 | { |
||||||
38 | $this->shouldHaveType(CancelRecurringSubscriptionProcessor::class); |
||||||
39 | } |
||||||
40 | |||||||
41 | function it_implements_cancel_recurring_subscription_processor_interface(): void |
||||||
42 | { |
||||||
43 | $this->shouldHaveType(CancelRecurringSubscriptionProcessorInterface::class); |
||||||
44 | } |
||||||
45 | |||||||
46 | function it_processes( |
||||||
47 | SubscriptionInterface $subscription, |
||||||
48 | OrderInterface $order, |
||||||
49 | PaymentInterface $payment, |
||||||
50 | PaymentMethodInterface $paymentMethod, |
||||||
51 | GatewayConfigInterface $gatewayConfig, |
||||||
52 | Payum $payum, |
||||||
53 | GatewayInterface $gateway |
||||||
54 | ): void { |
||||||
55 | $gatewayConfig->getFactoryName()->willReturn(MollieSubscriptionGatewayFactory::FACTORY_NAME); |
||||||
0 ignored issues
–
show
The function
Payum\Core\Model\Gateway...rface::getFactoryName() has been deprecated: since 1.3.3 will be removed in 2.0. set factory option inside the config
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead. ![]() |
|||||||
56 | $gatewayConfig->getGatewayName()->willReturn(MollieSubscriptionGatewayFactory::FACTORY_NAME); |
||||||
57 | |||||||
58 | $paymentMethod->getGatewayConfig()->willReturn($gatewayConfig); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Payum\Core\Model\GatewayConfigInterface .
(
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. ![]() |
|||||||
59 | |||||||
60 | $payment->getMethod()->willReturn($paymentMethod); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Sylius\Component\Payment...\PaymentMethodInterface .
(
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. ![]() |
|||||||
61 | |||||||
62 | $order->getLastPayment()->willReturn($payment); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Sylius\Component\Core\Model\PaymentInterface .
(
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. ![]() |
|||||||
63 | |||||||
64 | $subscription->getOrder()->willReturn($order); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Sylius\Component\Core\Model\OrderInterface .
(
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. ![]() |
|||||||
65 | |||||||
66 | $payum->getGateway(MollieSubscriptionGatewayFactory::FACTORY_NAME)->willReturn($gateway); |
||||||
0 ignored issues
–
show
The method
willReturn() does not exist on Payum\Core\GatewayInterface .
(
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. ![]() |
|||||||
67 | |||||||
68 | $gateway->execute(Argument::any())->shouldBeCalled(); |
||||||
0 ignored issues
–
show
The method
shouldBeCalled() does not exist on Payum\Core\Reply\ReplyInterface .
(
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. ![]() |
|||||||
69 | |||||||
70 | $this->process($subscription); |
||||||
0 ignored issues
–
show
The method
process() does not exist on spec\BitBag\SyliusMollie...bscriptionProcessorSpec . 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
![]() |
|||||||
71 | } |
||||||
72 | } |
||||||
73 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths