Completed
Push — master ( 96a7d0...2b7d76 )
by
unknown
01:58 queued 10s
created

NoDriverManagerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testException() 0 5 1
A managerMethods() 0 15 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\NewsBundle\Tests\Model;
15
16
use PHPUnit\Framework\TestCase;
17
use Sonata\NewsBundle\Exception\NoDriverException;
18
use Sonata\NewsBundle\Model\NoDriverManager;
19
20
class NoDriverManagerTest extends TestCase
21
{
22
    /**
23
     * @dataProvider managerMethods
24
     */
25
    public function testException(string $method, array $arguments)
26
    {
27
        $this->expectException(NoDriverException::class);
28
        (new NoDriverManager())->{$method}(...$arguments);
29
    }
30
31
    public function managerMethods()
32
    {
33
        return [
34
            ['getClass', []],
35
            ['findAll', []],
36
            ['findBy', [[]]],
37
            ['findOneBy', [[]]],
38
            ['find', [1]],
39
            ['create', []],
40
            ['save', [null]],
41
            ['delete', [null]],
42
            ['getTableName', []],
43
            ['getConnection', []],
44
        ];
45
    }
46
}
47