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

@@ 598-622 (lines=25) @@
595
    /**
596
     * @dataProvider getUpdateLocationData
597
     */
598
    public function testUpdateLocation($field, $value)
599
    {
600
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
601
        $handler = $this->getLocationGateway();
602
        $handler->update(
603
            new Location\UpdateStruct(
604
                array(
605
                    'priority' => 23,
606
                    'remoteId' => 'someNewHash',
607
                    'sortField' => 4,
608
                    'sortOrder' => 4,
609
                )
610
            ),
611
            70
612
        );
613
614
        $query = $this->handler->createSelectQuery();
615
        $this->assertQueryResult(
616
            array(array($value)),
617
            $query
618
                ->select($field)
619
                ->from('ezcontentobject_tree')
620
                ->where($query->expr->in('node_id', array(70)))
621
        );
622
    }
623
624
    public static function getNodeAssignmentValues()
625
    {