Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 338-358 (lines=21) @@
335
        );
336
    }
337
338
    public function testHideUpdateHidden()
339
    {
340
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
341
        $handler = $this->getLocationGateway();
342
        $handler->hideSubtree('/1/2/69/');
343
344
        $query = $this->handler->createSelectQuery();
345
        $this->assertQueryResult(
346
            array(
347
                array(1, 0, 0),
348
                array(2, 0, 0),
349
                array(69, 1, 1),
350
                array(75, 0, 1),
351
            ),
352
            $query
353
                ->select('node_id', 'is_hidden', 'is_invisible')
354
                ->from('ezcontentobject_tree')
355
                ->where($query->expr->in('node_id', array(1, 2, 69, 75)))
356
                ->orderBy('node_id')
357
        );
358
    }
359
360
    /**
361
     * @depends testHideUpdateHidden
@@ 363-384 (lines=22) @@
360
    /**
361
     * @depends testHideUpdateHidden
362
     */
363
    public function testHideUnhideUpdateHidden()
364
    {
365
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
366
        $handler = $this->getLocationGateway();
367
        $handler->hideSubtree('/1/2/69/');
368
        $handler->unhideSubtree('/1/2/69/');
369
370
        $query = $this->handler->createSelectQuery();
371
        $this->assertQueryResult(
372
            array(
373
                array(1, 0, 0),
374
                array(2, 0, 0),
375
                array(69, 0, 0),
376
                array(75, 0, 0),
377
            ),
378
            $query
379
                ->select('node_id', 'is_hidden', 'is_invisible')
380
                ->from('ezcontentobject_tree')
381
                ->where($query->expr->in('node_id', array(1, 2, 69, 75)))
382
                ->orderBy('node_id')
383
        );
384
    }
385
386
    /**
387
     * @depends testHideUpdateHidden