Completed
Push — 1.0-protecting-the-docs ( 1d2d44 )
by Kamil
42:51
created

MongoDBPurgerListenerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A managers_are_set_to_null_by_default() 0 4 1
A managers_are_optional() 0 4 1
A getConfiguration() 0 4 1
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\FixturesBundle\Tests\Listener;
15
16
use Doctrine\Common\Persistence\ManagerRegistry;
17
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
18
use Sylius\Bundle\FixturesBundle\Listener\MongoDBPurgerListener;
19
use Symfony\Component\Config\Definition\ConfigurationInterface;
20
21
final class MongoDBPurgerListenerTest extends \PHPUnit_Framework_TestCase
22
{
23
    use ConfigurationTestCaseTrait;
24
25
    /**
26
     * @test
27
     */
28
    public function managers_are_set_to_null_by_default(): void
29
    {
30
        $this->assertProcessedConfigurationEquals([[]], ['managers' => [null]], 'managers');
31
    }
32
33
    /**
34
     * @test
35
     */
36
    public function managers_are_optional(): void
37
    {
38
        $this->assertProcessedConfigurationEquals([['managers' => ['custom']]], ['managers' => ['custom']], 'managers');
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    protected function getConfiguration(): ConfigurationInterface
45
    {
46
        return new MongoDBPurgerListener($this->getMockBuilder(ManagerRegistry::class)->getMock());
47
    }
48
}
49