
| Current Path : /var/www/html/holz-machines/web/core/tests/Drupal/Tests/Core/Session/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/holz-machines/web/core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php |
<?php
namespace Drupal\Tests\Core\Session;
use Drupal\Tests\UnitTestCase;
use Drupal\Core\Session\AnonymousUserSession;
use Drupal\user\RoleInterface;
/**
* @coversDefaultClass \Drupal\Core\Session\AnonymousUserSession
* @group Session
*/
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));
}
}