Code Duplication    Length = 19-20 lines in 6 locations

tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php 1 location

@@ 55-74 (lines=20) @@
52
        self::assertEquals('CONCAT(column1, column2, column3)', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation function is not correct');
53
    }
54
55
    public function testGeneratesTransactionsCommands()
56
    {
57
        self::assertEquals(
58
            'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED',
59
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED),
60
            ''
61
        );
62
        self::assertEquals(
63
            'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
64
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED)
65
        );
66
        self::assertEquals(
67
            'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ',
68
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ)
69
        );
70
        self::assertEquals(
71
            'SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE',
72
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE)
73
        );
74
    }
75
76
77
    public function testGeneratesDDLSnippets()

tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php 1 location

@@ 65-83 (lines=19) @@
62
        self::assertEquals('(column1 + column2 + column3)', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation expression is not correct');
63
    }
64
65
    public function testGeneratesTransactionsCommands()
66
    {
67
        self::assertEquals(
68
                'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED',
69
                $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED)
70
        );
71
        self::assertEquals(
72
                'SET TRANSACTION ISOLATION LEVEL READ COMMITTED',
73
                $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED)
74
        );
75
        self::assertEquals(
76
                'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ',
77
                $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ)
78
        );
79
        self::assertEquals(
80
                'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE',
81
                $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE)
82
        );
83
    }
84
85
    public function testGeneratesDDLSnippets()
86
    {

tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php 1 location

@@ 105-123 (lines=19) @@
102
        self::assertEquals('column1 || column2 || column3', $this->_platform->getConcatExpression('column1', 'column2', 'column3'), 'Concatenation expression is not correct');
103
    }
104
105
    public function testGeneratesTransactionsCommands()
106
    {
107
        self::assertEquals(
108
            'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED',
109
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED)
110
        );
111
        self::assertEquals(
112
            'SET TRANSACTION ISOLATION LEVEL READ COMMITTED',
113
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED)
114
        );
115
        self::assertEquals(
116
            'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE',
117
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ)
118
        );
119
        self::assertEquals(
120
            'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE',
121
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE)
122
        );
123
    }
124
125
    /**
126
     * @expectedException \Doctrine\DBAL\DBALException

tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php 1 location

@@ 609-627 (lines=19) @@
606
        );
607
    }
608
609
    public function testGeneratesTransactionsCommands()
610
    {
611
        self::assertEquals(
612
            'SET TEMPORARY OPTION isolation_level = 0',
613
            $this->_platform->getSetTransactionIsolationSQL(Connection::TRANSACTION_READ_UNCOMMITTED)
614
        );
615
        self::assertEquals(
616
            'SET TEMPORARY OPTION isolation_level = 1',
617
            $this->_platform->getSetTransactionIsolationSQL(Connection::TRANSACTION_READ_COMMITTED)
618
        );
619
        self::assertEquals(
620
            'SET TEMPORARY OPTION isolation_level = 2',
621
            $this->_platform->getSetTransactionIsolationSQL(Connection::TRANSACTION_REPEATABLE_READ)
622
        );
623
        self::assertEquals(
624
            'SET TEMPORARY OPTION isolation_level = 3',
625
            $this->_platform->getSetTransactionIsolationSQL(Connection::TRANSACTION_SERIALIZABLE)
626
        );
627
    }
628
629
    public function testCannotGenerateTransactionCommandWithInvalidIsolationLevel()
630
    {

tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php 1 location

@@ 39-57 (lines=19) @@
36
        self::assertEquals('SUBSTR(column, 0, 5)', $this->_platform->getSubstringExpression('column', 0, 5), 'Substring expression with length is not correct');
37
    }
38
39
    public function testGeneratesTransactionCommands()
40
    {
41
        self::assertEquals(
42
            'PRAGMA read_uncommitted = 0',
43
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED)
44
        );
45
        self::assertEquals(
46
            'PRAGMA read_uncommitted = 1',
47
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED)
48
        );
49
        self::assertEquals(
50
            'PRAGMA read_uncommitted = 1',
51
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ)
52
        );
53
        self::assertEquals(
54
            'PRAGMA read_uncommitted = 1',
55
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE)
56
        );
57
    }
58
59
    public function testPrefersIdentityColumns()
60
    {

tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php 1 location

@@ 111-129 (lines=19) @@
108
        self::assertEquals('SUBSTRING(column FROM 1 FOR 5)', $this->_platform->getSubstringExpression('column', 1, 5), 'Substring expression with length is not correct');
109
    }
110
111
    public function testGeneratesTransactionCommands()
112
    {
113
        self::assertEquals(
114
            'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ UNCOMMITTED',
115
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_UNCOMMITTED)
116
        );
117
        self::assertEquals(
118
            'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED',
119
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_READ_COMMITTED)
120
        );
121
        self::assertEquals(
122
            'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL REPEATABLE READ',
123
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_REPEATABLE_READ)
124
        );
125
        self::assertEquals(
126
            'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE',
127
            $this->_platform->getSetTransactionIsolationSQL(\Doctrine\DBAL\Connection::TRANSACTION_SERIALIZABLE)
128
        );
129
    }
130
131
    public function testGeneratesDDLSnippets()
132
    {