Code Duplication    Length = 17-25 lines in 2 locations

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

@@ 670-694 (lines=25) @@
667
    /**
668
     * @dataProvider getUpdateLocationData
669
     */
670
    public function testUpdateLocation($field, $value)
671
    {
672
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
673
        $handler = $this->getLocationGateway();
674
        $handler->update(
675
            new Location\UpdateStruct(
676
                [
677
                    'priority' => 23,
678
                    'remoteId' => 'someNewHash',
679
                    'sortField' => 4,
680
                    'sortOrder' => 4,
681
                ]
682
            ),
683
            70
684
        );
685
686
        $query = $this->handler->createSelectQuery();
687
        $this->assertQueryResult(
688
            [[$value]],
689
            $query
690
                ->select($field)
691
                ->from('ezcontentobject_tree')
692
                ->where($query->expr->in('node_id', [70]))
693
        );
694
    }
695
696
    public static function getNodeAssignmentValues()
697
    {

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Location/Gateway/DoctrineDatabaseTrashTest.php 1 location

@@ 122-138 (lines=17) @@
119
    /**
120
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation
121
     */
122
    public function testUntrashLocationNewParent()
123
    {
124
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
125
        $handler = $this->getLocationGateway();
126
        $handler->trashLocation(71);
127
128
        $handler->untrashLocation(71, 1);
129
130
        $query = $this->handler->createSelectQuery();
131
        $this->assertQueryResult(
132
            [['228', '1', '/1/228/']],
133
            $query
134
                ->select('node_id', 'parent_node_id', 'path_string')
135
                ->from('ezcontentobject_tree')
136
                ->where($query->expr->in('contentobject_id', [69]))
137
        );
138
    }
139
140
    /**
141
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation