Code Duplication    Length = 23-23 lines in 2 locations

eZ/Publish/API/Repository/Tests/SectionServiceTest.php 2 locations

@@ 483-505 (lines=23) @@
480
     *
481
     * @see \eZ\Publish\API\Repository\SectionService::countAssignedContents()
482
     */
483
    public function testCountAssignedContents()
484
    {
485
        $repository = $this->getRepository();
486
487
        $sectionService = $repository->getSectionService();
488
489
        $standardSectionId = $this->generateId('section', 1);
490
        /* BEGIN: Use Case */
491
        // $standardSectionId contains the ID of the "Standard" section in a eZ
492
        // Publish demo installation.
493
494
        $standardSection = $sectionService->loadSection($standardSectionId);
495
496
        $numberOfAssignedContent = $sectionService->countAssignedContents(
497
            $standardSection
498
        );
499
        /* END: Use Case */
500
501
        $this->assertEquals(
502
            2, // Taken from the fixture
503
            $numberOfAssignedContent
504
        );
505
    }
506
507
    /**
508
     * Test for the isSectionUsed() method.
@@ 512-534 (lines=23) @@
509
     *
510
     * @see \eZ\Publish\API\Repository\SectionService::isSectionUsed()
511
     */
512
    public function testIsSectionUsed()
513
    {
514
        $repository = $this->getRepository();
515
516
        $sectionService = $repository->getSectionService();
517
518
        $standardSectionId = $this->generateId('section', 1);
519
        /* BEGIN: Use Case */
520
        // $standardSectionId contains the ID of the "Standard" section in a eZ
521
        // Publish demo installation.
522
523
        $standardSection = $sectionService->loadSection($standardSectionId);
524
525
        $isSectionUsed = $sectionService->isSectionUsed(
526
            $standardSection
527
        );
528
        /* END: Use Case */
529
530
        $this->assertEquals(
531
            true, // Taken from the fixture
532
            $isSectionUsed
533
        );
534
    }
535
536
    /**
537
     * Test for the assignSection() method.