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

Commit 82c554a

Browse files
committed
ENH: refs #236. Use the assetstore path from the database rather than hardcode
1 parent ea4c1d0 commit 82c554a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/api/tests/controllers/ApiCallMethodsTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function setUp()
1919
$this->setupDatabase(array('default')); //core dataset
2020
$this->setupDatabase(array('default'), 'api'); // module dataset
2121
$this->enabledModules = array('api');
22-
$this->_models = array('User', 'Folder', 'Item', 'ItemRevision');
22+
$this->_models = array('User', 'Folder', 'Item', 'ItemRevision', 'Assetstore');
2323
$this->_daos = array('User', 'Folder', 'Item');
2424

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

0 commit comments

Comments
 (0)