forked from Intervention/image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileTest.php
More file actions
27 lines (23 loc) · 770 Bytes
/
FileTest.php
File metadata and controls
27 lines (23 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
use Intervention\Image\File;
class FileTest extends PHPUnit_Framework_TestCase
{
public function testSetFileInfoFromPath()
{
$file = new File;
$file->setFileInfoFromPath('tests/images/test.jpg');
$this->assertEquals('tests/images', $file->dirname);
$this->assertEquals('test.jpg', $file->basename);
$this->assertEquals('jpg', $file->extension);
$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());
}
}