From fd1698d786a7bfe6177e354145b0cdc857e8b1be Mon Sep 17 00:00:00 2001 From: Toni Uebernickel Date: Mon, 16 Sep 2013 11:29:29 +0200 Subject: [PATCH] fix missing filename in exception --- Imagine/Data/Loader/FileSystemLoader.php | 2 +- Tests/Imagine/Data/Loader/FileSystemLoaderTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Imagine/Data/Loader/FileSystemLoader.php b/Imagine/Data/Loader/FileSystemLoader.php index aebf34e19..e6ec344d9 100644 --- a/Imagine/Data/Loader/FileSystemLoader.php +++ b/Imagine/Data/Loader/FileSystemLoader.php @@ -88,7 +88,7 @@ public function find($path) if (!empty($targetFormat) && is_file($name)) { $absolutePath = $name; } else { - throw new NotFoundHttpException(sprintf('Source image not found in "%s"', $absolutePath)); + throw new NotFoundHttpException(sprintf('Source image not found in "%s"', $file)); } } } diff --git a/Tests/Imagine/Data/Loader/FileSystemLoaderTest.php b/Tests/Imagine/Data/Loader/FileSystemLoaderTest.php index 10260ff61..98c5073bf 100644 --- a/Tests/Imagine/Data/Loader/FileSystemLoaderTest.php +++ b/Tests/Imagine/Data/Loader/FileSystemLoaderTest.php @@ -40,7 +40,8 @@ public function testFindNotExisting() $loader = new FileSystemLoader($this->imagine, array('jpeg'), $this->tempDir); - $this->setExpectedException('Symfony\Component\HttpKernel\Exception\NotFoundHttpException'); + $file = realpath($this->tempDir).'/invalid.jpeg'; + $this->setExpectedException('Symfony\Component\HttpKernel\Exception\NotFoundHttpException', 'Source image not found in "'.$file.'"'); $loader->find('/invalid.jpeg'); }