class AnonymousUserSessionTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php \Drupal\Tests\Core\Session\AnonymousUserSessionTest
- 10 core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php \Drupal\Tests\Core\Session\AnonymousUserSessionTest
- 8.9.x core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php \Drupal\Tests\Core\Session\AnonymousUserSessionTest
@coversDefaultClass \Drupal\Core\Session\AnonymousUserSession
@group Session
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Session\AnonymousUserSessionTest extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of AnonymousUserSessionTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ AnonymousUserSessionTest.php, line 13
Namespace
Drupal\Tests\Core\SessionView source
class AnonymousUserSessionTest extends UnitTestCase {
/**
* Tests the method getRoles exclude or include locked roles based in param.
*
* @covers ::getRoles
* @todo Move roles constants to a class/interface
*/
public function testUserGetRoles() {
$anonymous_user = new AnonymousUserSession();
$this->assertEquals([
RoleInterface::ANONYMOUS_ID,
], $anonymous_user->getRoles());
$this->assertEquals([], $anonymous_user->getRoles(TRUE));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.