From 841afad0da992f25b88fed6cb0188570ba1d1bf0 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 21 Nov 2012 18:34:25 +1300 Subject: [PATCH] BUGFIX: fixing unit tests to account for the ability for Admins to download embargoed files --- tests/DMSEmbargoTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/DMSEmbargoTest.php b/tests/DMSEmbargoTest.php index 9432c8e..9c47935 100644 --- a/tests/DMSEmbargoTest.php +++ b/tests/DMSEmbargoTest.php @@ -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; }