eZ\Publish\Core\Repository\Tests\Service\Integration\SectionBase::testCountAssignedContents PHP Method

testCountAssignedContents() public method

Test service function for counting content assigned to section.
    public function testCountAssignedContents()
    {
        $sectionService = $this->repository->getSectionService();
        $section = $sectionService->loadSection(1);
        $contentCount = $sectionService->countAssignedContents($section);
        self::assertGreaterThan(0, $contentCount);
        $sectionCreateStruct = $sectionService->newSectionCreateStruct();
        $sectionCreateStruct->identifier = 'test';
        $sectionCreateStruct->name = 'Test';
        $newSection = $sectionService->createSection($sectionCreateStruct);
        $contentCount = $sectionService->countAssignedContents($newSection);
        self::assertEquals(0, $contentCount);
    }