public function ProtectedEntityDeleteTest::testNonExistentProtectedUser in User protect 8
Tests UI for non-existent protected users.
Tests if there are no PHP errors in the UI when a protection rule for a non-existent user still exists.
File
- tests/
src/ Functional/ ProtectedEntityDeleteTest.php, line 18
Class
- ProtectedEntityDeleteTest
- Tests if protection rules are cleaned up upon entity deletion.
Namespace
Drupal\Tests\userprotect\FunctionalCode
public function testNonExistentProtectedUser() {
// Create a protection rule for a non-existent user.
$fake_uid = 10;
$protection_rule = $this
->createProtectionRule($fake_uid, [], 'user');
$protection_rule
->save();
// Check user interface.
$account = $this
->drupalCreateUser([
'userprotect.administer',
]);
$this
->drupalLogin($account);
$this
->drupalGet('admin/config/people/userprotect');
$this
->assertSession()
->pageTextContains('Missing');
}