Passed
Pull Request — master (#6)
by
unknown
02:45
created

ApiServiceBundleTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A testShouldAddCompilerPass() 0 15 2
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