Completed
Pull Request — master (#6)
by
unknown
10:54
created

ApiServiceBundleTest::testShouldAddCompilerPass()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
nc 1
nop 0
dl 0
loc 15
rs 9.9666
c 1
b 0
f 0
1
<?php
2
3
namespace ElevenLabs\ApiServiceBundle\Tests;
4
5
use ElevenLabs\ApiServiceBundle\ApiServiceBundle;
6
use ElevenLabs\ApiServiceBundle\DependencyInjection\Compiler\FormatPass;
7
use ElevenLabs\ApiServiceBundle\DependencyInjection\Compiler\PaginatorCompilerPass;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
/**
12
 * Class ApiServiceBundle.
13
 */
14
class ApiServiceBundleTest extends TestCase
15
{
16
    public function testShouldAddCompilerPass()
17
    {
18
        $container = $this->createMock(ContainerBuilder::class);
19
        $container
20
            ->expects($this->exactly(2))
21
            ->method('addCompilerPass')
22
            ->willReturnCallback(function ($pass) use ($container) {
23
                $this->assertTrue($pass instanceof FormatPass || $pass instanceof PaginatorCompilerPass);
24
25
                return $container;
26
            })
27
        ;
28
29
        $bundle = new ApiServiceBundle();
30
        $bundle->build($container);
31
    }
32
}
33