function UserAuthTest::testAuthenticateWithMissingCredentials

Same name and namespace in other branches
  1. 9 core/modules/user/tests/src/Unit/UserAuthTest.php \Drupal\Tests\user\Unit\UserAuthTest::testAuthenticateWithMissingCredentials()
  2. 10 core/modules/user/tests/src/Unit/UserAuthTest.php \Drupal\Tests\user\Unit\UserAuthTest::testAuthenticateWithMissingCredentials()
  3. 11.x core/modules/user/tests/src/Unit/UserAuthTest.php \Drupal\Tests\user\Unit\UserAuthTest::testAuthenticateWithMissingCredentials()

Tests failing authentication with missing credential parameters.

@covers ::authenticate

@dataProvider providerTestAuthenticateWithMissingCredentials

File

core/modules/user/tests/src/Unit/UserAuthTest.php, line 87

Class

UserAuthTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21user%21src%21UserAuth.php/class/UserAuth/8.9.x" title="Validates user authentication credentials." class="local">\Drupal\user\UserAuth</a> @group user

Namespace

Drupal\Tests\user\Unit

Code

public function testAuthenticateWithMissingCredentials($username, $password) {
    $this->userStorage
        ->expects($this->never())
        ->method('loadByProperties');
    $this->assertFalse($this->userAuth
        ->authenticate($username, $password));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.