Code Duplication    Length = 25-25 lines in 2 locations

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

@@ 166-190 (lines=25) @@
163
        );
164
    }
165
166
    public function testGeneratesCreateTableSQLWithForeignKeyConstraints()
167
    {
168
        $table = new Table('test');
169
        $table->addColumn('id', 'integer');
170
        $table->addColumn('fk_1', 'integer');
171
        $table->addColumn('fk_2', 'integer');
172
        $table->setPrimaryKey(array('id'));
173
        $table->addForeignKeyConstraint('foreign_table', array('fk_1', 'fk_2'), array('pk_1', 'pk_2'));
174
        $table->addForeignKeyConstraint(
175
            'foreign_table2',
176
            array('fk_1', 'fk_2'),
177
            array('pk_1', 'pk_2'),
178
            array(),
179
            'named_fk'
180
        );
181
182
        self::assertEquals(
183
            array(
184
                'CREATE TABLE test (id INTEGER NOT NULL, fk_1 INTEGER NOT NULL, fk_2 INTEGER NOT NULL)',
185
                'ALTER TABLE test ADD CONSTRAINT FK_D87F7E0C177612A38E7F4319 FOREIGN KEY (fk_1, fk_2) REFERENCES foreign_table (pk_1, pk_2)',
186
                'ALTER TABLE test ADD CONSTRAINT named_fk FOREIGN KEY (fk_1, fk_2) REFERENCES foreign_table2 (pk_1, pk_2)',
187
            ),
188
            $this->_platform->getCreateTableSQL($table, AbstractPlatform::CREATE_FOREIGNKEYS)
189
        );
190
    }
191
192
    public function testGeneratesCreateTableSQLWithCheckConstraints()
193
    {

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

@@ 146-170 (lines=25) @@
143
        );
144
    }
145
146
    public function testGeneratesCreateTableSQLWithForeignKeyConstraints()
147
    {
148
        $table = new Table('test');
149
        $table->addColumn('id', 'integer');
150
        $table->addColumn('fk_1', 'integer');
151
        $table->addColumn('fk_2', 'integer');
152
        $table->setPrimaryKey(array('id'));
153
        $table->addForeignKeyConstraint('foreign_table', array('fk_1', 'fk_2'), array('pk_1', 'pk_2'));
154
        $table->addForeignKeyConstraint(
155
            'foreign_table2',
156
            array('fk_1', 'fk_2'),
157
            array('pk_1', 'pk_2'),
158
            array(),
159
            'named_fk'
160
        );
161
162
        self::assertEquals(
163
            array(
164
                'CREATE TABLE test (id INT NOT NULL, fk_1 INT NOT NULL, fk_2 INT NOT NULL, ' .
165
                'CONSTRAINT FK_D87F7E0C177612A38E7F4319 FOREIGN KEY (fk_1, fk_2) REFERENCES foreign_table (pk_1, pk_2), ' .
166
                'CONSTRAINT named_fk FOREIGN KEY (fk_1, fk_2) REFERENCES foreign_table2 (pk_1, pk_2))'
167
            ),
168
            $this->_platform->getCreateTableSQL($table, AbstractPlatform::CREATE_FOREIGNKEYS)
169
        );
170
    }
171
172
    public function testGeneratesCreateTableSQLWithCheckConstraints()
173
    {