mirror of
https://github.com/Intervention/image.git
synced 2025-08-09 15:26:38 +02:00
fixed basePath()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
*
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user