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

Commit

Permalink
ENH: refs #236. Use the assetstore path from the database rather than…
Browse files Browse the repository at this point in the history
… hardcode
  • Loading branch information
zachmullen committed Oct 12, 2011
1 parent ea4c1d0 commit 82c554a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/api/tests/controllers/ApiCallMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function setUp()
$this->setupDatabase(array('default')); //core dataset
$this->setupDatabase(array('default'), 'api'); // module dataset
$this->enabledModules = array('api');
$this->_models = array('User', 'Folder', 'Item', 'ItemRevision');
$this->_models = array('User', 'Folder', 'Item', 'ItemRevision', 'Assetstore');
$this->_daos = array('User', 'Folder', 'Item');

parent::setUp();
Expand Down Expand Up @@ -285,7 +285,9 @@ public function testUpload()
fwrite($fh, $string);
fclose($fh);
$md5 = md5($string);
$assetstoreFile = BASE_PATH.'/data/assetstore/'.substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.$md5;
$assetstores = $this->Assetstore->getAll();
$this->assertTrue(count($assetstores) > 0, 'There are no assetstores defined in the database');
$assetstoreFile = $assetstores[0]->getPath().'/'.substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.$md5;
if(file_exists($assetstoreFile))
{
unlink($assetstoreFile);
Expand Down

0 comments on commit 82c554a

Please sign in to comment.