Code Duplication    Length = 17-25 lines in 2 locations

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

@@ 131-147 (lines=17) @@
128
    /**
129
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation
130
     */
131
    public function testUntrashLocationNewParent()
132
    {
133
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
134
        $handler = $this->getLocationGateway();
135
        $handler->trashLocation(71);
136
137
        $handler->untrashLocation(71, 1);
138
139
        $query = $this->handler->createSelectQuery();
140
        $this->assertQueryResult(
141
            array(array('228', '1', '/1/228/')),
142
            $query
143
                ->select('node_id', 'parent_node_id', 'path_string')
144
                ->from('ezcontentobject_tree')
145
                ->where($query->expr->in('contentobject_id', array(69)))
146
        );
147
    }
148
149
    /**
150
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation

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

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