Skip to content

Commit

Permalink
corrected incorrect commit
Browse files Browse the repository at this point in the history
  • Loading branch information
padmasreegade committed Jan 29, 2025
1 parent d4d1426 commit 3c76096
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testBadLoginResponse()
{
$this->expectException(\VuFind\Exception\Auth::class);

// VuFind requires the ILS driver to return a value in catUsername
// VuFind requires the ILS driver to return a value in cat_username
// by default -- if that is missing, we should fail.
$response = [];
$driver = $this->getMockDriver();
Expand All @@ -200,7 +200,7 @@ public function testBadLoginResponse()
public function testLogin()
{
$response = [
'catUsername' => 'testuser', 'catPassword' => 'testpass',
'cat_username' => 'testuser', 'cat_password' => 'testpass',
'email' => '[email protected]',
];
$driver = $this->getMockDriver();
Expand All @@ -223,7 +223,7 @@ public function testLoginWithMissingCatId()
$this->expectExceptionMessage('authentication_error_technical');

$response = [
'catUsername' => 'testuser', 'catPassword' => 'testpass',
'cat_username' => 'testuser', 'cat_password' => 'testpass',
'email' => '[email protected]',
];
$driver = $this->getMockDriver();
Expand All @@ -248,7 +248,7 @@ public function testUpdateUserPasswordWithEmptyValue()
$this->expectException(\VuFind\Exception\Auth::class);
$this->expectExceptionMessage('Password cannot be blank');

$patron = ['catUsername' => 'testuser'];
$patron = ['cat_username' => 'testuser'];
$request = $this->getLoginRequest(
[
'oldpwd' => 'foo',
Expand Down Expand Up @@ -296,7 +296,7 @@ public function testUpdateUserPasswordWithMismatch()
'password2' => 'fail',
]
);
$patron = ['catUsername' => 'testuser'];
$patron = ['cat_username' => 'testuser'];
$this->getAuth(null, $patron)->updatePassword($request);
}

Expand All @@ -317,7 +317,7 @@ public function testUpdateUserPassword()
$driver = $this->getMockDriver('Demo', ['changePassword']);
$driver->expects($this->once())->method('changePassword')
->will($this->returnValue(['success' => true]));
$patron = ['catUsername' => 'testuser'];
$patron = ['cat_username' => 'testuser'];
$user = $this->getAuth($driver, $patron)->updatePassword($request);
$this->assertEquals('testuser', $user->getUsername());
$this->assertEquals('newpass', $user->getRawCatPassword());
Expand All @@ -340,7 +340,7 @@ public function testUpdateUserPasswordUsingCatIdField()
$driver = $this->getMockDriver('Demo', ['changePassword']);
$driver->expects($this->once())->method('changePassword')
->will($this->returnValue(['success' => true]));
$patron = ['catUsername' => 'testuser', 'cat_id' => '1234'];
$patron = ['cat_username' => 'testuser', 'cat_id' => '1234'];
$auth = $this->getAuth($driver, $patron);
$config = ['Authentication' => ['ILS_username_field' => 'cat_id']];
$auth->setConfig(new \VuFind\Config\Config($config));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ public function testGetDriverConfig()
*/
protected function getPatron($username, $instance = null)
{
$catUsername = $instance ? $instance . '.' . $username : $username;
$cat_username = $instance ? $instance . '.' . $username : $username;
return [
'id' => 1,
'firstname' => 'JANE',
'lastname' => 'DOE',
'catUsername' => $catUsername,
'catPassword' => 'password',
'cat_username' => $cat_username,
'cat_password' => 'password',
'email' => '',
'major' => '',
'college' => '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ protected function getMockIlsConnection(?bool $blocks): Connection
'id' => 1,
'firstname' => 'Lib',
'lastname' => 'Rarian',
'catUsername' => 'user',
'catPassword' => 'pass',
'cat_username' => 'user',
'cat_password' => 'pass',
'email' => '[email protected]',
'major' => null,
'college' => null,
Expand Down

0 comments on commit 3c76096

Please sign in to comment.