Skip to content

Commit

Permalink
Updating XDUserTest to utilize pi
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ryanrath committed Jun 28, 2017
1 parent 95706ea commit 8113599
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions open_xdmod/modules/xdmod/integration_tests/lib/XDUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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());
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8113599

Please sign in to comment.