NoDriverManagerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testException() 0 6 1
A testIsInstanceOfGalleryManagerInterface() 0 4 1
A providerMethods() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\Model;
15
16
use PHPUnit\Framework\TestCase;
17
use Sonata\MediaBundle\Exception\NoDriverException;
18
use Sonata\MediaBundle\Model\GalleryManagerInterface;
19
use Sonata\MediaBundle\Model\NoDriverManager;
20
21
class NoDriverManagerTest extends TestCase
22
{
23
    /**
24
     * @dataProvider providerMethods
25
     */
26
    public function testException(string $method, array $arguments): void
27
    {
28
        $this->expectException(NoDriverException::class);
29
30
        \call_user_func_array([new NoDriverManager(), $method], $arguments);
31
    }
32
33
    public function testIsInstanceOfGalleryManagerInterface()
34
    {
35
        $this->assertInstanceOf(GalleryManagerInterface::class, new NoDriverManager());
36
    }
37
38
    public function providerMethods(): array
39
    {
40
        return [
41
            ['getClass', []],
42
            ['findAll', []],
43
            ['findBy', [[]]],
44
            ['findOneBy', [[]]],
45
            ['find', [1]],
46
            ['create', []],
47
            ['save', [null]],
48
            ['delete', [null]],
49
            ['getTableName', []],
50
            ['getConnection', []],
51
            ['getPager', [[], 1]],
52
        ];
53
    }
54
}
55