Failed Conditions
Push — master ( edfbda...298c91 )
by Luís
16s
created

tests/Doctrine/Tests/Mocks/DriverMock.php (1 issue)

1
<?php
2
3
namespace Doctrine\Tests\Mocks;
4
5
6
class DriverMock implements \Doctrine\DBAL\Driver
7
{
8
    private $_platformMock;
9
10
    private $_schemaManagerMock;
11
12
    public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
13
    {
14
        return new DriverConnectionMock();
15
    }
16
17
    /**
18
     * Constructs the Sqlite PDO DSN.
19
     *
20
     * @return string  The DSN.
21
     * @override
22
     */
23
    protected function _constructPdoDsn(array $params)
24
    {
25
        return "";
26
    }
27
28
    /**
29
     * @override
30
     */
31
    public function getDatabasePlatform()
32
    {
33
        if ( ! $this->_platformMock) {
34
            $this->_platformMock = new DatabasePlatformMock;
35
        }
36
        return $this->_platformMock;
37
    }
38
39
    /**
40
     * @override
41
     */
42
    public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
43
    {
44
        if($this->_schemaManagerMock == null) {
45
            return new SchemaManagerMock($conn);
46
        } else {
47
            return $this->_schemaManagerMock;
48
        }
49
    }
50
51
    /* MOCK API */
52
53
    public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform)
54
    {
55
        $this->_platformMock = $platform;
56
    }
57
58
    public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm)
59
    {
60
        $this->_schemaManagerMock = $sm;
61
    }
62
63
    public function getName()
64
    {
65
        return 'mock';
66
    }
67
68
    public function getDatabase(\Doctrine\DBAL\Connection $conn)
69
    {
70
        return;
71
    }
72
73
    public function convertExceptionCode(\Exception $exception)
0 ignored issues
show
The parameter $exception is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

73
    public function convertExceptionCode(/** @scrutinizer ignore-unused */ \Exception $exception)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
74
    {
75
        return 0;
76
    }
77
}