Completed
Push — 1.2-symfony4-packages ( fadf23...39ce77 )
by Kamil
18:12
created

its_services_are_initializable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Bundle\InventoryBundle\Tests;
15
16
use PHPUnit\Framework\Assert;
17
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\DependencyInjection\ContainerInterface;
20
21
final class SyliusInventoryBundleTest extends WebTestCase
22
{
23
    /**
24
     * @test
25
     */
26
    public function its_services_are_initializable(): void
27
    {
28
        /** @var ContainerBuilder $container */
29
        $container = self::createClient()->getContainer();
30
31
        $services = $container->getServiceIds();
32
33
        $services = array_filter($services, function (string $serviceId): bool {
34
            return 0 === strpos($serviceId, 'sylius.');
35
        });
36
37
        foreach ($services as $id) {
38
            Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE));
39
        }
40
    }
41
}
42