Neos\Flow\Tests\Functional\Security\Policy\PolicyTest::nonAuthenticatedUsersHaveTheEverybodyAndAnonymousRole PHP Method

nonAuthenticatedUsersHaveTheEverybodyAndAnonymousRole() public method

    public function nonAuthenticatedUsersHaveTheEverybodyAndAnonymousRole()
    {
        $hasEverybodyRole = false;
        $hasAnonymousRole = false;
        foreach ($this->securityContext->getRoles() as $role) {
            if ((string) $role === 'Neos.Flow:Everybody') {
                $hasEverybodyRole = true;
            }
            if ((string) $role === 'Neos.Flow:Anonymous') {
                $hasAnonymousRole = true;
            }
        }
        $this->assertEquals(2, count($this->securityContext->getRoles()));
        $this->assertTrue($this->securityContext->hasRole('Neos.Flow:Everybody'), 'Everybody - hasRole()');
        $this->assertTrue($hasEverybodyRole, 'Everybody - getRoles()');
        $this->assertTrue($this->securityContext->hasRole('Neos.Flow:Anonymous'), 'Anonymous - hasRole()');
        $this->assertTrue($hasAnonymousRole, 'Anonymous - getRoles()');
    }