Code Duplication    Length = 24-27 lines in 2 locations

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

@@ 800-823 (lines=24) @@
797
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::load
798
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase\QueryBuilder
799
     */
800
    public function testLoadWithSingleTranslation()
801
    {
802
        $this->insertDatabaseFixture(
803
            __DIR__ . '/../_fixtures/contentobjects.php'
804
        );
805
806
        $gateway = $this->getDatabaseGateway();
807
        $res = $gateway->load(226, 2, ['eng-GB']);
808
809
        $this->assertValuesInRows(
810
            'ezcontentobject_attribute_language_code',
811
            ['eng-GB'],
812
            $res
813
        );
814
        $this->assertValuesInRows(
815
            'ezcontentobject_attribute_language_id',
816
            ['4'],
817
            $res
818
        );
819
        $this->assertCount(
820
            1,
821
            $res
822
        );
823
    }
824
825
    /**
826
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::load
@@ 1299-1325 (lines=27) @@
1296
     *
1297
     * @throws \Doctrine\DBAL\DBALException
1298
     */
1299
    public function testLoadRelations(): void
1300
    {
1301
        $this->insertRelationFixture();
1302
1303
        $gateway = $this->getDatabaseGateway();
1304
1305
        $relations = $gateway->loadRelations(57);
1306
1307
        $this->assertCount(3, $relations);
1308
1309
        $this->assertValuesInRows(
1310
            'ezcontentobject_link_to_contentobject_id',
1311
            [58, 59, 60],
1312
            $relations
1313
        );
1314
1315
        $this->assertValuesInRows(
1316
            'ezcontentobject_link_from_contentobject_id',
1317
            [57],
1318
            $relations
1319
        );
1320
        $this->assertValuesInRows(
1321
            'ezcontentobject_link_from_contentobject_version',
1322
            [2],
1323
            $relations
1324
        );
1325
    }
1326
1327
    /**
1328
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadRelations