Skip to content

Commit

Permalink
Merge pull request #9372 from pamil/1.2-symfony4-packages
Browse files Browse the repository at this point in the history
Make subpackages compatible with Symfony 4
  • Loading branch information
pamil committed Apr 30, 2018
2 parents f7d42d2 + 2b7c92d commit 9383734
Show file tree
Hide file tree
Showing 94 changed files with 289 additions and 898 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Expand Up @@ -83,9 +83,6 @@ matrix:
- env:
- SYLIUS_SUITE="application"
- SYMFONY_VERSION="4.0.*"
- env:
- SYLIUS_SUITE="packages"
- SYMFONY_VERSION="4.0.*"
fast_finish: true

cache:
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php">
<testsuites>
Expand Down
6 changes: 3 additions & 3 deletions src/Sylius/Bundle/AddressingBundle/composer.json
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions src/Sylius/Bundle/AddressingBundle/phpunit.xml.dist
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
bootstrap="test/app/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="test/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>

<testsuites>
<testsuite name="SyliusAddressingBundle Test Suite">
<directory>./test/</directory>
Expand Down
30 changes: 0 additions & 30 deletions src/Sylius/Bundle/AddressingBundle/test/app/autoload.php

This file was deleted.

Expand Up @@ -13,10 +13,12 @@

namespace Sylius\Bundle\AddressingBundle\Tests;

use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;

class SyliusAddressingBundleTest extends WebTestCase
final class SyliusAddressingBundleTest extends WebTestCase
{
/**
* @test
Expand All @@ -33,7 +35,7 @@ public function its_services_are_initializable(): void
});

foreach ($services as $id) {
$container->get($id);
Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
}
}
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/AdminBundle/composer.json
Expand Up @@ -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": {
Expand Down
7 changes: 2 additions & 5 deletions src/Sylius/Bundle/AdminBundle/phpunit.xml.dist
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="SyliusAdminBundle Test Suite">
<directory>./Tests</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 3 additions & 3 deletions src/Sylius/Bundle/AttributeBundle/composer.json
Expand Up @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions src/Sylius/Bundle/AttributeBundle/phpunit.xml.dist
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
bootstrap="test/app/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="test/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>

<testsuites>
<testsuite name="SyliusAttributeBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>
30 changes: 0 additions & 30 deletions src/Sylius/Bundle/AttributeBundle/test/app/autoload.php

This file was deleted.

Expand Up @@ -13,7 +13,9 @@

namespace Sylius\Bundle\AttributeBundle\Tests;

use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;

final class SyliusAttributeBundleTest extends WebTestCase
Expand All @@ -23,17 +25,17 @@ final class SyliusAttributeBundleTest 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));
}
}
}
6 changes: 3 additions & 3 deletions src/Sylius/Bundle/ChannelBundle/composer.json
Expand Up @@ -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,
Expand Down
23 changes: 4 additions & 19 deletions src/Sylius/Bundle/ChannelBundle/phpunit.xml.dist
@@ -1,32 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
>
<php>
<server name="KERNEL_DIR" value="test/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>

<testsuites>
<testsuite name="Sylius Test Suite">
<directory>Tests</directory>
</testsuite>

<testsuite name="SyliusAttributeBundle Test Suite">
<testsuite name="SyliusChannelBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<exclude>
<directory>Resources</directory>
<directory>Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
30 changes: 0 additions & 30 deletions src/Sylius/Bundle/ChannelBundle/test/app/autoload.php

This file was deleted.

Expand Up @@ -13,27 +13,29 @@

namespace Sylius\Bundle\ChannelBundle\Tests;

use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;

class SyliusChannelBundleTest extends WebTestCase
final class SyliusChannelBundleTest extends WebTestCase
{
/**
* @test
*/
public function its_services_are_initializable()
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));
}
}
}
Expand Up @@ -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;
Expand All @@ -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);
}
}
10 changes: 1 addition & 9 deletions src/Sylius/Bundle/CoreBundle/phpunit.xml.dist
Expand Up @@ -2,20 +2,12 @@

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Sylius Test Suite">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./Tests</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 9383734

Please sign in to comment.