
| Current Path : /var/www/html/rocksensor1/web/core/modules/user/tests/src/Functional/ |
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/rocksensor1/web/core/modules/user/tests/src/Functional/UserRequirementsTest.php |
<?php
declare(strict_types=1);
namespace Drupal\Tests\user\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the requirements checks of the User module.
*
* @group user
*/
class UserRequirementsTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that the requirements check can detect a missing anonymous user.
*/
public function testAnonymousUser(): void {
// Remove the anonymous user.
\Drupal::database()
->delete('users')
->condition('uid', 0)
->execute();
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer site configuration',
]));
$this->drupalGet('/admin/reports/status');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains("The anonymous user does not exist.");
}
}