From de19dc4a8dd8037efacaba19363b3d956d9001f6 Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Sat, 2 Feb 2019 22:49:34 +0100 Subject: [PATCH 1/3] Add new getExtendedTypes method in form extension for Symfony 4.2 When bumping the requirement to PHP 7.1 the iterable return type should be added --- Form/Extension/GatewayFactoriesChoiceTypeExtension.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Form/Extension/GatewayFactoriesChoiceTypeExtension.php b/Form/Extension/GatewayFactoriesChoiceTypeExtension.php index 8de32b5b..294bbe72 100644 --- a/Form/Extension/GatewayFactoriesChoiceTypeExtension.php +++ b/Form/Extension/GatewayFactoriesChoiceTypeExtension.php @@ -49,4 +49,12 @@ public function getExtendedType() { return GatewayFactoriesChoiceType::class; } + + /** + * {@inheritdoc} + */ + public static function getExtendedTypes() + { + return [GatewayFactoriesChoiceType::class]; + } } From 5148e97bf347d8c073ed71ad5ae8fd196e84ed2e Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Sat, 2 Feb 2019 22:58:27 +0100 Subject: [PATCH 2/3] Remove deprecated ContainerAwareCommand usage --- Command/CreateCaptureTokenCommand.php | 11 +++++++---- Command/CreateNotifyTokenCommand.php | 10 +++++++--- Command/DebugGatewayCommand.php | 10 +++++++--- Command/StatusCommand.php | 10 +++++++--- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Command/CreateCaptureTokenCommand.php b/Command/CreateCaptureTokenCommand.php index acfa946d..4d3edf9e 100644 --- a/Command/CreateCaptureTokenCommand.php +++ b/Command/CreateCaptureTokenCommand.php @@ -3,14 +3,18 @@ use Payum\Core\Exception\RuntimeException; use Payum\Core\Payum; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; -class CreateCaptureTokenCommand extends ContainerAwareCommand +class CreateCaptureTokenCommand extends Command implements ContainerAwareInterface { + use ContainerAwareTrait; + protected static $defaultName = 'payum:security:create-capture-token'; /** @@ -35,7 +39,6 @@ protected function execute(InputInterface $input, OutputInterface $output) $gatewayName = $input->getArgument('gateway-name'); $modelClass = $input->getOption('model-class'); $modelId = $input->getOption('model-id'); - $model = null; $afterUrl = $input->getOption('after-url'); $model = null; @@ -62,6 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output) */ protected function getPayum() { - return $this->getContainer()->get('payum'); + return $this->container->get('payum'); } } diff --git a/Command/CreateNotifyTokenCommand.php b/Command/CreateNotifyTokenCommand.php index 7783d8dc..b3b96f1f 100644 --- a/Command/CreateNotifyTokenCommand.php +++ b/Command/CreateNotifyTokenCommand.php @@ -3,14 +3,18 @@ use Payum\Core\Exception\RuntimeException; use Payum\Core\Payum; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; -class CreateNotifyTokenCommand extends ContainerAwareCommand +class CreateNotifyTokenCommand extends Command implements ContainerAwareInterface { + use ContainerAwareTrait; + protected static $defaultName = 'payum:security:create-notify-token'; /** @@ -58,6 +62,6 @@ protected function execute(InputInterface $input, OutputInterface $output) */ protected function getPayum() { - return $this->getContainer()->get('payum'); + return $this->container->get('payum'); } } diff --git a/Command/DebugGatewayCommand.php b/Command/DebugGatewayCommand.php index 9e613a1e..6cf06421 100644 --- a/Command/DebugGatewayCommand.php +++ b/Command/DebugGatewayCommand.php @@ -5,15 +5,19 @@ use Payum\Core\Gateway; use Payum\Core\Registry\RegistryInterface; use Payum\Core\Storage\AbstractStorage; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; -class DebugGatewayCommand extends ContainerAwareCommand +class DebugGatewayCommand extends Command implements ContainerAwareInterface { + use ContainerAwareTrait; + protected static $defaultName = 'debug:payum:gateway'; /** @@ -141,7 +145,7 @@ protected function getMethodCode(\ReflectionMethod $reflectionMethod) */ protected function getPayum() { - return $this->getContainer()->get('payum'); + return $this->container->get('payum'); } private function findProperGatewayName(InputInterface $input, OutputInterface $output, $gateways, $name) diff --git a/Command/StatusCommand.php b/Command/StatusCommand.php index 9675fcf7..21175db5 100644 --- a/Command/StatusCommand.php +++ b/Command/StatusCommand.php @@ -4,14 +4,18 @@ use Payum\Core\Exception\RuntimeException; use Payum\Core\Registry\RegistryInterface; use Payum\Core\Request\GetHumanStatus; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; -class StatusCommand extends ContainerAwareCommand +class StatusCommand extends Command implements ContainerAwareInterface { + use ContainerAwareTrait; + protected static $defaultName = 'payum:status'; /** @@ -57,6 +61,6 @@ protected function execute(InputInterface $input, OutputInterface $output) */ protected function getPayum() { - return $this->getContainer()->get('payum'); + return $this->container->get('payum'); } } From 70bd4d18d680d7966e14164b6e0c944ff7f3e09c Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Sun, 3 Feb 2019 00:19:05 +0100 Subject: [PATCH 3/3] Fix tests for Symfony 4.2 --- .../ReplyToHttpResponseListenerTest.php | 8 +++---- .../Command/CreateCaptureTokenCommandTest.php | 5 ++--- .../Command/CreateNotifyTokenCommandTest.php | 5 ++--- .../Command/DebugGatewayCommandTest.php | 4 ++-- .../Functional/Command/StatusCommandTest.php | 5 ++--- .../ReplyToHttpResponseListenerTest.php | 4 ++-- .../Type/CreditCardExpirationDateTypeTest.php | 4 ++-- .../Form/Type/CreditCardTypeTest.php | 2 +- .../Form/Type/GatewayConfigTypeTest.php | 4 ++-- .../Type/GatewayFactoriesChoiceTypeTest.php | 4 ++-- Tests/Functional/PayumBuilderTest.php | 14 ++++++------ Tests/Functional/PayumTest.php | 22 +++++++++---------- Tests/Functional/WebTestCase.php | 6 ++--- phpunit.xml.dist | 3 ++- 14 files changed, 44 insertions(+), 46 deletions(-) diff --git a/Tests/EventListener/ReplyToHttpResponseListenerTest.php b/Tests/EventListener/ReplyToHttpResponseListenerTest.php index 0041ef1a..4a59a4c5 100644 --- a/Tests/EventListener/ReplyToHttpResponseListenerTest.php +++ b/Tests/EventListener/ReplyToHttpResponseListenerTest.php @@ -27,7 +27,7 @@ public function couldBeConstructedWithOneArgument() public function shouldDoNothingIfExceptionNotInstanceOfReply() { $expectedException = new Exception; - + $event = new GetResponseForExceptionEvent( $this->createHttpKernelMock(), new Request, @@ -40,11 +40,11 @@ public function shouldDoNothingIfExceptionNotInstanceOfReply() ->expects($this->never()) ->method('convert') ; - + $listener = new ReplyToHttpResponseListener($converterMock); $listener->onKernelException($event); - + $this->assertNull($event->getResponse()); $this->assertSame($expectedException, $event->getException()); $this->assertFalse($event->isPropagationStopped()); @@ -218,4 +218,4 @@ protected function createHttpKernelMock() { return $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface'); } -} \ No newline at end of file +} diff --git a/Tests/Functional/Command/CreateCaptureTokenCommandTest.php b/Tests/Functional/Command/CreateCaptureTokenCommandTest.php index 8871d1c8..e0785abc 100644 --- a/Tests/Functional/Command/CreateCaptureTokenCommandTest.php +++ b/Tests/Functional/Command/CreateCaptureTokenCommandTest.php @@ -4,11 +4,10 @@ use Payum\Bundle\PayumBundle\Command\CreateCaptureTokenCommand; use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase; use Payum\Core\Registry\RegistryInterface; -use Symfony\Bundle\FrameworkBundle\Client; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; class CreateCaptureTokenCommandTest extends WebTestCase { @@ -79,7 +78,7 @@ public function shouldCreateCaptureTokenWithRouteAsAfterUrl() protected function executeConsole(Command $command, array $arguments = array()) { $command->setApplication(new Application($this->client->getKernel())); - if ($command instanceof ContainerAwareCommand) { + if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->client->getContainer()); } diff --git a/Tests/Functional/Command/CreateNotifyTokenCommandTest.php b/Tests/Functional/Command/CreateNotifyTokenCommandTest.php index 17a2df09..cfc8678e 100644 --- a/Tests/Functional/Command/CreateNotifyTokenCommandTest.php +++ b/Tests/Functional/Command/CreateNotifyTokenCommandTest.php @@ -4,11 +4,10 @@ use Payum\Bundle\PayumBundle\Command\CreateNotifyTokenCommand; use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase; use Payum\Core\Registry\RegistryInterface; -use Symfony\Bundle\FrameworkBundle\Client; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; class CreateNotifyTokenCommandTest extends WebTestCase { @@ -62,7 +61,7 @@ public function shouldCreateNotifyTokenWithModel() protected function executeConsole(Command $command, array $arguments = array()) { $command->setApplication(new Application($this->client->getKernel())); - if ($command instanceof ContainerAwareCommand) { + if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->client->getContainer()); } diff --git a/Tests/Functional/Command/DebugGatewayCommandTest.php b/Tests/Functional/Command/DebugGatewayCommandTest.php index a758be6c..1f8482ec 100644 --- a/Tests/Functional/Command/DebugGatewayCommandTest.php +++ b/Tests/Functional/Command/DebugGatewayCommandTest.php @@ -3,10 +3,10 @@ use Payum\Bundle\PayumBundle\Command\DebugGatewayCommand; use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; class DebugGatewayCommandTest extends WebTestCase { @@ -90,7 +90,7 @@ protected function executeConsole(Command $command, array $arguments = [], array $command->setApplication(new Application($this->client->getKernel())); } - if ($command instanceof ContainerAwareCommand) { + if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->client->getContainer()); } diff --git a/Tests/Functional/Command/StatusCommandTest.php b/Tests/Functional/Command/StatusCommandTest.php index 4a31b7d5..32abfc5b 100644 --- a/Tests/Functional/Command/StatusCommandTest.php +++ b/Tests/Functional/Command/StatusCommandTest.php @@ -4,11 +4,10 @@ use Payum\Bundle\PayumBundle\Command\StatusCommand; use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase; use Payum\Core\Registry\RegistryInterface; -use Symfony\Bundle\FrameworkBundle\Client; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; class StatusCommandTest extends WebTestCase { @@ -46,7 +45,7 @@ public function shouldReturnNewStatus() protected function executeConsole(Command $command, array $arguments = array()) { $command->setApplication(new Application($this->client->getKernel())); - if ($command instanceof ContainerAwareCommand) { + if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->client->getContainer()); } diff --git a/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php b/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php index 39c6b248..1dc3f26f 100644 --- a/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php +++ b/Tests/Functional/EventListener/ReplyToHttpResponseListenerTest.php @@ -10,8 +10,8 @@ class ReplyToHttpResponseListenerTest extends WebTestCase */ public function couldBeGetFromContainerAsService() { - $listener = $this->container->get('payum.listener.reply_to_http_response'); + $listener = static::$container->get('payum.listener.reply_to_http_response'); $this->assertInstanceOf('Payum\Bundle\PayumBundle\EventListener\ReplyToHttpResponseListener', $listener); } -} \ No newline at end of file +} diff --git a/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php b/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php index 8d07775d..1166e1c0 100644 --- a/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php +++ b/Tests/Functional/Form/Type/CreditCardExpirationDateTypeTest.php @@ -18,7 +18,7 @@ protected function setUp() { parent::setUp(); - $this->formFactory = $this->container->get('form.factory'); + $this->formFactory = static::$container->get('form.factory'); } /** @@ -92,4 +92,4 @@ public function shouldHideDaySelectAndSetDayFromGivenDateTimeAsValue() $this->assertEquals(array('style' => 'display:none'), $view['day']->vars['attr']); $this->assertEquals(10, $view['day']->vars['value']); } -} \ No newline at end of file +} diff --git a/Tests/Functional/Form/Type/CreditCardTypeTest.php b/Tests/Functional/Form/Type/CreditCardTypeTest.php index 489d221c..7bb3d481 100644 --- a/Tests/Functional/Form/Type/CreditCardTypeTest.php +++ b/Tests/Functional/Form/Type/CreditCardTypeTest.php @@ -19,7 +19,7 @@ protected function setUp() { parent::setUp(); - $this->formFactory = $this->container->get('form.factory'); + $this->formFactory = static::$container->get('form.factory'); } /** diff --git a/Tests/Functional/Form/Type/GatewayConfigTypeTest.php b/Tests/Functional/Form/Type/GatewayConfigTypeTest.php index 2153e379..9ea6cec1 100644 --- a/Tests/Functional/Form/Type/GatewayConfigTypeTest.php +++ b/Tests/Functional/Form/Type/GatewayConfigTypeTest.php @@ -19,7 +19,7 @@ protected function setUp() { parent::setUp(); - $this->formFactory = $this->container->get('form.factory'); + $this->formFactory = static::$container->get('form.factory'); } /** @@ -35,4 +35,4 @@ public function couldBeCreatedByFormFactory() $this->assertInstanceOf(FormInterface::class, $form); $this->assertInstanceOf(FormView::class, $view); } -} \ No newline at end of file +} diff --git a/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php b/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php index d574cc80..5c63d20d 100644 --- a/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php +++ b/Tests/Functional/Form/Type/GatewayFactoriesChoiceTypeTest.php @@ -18,7 +18,7 @@ protected function setUp() { parent::setUp(); - $this->formFactory = $this->container->get('form.factory'); + $this->formFactory = static::$container->get('form.factory'); } /** @@ -32,4 +32,4 @@ public function couldBeCreatedByFormFactory() $this->assertInstanceOf(FormInterface::class, $form); $this->assertInstanceOf(FormView::class, $view); } -} \ No newline at end of file +} diff --git a/Tests/Functional/PayumBuilderTest.php b/Tests/Functional/PayumBuilderTest.php index fe7001c6..2e516d99 100644 --- a/Tests/Functional/PayumBuilderTest.php +++ b/Tests/Functional/PayumBuilderTest.php @@ -12,7 +12,7 @@ class PayumBuilderTest extends WebTestCase public function testCouldBeGetFromContainerAsService() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertInstanceOf(PayumBuilder::class, $builder); } @@ -20,7 +20,7 @@ public function testCouldBeGetFromContainerAsService() public function testShouldContainCoreGatewayFactoryBuilder() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertAttributeInstanceOf(CoreGatewayFactoryBuilder::class, 'coreGatewayFactory', $builder); } @@ -28,7 +28,7 @@ public function testShouldContainCoreGatewayFactoryBuilder() public function testShouldContainHttpRequestVerifierBuilder() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertAttributeInstanceOf(HttpRequestVerifierBuilder::class, 'httpRequestVerifier', $builder); } @@ -36,7 +36,7 @@ public function testShouldContainHttpRequestVerifierBuilder() public function testShouldContainTokenFactoryBuilder() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertAttributeInstanceOf(TokenFactoryBuilder::class, 'tokenFactory', $builder); } @@ -44,7 +44,7 @@ public function testShouldContainTokenFactoryBuilder() public function testShouldContainMainRegistry() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertAttributeInstanceOf(ContainerAwareRegistry::class, 'mainRegistry', $builder); } @@ -52,7 +52,7 @@ public function testShouldContainMainRegistry() public function testShouldContainGenericTokenFactoryPaths() { /** @var PayumBuilder $builder */ - $builder = $this->container->get('payum.builder'); + $builder = static::$container->get('payum.builder'); $this->assertAttributeEquals([ 'capture' => 'payum_capture_do', @@ -63,4 +63,4 @@ public function testShouldContainGenericTokenFactoryPaths() 'payout' => 'payum_payout_do', ], 'genericTokenFactoryPaths', $builder); } -} \ No newline at end of file +} diff --git a/Tests/Functional/PayumTest.php b/Tests/Functional/PayumTest.php index 7a903c00..47460dcc 100644 --- a/Tests/Functional/PayumTest.php +++ b/Tests/Functional/PayumTest.php @@ -16,7 +16,7 @@ class PayumTest extends WebTestCase public function testCouldBeGetFromContainerAsService() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $this->assertInstanceOf(Payum::class, $payum); } @@ -24,7 +24,7 @@ public function testCouldBeGetFromContainerAsService() public function testShouldReturnHttpRequestVerifyRequest() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $this->assertInstanceOf(HttpRequestVerifier::class, $payum->getHttpRequestVerifier()); } @@ -32,7 +32,7 @@ public function testShouldReturnHttpRequestVerifyRequest() public function testShouldReturnTokenFactory() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $tokenFactory = $payum->getTokenFactory(); $this->assertInstanceOf(GenericTokenFactory::class, $tokenFactory); @@ -42,7 +42,7 @@ public function testShouldReturnTokenFactory() public function testShouldReturnTokenStorage() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $storage = $payum->getTokenStorage(); $this->assertInstanceOf(StorageInterface::class, $storage); @@ -51,7 +51,7 @@ public function testShouldReturnTokenStorage() public function testShouldReturnStorages() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $storages = $payum->getStorages(); $this->assertInternalType('array', $storages); @@ -61,7 +61,7 @@ public function testShouldReturnStorages() public function testShouldReturnGateways() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $gateways = $payum->getGateways(); $this->assertInternalType('array', $gateways); @@ -71,7 +71,7 @@ public function testShouldReturnGateways() public function testShouldReturnGatewaysFactories() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $factories = $payum->getGatewayFactories(); $this->assertInternalType('array', $factories); @@ -81,7 +81,7 @@ public function testShouldReturnGatewaysFactories() public function testShouldReturnGatewayFactory() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $this->assertInstanceOf(PaypalExpressCheckoutGatewayFactory::class, $payum->getGatewayFactory('paypal_express_checkout')); $this->assertInstanceOf(StripeJsGatewayFactory::class, $payum->getGatewayFactory('stripe_js')); @@ -90,7 +90,7 @@ public function testShouldReturnGatewayFactory() public function testShouldReturnGateway() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $this->assertInstanceOf(GatewayInterface::class, $payum->getGateway('fooGateway')); $this->assertInstanceOf(GatewayInterface::class, $payum->getGateway('barGateway')); @@ -99,8 +99,8 @@ public function testShouldReturnGateway() public function testShouldReturnStorage() { /** @var Payum $payum */ - $payum = $this->container->get('payum'); + $payum = static::$container->get('payum'); $this->assertInstanceOf(StorageInterface::class, $payum->getStorage(ArrayObject::class)); } -} \ No newline at end of file +} diff --git a/Tests/Functional/WebTestCase.php b/Tests/Functional/WebTestCase.php index d77e0e4f..2adcb4d2 100644 --- a/Tests/Functional/WebTestCase.php +++ b/Tests/Functional/WebTestCase.php @@ -15,14 +15,14 @@ abstract class WebTestCase extends BaseWebTestCase /** * @var ContainerInterface */ - protected $container; + protected static $container; protected function setUp() { parent::setUp(); $this->client = static::createClient(); - $this->container = static::$kernel->getContainer(); + static::$container = static::$kernel->getContainer(); } /** @@ -34,4 +34,4 @@ public static function getKernelClass() return 'AppKernel'; } -} \ No newline at end of file +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d7527149..261a8049 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,5 +8,6 @@ + - \ No newline at end of file +