From 8113599abcd981cc08fdf42876f13d5ee2b0cff4 Mon Sep 17 00:00:00 2001 From: Ryan Rathsam Date: Tue, 27 Jun 2017 11:48:39 -0400 Subject: [PATCH] Updating XDUserTest to utilize pi - Open XDMoD does not have the program officer user so use pi instead. - Also update the default institution value to 0 as opposed to -1. --- .../xdmod/integration_tests/lib/XDUserTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/open_xdmod/modules/xdmod/integration_tests/lib/XDUserTest.php b/open_xdmod/modules/xdmod/integration_tests/lib/XDUserTest.php index 3c02236c21..6b51bc5778 100644 --- a/open_xdmod/modules/xdmod/integration_tests/lib/XDUserTest.php +++ b/open_xdmod/modules/xdmod/integration_tests/lib/XDUserTest.php @@ -16,8 +16,8 @@ class XDUserTest extends \PHPUnit_Framework_TestCase const CENTER_DIRECTOR_USER_NAME = 'centerdirector'; const CENTER_DIRECTOR_ACL_NAME = 'cd'; - const PROGRAM_OFFICER_USER_NAME = 'programofficer'; - const PROGRAM_OFFICER_ACL_NAME = 'po'; + + const PRINCIPAL_INVESTIGTOR_ACL_NAME = 'pi'; public function testGetPublicUser() { @@ -35,7 +35,7 @@ public function testPublicUserIsPublicUser() public function testNonPublicUserIsNotPublicUser() { - $user = XDUser::getUserByUserName(self::PROGRAM_OFFICER_USER_NAME); + $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $this->assertFalse($user->isPublicUser()); } @@ -61,7 +61,7 @@ public function testGetTokenAsPublic() public function testGetTokenAsNonPublic() { - $user = XDUser::getUserByUserName(self::PROGRAM_OFFICER_USER_NAME); + $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $token = $user->getToken(); $this->assertNotEquals('', $token); } @@ -75,7 +75,7 @@ public function testGetTokenExpirationAsPublic() public function testGetTokenExpirationAsNonPublic() { - $user = XDUser::getUserByUserName(self::PROGRAM_OFFICER_USER_NAME); + $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $expiration = $user->getTokenExpiration(); $this->assertNotEquals('', $expiration); } @@ -124,7 +124,7 @@ public function testSetInstitution() $originalInstitution = $user->getInstitution(); $this->assertTrue($originalInstitution !== null); - $this->assertNotEquals('-1', $originalInstitution); + $this->assertNotEquals('0', $originalInstitution); $user->setInstitution($validInstitutionId); @@ -293,7 +293,7 @@ public function testSetAclsEmpty() public function testAddNewAcl() { - $newAcl = Acls::getAclByName(self::PROGRAM_OFFICER_ACL_NAME); + $newAcl = Acls::getAclByName(self::PRINCIPAL_INVESTIGTOR_ACL_NAME); $this->assertNotNull($newAcl); $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); @@ -367,7 +367,7 @@ public function testHasAclExists() public function testHasAclNotExists() { - $existingAcl = Acls::getAclByName(self::PROGRAM_OFFICER_ACL_NAME); + $existingAcl = Acls::getAclByName(self::PRINCIPAL_INVESTIGTOR_ACL_NAME); $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $hasAcl = $user->hasAcl($existingAcl);