Code Duplication    Length = 17-25 lines in 2 locations

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

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

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

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