summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controller/File.php6
-rw-r--r--app/Core/ObjectStorage/FileStorage.php2
-rw-r--r--app/Core/ObjectStorage/ObjectStorageInterface.php2
-rw-r--r--tests/units/Model/FileTest.php10
4 files changed, 14 insertions, 6 deletions
diff --git a/app/Controller/File.php b/app/Controller/File.php
index 1431372f..ef90c55a 100644
--- a/app/Controller/File.php
+++ b/app/Controller/File.php
@@ -86,7 +86,7 @@ class File extends Base
}
$this->response->forceDownload($file['name']);
- $this->objectStorage->passthru($file['path']);
+ $this->objectStorage->output($file['path']);
}
catch (ObjectStorageException $e) {
$this->logger->error($e->getMessage());
@@ -128,7 +128,7 @@ class File extends Base
}
$this->response->contentType($this->file->getImageMimeType($file['name']));
- $this->objectStorage->passthru($file['path']);
+ $this->objectStorage->output($file['path']);
}
catch (ObjectStorageException $e) {
$this->logger->error($e->getMessage());
@@ -152,7 +152,7 @@ class File extends Base
}
$this->response->contentType('image/jpeg');
- $this->objectStorage->passthru($this->file->getThumbnailPath($file['path']));
+ $this->objectStorage->output($this->file->getThumbnailPath($file['path']));
}
catch (ObjectStorageException $e) {
$this->logger->error($e->getMessage());
diff --git a/app/Core/ObjectStorage/FileStorage.php b/app/Core/ObjectStorage/FileStorage.php
index 96478c3a..fa1efe21 100644
--- a/app/Core/ObjectStorage/FileStorage.php
+++ b/app/Core/ObjectStorage/FileStorage.php
@@ -70,7 +70,7 @@ class FileStorage implements ObjectStorageInterface
* @access public
* @param string $key
*/
- public function passthru($key)
+ public function output($key)
{
$filename = $this->path.DIRECTORY_SEPARATOR.$key;
diff --git a/app/Core/ObjectStorage/ObjectStorageInterface.php b/app/Core/ObjectStorage/ObjectStorageInterface.php
index 5440cf2b..180bdf86 100644
--- a/app/Core/ObjectStorage/ObjectStorageInterface.php
+++ b/app/Core/ObjectStorage/ObjectStorageInterface.php
@@ -35,7 +35,7 @@ interface ObjectStorageInterface
* @access public
* @param string $key
*/
- public function passthru($key);
+ public function output($key);
/**
* Move local file to object storage
diff --git a/tests/units/Model/FileTest.php b/tests/units/Model/FileTest.php
index e7520c89..d1ad7248 100644
--- a/tests/units/Model/FileTest.php
+++ b/tests/units/Model/FileTest.php
@@ -227,7 +227,7 @@ class FileTest extends Base
->expects($this->at(1))
->method('remove')
->with(
- $this->equalTo('/tmp/foo1')
+ $this->equalTo('thumbnails//tmp/foo2')
)
->will($this->returnValue(true));
@@ -235,6 +235,14 @@ class FileTest extends Base
->expects($this->at(2))
->method('remove')
->with(
+ $this->equalTo('/tmp/foo1')
+ )
+ ->will($this->returnValue(true));
+
+ $this->container['objectStorage']
+ ->expects($this->at(3))
+ ->method('remove')
+ ->with(
$this->equalTo('/tmp/foo3')
)
->will($this->returnValue(true));