Code Duplication    Length = 29-29 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Language/Gateway/DoctrineDatabaseTest.php 1 location

@@ 180-208 (lines=29) @@
177
    /**
178
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Language\Gateway\DoctrineDatabase::deleteLanguage
179
     */
180
    public function testDeleteLanguage()
181
    {
182
        $gateway = $this->getDatabaseGateway();
183
184
        $result = $gateway->deleteLanguage(2);
185
186
        $this->assertQueryResult(
187
            array(
188
                array(
189
                    'count' => '1',
190
                ),
191
            ),
192
            $this->getDatabaseHandler()->createSelectQuery()
193
                ->select('COUNT( * ) AS count')
194
                ->from('ezcontent_language')
195
        );
196
197
        $this->assertQueryResult(
198
            array(
199
                array(
200
                    'count' => '0',
201
                ),
202
            ),
203
            $this->getDatabaseHandler()->createSelectQuery()
204
                ->select('COUNT( * ) AS count')
205
                ->from('ezcontent_language')
206
                ->where('id=2')
207
        );
208
    }
209
210
    /**
211
     * Returns a ready to test DoctrineDatabase gateway.

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Section/Gateway/DoctrineDatabaseTest.php 1 location

@@ 239-267 (lines=29) @@
236
    /**
237
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::deleteSection
238
     */
239
    public function testDeleteSection()
240
    {
241
        $gateway = $this->getDatabaseGateway();
242
243
        $result = $gateway->deleteSection(2);
244
245
        $this->assertQueryResult(
246
            array(
247
                array(
248
                    'count' => '5',
249
                ),
250
            ),
251
            $this->getDatabaseHandler()->createSelectQuery()
252
                ->select('COUNT( * ) AS count')
253
                ->from('ezsection')
254
        );
255
256
        $this->assertQueryResult(
257
            array(
258
                array(
259
                    'count' => '0',
260
                ),
261
            ),
262
            $this->getDatabaseHandler()->createSelectQuery()
263
                ->select('COUNT( * ) AS count')
264
                ->from('ezsection')
265
                ->where('id=2')
266
        );
267
    }
268
269
    /**
270
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::assignSectionToContent