Code Duplication    Length = 22-22 lines in 2 locations

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

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