BUGFIX: fixing unit tests to account for the ability for Admins to download embargoed files

This commit is contained in:
Julian Seidenberg 2012-11-21 18:34:25 +13:00
parent 1bd5d929ef
commit 841afad0da

View File

@ -41,8 +41,13 @@ class DMSEmbargoTest extends SapphireTest {
$doc->embargoIndefinitely();
$this->logInWithPermission('ADMIN');
$result = $controller->index($this->createFakeHTTPRequest($docID));
$this->assertNotEquals($doc->getFullPath(),$result,"File no longer returned (in test mode)");
$this->assertEquals($doc->getFullPath(),$result,"Admins can still download embargoed files");
$this->logInWithPermission('random-user-group');
$result = $controller->index($this->createFakeHTTPRequest($docID));
$this->assertNotEquals($doc->getFullPath(),$result,"File no longer returned (in test mode) when switching to other user group");
DMS::$dmsFolder = $oldDMSFolder;
}