function UserAuthenticationTest::testLookupAccountWithInvalidUsername
Tests lookupAccount() with an invalid username.
File
-
core/
modules/ user/ tests/ src/ Unit/ UserAuthenticationTest.php, line 102
Class
Namespace
Drupal\Tests\user\UnitCode
public function testLookupAccountWithInvalidUsername() : void {
$this->userStorage
->expects($this->once())
->method('loadByProperties')
->with([
'name' => 'invalidUser',
])
->willReturn([]);
$this->assertFalse($this->userAuth
->lookupAccount('invalidUser'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.