Completed
Push — master ( cc6356...ca1999 )
by
unknown
04:54 queued 10s
created

NoDriverManagerTest::testException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
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
namespace Sonata\MediaBundle\Tests\Model;
13
14
use PHPUnit\Framework\TestCase;
15
use Sonata\MediaBundle\Exception\NoDriverException;
16
use Sonata\MediaBundle\Model\NoDriverManager;
17
18
class NoDriverManagerTest extends TestCase
19
{
20
    /**
21
     * @dataProvider providerMethods
22
     */
23
    public function testException($method, array $arguments)
24
    {
25
        $this->expectException(NoDriverException::class);
26
27
        call_user_func_array([new NoDriverManager(), $method], $arguments);
28
    }
29
30
    public function providerMethods()
31
    {
32
        return [
33
            ['getClass', []],
34
            ['findAll', []],
35
            ['findBy', [[]]],
36
            ['findOneBy', [[]]],
37
            ['find', [1]],
38
            ['create', []],
39
            ['save', [null]],
40
            ['delete', [null]],
41
            ['getTableName', []],
42
            ['getConnection', []],
43
        ];
44
    }
45
}
46