Neos\Flow\Tests\Functional\Security\Authorization\Privilege\Entity\Doctrine\ContentSecurityTest::administratorsAreAllowedToSeeHiddenRestrictableEntities PHP Method

administratorsAreAllowedToSeeHiddenRestrictableEntities() public method

    public function administratorsAreAllowedToSeeHiddenRestrictableEntities()
    {
        $this->authenticateRoles(['Neos.Flow:Administrator']);
        $defaultEntity = new Fixtures\RestrictableEntity('default');
        $hiddenEntity = new Fixtures\RestrictableEntity('hiddenEntity');
        $hiddenEntity->setHidden(true);
        $this->restrictableEntityDoctrineRepository->add($defaultEntity);
        $defaultEntityIdentifier = $this->persistenceManager->getIdentifierByObject($defaultEntity);
        $this->restrictableEntityDoctrineRepository->add($hiddenEntity);
        $hiddenEntityIdentifier = $this->persistenceManager->getIdentifierByObject($hiddenEntity);
        $this->persistenceManager->persistAll();
        $this->persistenceManager->clearState();
        $result = $this->restrictableEntityDoctrineRepository->findAllWithDql();
        $this->assertTrue(count($result) === 2);
        $this->assertNotNull($this->persistenceManager->getObjectByIdentifier($defaultEntityIdentifier, Fixtures\RestrictableEntity::class));
        $this->assertNotNull($this->persistenceManager->getObjectByIdentifier($hiddenEntityIdentifier, Fixtures\RestrictableEntity::class));
        $this->restrictableEntityDoctrineRepository->removeAll();
        $this->persistenceManager->persistAll();
        $this->persistenceManager->clearState();
    }