diff --git a/src/Intervention/Image/File.php b/src/Intervention/Image/File.php index b1dd26aa..cf15da0b 100644 --- a/src/Intervention/Image/File.php +++ b/src/Intervention/Image/File.php @@ -75,4 +75,18 @@ class File return false; } + /** + * Get fully qualified path + * + * @return string + */ + public function basePath() + { + if ($this->dirname && $this->basename) { + return ($this->dirname .'/'. $this->basename); + } + + return null; + } + } diff --git a/src/Intervention/Image/Image.php b/src/Intervention/Image/Image.php index c24c41d7..4c8e690e 100644 --- a/src/Intervention/Image/Image.php +++ b/src/Intervention/Image/Image.php @@ -343,20 +343,6 @@ class Image extends File return $this->mime; } - /** - * Get fully qualified path to image - * - * @return string - */ - public function basePath() - { - if ($this->dirname && $this->basename) { - return ($this->dirname .'/'. $this->basename); - } - - return null; - } - /** * Returns encoded image data in string conversion * diff --git a/tests/FileTest.php b/tests/FileTest.php index d9fc15d9..d79d6497 100644 --- a/tests/FileTest.php +++ b/tests/FileTest.php @@ -14,4 +14,14 @@ class FileTest extends PHPUnit_Framework_TestCase $this->assertEquals('test', $file->filename); $this->assertEquals('image/jpeg', $file->mime); } + + public function testBasePath() + { + $file = new File; + $this->assertNull(null, $file->basePath()); + + $file->dirname = 'foo'; + $file->basename = 'bar'; + $this->assertEquals('foo/bar', $file->basePath()); + } } diff --git a/tests/ImageTest.php b/tests/ImageTest.php index 752b0cc6..245d4df9 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -66,12 +66,6 @@ class ImageTest extends PHPUnit_Framework_TestCase $this->assertEquals('image/png', $image->mime()); } - public function testBasePath() - { - $image = $this->getTestImage(); - $this->assertEquals('./tmp/foo.png', $image->basePath()); - } - /** * @expectedException \Intervention\Image\Exception\RuntimeException */