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

Commit

Permalink
BUG: refs #236. Fix the tests I broke with previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmullen committed Oct 11, 2011
1 parent 6af8bf2 commit 7430b69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/controllers/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function indexAction()
{
continue;
}

$this->Item->incrementDownloadCount($item);
if(isset($tmp[1]))
{
Expand Down
2 changes: 1 addition & 1 deletion core/tests/controllers/UploadDownloadControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function testDownloadBitstream()
{
$usersFile = $this->loadData('User', 'default');
$userDao = $this->User->load($usersFile[0]->getKey());
$actualMd5 = md5_file(BASE_PATH.'/tmp/misc/httpupload.png');
$actualMd5 = md5_file(BASE_PATH.'/tmp/misc/testing_file.png');

$search = $this->Item->getItemsFromSearch('search.png', $userDao);
$this->assertTrue(count($search) > 0);
Expand Down
8 changes: 4 additions & 4 deletions modules/api/tests/controllers/ApiCallMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ public function testUpload()
$this->_assertStatusOk($resp);
$token = $resp->data->token;
$this->assertTrue(
preg_match('/^'.$usersFile[0]->getKey().'\/'.$itemsFile[1]->getKey().'\/.+\.tmp$/', $token) > 0,
'Upload token is not of the form <userid>/<itemid>/*.tmp');
preg_match('/^'.$usersFile[0]->getKey().'\/'.$itemsFile[1]->getKey().'\/.+\..+$/', $token) > 0,
'Upload token ('.$token.') is not of the form <userid>/<itemid>/*.*');
$this->assertTrue(file_exists(BASE_PATH.'/tmp/misc/'.$token),
"Token placeholder file $token was not created in the temp dir");
'Token placeholder file '.$token.' was not created in the temp dir');

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

$this->_assertStatusOk($resp);

$this->assertTrue(file_exists($assetstoreFile), 'File was not written to the assetstore');
$this->assertEquals(filesize($assetstoreFile), $length, 'Assetstore file is the wrong length: '.filesize($assetstoreFile));
$this->assertEquals(md5_file($assetstoreFile), $md5, 'Assetstore file had incorrect checksum');
Expand Down

0 comments on commit 7430b69

Please sign in to comment.