Code Duplication    Length = 22-22 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Gateway/DoctrineDatabaseTest.php 2 locations

@@ 1345-1366 (lines=22) @@
1342
    /**
1343
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadRelations
1344
     */
1345
    public function testLoadRelationsByType()
1346
    {
1347
        $this->insertRelationFixture();
1348
1349
        $gateway = $this->getDatabaseGateway();
1350
1351
        $relations = $gateway->loadRelations(57, null, \eZ\Publish\API\Repository\Values\Content\Relation::COMMON);
1352
1353
        $this->assertEquals(1, count($relations), 'Expecting one relation to be loaded');
1354
1355
        $this->assertValuesInRows(
1356
            'ezcontentobject_link_relation_type',
1357
            array(\eZ\Publish\API\Repository\Values\Content\Relation::COMMON),
1358
            $relations
1359
        );
1360
1361
        $this->assertValuesInRows(
1362
            'ezcontentobject_link_to_contentobject_id',
1363
            array(58),
1364
            $relations
1365
        );
1366
    }
1367
1368
    /**
1369
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadRelations
@@ 1425-1446 (lines=22) @@
1422
    /**
1423
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadReverseRelations
1424
     */
1425
    public function testLoadReverseRelationsWithType()
1426
    {
1427
        $this->insertRelationFixture();
1428
1429
        $gateway = $this->getDatabaseGateway();
1430
1431
        $relations = $gateway->loadReverseRelations(58, \eZ\Publish\API\Repository\Values\Content\Relation::COMMON);
1432
1433
        self::assertEquals(1, count($relations));
1434
1435
        $this->assertValuesInRows(
1436
            'ezcontentobject_link_from_contentobject_id',
1437
            array(57),
1438
            $relations
1439
        );
1440
1441
        $this->assertValuesInRows(
1442
            'ezcontentobject_link_relation_type',
1443
            array(\eZ\Publish\API\Repository\Values\Content\Relation::COMMON),
1444
            $relations
1445
        );
1446
    }
1447
1448
    /**
1449
     * Inserts the relation database fixture from relation_data.php.