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; |
|
|
|
|
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 |
|
|
|
|
32
|
|
|
{ |
33
|
|
|
$this->beConstructedWith($payum, $session); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
function it_is_initializable(): void |
|
|
|
|
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); |
|
|
|
|
56
|
|
|
$gatewayConfig->getGatewayName()->willReturn(MollieSubscriptionGatewayFactory::FACTORY_NAME); |
57
|
|
|
|
58
|
|
|
$paymentMethod->getGatewayConfig()->willReturn($gatewayConfig); |
|
|
|
|
59
|
|
|
|
60
|
|
|
$payment->getMethod()->willReturn($paymentMethod); |
|
|
|
|
61
|
|
|
|
62
|
|
|
$order->getLastPayment()->willReturn($payment); |
|
|
|
|
63
|
|
|
|
64
|
|
|
$subscription->getOrder()->willReturn($order); |
|
|
|
|
65
|
|
|
|
66
|
|
|
$payum->getGateway(MollieSubscriptionGatewayFactory::FACTORY_NAME)->willReturn($gateway); |
|
|
|
|
67
|
|
|
|
68
|
|
|
$gateway->execute(Argument::any())->shouldBeCalled(); |
|
|
|
|
69
|
|
|
|
70
|
|
|
$this->process($subscription); |
|
|
|
|
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