Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 7430b69

Browse files
committed
BUG: refs #236. Fix the tests I broke with previous commit
1 parent 6af8bf2 commit 7430b69

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

core/controllers/DownloadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function indexAction()
7878
{
7979
continue;
8080
}
81-
81+
8282
$this->Item->incrementDownloadCount($item);
8383
if(isset($tmp[1]))
8484
{

core/tests/controllers/UploadDownloadControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function testDownloadBitstream()
192192
{
193193
$usersFile = $this->loadData('User', 'default');
194194
$userDao = $this->User->load($usersFile[0]->getKey());
195-
$actualMd5 = md5_file(BASE_PATH.'/tmp/misc/httpupload.png');
195+
$actualMd5 = md5_file(BASE_PATH.'/tmp/misc/testing_file.png');
196196

197197
$search = $this->Item->getItemsFromSearch('search.png', $userDao);
198198
$this->assertTrue(count($search) > 0);

modules/api/tests/controllers/ApiCallMethodsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ public function testUpload()
285285
$this->_assertStatusOk($resp);
286286
$token = $resp->data->token;
287287
$this->assertTrue(
288-
preg_match('/^'.$usersFile[0]->getKey().'\/'.$itemsFile[1]->getKey().'\/.+\.tmp$/', $token) > 0,
289-
'Upload token is not of the form <userid>/<itemid>/*.tmp');
288+
preg_match('/^'.$usersFile[0]->getKey().'\/'.$itemsFile[1]->getKey().'\/.+\..+$/', $token) > 0,
289+
'Upload token ('.$token.') is not of the form <userid>/<itemid>/*.*');
290290
$this->assertTrue(file_exists(BASE_PATH.'/tmp/misc/'.$token),
291-
"Token placeholder file $token was not created in the temp dir");
291+
'Token placeholder file '.$token.' was not created in the temp dir');
292292

293293
//now upload using our token
294294
$this->resetAll();
@@ -320,7 +320,7 @@ public function testUpload()
320320
unlink(BASE_PATH.'/tmp/misc/test.txt');
321321

322322
$this->_assertStatusOk($resp);
323-
323+
324324
$this->assertTrue(file_exists($assetstoreFile), 'File was not written to the assetstore');
325325
$this->assertEquals(filesize($assetstoreFile), $length, 'Assetstore file is the wrong length: '.filesize($assetstoreFile));
326326
$this->assertEquals(md5_file($assetstoreFile), $md5, 'Assetstore file had incorrect checksum');

0 commit comments

Comments
 (0)