Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 352-372 (lines=21) @@
349
        );
350
    }
351
352
    public function testHideUpdateHidden()
353
    {
354
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
355
        $handler = $this->getLocationGateway();
356
        $handler->hideSubtree('/1/2/69/');
357
358
        $query = $this->handler->createSelectQuery();
359
        $this->assertQueryResult(
360
            [
361
                [1, 0, 0],
362
                [2, 0, 0],
363
                [69, 1, 1],
364
                [75, 0, 1],
365
            ],
366
            $query
367
                ->select('node_id', 'is_hidden', 'is_invisible')
368
                ->from('ezcontentobject_tree')
369
                ->where($query->expr->in('node_id', [1, 2, 69, 75]))
370
                ->orderBy('node_id')
371
        );
372
    }
373
374
    /**
375
     * @depends testHideUpdateHidden
@@ 377-398 (lines=22) @@
374
    /**
375
     * @depends testHideUpdateHidden
376
     */
377
    public function testHideUnhideUpdateHidden()
378
    {
379
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
380
        $handler = $this->getLocationGateway();
381
        $handler->hideSubtree('/1/2/69/');
382
        $handler->unhideSubtree('/1/2/69/');
383
384
        $query = $this->handler->createSelectQuery();
385
        $this->assertQueryResult(
386
            [
387
                [1, 0, 0],
388
                [2, 0, 0],
389
                [69, 0, 0],
390
                [75, 0, 0],
391
            ],
392
            $query
393
                ->select('node_id', 'is_hidden', 'is_invisible')
394
                ->from('ezcontentobject_tree')
395
                ->where($query->expr->in('node_id', [1, 2, 69, 75]))
396
                ->orderBy('node_id')
397
        );
398
    }
399
400
    /**
401
     * @depends testHideUpdateHidden