diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7991ae8923e..a0b32618ab7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,7 +2,6 @@ diff --git a/src/Sylius/Bundle/AddressingBundle/composer.json b/src/Sylius/Bundle/AddressingBundle/composer.json index 3de5414695c..8a6252ae3c5 100644 --- a/src/Sylius/Bundle/AddressingBundle/composer.json +++ b/src/Sylius/Bundle/AddressingBundle/composer.json @@ -48,9 +48,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\AddressingBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\AddressingBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/AddressingBundle/phpunit.xml.dist b/src/Sylius/Bundle/AddressingBundle/phpunit.xml.dist index 0c17969de42..6f8a895e79d 100644 --- a/src/Sylius/Bundle/AddressingBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/AddressingBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/AddressingBundle/test/app/autoload.php b/src/Sylius/Bundle/AddressingBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/AddressingBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/AdminBundle/composer.json b/src/Sylius/Bundle/AdminBundle/composer.json index 0ba8b13fab3..1b8fad21b8c 100644 --- a/src/Sylius/Bundle/AdminBundle/composer.json +++ b/src/Sylius/Bundle/AdminBundle/composer.json @@ -28,8 +28,8 @@ "symfony/framework-bundle": "^3.4|^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.5", "phpspec/phpspec": "^4.0", + "phpunit/phpunit": "^6.5", "symfony/dependency-injection": "^3.4|^4.0" }, "conflict": { diff --git a/src/Sylius/Bundle/AdminBundle/phpunit.xml.dist b/src/Sylius/Bundle/AdminBundle/phpunit.xml.dist index 4a103a2f8fb..8e948485a42 100644 --- a/src/Sylius/Bundle/AdminBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/AdminBundle/phpunit.xml.dist @@ -1,15 +1,12 @@ - - ./Tests + ./Tests/ diff --git a/src/Sylius/Bundle/AttributeBundle/composer.json b/src/Sylius/Bundle/AttributeBundle/composer.json index 809bc068bd9..f5e6886a8c2 100644 --- a/src/Sylius/Bundle/AttributeBundle/composer.json +++ b/src/Sylius/Bundle/AttributeBundle/composer.json @@ -46,9 +46,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\AttributeBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\AttributeBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/AttributeBundle/phpunit.xml.dist b/src/Sylius/Bundle/AttributeBundle/phpunit.xml.dist index 3d5316df076..515f1ccf8f7 100644 --- a/src/Sylius/Bundle/AttributeBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/AttributeBundle/phpunit.xml.dist @@ -2,17 +2,16 @@ - - + + ./test/ + ./Tests/ diff --git a/src/Sylius/Bundle/AttributeBundle/test/app/autoload.php b/src/Sylius/Bundle/AttributeBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/AttributeBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ChannelBundle/composer.json b/src/Sylius/Bundle/ChannelBundle/composer.json index 44f2ceef3bf..1c42ca404a6 100644 --- a/src/Sylius/Bundle/ChannelBundle/composer.json +++ b/src/Sylius/Bundle/ChannelBundle/composer.json @@ -45,9 +45,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\ChannelBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\ChannelBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ChannelBundle/phpunit.xml.dist b/src/Sylius/Bundle/ChannelBundle/phpunit.xml.dist index c1a3d694408..596a077a0e7 100644 --- a/src/Sylius/Bundle/ChannelBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ChannelBundle/phpunit.xml.dist @@ -1,32 +1,17 @@ - - - + - - Tests - - - + ./test/ + ./Tests/ - - - - - Resources - Tests - - - diff --git a/src/Sylius/Bundle/ChannelBundle/test/app/autoload.php b/src/Sylius/Bundle/ChannelBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/ChannelBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/CoreBundle/Tests/Application/SyliusPluginTraitTest.php b/src/Sylius/Bundle/CoreBundle/Tests/Application/SyliusPluginTraitTest.php index 4c26bf6dee1..3157a6b9a58 100644 --- a/src/Sylius/Bundle/CoreBundle/Tests/Application/SyliusPluginTraitTest.php +++ b/src/Sylius/Bundle/CoreBundle/Tests/Application/SyliusPluginTraitTest.php @@ -13,6 +13,7 @@ namespace Sylius\Bundle\CoreBundle\Tests\Application; +use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -24,8 +25,10 @@ final class SyliusPluginTraitTest extends TestCase */ public function it_does_not_crash(): void { - new class() extends Bundle { + $class = new class() extends Bundle { use SyliusPluginTrait; }; + + Assert::assertNotNull($class); } } diff --git a/src/Sylius/Bundle/CoreBundle/phpunit.xml.dist b/src/Sylius/Bundle/CoreBundle/phpunit.xml.dist index cb8d986d0d2..1167b623b89 100644 --- a/src/Sylius/Bundle/CoreBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/CoreBundle/phpunit.xml.dist @@ -3,19 +3,11 @@ ./Tests - - - - ./Tests - - diff --git a/src/Sylius/Bundle/CurrencyBundle/composer.json b/src/Sylius/Bundle/CurrencyBundle/composer.json index 75d45c2202a..6fef680a263 100644 --- a/src/Sylius/Bundle/CurrencyBundle/composer.json +++ b/src/Sylius/Bundle/CurrencyBundle/composer.json @@ -48,9 +48,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\CurrencyBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\CurrencyBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist b/src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist index e31a21bbcac..ee9a3ec3541 100644 --- a/src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/CurrencyBundle/test/app/autoload.php b/src/Sylius/Bundle/CurrencyBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/CurrencyBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/CustomerBundle/composer.json b/src/Sylius/Bundle/CustomerBundle/composer.json index 689a93611bb..87bbf623479 100644 --- a/src/Sylius/Bundle/CustomerBundle/composer.json +++ b/src/Sylius/Bundle/CustomerBundle/composer.json @@ -56,9 +56,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\CustomerBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\CustomerBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/CustomerBundle/phpunit.xml.dist b/src/Sylius/Bundle/CustomerBundle/phpunit.xml.dist index 0beec81acd2..b88be054af5 100644 --- a/src/Sylius/Bundle/CustomerBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/CustomerBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/CustomerBundle/test/app/autoload.php b/src/Sylius/Bundle/CustomerBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/CustomerBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/FixturesBundle/composer.json b/src/Sylius/Bundle/FixturesBundle/composer.json index 2755e5d1e9c..d9b26c436db 100644 --- a/src/Sylius/Bundle/FixturesBundle/composer.json +++ b/src/Sylius/Bundle/FixturesBundle/composer.json @@ -53,9 +53,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\FixturesBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\FixturesBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/FixturesBundle/humbug.json.dist b/src/Sylius/Bundle/FixturesBundle/humbug.json.dist deleted file mode 100644 index 353452a0637..00000000000 --- a/src/Sylius/Bundle/FixturesBundle/humbug.json.dist +++ /dev/null @@ -1,17 +0,0 @@ -{ - "source": { - "directories": [ - "." - ], - "excludes": [ - "bin", - "spec", - "Tests", - "vendor" - ] - }, - "timeout": 2, - "logs": { - "text": "humbuglog.txt" - } -} diff --git a/src/Sylius/Bundle/FixturesBundle/phpunit.xml.dist b/src/Sylius/Bundle/FixturesBundle/phpunit.xml.dist index 5ad84c71a85..809783fc9a5 100644 --- a/src/Sylius/Bundle/FixturesBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/FixturesBundle/phpunit.xml.dist @@ -1,30 +1,17 @@ - - - + - - ./Tests - - ./test/ + ./Tests/ - - - - ./Tests - - diff --git a/src/Sylius/Bundle/FixturesBundle/test/app/autoload.php b/src/Sylius/Bundle/FixturesBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/FixturesBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/GridBundle/composer.json b/src/Sylius/Bundle/GridBundle/composer.json index ea130420154..3809507fbfe 100644 --- a/src/Sylius/Bundle/GridBundle/composer.json +++ b/src/Sylius/Bundle/GridBundle/composer.json @@ -59,9 +59,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\GridBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\GridBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/GridBundle/phpunit.xml.dist b/src/Sylius/Bundle/GridBundle/phpunit.xml.dist index e4e8acba8ab..66c7f0b297c 100644 --- a/src/Sylius/Bundle/GridBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/GridBundle/phpunit.xml.dist @@ -1,29 +1,17 @@ - - - + + - + ./test/ - - - - ./Tests + ./Tests/ - - - - ./Tests - - diff --git a/src/Sylius/Bundle/GridBundle/test/app/autoload.php b/src/Sylius/Bundle/GridBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/GridBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/InventoryBundle/composer.json b/src/Sylius/Bundle/InventoryBundle/composer.json index 94a80964e03..fcc347200cd 100644 --- a/src/Sylius/Bundle/InventoryBundle/composer.json +++ b/src/Sylius/Bundle/InventoryBundle/composer.json @@ -48,9 +48,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\InventoryBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\InventoryBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/InventoryBundle/phpunit.xml.dist b/src/Sylius/Bundle/InventoryBundle/phpunit.xml.dist index 53e3bda378a..1d03cd8dbd1 100644 --- a/src/Sylius/Bundle/InventoryBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/InventoryBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/InventoryBundle/test/app/autoload.php b/src/Sylius/Bundle/InventoryBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/InventoryBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/LocaleBundle/composer.json b/src/Sylius/Bundle/LocaleBundle/composer.json index ba7b22b19c5..a065494aa6c 100644 --- a/src/Sylius/Bundle/LocaleBundle/composer.json +++ b/src/Sylius/Bundle/LocaleBundle/composer.json @@ -48,9 +48,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\LocaleBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\LocaleBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/LocaleBundle/phpunit.xml.dist b/src/Sylius/Bundle/LocaleBundle/phpunit.xml.dist index d49e2f58a9c..05423274e62 100644 --- a/src/Sylius/Bundle/LocaleBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/LocaleBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/LocaleBundle/test/app/autoload.php b/src/Sylius/Bundle/LocaleBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/LocaleBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/MailerBundle/composer.json b/src/Sylius/Bundle/MailerBundle/composer.json index 0cee42d7e8a..711ab75a8dc 100644 --- a/src/Sylius/Bundle/MailerBundle/composer.json +++ b/src/Sylius/Bundle/MailerBundle/composer.json @@ -43,9 +43,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\MailerBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\MailerBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/MailerBundle/phpunit.xml.dist b/src/Sylius/Bundle/MailerBundle/phpunit.xml.dist index bd8af90d516..e41de44205f 100644 --- a/src/Sylius/Bundle/MailerBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/MailerBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/MailerBundle/test/src/Tests/SyliusMailerBundleTest.php b/src/Sylius/Bundle/MailerBundle/test/src/Tests/SyliusMailerBundleTest.php index 0dac63ceb8b..94f629513bc 100644 --- a/src/Sylius/Bundle/MailerBundle/test/src/Tests/SyliusMailerBundleTest.php +++ b/src/Sylius/Bundle/MailerBundle/test/src/Tests/SyliusMailerBundleTest.php @@ -13,7 +13,9 @@ namespace Sylius\Bundle\MailerBundle\Tests; +use PHPUnit\Framework\Assert; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; final class SyliusMailerBundleTest extends WebTestCase @@ -23,17 +25,17 @@ final class SyliusMailerBundleTest extends WebTestCase */ public function its_services_are_initializable(): void { - /** @var ContainerInterface $container */ + /** @var ContainerBuilder $container */ $container = self::createClient()->getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/MoneyBundle/composer.json b/src/Sylius/Bundle/MoneyBundle/composer.json index 97c104bf26f..0a245f83611 100644 --- a/src/Sylius/Bundle/MoneyBundle/composer.json +++ b/src/Sylius/Bundle/MoneyBundle/composer.json @@ -50,9 +50,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\MoneyBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\MoneyBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/MoneyBundle/phpunit.xml.dist b/src/Sylius/Bundle/MoneyBundle/phpunit.xml.dist index 37664ba4154..3db715fe7b8 100644 --- a/src/Sylius/Bundle/MoneyBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/MoneyBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/MoneyBundle/test/app/autoload.php b/src/Sylius/Bundle/MoneyBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/MoneyBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { - return false !== strpos($serviceId, 'sylius'); + $services = array_filter($services, function (string $serviceId): bool { + return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/OrderBundle/Tests/DependencyInjection/Compiler/RegisterOrderProcessorPassTest.php b/src/Sylius/Bundle/OrderBundle/Tests/DependencyInjection/Compiler/RegisterOrderProcessorPassTest.php index 3ecdcbe477d..1247aa80495 100644 --- a/src/Sylius/Bundle/OrderBundle/Tests/DependencyInjection/Compiler/RegisterOrderProcessorPassTest.php +++ b/src/Sylius/Bundle/OrderBundle/Tests/DependencyInjection/Compiler/RegisterOrderProcessorPassTest.php @@ -31,7 +31,7 @@ final class RegisterOrderProcessorPassTest extends AbstractCompilerPassTestCase public function it_adds_method_call_to_composite_order_processor_if_exist(): void { $compositeOrderProcessorDefinition = new Definition(CompositeOrderProcessor::class); - $this->setDefinition('sylius.order_processing.order_processor', $compositeOrderProcessorDefinition); + $this->setDefinition('sylius.order_processing.order_processor.composite', $compositeOrderProcessorDefinition); $orderAdjustmentClearerDefinition = new Definition(OrderAdjustmentsClearer::class); $orderAdjustmentClearerDefinition->addTag('sylius.order_processor'); @@ -55,7 +55,7 @@ public function it_adds_method_call_to_composite_order_processor_if_exist(): voi public function it_adds_method_call_to_composite_order_processor_with_custom_priority(): void { $compositeOrderProcessorDefinition = new Definition(CompositeOrderProcessor::class); - $this->setDefinition('sylius.order_processing.order_processor', $compositeOrderProcessorDefinition); + $this->setDefinition('sylius.order_processing.order_processor.composite', $compositeOrderProcessorDefinition); $orderAdjustmentClearerDefinition = new Definition(OrderAdjustmentsClearer::class); $orderAdjustmentClearerDefinition->addTag('sylius.order_processor', ['priority' => 10]); diff --git a/src/Sylius/Bundle/OrderBundle/composer.json b/src/Sylius/Bundle/OrderBundle/composer.json index 7764e6e8d51..2341673b332 100644 --- a/src/Sylius/Bundle/OrderBundle/composer.json +++ b/src/Sylius/Bundle/OrderBundle/composer.json @@ -31,13 +31,14 @@ }, "require-dev": { "doctrine/orm": "^2.5", + "matthiasnoback/symfony-dependency-injection-test": "^2.0", "phpspec/phpspec": "^4.0", "phpunit/phpunit": "^6.5", + "polishsymfonycommunity/symfony-mocker-container": "^1.0", "symfony/browser-kit": "^3.4|^4.0", "symfony/dependency-injection": "^3.4|^4.0", "symfony/form": "^3.4|^4.0", - "symfony/validator": "^3.4|^4.0", - "polishsymfonycommunity/symfony-mocker-container": "^1.0" + "symfony/validator": "^3.4|^4.0" }, "conflict": { "twig/twig": "^1.0" @@ -50,9 +51,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\OrderBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\OrderBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/OrderBundle/phpunit.xml.dist b/src/Sylius/Bundle/OrderBundle/phpunit.xml.dist index 73cc516eea4..e85f9862b56 100644 --- a/src/Sylius/Bundle/OrderBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/OrderBundle/phpunit.xml.dist @@ -2,17 +2,16 @@ - - + + ./test/ + ./Tests/ diff --git a/src/Sylius/Bundle/OrderBundle/test/app/autoload.php b/src/Sylius/Bundle/OrderBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/OrderBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/PaymentBundle/composer.json b/src/Sylius/Bundle/PaymentBundle/composer.json index 9de13036a90..29958b9c261 100644 --- a/src/Sylius/Bundle/PaymentBundle/composer.json +++ b/src/Sylius/Bundle/PaymentBundle/composer.json @@ -43,9 +43,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\PaymentBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\PaymentBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/PaymentBundle/phpunit.xml.dist b/src/Sylius/Bundle/PaymentBundle/phpunit.xml.dist index db2cee1ff77..06bdb3e9dcb 100644 --- a/src/Sylius/Bundle/PaymentBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/PaymentBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/PaymentBundle/test/app/autoload.php b/src/Sylius/Bundle/PaymentBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/PaymentBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ProductBundle/composer.json b/src/Sylius/Bundle/ProductBundle/composer.json index b12d3e78de5..4edab47de5f 100644 --- a/src/Sylius/Bundle/ProductBundle/composer.json +++ b/src/Sylius/Bundle/ProductBundle/composer.json @@ -47,9 +47,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\ProductBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\ProductBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ProductBundle/phpunit.xml.dist b/src/Sylius/Bundle/ProductBundle/phpunit.xml.dist index 62e1812181f..72bc08b324b 100644 --- a/src/Sylius/Bundle/ProductBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ProductBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/ProductBundle/test/app/autoload.php b/src/Sylius/Bundle/ProductBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/ProductBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/PromotionBundle/composer.json b/src/Sylius/Bundle/PromotionBundle/composer.json index b2893d7c772..5e15479bc2d 100644 --- a/src/Sylius/Bundle/PromotionBundle/composer.json +++ b/src/Sylius/Bundle/PromotionBundle/composer.json @@ -50,7 +50,8 @@ "psr-4": { "Sylius\\Bundle\\PromotionBundle\\spec\\": "spec/", "AppBundle\\": "test/src/AppBundle/" - } + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/PromotionBundle/phpunit.xml.dist b/src/Sylius/Bundle/PromotionBundle/phpunit.xml.dist index 3865b763a4f..6d88d6faeff 100644 --- a/src/Sylius/Bundle/PromotionBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/PromotionBundle/phpunit.xml.dist @@ -1,28 +1,17 @@ - - - + + - - ./Tests - ./test/ + ./Tests/ - - - - ./Tests - - diff --git a/src/Sylius/Bundle/PromotionBundle/test/app/autoload.php b/src/Sylius/Bundle/PromotionBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/PromotionBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ResourceBundle/DependencyInjection/Compiler/PrioritizedCompositeServicePass.php b/src/Sylius/Bundle/ResourceBundle/DependencyInjection/Compiler/PrioritizedCompositeServicePass.php index 8ac2dafe4fd..b03392b7d99 100644 --- a/src/Sylius/Bundle/ResourceBundle/DependencyInjection/Compiler/PrioritizedCompositeServicePass.php +++ b/src/Sylius/Bundle/ResourceBundle/DependencyInjection/Compiler/PrioritizedCompositeServicePass.php @@ -59,7 +59,7 @@ public function __construct(string $serviceId, string $compositeId, string $tagN */ public function process(ContainerBuilder $container): void { - if (!$container->hasDefinition($this->compositeId)) { + if (!$container->has($this->compositeId)) { return; } @@ -111,12 +111,6 @@ private function addMethodCalls(Definition $contextDefinition, string $id, array */ private function addMethodCall(Definition $contextDefinition, string $id, array $attributes): void { - $arguments = [new Reference($id)]; - - if (isset($attributes['priority'])) { - $arguments[] = $attributes['priority']; - } - - $contextDefinition->addMethodCall($this->methodName, $arguments); + $contextDefinition->addMethodCall($this->methodName, [new Reference($id), $attributes['priority'] ?? 0]); } } diff --git a/src/Sylius/Bundle/ResourceBundle/composer.json b/src/Sylius/Bundle/ResourceBundle/composer.json index 30975138840..6126538ec68 100644 --- a/src/Sylius/Bundle/ResourceBundle/composer.json +++ b/src/Sylius/Bundle/ResourceBundle/composer.json @@ -70,7 +70,8 @@ "psr-4": { "Sylius\\Bundle\\ResourceBundle\\spec\\": "spec/", "AppBundle\\": "test/src/AppBundle/" - } + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ResourceBundle/phpunit.xml.dist b/src/Sylius/Bundle/ResourceBundle/phpunit.xml.dist index 533f8c4c59c..2e672ad695c 100644 --- a/src/Sylius/Bundle/ResourceBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ResourceBundle/phpunit.xml.dist @@ -2,14 +2,13 @@ - + + ./test/ diff --git a/src/Sylius/Bundle/ResourceBundle/test/app/autoload.php b/src/Sylius/Bundle/ResourceBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/ResourceBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ReviewBundle/composer.json b/src/Sylius/Bundle/ReviewBundle/composer.json index a0c90e339f1..095b31b2f55 100644 --- a/src/Sylius/Bundle/ReviewBundle/composer.json +++ b/src/Sylius/Bundle/ReviewBundle/composer.json @@ -60,9 +60,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\ReviewBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\ReviewBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ReviewBundle/phpunit.xml.dist b/src/Sylius/Bundle/ReviewBundle/phpunit.xml.dist index 04fcea1a846..142315c3e76 100644 --- a/src/Sylius/Bundle/ReviewBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ReviewBundle/phpunit.xml.dist @@ -1,19 +1,17 @@ - - - + + ./test/ + ./Tests/ diff --git a/src/Sylius/Bundle/ReviewBundle/test/app/autoload.php b/src/Sylius/Bundle/ReviewBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/ReviewBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ShippingBundle/composer.json b/src/Sylius/Bundle/ShippingBundle/composer.json index fe03cc841af..b3d1715b0cb 100644 --- a/src/Sylius/Bundle/ShippingBundle/composer.json +++ b/src/Sylius/Bundle/ShippingBundle/composer.json @@ -45,10 +45,7 @@ "psr-4": { "Sylius\\Bundle\\ShippingBundle\\": "" } }, "autoload-dev": { - "psr-4": { - "Sylius\\Bundle\\ShippingBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ShippingBundle/phpunit.xml.dist b/src/Sylius/Bundle/ShippingBundle/phpunit.xml.dist index efa9305f53c..bb1d52bef8b 100644 --- a/src/Sylius/Bundle/ShippingBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ShippingBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./test/ diff --git a/src/Sylius/Bundle/ShippingBundle/test/app/autoload.php b/src/Sylius/Bundle/ShippingBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/ShippingBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ShopBundle/composer.json b/src/Sylius/Bundle/ShopBundle/composer.json index 46dc75815ee..92bf42754c6 100644 --- a/src/Sylius/Bundle/ShopBundle/composer.json +++ b/src/Sylius/Bundle/ShopBundle/composer.json @@ -2,26 +2,32 @@ "name": "sylius/shop-bundle", "type": "symfony-bundle", "description": "Sylius eCommerce storefront.", - "keywords": ["shop", "ecommerce", "store", "webshop", "sylius"], + "keywords": [ + "shop", + "ecommerce", + "store", + "webshop", + "sylius" + ], "homepage": "http://sylius.com", "license": "MIT", "authors": [ { - "name": "Paweł Jędrzejewski", + "name": "Paweł Jędrzejewski", "homepage": "http://pjedrzejewski.com" }, { - "name": "Sylius project", + "name": "Sylius project", "homepage": "http://sylius.com" }, { - "name": "Community contributions", + "name": "Community contributions", "homepage": "http://github.com/Sylius/Sylius/contributors" } ], "require": { "php": "^7.1", - + "sonata-project/intl-bundle": "^2.2", "sylius/core-bundle": "^1.0", "sylius/ui-bundle": "^1.0", @@ -30,15 +36,17 @@ "require-dev": { "matthiasnoback/symfony-config-test": "^3.0", "matthiasnoback/symfony-dependency-injection-test": "^2.0", - "phpunit/phpunit": "^6.5", "phpspec/phpspec": "^4.0", + "phpunit/phpunit": "^6.5", "symfony/dependency-injection": "^3.4|^4.0" }, "config": { "bin-dir": "bin" }, "autoload": { - "psr-4": { "Sylius\\Bundle\\ShopBundle\\": "" } + "psr-4": { + "Sylius\\Bundle\\ShopBundle\\": "" + } }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/ShopBundle/phpunit.xml.dist b/src/Sylius/Bundle/ShopBundle/phpunit.xml.dist index a16b756eab7..f8b2c84fc84 100644 --- a/src/Sylius/Bundle/ShopBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ShopBundle/phpunit.xml.dist @@ -1,15 +1,16 @@ - + + + + - ./Tests + ./Tests/ diff --git a/src/Sylius/Bundle/TaxationBundle/composer.json b/src/Sylius/Bundle/TaxationBundle/composer.json index d1c18fb5588..dfff1974b83 100644 --- a/src/Sylius/Bundle/TaxationBundle/composer.json +++ b/src/Sylius/Bundle/TaxationBundle/composer.json @@ -45,9 +45,9 @@ }, "autoload-dev": { "psr-4": { - "Sylius\\Bundle\\TaxationBundle\\spec\\": "spec/", - "AppBundle\\": "test/src/AppBundle/" - } + "Sylius\\Bundle\\TaxationBundle\\spec\\": "spec/" + }, + "classmap": ["test/app/AppKernel.php"] }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/src/Sylius/Bundle/TaxationBundle/phpunit.xml.dist b/src/Sylius/Bundle/TaxationBundle/phpunit.xml.dist index d6e7d454342..57d79f02857 100644 --- a/src/Sylius/Bundle/TaxationBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/TaxationBundle/phpunit.xml.dist @@ -2,17 +2,16 @@ - - + + ./test/ + ./Tests/ diff --git a/src/Sylius/Bundle/TaxationBundle/test/app/autoload.php b/src/Sylius/Bundle/TaxationBundle/test/app/autoload.php deleted file mode 100644 index 3aa013d4ae1..00000000000 --- a/src/Sylius/Bundle/TaxationBundle/test/app/autoload.php +++ /dev/null @@ -1,30 +0,0 @@ -getContainer(); $services = $container->getServiceIds(); - $services = array_filter($services, function ($serviceId) { + $services = array_filter($services, function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); foreach ($services as $id) { - $container->get($id); + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php index 83bc4516c28..d1e5f1baa2c 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php +++ b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Assert; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; final class SyliusTaxonomyBundleTest extends KernelTestCase { @@ -29,12 +30,12 @@ public function its_services_are_initializable() /** @var Container $container */ $container = self::$kernel->getContainer(); - $serviceIds = array_filter($container->getServiceIds(), function ($serviceId) { + $serviceIds = array_filter($container->getServiceIds(), function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); - foreach ($serviceIds as $serviceId) { - Assert::assertNotNull($container->get($serviceId)); + foreach ($serviceIds as $id) { + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/TaxonomyBundle/phpunit.xml.dist b/src/Sylius/Bundle/TaxonomyBundle/phpunit.xml.dist index 842ea7b5f9f..648009ad7f1 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/TaxonomyBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./Tests/ diff --git a/src/Sylius/Bundle/ThemeBundle/Tests/Functional/SyliusThemeBundleTest.php b/src/Sylius/Bundle/ThemeBundle/Tests/Functional/SyliusThemeBundleTest.php index 4ce8988c5c2..383946eef96 100644 --- a/src/Sylius/Bundle/ThemeBundle/Tests/Functional/SyliusThemeBundleTest.php +++ b/src/Sylius/Bundle/ThemeBundle/Tests/Functional/SyliusThemeBundleTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Assert; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; final class SyliusThemeBundleTest extends KernelTestCase { @@ -29,12 +30,12 @@ public function its_services_are_initializable(): void /** @var Container $container */ $container = self::$kernel->getContainer(); - $serviceIds = array_filter($container->getServiceIds(), function ($serviceId) { + $serviceIds = array_filter($container->getServiceIds(), function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); - foreach ($serviceIds as $serviceId) { - Assert::assertNotNull($container->get($serviceId)); + foreach ($serviceIds as $id) { + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/ThemeBundle/phpunit.xml.dist b/src/Sylius/Bundle/ThemeBundle/phpunit.xml.dist index d167538f332..be8c4f257ad 100644 --- a/src/Sylius/Bundle/ThemeBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/ThemeBundle/phpunit.xml.dist @@ -1,16 +1,13 @@ - - - + + ./Tests/ diff --git a/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php b/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php index f2de2de0f42..b0f67075665 100644 --- a/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php +++ b/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Assert; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; final class SyliusUserBundleTest extends KernelTestCase { @@ -29,12 +30,12 @@ public function its_services_are_initializable() /** @var Container $container */ $container = self::$kernel->getContainer(); - $serviceIds = array_filter($container->getServiceIds(), function ($serviceId) { + $serviceIds = array_filter($container->getServiceIds(), function (string $serviceId): bool { return 0 === strpos($serviceId, 'sylius.'); }); - foreach ($serviceIds as $serviceId) { - Assert::assertNotNull($container->get($serviceId)); + foreach ($serviceIds as $id) { + Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); } } } diff --git a/src/Sylius/Bundle/UserBundle/phpunit.xml.dist b/src/Sylius/Bundle/UserBundle/phpunit.xml.dist index a501e1e8fa0..ea4f8b74a65 100644 --- a/src/Sylius/Bundle/UserBundle/phpunit.xml.dist +++ b/src/Sylius/Bundle/UserBundle/phpunit.xml.dist @@ -2,14 +2,12 @@ - - + + ./Tests/ diff --git a/src/Sylius/Component/Core/composer.json b/src/Sylius/Component/Core/composer.json index 10c2a043d08..cd055bbaf0f 100644 --- a/src/Sylius/Component/Core/composer.json +++ b/src/Sylius/Component/Core/composer.json @@ -22,7 +22,7 @@ "require": { "php": "^7.1", - "knplabs/gaufrette": "^0.2", + "knplabs/gaufrette": "^0.5", "payum/payum": "^1.3", "php-http/guzzle6-adapter": "^1.1", "sylius/addressing": "^1.0",