Code Duplication    Length = 25-25 lines in 2 locations

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

@@ 389-413 (lines=25) @@
386
    /**
387
     * @depends testHideUpdateHidden
388
     */
389
    public function testHideUnhideParentTree()
390
    {
391
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
392
        $handler = $this->getLocationGateway();
393
        $handler->hideSubtree('/1/2/69/');
394
        $handler->hideSubtree('/1/2/69/70/');
395
        $handler->unhideSubtree('/1/2/69/');
396
397
        $query = $this->handler->createSelectQuery();
398
        $this->assertQueryResult(
399
            array(
400
                array(1, 0, 0),
401
                array(2, 0, 0),
402
                array(69, 0, 0),
403
                array(70, 1, 1),
404
                array(71, 0, 1),
405
                array(75, 0, 0),
406
            ),
407
            $query
408
                ->select('node_id', 'is_hidden', 'is_invisible')
409
                ->from('ezcontentobject_tree')
410
                ->where($query->expr->in('node_id', array(1, 2, 69, 70, 71, 75)))
411
                ->orderBy('node_id')
412
        );
413
    }
414
415
    /**
416
     * @depends testHideUpdateHidden
@@ 418-442 (lines=25) @@
415
    /**
416
     * @depends testHideUpdateHidden
417
     */
418
    public function testHideUnhidePartialSubtree()
419
    {
420
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
421
        $handler = $this->getLocationGateway();
422
        $handler->hideSubtree('/1/2/69/');
423
        $handler->hideSubtree('/1/2/69/70/');
424
        $handler->unhideSubtree('/1/2/69/70/');
425
426
        $query = $this->handler->createSelectQuery();
427
        $this->assertQueryResult(
428
            array(
429
                array(1, 0, 0),
430
                array(2, 0, 0),
431
                array(69, 1, 1),
432
                array(70, 0, 1),
433
                array(71, 0, 1),
434
                array(75, 0, 1),
435
            ),
436
            $query
437
                ->select('node_id', 'is_hidden', 'is_invisible')
438
                ->from('ezcontentobject_tree')
439
                ->where($query->expr->in('node_id', array(1, 2, 69, 70, 71, 75)))
440
                ->orderBy('node_id')
441
        );
442
    }
443
444
    public function testSwapLocations()
445
    {