diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 15e0585d..a5478731 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,10 +14,9 @@ jobs: fail-fast: false matrix: include: - - php: 7.2 - - php: 7.3 - php: 7.4 - php: 8.0 + - php: 8.1 steps: - name: Checkout @@ -40,12 +39,6 @@ jobs: key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json composer.lock') }} restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer- - - name: Install PHP 8 dependencies - if: startsWith(matrix.php, '8') - run: | - composer req --dev --no-update payum/payum:dev-master - composer rem --dev --no-update league/uri-schemes - - name: Install dependencies run: composer update @@ -60,7 +53,7 @@ jobs: fail-fast: false matrix: include: - - php: 7.2 + - php: 7.4 steps: - name: Checkout diff --git a/.gitignore b/.gitignore index 1f50fd12..7e528a97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ composer.phar composer.lock vendor -bin \ No newline at end of file +bin +.phpunit.result.cache \ No newline at end of file diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index f9f21c57..021635b6 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -2,12 +2,14 @@ namespace Payum\Bundle\PayumBundle\Tests\Controller; +use Payum\Core\GatewayInterface; use Payum\Core\Model\Token; use Payum\Core\Payum; use Payum\Core\Registry\RegistryInterface; use Payum\Core\Security\GenericTokenFactoryInterface; use Payum\Core\Security\HttpRequestVerifierInterface; use Payum\Core\Storage\StorageInterface; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; @@ -16,12 +18,19 @@ abstract class AbstractControllerTest extends TestCase protected const GATEWAY_NAME = 'theGateway'; protected const AFTER_URL = 'http://example.com/theAfterUrl'; - protected $token; + protected Token $token; + + /** @var RegistryInterface&MockObject */ protected $httpRequestVerifierMock; + + /** @var GatewayInterface&MockObject */ protected $gatewayMock; + + /** @var RegistryInterface&MockObject */ protected $registryMock; - protected $payum; - protected $request; + + protected Payum $payum; + protected Request $request; protected function setUp(): void { @@ -63,5 +72,5 @@ protected function setUp(): void ); } - protected abstract function initGatewayMock(); + abstract protected function initGatewayMock(); } diff --git a/Tests/Controller/AuthorizeControllerTest.php b/Tests/Controller/AuthorizeControllerTest.php index 8a5185af..fbab49ea 100644 --- a/Tests/Controller/AuthorizeControllerTest.php +++ b/Tests/Controller/AuthorizeControllerTest.php @@ -13,7 +13,7 @@ class AuthorizeControllerTest extends AbstractControllerTest /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(AuthorizeController::class); @@ -23,7 +23,7 @@ public function shouldBeSubClassOfController() /** * @test */ - public function shouldExecuteAuthorizeRequest() + public function shouldExecuteAuthorizeRequest(): void { $controller = new AuthorizeController(); $controller->setContainer(new ServiceLocator(['payum' => function () { return $this->payum; }])); @@ -34,7 +34,7 @@ public function shouldExecuteAuthorizeRequest() $this->assertEquals(self::AFTER_URL, $response->getTargetUrl()); } - protected function initGatewayMock() + protected function initGatewayMock(): void { $this->gatewayMock = $this->createMock(GatewayInterface::class); $this->gatewayMock diff --git a/Tests/Controller/CancelControllerTest.php b/Tests/Controller/CancelControllerTest.php index 02222a72..a44d75b6 100644 --- a/Tests/Controller/CancelControllerTest.php +++ b/Tests/Controller/CancelControllerTest.php @@ -14,7 +14,7 @@ class CancelControllerTest extends AbstractControllerTest /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(CancelController::class); @@ -24,7 +24,7 @@ public function shouldBeSubClassOfController() /** * @test */ - public function shouldExecuteCancelRequest() + public function shouldExecuteCancelRequest(): void { $controller = new CancelController(); $controller->setContainer(new ServiceLocator(['payum' => function () { return $this->payum; }])); @@ -38,7 +38,7 @@ public function shouldExecuteCancelRequest() /** * @test */ - public function shouldExecuteCancelRequestWithoutAfterUrl() + public function shouldExecuteCancelRequestWithoutAfterUrl(): void { $this->token->setAfterUrl(null); @@ -51,7 +51,7 @@ public function shouldExecuteCancelRequestWithoutAfterUrl() $this->assertEquals(204, $response->getStatusCode()); } - protected function initGatewayMock() + protected function initGatewayMock(): void { $this->gatewayMock = $this->createMock(GatewayInterface::class); $this->gatewayMock diff --git a/Tests/Controller/CaptureControllerTest.php b/Tests/Controller/CaptureControllerTest.php index 7cf79db5..4be704eb 100644 --- a/Tests/Controller/CaptureControllerTest.php +++ b/Tests/Controller/CaptureControllerTest.php @@ -19,7 +19,7 @@ class CaptureControllerTest extends AbstractControllerTest /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(CaptureController::class); @@ -28,12 +28,11 @@ public function shouldBeSubClassOfController() /** * @test - * - * @expectedException \Symfony\Component\HttpKernel\Exception\HttpException - * @expectedExceptionMessage This controller requires session to be started. */ - public function throwBadRequestIfSessionNotStartedOnDoSessionAction() + public function throwBadRequestIfSessionNotStartedOnDoSessionAction(): void { + $this->expectExceptionMessage("This controller requires session to be started."); + $this->expectException(\Symfony\Component\HttpKernel\Exception\HttpException::class); $this->registryMock = $this->createMock(RegistryInterface::class); $this->httpRequestVerifierMock = $this->createMock( HttpRequestVerifierInterface::class @@ -52,12 +51,11 @@ public function throwBadRequestIfSessionNotStartedOnDoSessionAction() /** * @test - * - * @expectedException \Symfony\Component\HttpKernel\Exception\HttpException - * @expectedExceptionMessage This controller requires token hash to be stored in the session. */ - public function throwBadRequestIfSessionNotContainPayumTokenOnDoSessionAction() + public function throwBadRequestIfSessionNotContainPayumTokenOnDoSessionAction(): void { + $this->expectExceptionMessage("This controller requires token hash to be stored in the session."); + $this->expectException(\Symfony\Component\HttpKernel\Exception\HttpException::class); $this->registryMock = $this->createMock(RegistryInterface::class); $this->httpRequestVerifierMock = $this->createMock( HttpRequestVerifierInterface::class @@ -75,7 +73,7 @@ public function throwBadRequestIfSessionNotContainPayumTokenOnDoSessionAction() /** * @test */ - public function shouldDoRedirectToCaptureWithTokenUrl() + public function shouldDoRedirectToCaptureWithTokenUrl(): void { $routerMock = $this->createMock(RouterInterface::class); $routerMock @@ -116,7 +114,7 @@ public function shouldDoRedirectToCaptureWithTokenUrl() /** * @test */ - public function shouldExecuteCaptureRequest() + public function shouldExecuteCaptureRequest(): void { $controller = new CaptureController(); $controller->setContainer(new ServiceLocator(['payum' => function () { return $this->payum; }])); @@ -127,7 +125,7 @@ public function shouldExecuteCaptureRequest() $this->assertEquals(self::AFTER_URL, $response->getTargetUrl()); } - protected function initGatewayMock() + protected function initGatewayMock(): void { $this->gatewayMock = $this->createMock(GatewayInterface::class); $this->gatewayMock diff --git a/Tests/Controller/NotifyControllerTest.php b/Tests/Controller/NotifyControllerTest.php index 2d5678c7..50dcfc20 100644 --- a/Tests/Controller/NotifyControllerTest.php +++ b/Tests/Controller/NotifyControllerTest.php @@ -17,7 +17,7 @@ class NotifyControllerTest extends TestCase /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(NotifyController::class); @@ -27,7 +27,7 @@ public function shouldBeSubClassOfController() /** * @test */ - public function shouldExecuteNotifyRequestOnDoUnsafe() + public function shouldExecuteNotifyRequestOnDoUnsafe(): void { $request = Request::create('/'); $request->query->set('gateway', 'theGatewayName'); diff --git a/Tests/Controller/PayoutControllerTest.php b/Tests/Controller/PayoutControllerTest.php index 266b896c..d07922f7 100644 --- a/Tests/Controller/PayoutControllerTest.php +++ b/Tests/Controller/PayoutControllerTest.php @@ -13,7 +13,7 @@ class PayoutControllerTest extends AbstractControllerTest /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(PayoutController::class); @@ -23,7 +23,7 @@ public function shouldBeSubClassOfController() /** * @test */ - public function shouldExecutePayoutRequest() + public function shouldExecutePayoutRequest(): void { $controller = new PayoutController(); $controller->setContainer(new ServiceLocator(['payum' => function () { return $this->payum; }])); @@ -34,7 +34,7 @@ public function shouldExecutePayoutRequest() $this->assertEquals(self::AFTER_URL, $response->getTargetUrl()); } - protected function initGatewayMock() + protected function initGatewayMock(): void { $this->gatewayMock = $this->createMock(GatewayInterface::class); $this->gatewayMock diff --git a/Tests/Controller/RefundControllerTest.php b/Tests/Controller/RefundControllerTest.php index a72a35aa..4a7da487 100644 --- a/Tests/Controller/RefundControllerTest.php +++ b/Tests/Controller/RefundControllerTest.php @@ -15,7 +15,7 @@ class RefundControllerTest extends AbstractControllerTest /** * @test */ - public function shouldBeSubClassOfController() + public function shouldBeSubClassOfController(): void { $rc = new \ReflectionClass(RefundController::class); @@ -25,7 +25,7 @@ public function shouldBeSubClassOfController() /** * @test */ - public function shouldExecuteRefundRequest() + public function shouldExecuteRefundRequest(): void { $controller = new RefundController(); $controller->setContainer(new ServiceLocator(['payum' => function () { return $this->payum; }])); @@ -39,7 +39,7 @@ public function shouldExecuteRefundRequest() /** * @test */ - public function shouldExecuteRefundRequestWithoutAfterUrl() + public function shouldExecuteRefundRequestWithoutAfterUrl(): void { $this->token->setAfterUrl(null); @@ -52,7 +52,7 @@ public function shouldExecuteRefundRequestWithoutAfterUrl() $this->assertEquals(204, $response->getStatusCode()); } - protected function initGatewayMock() + protected function initGatewayMock(): void { $this->gatewayMock = $this->createMock(GatewayInterface::class); $this->gatewayMock diff --git a/Tests/DependencyInjection/Compiler/BuildConfigsPassTest.php b/Tests/DependencyInjection/Compiler/BuildConfigsPassTest.php index 73ec55a7..c7ff579e 100644 --- a/Tests/DependencyInjection/Compiler/BuildConfigsPassTest.php +++ b/Tests/DependencyInjection/Compiler/BuildConfigsPassTest.php @@ -8,7 +8,7 @@ class BuildConfigsPassTest extends \PHPUnit\Framework\TestCase { - public function provideTags() + public function provideTags(): array { return [ 0 => [['name' => 'payum.action'], []], @@ -182,7 +182,7 @@ public function provideTags() ]; } - public function testShouldImplementCompilerPassInterface() + public function testShouldImplementCompilerPassInterface(): void { $rc = new \ReflectionClass(BuildConfigsPass::class); @@ -192,7 +192,7 @@ public function testShouldImplementCompilerPassInterface() /** * @dataProvider provideTags */ - public function testShouldAddConfig(array $tagAttributes, $expected) + public function testShouldAddConfig(array $tagAttributes, $expected): void { $tagName = $tagAttributes['name']; unset($tagAttributes['name']); diff --git a/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesBuilderPassTest.php b/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesBuilderPassTest.php index 3d375dc7..7bf9c5c2 100644 --- a/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesBuilderPassTest.php +++ b/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesBuilderPassTest.php @@ -11,14 +11,14 @@ class BuildGatewayFactoriesBuilderPassTest extends \PHPUnit\Framework\TestCase { - public function testShouldImplementCompilerPassInterface() + public function testShouldImplementCompilerPassInterface(): void { $rc = new \ReflectionClass(BuildGatewayFactoriesBuilderPass::class); $this->assertTrue($rc->implementsInterface(CompilerPassInterface::class)); } - public function testShouldAddServiceWithTagToPayumBuilder() + public function testShouldAddServiceWithTagToPayumBuilder(): void { $service = new Definition(); $service->addTag('payum.gateway_factory_builder', ['factory' => 'fooFactory']); @@ -40,12 +40,10 @@ public function testShouldAddServiceWithTagToPayumBuilder() $this->assertEquals('aservice', (string) $calls[0][1][1]); } - /** - * @expectedException \Payum\Core\Exception\LogicException - * @expectedExceptionMessage The payum.gateway_factory tag require factory attribute. - */ - public function testThrowIfTagMissFactoryAttribute() + public function testThrowIfTagMissFactoryAttribute(): void { + $this->expectExceptionMessage("The payum.gateway_factory tag require factory attribute."); + $this->expectException(\Payum\Core\Exception\LogicException::class); $service = new Definition(); $service->addTag('payum.gateway_factory_builder'); diff --git a/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesPassTest.php b/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesPassTest.php index 99c4684c..e0df82ac 100644 --- a/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesPassTest.php +++ b/Tests/DependencyInjection/Compiler/BuildGatewayFactoriesPassTest.php @@ -9,14 +9,14 @@ class BuildGatewayFactoriesPassTest extends \PHPUnit\Framework\TestCase { - public function testShouldImplementCompilerPassInterface() + public function testShouldImplementCompilerPassInterface(): void { $rc = new \ReflectionClass(BuildConfigsPass::class); $this->assertTrue($rc->implementsInterface(CompilerPassInterface::class)); } - public function testShouldAddServiceWithTagToStaticRegistry() + public function testShouldAddServiceWithTagToStaticRegistry(): void { $service = new Definition(); $service->addTag('payum.gateway_factory', ['factory' => 'foo']); @@ -34,12 +34,10 @@ public function testShouldAddServiceWithTagToStaticRegistry() $this->assertEquals(['foo' => 'aservice'], $registry->getArgument(2)); } - /** - * @expectedException \Payum\Core\Exception\LogicException - * @expectedExceptionMessage The payum.gateway_factory tag require factory attribute. - */ - public function testThrowIfTagMissFactoryAttribute() + public function testThrowIfTagMissFactoryAttribute(): void { + $this->expectException(\Payum\Core\Exception\LogicException::class); + $this->expectExceptionMessage("The payum.gateway_factory tag require factory attribute."); $service = new Definition(); $service->addTag('payum.gateway_factory'); diff --git a/Tests/DependencyInjection/Compiler/BuildGatewaysPassTest.php b/Tests/DependencyInjection/Compiler/BuildGatewaysPassTest.php index 7cf2fecf..004ec2e2 100644 --- a/Tests/DependencyInjection/Compiler/BuildGatewaysPassTest.php +++ b/Tests/DependencyInjection/Compiler/BuildGatewaysPassTest.php @@ -8,14 +8,14 @@ class BuildGatewaysPassTest extends \PHPUnit\Framework\TestCase { - public function testShouldImplementCompilerPassInterface() + public function testShouldImplementCompilerPassInterface(): void { $rc = new \ReflectionClass(BuildGatewaysPass::class); $this->assertTrue($rc->implementsInterface(CompilerPassInterface::class)); } - public function testShouldAddServiceWithTagToStaticRegistry() + public function testShouldAddServiceWithTagToStaticRegistry(): void { $service = new Definition(); $service->addTag('payum.gateway', ['gateway' => 'foo']); @@ -33,12 +33,10 @@ public function testShouldAddServiceWithTagToStaticRegistry() $this->assertEquals(['foo' => 'aservice'], $registry->getArgument(0)); } - /** - * @expectedException \Payum\Core\Exception\LogicException - * @expectedExceptionMessage The payum.gateway tag require gateway attribute. - */ - public function testThrowIfTagMissFactoryAttribute() + public function testThrowIfTagMissFactoryAttribute(): void { + $this->expectExceptionMessage("The payum.gateway tag require gateway attribute."); + $this->expectException(\Payum\Core\Exception\LogicException::class); $service = new Definition(); $service->addTag('payum.gateway'); diff --git a/Tests/DependencyInjection/Compiler/BuildStoragesPassTest.php b/Tests/DependencyInjection/Compiler/BuildStoragesPassTest.php index f581ec19..a39c45f8 100644 --- a/Tests/DependencyInjection/Compiler/BuildStoragesPassTest.php +++ b/Tests/DependencyInjection/Compiler/BuildStoragesPassTest.php @@ -12,14 +12,14 @@ class BuildStoragesPassTest extends \PHPUnit\Framework\TestCase { - public function testShouldImplementCompilerPassInterface() + public function testShouldImplementCompilerPassInterface(): void { $rc = new \ReflectionClass(BuildStoragesPass::class); $this->assertTrue($rc->implementsInterface(CompilerPassInterface::class)); } - public function testShouldAddServiceWithTagToStaticRegistry() + public function testShouldAddServiceWithTagToStaticRegistry(): void { $service = new Definition(); $service->addTag('payum.storage', ['model_class' => stdClass::class]); @@ -37,12 +37,10 @@ public function testShouldAddServiceWithTagToStaticRegistry() $this->assertEquals(['stdClass' => 'aservice'], $registry->getArgument(1)); } - /** - * @expectedException \Payum\Core\Exception\LogicException - * @expectedExceptionMessage The payum.storage tag require model_class attribute. - */ - public function testThrowIfTagMissFactoryAttribute() + public function testThrowIfTagMissFactoryAttribute(): void { + $this->expectException(\Payum\Core\Exception\LogicException::class); + $this->expectExceptionMessage("The payum.storage tag require model_class attribute."); $service = new Definition(); $service->addTag('payum.storage'); diff --git a/Tests/DependencyInjection/Factory/AbstractStorageFactoryTest.php b/Tests/DependencyInjection/Factory/AbstractStorageFactoryTest.php index 7c8942b9..e4013894 100644 --- a/Tests/DependencyInjection/Factory/AbstractStorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/AbstractStorageFactoryTest.php @@ -3,6 +3,7 @@ use Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\AbstractStorageFactory; use Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\StorageFactoryInterface; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -13,7 +14,7 @@ class AbstractStorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldImplementStorageFactoryInterface() + public function shouldImplementStorageFactoryInterface(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\AbstractStorageFactory'); @@ -23,7 +24,7 @@ public function shouldImplementStorageFactoryInterface() /** * @test */ - public function shouldBeAbstract() + public function shouldBeAbstract(): void { $rc = new \ReflectionClass(StorageFactoryInterface::class); @@ -33,8 +34,10 @@ public function shouldBeAbstract() /** * @test */ - public function shouldAllowAddConfiguration() + public function shouldAllowAddConfiguration(): void { + $this->expectNotToPerformAssertions(); + $factory = $this->createAbstractStorageFactory(); $tb = new TreeBuilder('foo'); @@ -49,7 +52,7 @@ public function shouldAllowAddConfiguration() /** * @test */ - public function shouldAllowCreateStorageAndReturnItsId() + public function shouldAllowCreateStorageAndReturnItsId(): void { $expectedStorage = new Definition(); @@ -71,7 +74,7 @@ public function shouldAllowCreateStorageAndReturnItsId() $this->assertSame($expectedStorage, $container->getDefinition($actualStorageId)); } - protected function assertDefinitionContainsMethodCall(Definition $serviceDefinition, $expectedMethod, $expectedFirstArgument) + protected function assertDefinitionContainsMethodCall(Definition $serviceDefinition, $expectedMethod, $expectedFirstArgument): void { foreach ($serviceDefinition->getMethodCalls() as $methodCall) { if ($expectedMethod == $methodCall[0] && $expectedFirstArgument == $methodCall[1][0]) { @@ -88,7 +91,7 @@ protected function assertDefinitionContainsMethodCall(Definition $serviceDefinit } /** - * @return \PHPUnit_Framework_MockObject_MockObject|AbstractStorageFactory + * @return AbstractStorageFactory|MockObject */ protected function createAbstractStorageFactory() { diff --git a/Tests/DependencyInjection/Factory/CustomStorageFactoryTest.php b/Tests/DependencyInjection/Factory/CustomStorageFactoryTest.php index 51f836d6..15cdbdef 100644 --- a/Tests/DependencyInjection/Factory/CustomStorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/CustomStorageFactoryTest.php @@ -3,6 +3,7 @@ use Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\CustomStorageFactory; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -12,7 +13,7 @@ class CustomStorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfAbstractStorageFactory() + public function shouldBeSubClassOfAbstractStorageFactory(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\CustomStorageFactory'); @@ -22,15 +23,16 @@ public function shouldBeSubClassOfAbstractStorageFactory() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new CustomStorageFactory(); } /** * @test */ - public function shouldAllowGetName() + public function shouldAllowGetName(): void { $factory = new CustomStorageFactory(); @@ -40,7 +42,7 @@ public function shouldAllowGetName() /** * @test */ - public function shouldAllowAddConfiguration() + public function shouldAllowAddConfiguration(): void { $factory = new CustomStorageFactory(); @@ -60,12 +62,11 @@ public function shouldAllowAddConfiguration() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "service" (at path|under) "foo" must be configured\./ */ - public function shouldRequireServiceOption() + public function shouldRequireServiceOption(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"service\" (at path|under) \"foo\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $factory = new CustomStorageFactory(); $tb = new TreeBuilder('foo'); @@ -79,12 +80,11 @@ public function shouldRequireServiceOption() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage The path "foo.service" cannot contain an empty value, but got "". */ - public function shouldNotAllowEmptyServiceOption() + public function shouldNotAllowEmptyServiceOption(): void { + $this->expectExceptionMessage("The path \"foo.service\" cannot contain an empty value, but got \"\"."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $factory = new CustomStorageFactory(); $tb = new TreeBuilder('foo'); @@ -100,12 +100,11 @@ public function shouldNotAllowEmptyServiceOption() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage The path "foo.service" cannot contain an empty value, but got null. */ - public function shouldNotAllowNullServiceOption() + public function shouldNotAllowNullServiceOption(): void { + $this->expectExceptionMessage("The path \"foo.service\" cannot contain an empty value, but got null."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $factory = new CustomStorageFactory(); $tb = new TreeBuilder('foo'); @@ -122,7 +121,7 @@ public function shouldNotAllowNullServiceOption() /** * @test */ - public function shouldAllowAddShortConfiguration() + public function shouldAllowAddShortConfiguration(): void { $factory = new CustomStorageFactory; @@ -141,7 +140,7 @@ public function shouldAllowAddShortConfiguration() /** * @test */ - public function shouldCreateServiceDefinition() + public function shouldCreateServiceDefinition(): void { $serviceName = 'service.name'; @@ -155,7 +154,7 @@ public function shouldCreateServiceDefinition() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|\Symfony\Component\DependencyInjection\ContainerBuilder + * @return MockObject|\Symfony\Component\DependencyInjection\ContainerBuilder */ protected function createContainerBuilderMock() { diff --git a/Tests/DependencyInjection/Factory/DoctrineStorageFactoryTest.php b/Tests/DependencyInjection/Factory/DoctrineStorageFactoryTest.php index 16ad4e6f..4ff40c88 100644 --- a/Tests/DependencyInjection/Factory/DoctrineStorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/DoctrineStorageFactoryTest.php @@ -10,7 +10,7 @@ class DoctrineStorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfAbstractStorageFactory() + public function shouldBeSubClassOfAbstractStorageFactory(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\DoctrineStorageFactory'); @@ -20,15 +20,16 @@ public function shouldBeSubClassOfAbstractStorageFactory() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new DoctrineStorageFactory; } /** * @test */ - public function shouldAllowGetName() + public function shouldAllowGetName(): void { $factory = new DoctrineStorageFactory; @@ -38,7 +39,7 @@ public function shouldAllowGetName() /** * @test */ - public function shouldAllowAddConfiguration() + public function shouldAllowAddConfiguration(): void { $factory = new DoctrineStorageFactory; @@ -59,7 +60,7 @@ public function shouldAllowAddConfiguration() /** * @test */ - public function shouldAllowAddShortConfiguration() + public function shouldAllowAddShortConfiguration(): void { $factory = new DoctrineStorageFactory; @@ -77,12 +78,11 @@ public function shouldAllowAddShortConfiguration() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "driver" (at path|under) "foo" must be configured\./ */ - public function shouldRequireDriverOption() + public function shouldRequireDriverOption(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"driver\" (at path|under) \"foo\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $factory = new DoctrineStorageFactory; $tb = new TreeBuilder('foo'); diff --git a/Tests/DependencyInjection/Factory/FilesystemStorageFactoryTest.php b/Tests/DependencyInjection/Factory/FilesystemStorageFactoryTest.php index 5aedc6d1..a721c55c 100644 --- a/Tests/DependencyInjection/Factory/FilesystemStorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/FilesystemStorageFactoryTest.php @@ -10,7 +10,7 @@ class FilesystemStorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfAbstractStorageFactory() + public function shouldBeSubClassOfAbstractStorageFactory(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\FilesystemStorageFactory'); @@ -20,15 +20,16 @@ public function shouldBeSubClassOfAbstractStorageFactory() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new FilesystemStorageFactory; } /** * @test */ - public function shouldAllowGetName() + public function shouldAllowGetName(): void { $factory = new FilesystemStorageFactory; @@ -38,7 +39,7 @@ public function shouldAllowGetName() /** * @test */ - public function shouldAllowAddConfiguration() + public function shouldAllowAddConfiguration(): void { $factory = new FilesystemStorageFactory; @@ -62,12 +63,11 @@ public function shouldAllowAddConfiguration() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "storage_dir" (at path|under) "foo" must be configured\./ */ - public function shouldRequireStorageDirOption() + public function shouldRequireStorageDirOption(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"storage_dir\" (at path|under) \"foo\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $factory = new FilesystemStorageFactory; $tb = new TreeBuilder('foo'); @@ -82,7 +82,7 @@ public function shouldRequireStorageDirOption() /** * @test */ - public function shouldSetIdPropertyToNull() + public function shouldSetIdPropertyToNull(): void { $factory = new FilesystemStorageFactory; diff --git a/Tests/DependencyInjection/Factory/Propel1StorageFactoryTest.php b/Tests/DependencyInjection/Factory/Propel1StorageFactoryTest.php index afd989b5..abea51ae 100644 --- a/Tests/DependencyInjection/Factory/Propel1StorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/Propel1StorageFactoryTest.php @@ -11,7 +11,7 @@ class Propel1StorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfAbstractStorageFactory() + public function shouldBeSubClassOfAbstractStorageFactory(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\Propel1StorageFactory'); @@ -21,15 +21,16 @@ public function shouldBeSubClassOfAbstractStorageFactory() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new Propel1StorageFactory; } /** * @test */ - public function shouldAllowGetName() + public function shouldAllowGetName(): void { $factory = new Propel1StorageFactory; diff --git a/Tests/DependencyInjection/Factory/Propel2StorageFactoryTest.php b/Tests/DependencyInjection/Factory/Propel2StorageFactoryTest.php index 0431bade..a0c80b17 100644 --- a/Tests/DependencyInjection/Factory/Propel2StorageFactoryTest.php +++ b/Tests/DependencyInjection/Factory/Propel2StorageFactoryTest.php @@ -12,7 +12,7 @@ class Propel2StorageFactoryTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfAbstractStorageFactory() + public function shouldBeSubClassOfAbstractStorageFactory(): void { $rc = new \ReflectionClass('Payum\Bundle\PayumBundle\DependencyInjection\Factory\Storage\Propel2StorageFactory'); @@ -22,15 +22,16 @@ public function shouldBeSubClassOfAbstractStorageFactory() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new Propel2StorageFactory; } /** * @test */ - public function shouldAllowGetName() + public function shouldAllowGetName(): void { $factory = new Propel2StorageFactory; diff --git a/Tests/DependencyInjection/MainConfigurationTest.php b/Tests/DependencyInjection/MainConfigurationTest.php index 35b4fc1d..6269be02 100644 --- a/Tests/DependencyInjection/MainConfigurationTest.php +++ b/Tests/DependencyInjection/MainConfigurationTest.php @@ -10,7 +10,7 @@ class MainConfigurationTest extends TestCase { - protected $storageFactories = array(); + protected array $storageFactories = []; protected function setUp(): void { @@ -23,16 +23,19 @@ protected function setUp(): void /** * @test */ - public function couldBeConstructedWithArrayOfGatewayFactoriesAndStorageFactories() + public function couldBeConstructedWithArrayOfGatewayFactoriesAndStorageFactories(): void { + $this->expectNotToPerformAssertions(); new MainConfiguration($this->storageFactories); } /** * @test */ - public function shouldPassConfigurationProcessing() + public function shouldPassConfigurationProcessing(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -80,7 +83,7 @@ public function shouldPassConfigurationProcessing() /** * @test */ - public function shouldAddStoragesToAllGatewayByDefault() + public function shouldAddStoragesToAllGatewayByDefault(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -122,7 +125,7 @@ public function shouldAddStoragesToAllGatewayByDefault() /** * @test */ - public function shouldAllowDisableAddStoragesToAllGatewayFeature() + public function shouldAllowDisableAddStoragesToAllGatewayFeature(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -161,7 +164,7 @@ public function shouldAllowDisableAddStoragesToAllGatewayFeature() /** * @test */ - public function shouldAllowSetConcreteGatewaysWhereToAddStorages() + public function shouldAllowSetConcreteGatewaysWhereToAddStorages(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -202,7 +205,7 @@ public function shouldAllowSetConcreteGatewaysWhereToAddStorages() /** * @test */ - public function shouldAllowSetGatewaysCreatedWithFactoriesWhereToAddStorages() + public function shouldAllowSetGatewaysCreatedWithFactoriesWhereToAddStorages(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -242,12 +245,11 @@ public function shouldAllowSetGatewaysCreatedWithFactoriesWhereToAddStorages() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.storages": The storage entry must be a valid model class. It is set notExistClass */ - public function throwIfTryToUseNotValidClassAsStorageEntry() + public function throwIfTryToUseNotValidClassAsStorageEntry(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.storages\": The storage entry must be a valid model class. It is set notExistClass"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -276,12 +278,11 @@ public function throwIfTryToUseNotValidClassAsStorageEntry() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.storages.stdClass": Only one storage per entry could be selected */ - public function throwIfTryToAddMoreThenOneStorageForOneEntry() + public function throwIfTryToAddMoreThenOneStorageForOneEntry(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.storages.stdClass\": Only one storage per entry could be selected"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -313,12 +314,11 @@ public function throwIfTryToAddMoreThenOneStorageForOneEntry() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.storages.stdClass": At least one storage must be configured. */ - public function throwIfStorageEntryDefinedWithoutConcreteStorage() + public function throwIfStorageEntryDefinedWithoutConcreteStorage(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.storages.stdClass\": At least one storage must be configured."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -344,8 +344,10 @@ public function throwIfStorageEntryDefinedWithoutConcreteStorage() /** * @test */ - public function shouldPassIfNoneStorageSelected() + public function shouldPassIfNoneStorageSelected(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -370,12 +372,11 @@ public function shouldPassIfNoneStorageSelected() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.security.token_storage": Only one token storage could be configured. */ - public function throwIfMoreThenOneTokenStorageConfigured() + public function throwIfMoreThenOneTokenStorageConfigured(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.security.token_storage\": Only one token storage could be configured."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -402,12 +403,11 @@ public function throwIfMoreThenOneTokenStorageConfigured() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.security.token_storage": The token class must implement `Payum\Core\Security\TokenInterface` interface */ - public function throwIfTokenStorageConfiguredWithModelNotImplementingTokenInterface() + public function throwIfTokenStorageConfiguredWithModelNotImplementingTokenInterface(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.security.token_storage\": The token class must implement `Payum\Core\Security\TokenInterface` interface"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -429,12 +429,11 @@ public function throwIfTokenStorageConfiguredWithModelNotImplementingTokenInterf /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.security.token_storage": The storage entry must be a valid model class. */ - public function throwIfTokenStorageConfiguredWithNotModelClass() + public function throwIfTokenStorageConfiguredWithNotModelClass(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.security.token_storage\": The storage entry must be a valid model class."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -456,12 +455,11 @@ public function throwIfTokenStorageConfiguredWithNotModelClass() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "security" (at path|under) "payum" must be configured\./ */ - public function throwIfSecurityNotConfigured() + public function throwIfSecurityNotConfigured(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"security\" (at path|under) \"payum\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -473,12 +471,11 @@ public function throwIfSecurityNotConfigured() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "token_storage" (at path|under) "payum.security" must be configured\./ */ - public function throwIfTokenStorageNotConfigured() + public function throwIfTokenStorageNotConfigured(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"token_storage\" (at path|under) \"payum.security\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -492,12 +489,11 @@ public function throwIfTokenStorageNotConfigured() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.dynamic_gateways.config_storage": Only one config storage could be configured. */ - public function throwIfMoreThenOneGatewayConfigStorageConfigured() + public function throwIfMoreThenOneGatewayConfigStorageConfigured(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.dynamic_gateways.config_storage\": Only one config storage could be configured."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -533,12 +529,11 @@ public function throwIfMoreThenOneGatewayConfigStorageConfigured() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.dynamic_gateways.config_storage": The config class must implement `Payum\Core\Model\GatewayConfigInterface` interface */ - public function throwIfGatewayConfigStorageConfiguredWithModelNotImplementingGatewayConfigInterface() + public function throwIfGatewayConfigStorageConfiguredWithModelNotImplementingGatewayConfigInterface(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.dynamic_gateways.config_storage\": The config class must implement `Payum\Core\Model\GatewayConfigInterface` interface"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -569,12 +564,11 @@ public function throwIfGatewayConfigStorageConfiguredWithModelNotImplementingGat /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessage Invalid configuration for path "payum.dynamic_gateways.config_storage": The storage entry must be a valid model class. */ - public function throwIfGatewayConfigStorageConfiguredWithNotModelClass() + public function throwIfGatewayConfigStorageConfiguredWithNotModelClass(): void { + $this->expectExceptionMessage("Invalid configuration for path \"payum.dynamic_gateways.config_storage\": The storage entry must be a valid model class."); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -605,12 +599,11 @@ public function throwIfGatewayConfigStorageConfiguredWithNotModelClass() /** * @test - * - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - * @expectedExceptionMessageRegExp /The child (node|config) "config_storage" (at path|under) "payum.dynamic_gateways" must be configured\./ */ - public function throwIfGatewayConfigStorageNotConfigured() + public function throwIfGatewayConfigStorageNotConfigured(): void { + $this->expectExceptionMessageMatches("/The child (node|config) \"config_storage\" (at path|under) \"payum.dynamic_gateways\" must be configured\./"); + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -635,7 +628,7 @@ public function throwIfGatewayConfigStorageNotConfigured() /** * @test */ - public function shouldTreatNullGatewaysV2AsEmptyArray() + public function shouldTreatNullGatewaysV2AsEmptyArray(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -662,7 +655,7 @@ public function shouldTreatNullGatewaysV2AsEmptyArray() /** * @test */ - public function shouldAllowPutAnythingToGatewaysV2AndNotPerformAnyValidations() + public function shouldAllowPutAnythingToGatewaysV2AndNotPerformAnyValidations(): void { $configuration = new MainConfiguration($this->storageFactories); @@ -719,6 +712,7 @@ class FooStorageFactory implements StorageFactoryInterface { public function create(ContainerBuilder $container, $modelClass, array $config) { + return 'aStorageId'; } public function getName() @@ -740,6 +734,7 @@ class BarStorageFactory implements StorageFactoryInterface { public function create(ContainerBuilder $container, $modelClass, array $config) { + return 'serviceId'; } public function getName() diff --git a/Tests/DependencyInjection/PayumExtensionTest.php b/Tests/DependencyInjection/PayumExtensionTest.php index 89179459..18061ba8 100644 --- a/Tests/DependencyInjection/PayumExtensionTest.php +++ b/Tests/DependencyInjection/PayumExtensionTest.php @@ -14,7 +14,7 @@ class PayumExtensionTest extends TestCase /** * @test */ - public function shouldBeSubClassOfExtension() + public function shouldBeSubClassOfExtension(): void { $rc = new \ReflectionClass(PayumExtension::class); @@ -24,7 +24,7 @@ public function shouldBeSubClassOfExtension() /** * @test */ - public function shouldImplementPrependExtensionInterface() + public function shouldImplementPrependExtensionInterface(): void { $rc = new \ReflectionClass(PayumExtension::class); @@ -34,42 +34,45 @@ public function shouldImplementPrependExtensionInterface() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new PayumExtension; } /** * @test */ - public function shouldAllowAddStorageFactory() + public function shouldAllowAddStorageFactory(): void { $factory = $this->createMock(StorageFactoryInterface::class); $factory - ->expects($this->any()) ->method('getName') - ->will($this->returnValue('theFoo')) + ->willReturn('theFoo') ; $extension = new PayumExtension; $extension->addStorageFactory($factory); - $this->assertAttributeContains($factory, 'storagesFactories', $extension); + $reflectedConstraint = (new \ReflectionObject($extension))->getProperty('storagesFactories'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($extension); + + $this->assertEquals($factory, $constraint["theFoo"]); } /** * @test - * - * @expectedException \Payum\Core\Exception\InvalidArgumentException - * @expectedExceptionMessage The storage factory Mock_StorageFactoryInterface_ */ - public function throwIfTryToAddStorageFactoryWithEmptyName() + public function throwIfTryToAddStorageFactoryWithEmptyName(): void { + $this->expectExceptionMessage("The storage factory Mock_StorageFactoryInterface_"); + $this->expectException(\Payum\Core\Exception\InvalidArgumentException::class); $factoryWithEmptyName = $this->createMock(StorageFactoryInterface::class); $factoryWithEmptyName ->expects($this->once()) ->method('getName') - ->will($this->returnValue('')) + ->willReturn('') ; $extension = new PayumExtension; @@ -78,17 +81,16 @@ public function throwIfTryToAddStorageFactoryWithEmptyName() /** * @test - * - * @expectedException \Payum\Core\Exception\InvalidArgumentException - * @expectedExceptionMessage The storage factory with such name theFoo already registered */ - public function throwIfTryToAddStorageGatewayFactoryWithNameAlreadyAdded() + public function throwIfTryToAddStorageGatewayFactoryWithNameAlreadyAdded(): void { + $this->expectExceptionMessage("The storage factory with such name theFoo already registered"); + $this->expectException(\Payum\Core\Exception\InvalidArgumentException::class); $factory = $this->createMock(StorageFactoryInterface::class); $factory ->expects($this->atLeastOnce()) ->method('getName') - ->will($this->returnValue('theFoo')) + ->willReturn('theFoo') ; $extension = new PayumExtension; @@ -99,7 +101,7 @@ public function throwIfTryToAddStorageGatewayFactoryWithNameAlreadyAdded() /** * @test */ - public function shouldNotAddPayumMappingIfDoctrineBundleNotRegistered() + public function shouldNotAddPayumMappingIfDoctrineBundleNotRegistered(): void { $container = new ContainerBuilder; $container->setParameter('kernel.bundles', array()); @@ -114,7 +116,7 @@ public function shouldNotAddPayumMappingIfDoctrineBundleNotRegistered() /** * @test */ - public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButDbalNotConfigured() + public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButDbalNotConfigured(): void { $extension = new PayumExtension; @@ -137,7 +139,7 @@ public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButDbalNotConf /** * @test */ - public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButOrmNotConfigured() + public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButOrmNotConfigured(): void { $extension = new PayumExtension; @@ -160,7 +162,7 @@ public function shouldNotAddPayumMappingIfDoctrineBundleRegisteredButOrmNotConfi /** * @test */ - public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmConfiguredInSingleConfiguration() + public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmConfiguredInSingleConfiguration(): void { $extension = new PayumExtension; @@ -201,7 +203,7 @@ public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmCon /** * @test */ - public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmConfiguredInMultipleConfigurations() + public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmConfiguredInMultipleConfigurations(): void { $extension = new PayumExtension; @@ -246,7 +248,7 @@ public function shouldAddPayumMappingIfDoctrineBundleRegisteredWithDbalAndOrmCon /** * @test */ - public function shouldAddGatewaysToBuilder() + public function shouldAddGatewaysToBuilder(): void { $extension = new PayumExtension; $extension->addStorageFactory(new FeeStorageFactory()); @@ -300,12 +302,12 @@ public function create(ContainerBuilder $container, $modelClass, array $config) return 'aStorageId'; } - public function getName() + public function getName(): string { return 'bar_storage'; } - public function addConfiguration(ArrayNodeDefinition $builder) + public function addConfiguration(ArrayNodeDefinition $builder): void { $builder ->children() diff --git a/Tests/EventListener/ReplyToHttpResponseListenerTest.php b/Tests/EventListener/ReplyToHttpResponseListenerTest.php index 05fb17f8..41572e34 100644 --- a/Tests/EventListener/ReplyToHttpResponseListenerTest.php +++ b/Tests/EventListener/ReplyToHttpResponseListenerTest.php @@ -4,6 +4,8 @@ use Payum\Bundle\PayumBundle\EventListener\ReplyToHttpResponseListener; use Payum\Core\Bridge\Symfony\ReplyToSymfonyResponseConverter; use Payum\Core\Reply\HttpRedirect; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -11,20 +13,21 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Kernel; -class ReplyToHttpResponseListenerTest extends \PHPUnit\Framework\TestCase +class ReplyToHttpResponseListenerTest extends TestCase { /** * @test */ - public function couldBeConstructedWithOneArgument() + public function couldBeConstructedWithOneArgument(): void { + $this->expectNotToPerformAssertions(); new ReplyToHttpResponseListener($this->createReplyToSymfonyResponseConverterMock()); } /** * @test */ - public function shouldDoNothingIfExceptionNotInstanceOfReply() + public function shouldDoNothingIfExceptionNotInstanceOfReply(): void { $expectedException = new Exception; @@ -53,7 +56,7 @@ public function shouldDoNothingIfExceptionNotInstanceOfReply() /** * @test */ - public function shouldSetResponseReturnedByConverterToEvent() + public function shouldSetResponseReturnedByConverterToEvent(): void { $expectedUrl = '/foo/bar'; @@ -86,7 +89,7 @@ public function shouldSetResponseReturnedByConverterToEvent() /** * @test */ - public function shouldCallAllowCustomResponseCode() + public function shouldCallAllowCustomResponseCode(): void { $reply = new HttpRedirect('/foo/bar'); $response = new Response('', 302); @@ -111,7 +114,7 @@ public function shouldCallAllowCustomResponseCode() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|ReplyToSymfonyResponseConverter + * @return MockObject|ReplyToSymfonyResponseConverter */ protected function createReplyToSymfonyResponseConverterMock() { @@ -119,7 +122,7 @@ protected function createReplyToSymfonyResponseConverterMock() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|HttpKernelInterface + * @return HttpKernelInterface|MockObject */ protected function createHttpKernelMock() { diff --git a/Tests/Functional/Command/CreateCaptureTokenCommandTest.php b/Tests/Functional/Command/CreateCaptureTokenCommandTest.php index e0785abc..6ef2e861 100644 --- a/Tests/Functional/Command/CreateCaptureTokenCommandTest.php +++ b/Tests/Functional/Command/CreateCaptureTokenCommandTest.php @@ -14,7 +14,7 @@ class CreateCaptureTokenCommandTest extends WebTestCase /** * @test */ - public function shouldCreateCaptureTokenWithUrlAsAfterUrl() + public function shouldCreateCaptureTokenWithUrlAsAfterUrl(): void { /** @var RegistryInterface $payum */ $payum = $this->client->getContainer()->get('payum'); @@ -34,16 +34,16 @@ public function shouldCreateCaptureTokenWithUrlAsAfterUrl() '--after-url' => 'http://google.com/' )); - $this->assertContains('Hash: ', $output); - $this->assertContains('Url: http://localhost/payment/capture', $output); - $this->assertContains('After Url: http://google.com/?payum_token=', $output); - $this->assertContains("Details: $modelClass#$modelId", $output); + $this->assertStringContainsString('Hash: ', $output); + $this->assertStringContainsString('Url: http://localhost/payment/capture', $output); + $this->assertStringContainsString('After Url: http://google.com/?payum_token=', $output); + $this->assertStringContainsString("Details: $modelClass#$modelId", $output); } /** * @test */ - public function shouldCreateCaptureTokenWithRouteAsAfterUrl() + public function shouldCreateCaptureTokenWithRouteAsAfterUrl(): void { /** @var RegistryInterface $payum */ $payum = $this->client->getContainer()->get('payum'); @@ -63,19 +63,16 @@ public function shouldCreateCaptureTokenWithRouteAsAfterUrl() '--after-url' => 'foo' )); - $this->assertContains('Hash: ', $output); - $this->assertContains('Url: http://localhost/payment/capture', $output); - $this->assertContains('After Url: http://localhost/foo/url?payum_token=', $output); - $this->assertContains("Details: $modelClass#$modelId", $output); + $this->assertStringContainsString('Hash: ', $output); + $this->assertStringContainsString('Url: http://localhost/payment/capture', $output); + $this->assertStringContainsString('After Url: http://localhost/foo/url?payum_token=', $output); + $this->assertStringContainsString("Details: $modelClass#$modelId", $output); } /** - * @param Command $command * @param string[] $arguments - * - * @return string */ - protected function executeConsole(Command $command, array $arguments = array()) + protected function executeConsole(Command $command, array $arguments = array()): string { $command->setApplication(new Application($this->client->getKernel())); if ($command instanceof ContainerAwareInterface) { diff --git a/Tests/Functional/Command/CreateNotifyTokenCommandTest.php b/Tests/Functional/Command/CreateNotifyTokenCommandTest.php index cfc8678e..11c2bd27 100644 --- a/Tests/Functional/Command/CreateNotifyTokenCommandTest.php +++ b/Tests/Functional/Command/CreateNotifyTokenCommandTest.php @@ -14,21 +14,21 @@ class CreateNotifyTokenCommandTest extends WebTestCase /** * @test */ - public function shouldCreateNotifyTokenWithoutModel() + public function shouldCreateNotifyTokenWithoutModel(): void { $output = $this->executeConsole(new CreateNotifyTokenCommand, array( 'gateway-name' => 'fooGateway' )); - $this->assertContains('Hash: ', $output); - $this->assertContains('Url: ', $output); - $this->assertContains('Details: null', $output); + $this->assertStringContainsString('Hash: ', $output); + $this->assertStringContainsString('Url: ', $output); + $this->assertStringContainsString('Details: null', $output); } /** * @test */ - public function shouldCreateNotifyTokenWithModel() + public function shouldCreateNotifyTokenWithModel(): void { /** @var RegistryInterface $payum */ $payum = $this->client->getContainer()->get('payum'); @@ -47,18 +47,15 @@ public function shouldCreateNotifyTokenWithModel() '--model-id' => $modelId )); - $this->assertContains('Hash: ', $output); - $this->assertContains('Url: ', $output); - $this->assertContains("Details: $modelClass#$modelId", $output); + $this->assertStringContainsString('Hash: ', $output); + $this->assertStringContainsString('Url: ', $output); + $this->assertStringContainsString("Details: $modelClass#$modelId", $output); } /** - * @param Command $command * @param string[] $arguments - * - * @return string */ - protected function executeConsole(Command $command, array $arguments = array()) + protected function executeConsole(Command $command, array $arguments = array()): string { $command->setApplication(new Application($this->client->getKernel())); if ($command instanceof ContainerAwareInterface) { diff --git a/Tests/Functional/Command/DebugGatewayCommandTest.php b/Tests/Functional/Command/DebugGatewayCommandTest.php index 1f8482ec..5795fc22 100644 --- a/Tests/Functional/Command/DebugGatewayCommandTest.php +++ b/Tests/Functional/Command/DebugGatewayCommandTest.php @@ -13,58 +13,58 @@ class DebugGatewayCommandTest extends WebTestCase /** * @test */ - public function shouldOutputDebugInfoAboutSingleGateway() + public function shouldOutputDebugInfoAboutSingleGateway(): void { $output = $this->executeConsole(new DebugGatewayCommand(), array( 'gateway-name' => 'fooGateway', )); - $this->assertContains('Found 1 gateways', $output); - $this->assertContains('fooGateway (Payum\Core\Gateway):', $output); - $this->assertContains('Actions:', $output); - $this->assertContains('Extensions:', $output); - $this->assertContains('Apis:', $output); + $this->assertStringContainsString('Found 1 gateways', $output); + $this->assertStringContainsString('fooGateway (Payum\Core\Gateway):', $output); + $this->assertStringContainsString('Actions:', $output); + $this->assertStringContainsString('Extensions:', $output); + $this->assertStringContainsString('Apis:', $output); - $this->assertContains('Payum\Offline\Action\CaptureAction', $output); + $this->assertStringContainsString('Payum\Offline\Action\CaptureAction', $output); - $this->assertContains('Payum\Core\Extension\StorageExtension', $output); - $this->assertContains('Payum\Core\Storage\FilesystemStorage', $output); - $this->assertContains('Payum\Core\Model\ArrayObject', $output); + $this->assertStringContainsString('Payum\Core\Extension\StorageExtension', $output); + $this->assertStringContainsString('Payum\Core\Storage\FilesystemStorage', $output); + $this->assertStringContainsString('Payum\Core\Model\ArrayObject', $output); } /** * @test */ - public function shouldOutputDebugInfoAboutAllGateways() + public function shouldOutputDebugInfoAboutAllGateways(): void { $output = $this->executeConsole(new DebugGatewayCommand()); - $this->assertContains('Found 2 gateways', $output); - $this->assertContains('fooGateway (Payum\Core\Gateway):', $output); - $this->assertContains('barGateway (Payum\Core\Gateway):', $output); + $this->assertStringContainsString('Found 2 gateways', $output); + $this->assertStringContainsString('fooGateway (Payum\Core\Gateway):', $output); + $this->assertStringContainsString('barGateway (Payum\Core\Gateway):', $output); } /** * @test */ - public function shouldOutputInfoWhatActionsSupports() + public function shouldOutputInfoWhatActionsSupports(): void { $output = $this->executeConsole(new DebugGatewayCommand(), array( 'gateway-name' => 'fooGateway', '--show-supports' => true, )); - $this->assertContains('Found 1 gateways', $output); - $this->assertContains('fooGateway (Payum\Core\Gateway):', $output); - $this->assertContains('Payum\Offline\Action\CaptureAction', $output); - $this->assertContains('$request instanceof Capture &&', $output); - $this->assertContains('$request->getModel() instanceof PaymentInterface', $output); + $this->assertStringContainsString('Found 1 gateways', $output); + $this->assertStringContainsString('fooGateway (Payum\Core\Gateway):', $output); + $this->assertStringContainsString('Payum\Offline\Action\CaptureAction', $output); + $this->assertStringContainsString('$request instanceof Capture &&', $output); + $this->assertStringContainsString('$request->getModel() instanceof PaymentInterface', $output); } /** * @test */ - public function shouldOutputChoiceListGatewaysForNameGiven() + public function shouldOutputChoiceListGatewaysForNameGiven(): void { $command = new DebugGatewayCommand(); $command->setApplication(new Application($this->client->getKernel())); @@ -73,8 +73,8 @@ public function shouldOutputChoiceListGatewaysForNameGiven() 'gateway-name' => 'foo', ], ['0']); - $this->assertContains('Choose a number for more information on the payum gateway', $output); - $this->assertContains('[0] fooGateway', $output); + $this->assertStringContainsString('Choose a number for more information on the payum gateway', $output); + $this->assertStringContainsString('[0] fooGateway', $output); } /** @@ -84,7 +84,7 @@ public function shouldOutputChoiceListGatewaysForNameGiven() * * @return string */ - protected function executeConsole(Command $command, array $arguments = [], array $inputs = []) + protected function executeConsole(Command $command, array $arguments = [], array $inputs = []): string { if (!$command->getApplication()) { $command->setApplication(new Application($this->client->getKernel())); @@ -110,7 +110,7 @@ protected function executeConsole(Command $command, array $arguments = [], array protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); - fputs($stream, $input); + fwrite($stream, $input); rewind($stream); return $stream; diff --git a/Tests/Functional/Command/StatusCommandTest.php b/Tests/Functional/Command/StatusCommandTest.php index 32abfc5b..f7bcf99f 100644 --- a/Tests/Functional/Command/StatusCommandTest.php +++ b/Tests/Functional/Command/StatusCommandTest.php @@ -14,7 +14,7 @@ class StatusCommandTest extends WebTestCase /** * @test */ - public function shouldReturnNewStatus() + public function shouldReturnNewStatus(): void { /** @var RegistryInterface $payum */ $payum = $this->client->getContainer()->get('payum'); @@ -33,7 +33,7 @@ public function shouldReturnNewStatus() '--model-id' => $modelId )); - $this->assertContains("Status: new", $output); + $this->assertStringContainsString("Status: new", $output); } /** @@ -42,7 +42,7 @@ public function shouldReturnNewStatus() * * @return string */ - protected function executeConsole(Command $command, array $arguments = array()) + protected function executeConsole(Command $command, array $arguments = array()): string { $command->setApplication(new Application($this->client->getKernel())); if ($command instanceof ContainerAwareInterface) { diff --git a/Tests/Functional/Controller/AuthorizeControllerTest.php b/Tests/Functional/Controller/AuthorizeControllerTest.php index 47d30d72..f8c33dc5 100644 --- a/Tests/Functional/Controller/AuthorizeControllerTest.php +++ b/Tests/Functional/Controller/AuthorizeControllerTest.php @@ -10,7 +10,7 @@ class AuthorizeControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/CancelControllerTest.php b/Tests/Functional/Controller/CancelControllerTest.php index 32065d6a..5a29b783 100644 --- a/Tests/Functional/Controller/CancelControllerTest.php +++ b/Tests/Functional/Controller/CancelControllerTest.php @@ -10,7 +10,7 @@ class CancelControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/CaptureControllerTest.php b/Tests/Functional/Controller/CaptureControllerTest.php index 1b39b222..9adf80a5 100644 --- a/Tests/Functional/Controller/CaptureControllerTest.php +++ b/Tests/Functional/Controller/CaptureControllerTest.php @@ -10,7 +10,7 @@ class CaptureControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/NotifyControllerTest.php b/Tests/Functional/Controller/NotifyControllerTest.php index 446e224c..03e8679e 100644 --- a/Tests/Functional/Controller/NotifyControllerTest.php +++ b/Tests/Functional/Controller/NotifyControllerTest.php @@ -10,7 +10,7 @@ class NotifyControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/PayoutControllerTest.php b/Tests/Functional/Controller/PayoutControllerTest.php index 1e782fe8..03e9a5a1 100644 --- a/Tests/Functional/Controller/PayoutControllerTest.php +++ b/Tests/Functional/Controller/PayoutControllerTest.php @@ -10,7 +10,7 @@ class PayoutControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/RefundControllerTest.php b/Tests/Functional/Controller/RefundControllerTest.php index 51d36955..8767bcfe 100644 --- a/Tests/Functional/Controller/RefundControllerTest.php +++ b/Tests/Functional/Controller/RefundControllerTest.php @@ -10,7 +10,7 @@ class RefundControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/Controller/SyncControllerTest.php b/Tests/Functional/Controller/SyncControllerTest.php index b8d5f98c..7ffca367 100644 --- a/Tests/Functional/Controller/SyncControllerTest.php +++ b/Tests/Functional/Controller/SyncControllerTest.php @@ -10,7 +10,7 @@ class SyncControllerTest extends WebTestCase /** * @ticket 507 */ - public function testCanBeAccessed() + public function testCanBeAccessed(): void { $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('A token with hash `payum_token` could not be found.'); diff --git a/Tests/Functional/DependencyInjection/MainConfigurationTest.php b/Tests/Functional/DependencyInjection/MainConfigurationTest.php index 2b3afb39..7930e496 100644 --- a/Tests/Functional/DependencyInjection/MainConfigurationTest.php +++ b/Tests/Functional/DependencyInjection/MainConfigurationTest.php @@ -9,7 +9,7 @@ class MainConfigurationTest extends TestCase { - protected $storageFactories = array(); + protected array $storageFactories = array(); protected function setUp(): void { @@ -22,8 +22,10 @@ protected function setUp(): void /** * @test */ - public function shouldPassConfigurationProcessingWithMinimumConfig() + public function shouldPassConfigurationProcessingWithMinimumConfig(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -48,8 +50,9 @@ public function shouldPassConfigurationProcessingWithMinimumConfig() /** * @test */ - public function shouldPassConfigurationProcessingWithMinimumConfigPlusGateway() + public function shouldPassConfigurationProcessingWithMinimumConfigPlusGateway(): void { + $this->expectNotToPerformAssertions(); $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -82,8 +85,10 @@ public function shouldPassConfigurationProcessingWithMinimumConfigPlusGateway() /** * @test */ - public function shouldPassConfigurationProcessingWithDynamicGateways() + public function shouldPassConfigurationProcessingWithDynamicGateways(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -116,8 +121,10 @@ public function shouldPassConfigurationProcessingWithDynamicGateways() /** * @test */ - public function shouldPassConfigurationProcessingWithDynamicGatewaysAndEncryption() + public function shouldPassConfigurationProcessingWithDynamicGatewaysAndEncryption(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -153,8 +160,10 @@ public function shouldPassConfigurationProcessingWithDynamicGatewaysAndEncryptio /** * @test */ - public function shouldPassConfigurationProcessingWithDynamicGatewaysPlusSonataAdmin() + public function shouldPassConfigurationProcessingWithDynamicGatewaysPlusSonataAdmin(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -188,8 +197,10 @@ public function shouldPassConfigurationProcessingWithDynamicGatewaysPlusSonataAd /** * @test */ - public function shouldPassConfigurationProcessingWithKlarnaCheckoutGatewayFactory() + public function shouldPassConfigurationProcessingWithKlarnaCheckoutGatewayFactory(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -222,8 +233,10 @@ public function shouldPassConfigurationProcessingWithKlarnaCheckoutGatewayFactor /** * @test */ - public function shouldPassConfigurationProcessingWithDoctrineStorageFactory() + public function shouldPassConfigurationProcessingWithDoctrineStorageFactory(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); @@ -262,8 +275,10 @@ public function shouldPassConfigurationProcessingWithDoctrineStorageFactory() /** * @test */ - public function shouldPassConfigurationProcessingWithFilesystemStorageFactory() + public function shouldPassConfigurationProcessingWithFilesystemStorageFactory(): void { + $this->expectNotToPerformAssertions(); + $configuration = new MainConfiguration($this->storageFactories); $processor = new Processor(); diff --git a/Tests/Functional/DependencyInjection/PayumExtensionTest.php b/Tests/Functional/DependencyInjection/PayumExtensionTest.php index 939a85f9..2103f92f 100644 --- a/Tests/Functional/DependencyInjection/PayumExtensionTest.php +++ b/Tests/Functional/DependencyInjection/PayumExtensionTest.php @@ -15,7 +15,7 @@ class PayumExtensionTest extends TestCase /** * @test */ - public function shouldAddGatewayTagWithCorrectGatewayAndFactoryNamesSet() + public function shouldAddGatewayTagWithCorrectGatewayAndFactoryNamesSet(): void { $this->markTestSkipped(); @@ -68,7 +68,7 @@ public function shouldAddGatewayTagWithCorrectGatewayAndFactoryNamesSet() /** * @test */ - public function shouldUsePayumBuilderServiceToBuildPayumService() + public function shouldUsePayumBuilderServiceToBuildPayumService(): void { $config = array( // 'dynamic_gateways' => array() @@ -96,7 +96,7 @@ public function shouldUsePayumBuilderServiceToBuildPayumService() $payum = $containerBuilder->getDefinition('payum'); $this->assertEquals('Payum\Core\Payum', $payum->getClass()); - $this->assertInternalType('array', $payum->getFactory()); + $this->assertIsArray($payum->getFactory()); $this->assertInstanceOf(Reference::class, $payum->getFactory()[0]); $this->assertEquals('payum.builder', (string) $payum->getFactory()[0]); @@ -107,7 +107,7 @@ public function shouldUsePayumBuilderServiceToBuildPayumService() /** * @test */ - public function shouldSetGatewayConfigStorageToPayumBuilderIfConfigured() + public function shouldSetGatewayConfigStorageToPayumBuilderIfConfigured(): void { $config = array( 'dynamic_gateways' => array( @@ -155,7 +155,7 @@ public function shouldSetGatewayConfigStorageToPayumBuilderIfConfigured() /** * @test */ - public function shouldWrapGatewayConfigStorageByEncryptionDecoratorWhenDefuseEncryptionIsEnabled() + public function shouldWrapGatewayConfigStorageByEncryptionDecoratorWhenDefuseEncryptionIsEnabled(): void { $config = array( 'dynamic_gateways' => array( @@ -210,7 +210,7 @@ public function shouldWrapGatewayConfigStorageByEncryptionDecoratorWhenDefuseEnc /** * @test */ - public function shouldConfigureSonataAdminClassForGatewayConfigModelSetInStorageSection() + public function shouldConfigureSonataAdminClassForGatewayConfigModelSetInStorageSection(): void { $this->markTestSkipped('Has to wait for Sonata Admin Sf4 compatible release'); @@ -265,7 +265,7 @@ public function shouldConfigureSonataAdminClassForGatewayConfigModelSetInStorage /** * @test */ - public function shouldInjectCypherToForGatewayConfigAdmin() + public function shouldInjectCypherToForGatewayConfigAdmin(): void { $this->markTestSkipped('Has to wait for Sonata Admin Sf4 compatible release'); @@ -320,7 +320,7 @@ public function shouldInjectCypherToForGatewayConfigAdmin() /** * @test */ - public function shouldNotConfigureSonataAdminClassForGatewayConfigIfDisabled() + public function shouldNotConfigureSonataAdminClassForGatewayConfigIfDisabled(): void { $config = array( 'dynamic_gateways' => array( @@ -366,7 +366,7 @@ public function getGatewayName() { } - public function setGatewayName($gatewayName) + public function setGatewayName($gatewayName): void { } @@ -374,11 +374,11 @@ public function getFactoryName() { } - public function setFactoryName($name) + public function setFactoryName($name): void { } - public function setConfig(array $config) + public function setConfig(array $config): void { } diff --git a/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php b/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php index 1dc3f26f..3b7215b6 100644 --- a/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php +++ b/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php @@ -8,7 +8,7 @@ class ReplyToHttpResponseListenerTest extends WebTestCase /** * @test */ - public function couldBeGetFromContainerAsService() + public function couldBeGetFromContainerAsService(): void { $listener = static::$container->get('payum.listener.reply_to_http_response'); diff --git a/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php b/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php index ed999196..df80f149 100644 --- a/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php +++ b/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php @@ -24,7 +24,7 @@ protected function setUp(): void /** * @test */ - public function couldBeCreatedByFormFactory() + public function couldBeCreatedByFormFactory(): void { $form = $this->formFactory->create(CreditCardExpirationDateType::class); $view = $form->createView(); @@ -36,7 +36,7 @@ public function couldBeCreatedByFormFactory() /** * @test */ - public function shouldAllowSubmitExpireDateAsChoice() + public function shouldAllowSubmitExpireDateAsChoice(): void { $form = $this->formFactory->create(CreditCardExpirationDateType::class, null, array( 'widget' => 'choice', @@ -62,7 +62,7 @@ public function shouldAllowSubmitExpireDateAsChoice() /** * @test */ - public function shouldHideDaySelectAndSetFirstDayFromChoiceAsValue() + public function shouldHideDaySelectAndSetFirstDayFromChoiceAsValue(): void { $form = $this->formFactory->create(CreditCardExpirationDateType::class, null, array( 'widget' => 'choice', @@ -79,7 +79,7 @@ public function shouldHideDaySelectAndSetFirstDayFromChoiceAsValue() /** * @test */ - public function shouldHideDaySelectAndSetDayFromGivenDateTimeAsValue() + public function shouldHideDaySelectAndSetDayFromGivenDateTimeAsValue(): void { $date = new \DateTime('2020-01-10'); diff --git a/Tests/Functional/Form/Type/CreditCardTypeTest.php b/Tests/Functional/Form/Type/CreditCardTypeTest.php index bd5f0b50..ff45c0c5 100644 --- a/Tests/Functional/Form/Type/CreditCardTypeTest.php +++ b/Tests/Functional/Form/Type/CreditCardTypeTest.php @@ -25,7 +25,7 @@ protected function setUp(): void /** * @test */ - public function couldBeCreatedByFormFactory() + public function couldBeCreatedByFormFactory(): void { $form = $this->formFactory->create(CreditCardType::class); $view = $form->createView(); @@ -37,7 +37,7 @@ public function couldBeCreatedByFormFactory() /** * @test */ - public function shouldSubmitDataCorrectly() + public function shouldSubmitDataCorrectly(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -72,7 +72,7 @@ public function shouldSubmitDataCorrectly() /** * @test */ - public function shouldRequireHolderNotBlank() + public function shouldRequireHolderNotBlank(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -96,7 +96,7 @@ public function shouldRequireHolderNotBlank() /** * @test */ - public function shouldRequireNumberNotBlank() + public function shouldRequireNumberNotBlank(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -120,7 +120,7 @@ public function shouldRequireNumberNotBlank() /** * @test */ - public function shouldNumberPassLuchValidation() + public function shouldNumberPassLuchValidation(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -144,7 +144,7 @@ public function shouldNumberPassLuchValidation() /** * @test */ - public function shouldRequireSecurityCodeNotBlank() + public function shouldRequireSecurityCodeNotBlank(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -168,7 +168,7 @@ public function shouldRequireSecurityCodeNotBlank() /** * @test */ - public function shouldRequireExpireAtNotBlank() + public function shouldRequireExpireAtNotBlank(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, @@ -192,7 +192,7 @@ public function shouldRequireExpireAtNotBlank() /** * @test */ - public function shouldRequireExpireAtInFuture() + public function shouldRequireExpireAtInFuture(): void { $form = $this->formFactory->create(CreditCardType::class, null, array( 'csrf_protection' => false, diff --git a/Tests/Functional/Form/Type/GatewayConfigTypeTest.php b/Tests/Functional/Form/Type/GatewayConfigTypeTest.php index e566a770..bafcf72d 100644 --- a/Tests/Functional/Form/Type/GatewayConfigTypeTest.php +++ b/Tests/Functional/Form/Type/GatewayConfigTypeTest.php @@ -25,7 +25,7 @@ protected function setUp(): void /** * @test */ - public function couldBeCreatedByFormFactory() + public function couldBeCreatedByFormFactory(): void { $form = $this->formFactory->create(GatewayConfigType::class, null, array( 'data_class' => GatewayConfig::class, diff --git a/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php b/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php index 2930765f..3f3e89b3 100644 --- a/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php +++ b/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php @@ -24,7 +24,7 @@ protected function setUp(): void /** * @test */ - public function couldBeCreatedByFormFactory() + public function couldBeCreatedByFormFactory(): void { $form = $this->formFactory->create(GatewayFactoriesChoiceType::class); $view = $form->createView(); diff --git a/Tests/Functional/PayumBuilderTest.php b/Tests/Functional/PayumBuilderTest.php index 2e516d99..24eaee9d 100644 --- a/Tests/Functional/PayumBuilderTest.php +++ b/Tests/Functional/PayumBuilderTest.php @@ -9,7 +9,7 @@ class PayumBuilderTest extends WebTestCase { - public function testCouldBeGetFromContainerAsService() + public function testCouldBeGetFromContainerAsService(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); @@ -17,50 +17,65 @@ public function testCouldBeGetFromContainerAsService() $this->assertInstanceOf(PayumBuilder::class, $builder); } - public function testShouldContainCoreGatewayFactoryBuilder() + + public function testShouldContainCoreGatewayFactoryBuilder(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); - $this->assertAttributeInstanceOf(CoreGatewayFactoryBuilder::class, 'coreGatewayFactory', $builder); + $reflectedConstraint = (new \ReflectionObject($builder))->getProperty('coreGatewayFactory'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($builder); + $this->assertInstanceOf(CoreGatewayFactoryBuilder::class, $constraint); } - public function testShouldContainHttpRequestVerifierBuilder() + public function testShouldContainHttpRequestVerifierBuilder(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); - $this->assertAttributeInstanceOf(HttpRequestVerifierBuilder::class, 'httpRequestVerifier', $builder); + $reflectedConstraint = (new \ReflectionObject($builder))->getProperty('httpRequestVerifier'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($builder); + $this->assertInstanceOf(HttpRequestVerifierBuilder::class, $constraint); } - public function testShouldContainTokenFactoryBuilder() + public function testShouldContainTokenFactoryBuilder(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); - $this->assertAttributeInstanceOf(TokenFactoryBuilder::class, 'tokenFactory', $builder); + $reflectedConstraint = (new \ReflectionObject($builder))->getProperty('tokenFactory'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($builder); + $this->assertInstanceOf(TokenFactoryBuilder::class, $constraint); } - public function testShouldContainMainRegistry() + public function testShouldContainMainRegistry(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); - $this->assertAttributeInstanceOf(ContainerAwareRegistry::class, 'mainRegistry', $builder); + $reflectedConstraint = (new \ReflectionObject($builder))->getProperty('mainRegistry'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($builder); + $this->assertInstanceOf(ContainerAwareRegistry::class, $constraint); } - public function testShouldContainGenericTokenFactoryPaths() + public function testShouldContainGenericTokenFactoryPaths(): void { /** @var PayumBuilder $builder */ $builder = static::$container->get('payum.builder'); - $this->assertAttributeEquals([ - 'capture' => 'payum_capture_do', - 'notify' => 'payum_notify_do', - 'authorize' => 'payum_authorize_do', - 'refund' => 'payum_refund_do', - 'cancel' => 'payum_cancel_do', - 'payout' => 'payum_payout_do', - ], 'genericTokenFactoryPaths', $builder); + $reflectedConstraint = (new \ReflectionObject($builder))->getProperty('genericTokenFactoryPaths'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($builder); + + $this->assertEquals('payum_capture_do', $constraint['capture']); + $this->assertEquals('payum_notify_do', $constraint['notify']); + $this->assertEquals('payum_authorize_do', $constraint['authorize']); + $this->assertEquals('payum_refund_do', $constraint['refund']); + $this->assertEquals('payum_cancel_do', $constraint['cancel']); + $this->assertEquals('payum_payout_do', $constraint['payout']); } } diff --git a/Tests/Functional/PayumTest.php b/Tests/Functional/PayumTest.php index 47460dcc..e904e9b1 100644 --- a/Tests/Functional/PayumTest.php +++ b/Tests/Functional/PayumTest.php @@ -13,7 +13,7 @@ class PayumTest extends WebTestCase { - public function testCouldBeGetFromContainerAsService() + public function testCouldBeGetFromContainerAsService(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); @@ -21,7 +21,7 @@ public function testCouldBeGetFromContainerAsService() $this->assertInstanceOf(Payum::class, $payum); } - public function testShouldReturnHttpRequestVerifyRequest() + public function testShouldReturnHttpRequestVerifyRequest(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); @@ -29,17 +29,21 @@ public function testShouldReturnHttpRequestVerifyRequest() $this->assertInstanceOf(HttpRequestVerifier::class, $payum->getHttpRequestVerifier()); } - public function testShouldReturnTokenFactory() + public function testShouldReturnTokenFactory(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); $tokenFactory = $payum->getTokenFactory(); $this->assertInstanceOf(GenericTokenFactory::class, $tokenFactory); - $this->assertAttributeInstanceOf(TokenFactory::class, 'tokenFactory', $tokenFactory); + + $reflectedConstraint = (new \ReflectionObject($tokenFactory))->getProperty('tokenFactory'); + $reflectedConstraint->setAccessible(true); + $constraint = $reflectedConstraint->getValue($tokenFactory); + $this->assertInstanceOf(TokenFactory::class, $constraint); } - public function testShouldReturnTokenStorage() + public function testShouldReturnTokenStorage(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); @@ -48,37 +52,37 @@ public function testShouldReturnTokenStorage() $this->assertInstanceOf(StorageInterface::class, $storage); } - public function testShouldReturnStorages() + public function testShouldReturnStorages(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); $storages = $payum->getStorages(); - $this->assertInternalType('array', $storages); + $this->assertIsArray($storages); $this->assertCount(1, $storages); } - public function testShouldReturnGateways() + public function testShouldReturnGateways(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); $gateways = $payum->getGateways(); - $this->assertInternalType('array', $gateways); + $this->assertIsArray($gateways); $this->assertCount(2, $gateways); } - public function testShouldReturnGatewaysFactories() + public function testShouldReturnGatewaysFactories(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); $factories = $payum->getGatewayFactories(); - $this->assertInternalType('array', $factories); + $this->assertIsArray($factories); $this->assertGreaterThan(10, count($factories)); } - public function testShouldReturnGatewayFactory() + public function testShouldReturnGatewayFactory(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); @@ -87,7 +91,7 @@ public function testShouldReturnGatewayFactory() $this->assertInstanceOf(StripeJsGatewayFactory::class, $payum->getGatewayFactory('stripe_js')); } - public function testShouldReturnGateway() + public function testShouldReturnGateway(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); @@ -96,7 +100,7 @@ public function testShouldReturnGateway() $this->assertInstanceOf(GatewayInterface::class, $payum->getGateway('barGateway')); } - public function testShouldReturnStorage() + public function testShouldReturnStorage(): void { /** @var Payum $payum */ $payum = static::$container->get('payum'); diff --git a/Tests/Functional/WebTestCase.php b/Tests/Functional/WebTestCase.php index 42826c82..491f20e4 100644 --- a/Tests/Functional/WebTestCase.php +++ b/Tests/Functional/WebTestCase.php @@ -7,10 +7,7 @@ abstract class WebTestCase extends BaseWebTestCase { - /** - * @var KernelBrowser - */ - protected $client; + protected KernelBrowser $client; /** * @var ContainerInterface @@ -25,10 +22,7 @@ protected function setUp(): void static::$container = static::$kernel->getContainer(); } - /** - * @return string - */ - public static function getKernelClass() + public static function getKernelClass(): string { require_once __DIR__ . '/app/AppKernel.php'; diff --git a/Tests/Functional/app/AppKernel.php b/Tests/Functional/app/AppKernel.php index 2d3bf8a8..444d8ff3 100644 --- a/Tests/Functional/app/AppKernel.php +++ b/Tests/Functional/app/AppKernel.php @@ -1,61 +1,29 @@ load(__DIR__ . '/config/config.yml'); + public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response + { + return parent::handle($request, $type, false); + } } -} +} \ No newline at end of file diff --git a/Tests/Functional/app/AppKernelShared.php b/Tests/Functional/app/AppKernelShared.php new file mode 100644 index 00000000..0bf619f1 --- /dev/null +++ b/Tests/Functional/app/AppKernelShared.php @@ -0,0 +1,44 @@ +load(__DIR__ . '/config/config.yml'); + + if(Kernel::MAJOR_VERSION===4){ + $loader->load(__DIR__ . '/config/config_sf4.yml'); + } + else + { + $loader->load(__DIR__ . '/config/config_sf5.yml'); + } + } +} diff --git a/Tests/Functional/app/config/config.yml b/Tests/Functional/app/config/config.yml index 1938bae6..2feeb3a5 100644 --- a/Tests/Functional/app/config/config.yml +++ b/Tests/Functional/app/config/config.yml @@ -6,14 +6,11 @@ framework: #esi: ~ #translator: { fallback: %locale% } test: ~ - session: - storage_id: 'session.storage.mock_file' secret: '%secret%' - router: { resource: '%kernel.project_dir%/Tests/Functional/app/config/routing.yml' } + router: { utf8: true, resource: '%kernel.project_dir%/Tests/Functional/app/config/routing.yml' } default_locale: '%locale%' form: true csrf_protection: true - validation: { enable_annotations: true } assets: false payum: diff --git a/Tests/Functional/app/config/config_sf4.yml b/Tests/Functional/app/config/config_sf4.yml new file mode 100644 index 00000000..e23e7560 --- /dev/null +++ b/Tests/Functional/app/config/config_sf4.yml @@ -0,0 +1,4 @@ +framework: + session: + storage_id: 'session.storage.mock_file' + validation: { enable_annotations: true } \ No newline at end of file diff --git a/Tests/Functional/app/config/config_sf5.yml b/Tests/Functional/app/config/config_sf5.yml new file mode 100644 index 00000000..f6c17d91 --- /dev/null +++ b/Tests/Functional/app/config/config_sf5.yml @@ -0,0 +1,7 @@ +framework: + session: + handler_id: null + cookie_secure: auto + cookie_samesite: lax + storage_factory_id: session.storage.factory.mock_file + validation: { enable_annotations: false } \ No newline at end of file diff --git a/Tests/PayumBundleTest.php b/Tests/PayumBundleTest.php index 8ee13f6b..ce77e821 100644 --- a/Tests/PayumBundleTest.php +++ b/Tests/PayumBundleTest.php @@ -9,7 +9,7 @@ class PayumBundleTest extends \PHPUnit\Framework\TestCase /** * @test */ - public function shouldBeSubClassOfBundle() + public function shouldBeSubClassOfBundle(): void { $rc = new \ReflectionClass(PayumBundle::class); @@ -19,8 +19,9 @@ public function shouldBeSubClassOfBundle() /** * @test */ - public function couldBeConstructedWithoutAnyArguments() + public function couldBeConstructedWithoutAnyArguments(): void { + $this->expectNotToPerformAssertions(); new PayumBundle; } } \ No newline at end of file diff --git a/Tests/Sonata/GatewayConfigAdminTest.php b/Tests/Sonata/GatewayConfigAdminTest.php index 817d72e6..c63a6aa8 100644 --- a/Tests/Sonata/GatewayConfigAdminTest.php +++ b/Tests/Sonata/GatewayConfigAdminTest.php @@ -16,7 +16,7 @@ public static function setUpBeforeClass(): void /** * @test */ - public function shouldBeSubClassSonataAdmin() + public function shouldBeSubClassSonataAdmin(): void { $rc = new \ReflectionClass(GatewayConfigAdmin::class); @@ -26,7 +26,7 @@ public function shouldBeSubClassSonataAdmin() /** * @test */ - public function couldBeConstructedWithExpectedArguments() + public function couldBeConstructedWithExpectedArguments(): void { new GatewayConfigAdmin('code', 'class', 'baseControllerName'); } @@ -34,7 +34,7 @@ public function couldBeConstructedWithExpectedArguments() /** * @test */ - public function shouldAllowSetFormFactory() + public function shouldAllowSetFormFactory(): void { $admin = new GatewayConfigAdmin('code', 'class', 'baseControllerName'); diff --git a/composer.json b/composer.json index 032da7a3..0b6f53b1 100644 --- a/composer.json +++ b/composer.json @@ -37,26 +37,26 @@ } ], "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "payum/core": "^1.6", "symfony/framework-bundle": "^4.4 || ^5.0", - "symfony/form": "^4.4 || ^5.0", + "symfony/form": "^4.4.20 || ^5.0", "symfony/validator": "^4.4 || ^5.0", "symfony/security-csrf": "^4.4 | ^5.0" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.5", + "phpunit/phpunit": "^9.5", "twig/twig": "^1.16 || ^2.0 || ^3.0", "symfony/twig-bundle": "^4.4|^5", "symfony/expression-language": "^4.4 || ^5.0", "symfony/browser-kit": "^4.4 || ^5.0", - "symfony/phpunit-bridge": "^4.4 || ^5.0", + "symfony/phpunit-bridge": "6.0", "symfony/templating": "^4.4 || ^5.0", "symfony/yaml": "^4.4 || ^5.0 ", "defuse/php-encryption": "^2", "doctrine/orm": "~2.5", "payum/omnipay-v3-bridge": "^1@alpha", - "payum/payum": "^1.6", + "payum/payum": "^1.6.2", "php-http/guzzle6-adapter": "1.1.1", "omnipay/dummy": "^3@alpha", "omnipay/paypal": "^3@dev", @@ -65,8 +65,8 @@ "klarna/checkout": "~1|~2.0", "fp/klarna-invoice": "0.1.*", "stripe/stripe-php": "~1.0", - "league/uri-schemes": "^1.1", "doctrine/annotations": "^1.9", + "psr/log": "^1 || ^2", "ext-curl": "*", "ext-pdo_sqlite": "*", "ext-soap": "*"