Make PHPUnit package tests great again

This commit is contained in:
Kamil Kokot 2018-04-30 11:50:54 +02:00
parent fadf23ed11
commit 2b7c92d22b
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
93 changed files with 264 additions and 870 deletions

View file

@ -2,7 +2,6 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php">
<testsuites>

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,10 +13,12 @@ declare(strict_types=1);
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
@ -33,7 +35,7 @@ class SyliusAddressingBundleTest extends WebTestCase
});
foreach ($services as $id) {
$container->get($id);
Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
}
}

View file

@ -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": {

View file

@ -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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="SyliusAdminBundle Test Suite">
<directory>./Tests</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -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,

View file

@ -2,17 +2,16 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
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
@ -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));
}
}
}

View file

@ -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,

View file

@ -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/6.5/phpunit.xsd"
backupGlobals="false"
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>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
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));
}
}
}

View file

@ -13,6 +13,7 @@ declare(strict_types=1);
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);
}
}

View file

@ -3,19 +3,11 @@
<!-- 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/6.5/phpunit.xsd"
backupGlobals="false"
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>

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusCurrencyBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\CurrencyBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusCurrencyBundleTest extends WebTestCase
final class SyliusCurrencyBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusCustomerBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\CustomerBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusCustomerBundleTest extends WebTestCase
final class SyliusCustomerBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -1,17 +0,0 @@
{
"source": {
"directories": [
"."
],
"excludes": [
"bin",
"spec",
"Tests",
"vendor"
]
},
"timeout": 2,
"logs": {
"text": "humbuglog.txt"
}
}

View file

@ -1,30 +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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/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="Sylius Test Suite">
<directory>./Tests</directory>
</testsuite>
<testsuite name="SyliusFixturesBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./Tests</directory>
</whitelist>
</filter>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\FixturesBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusFixturesBundleTest extends WebTestCase
final class SyliusFixturesBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -1,29 +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/6.5/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
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="SyliusAddressingBundle Test Suite">
<directory>./test/</directory>
</testsuite>
<testsuite name="Sylius Test Suite">
<directory>./Tests</directory>
<testsuites>
<testsuite name="SyliusGridBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./Tests</directory>
</whitelist>
</filter>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\GridBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusGridBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusGridBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusInventoryBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -11,9 +11,11 @@
declare(strict_types=1);
namespace Sylius\Bundle\AddressingBundle\Tests;
namespace Sylius\Bundle\InventoryBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusInventoryBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusInventoryBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusLocaleBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\LocaleBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusLocaleBundleTest extends WebTestCase
final class SyliusLocaleBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/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="SyliusMailerBundle Test Suite">
<directory>./test/</directory>

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusMoneyBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\MoneyBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusMoneyBundleTest extends WebTestCase
final class SyliusMoneyBundleTest extends WebTestCase
{
/**
* @test
*/
public function its_services_are_intitializable()
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) {
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));
}
}
}

View file

@ -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 @@ final class RegisterOrderProcessorPassTest extends AbstractCompilerPassTestCase
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]);

View file

@ -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,

View file

@ -2,17 +2,16 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusOrderBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\OrderBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusOrderBundleTest extends WebTestCase
final class SyliusOrderBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusPaymentBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\PaymentBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusPaymentBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusPaymentBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusProductBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\ProductBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusProductBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusProductBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -1,28 +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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/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="Sylius Test Suite">
<directory>./Tests</directory>
</testsuite>
<testsuite name="SyliusPromotionBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./Tests</directory>
</whitelist>
</filter>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\PromotionBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusPromotionBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusPromotionBundleTest 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));
}
}
}

View file

@ -59,7 +59,7 @@ abstract class PrioritizedCompositeServicePass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition($this->compositeId)) {
if (!$container->has($this->compositeId)) {
return;
}
@ -111,12 +111,6 @@ abstract class PrioritizedCompositeServicePass implements CompilerPassInterface
*/
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]);
}
}

View file

@ -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,

View file

@ -2,14 +2,13 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="test/app/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="test/app/" />
<server name="KERNEL_CLASS" value="AppKernel" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
</php>
<testsuites>
<testsuite name="SyliusResourceBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,27 +13,29 @@ declare(strict_types=1);
namespace Sylius\Bundle\ResourceBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SyliusResourceBundleTest extends WebTestCase
final class SyliusResourceBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -1,19 +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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/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="SyliusReviewBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\ReviewBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusReviewBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusReviewBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusShippingBundle Test Suite">
<directory>./test/</directory>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\ShippingBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusShippingBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusShippingBundleTest 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));
}
}
}

View file

@ -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,

View file

@ -1,15 +1,16 @@
<?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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_CLASS" value="AppKernel" />
</php>
<testsuites>
<testsuite name="SyliusShopBundle Test Suite">
<directory>./Tests</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -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,

View file

@ -2,17 +2,16 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
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="SyliusTaxationBundle Test Suite">
<directory>./test/</directory>
<directory>./Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -1,30 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View file

@ -13,7 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\TaxationBundle\Tests;
use PHPUnit\Framework\Assert;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class SyliusTaxationBundleTest extends WebTestCase
@ -23,17 +25,17 @@ final class SyliusTaxationBundleTest 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));
}
}
}

View file

@ -16,6 +16,7 @@ namespace Sylius\Bundle\TaxonomyBundle\Tests\Functional;
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 @@ final class SyliusTaxonomyBundleTest extends KernelTestCase
/** @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));
}
}
}

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="Tests/Functional/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>
<testsuites>
<testsuite name="SyliusTaxonomyBundle Test Suite">
<directory>./Tests/</directory>

View file

@ -16,6 +16,7 @@ namespace Sylius\Bundle\ThemeBundle\Tests\Functional;
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 @@ final class SyliusThemeBundleTest extends KernelTestCase
/** @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));
}
}
}

View file

@ -1,16 +1,13 @@
<?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/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="Tests/Functional/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>
<testsuites>
<testsuite name="SyliusThemeBundle Test Suite">
<directory>./Tests/</directory>

View file

@ -16,6 +16,7 @@ namespace Sylius\Bundle\UserBundle\Tests\Functional;
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 @@ final class SyliusUserBundleTest extends KernelTestCase
/** @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));
}
}
}

View file

@ -2,14 +2,12 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_DIR" value="Tests/Functional/app/" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="KERNEL_CLASS" value="AppKernel" />
</php>
<testsuites>
<testsuite name="SyliusUserBundle Test Suite">
<directory>./Tests/</directory>

View file

@ -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",