name) { $this->name = $config->name; } else { $this->name = 'TestBackendErrorProneMock-' . uniqid(); } } /** * Test if the username exists * * @param Credential $credentials * * @return bool * @throws Exception */ public function hasUsername(Credential $credentials) { throw new Exception('hasUsername error: ' . $credentials->getUsername()); } /** * Authenticate * * @param Credential $credentials * * @return User * @throws Exception */ public function authenticate(Credential $credentials) { throw new Exception('authenticate error: ' . $credentials->getUsername()); } /** * Name of the backend * * @return string */ public function getName() { return $this->name; } /** * Get the number of users available through this backend * * @return int * @throws Exception */ public function getUserCount() { throw new Exception('getUserCount error: No users in this error prone backend'); } }