|
@@ 44-67 (lines=24) @@
|
| 41 |
|
/** |
| 42 |
|
* @covers \Kint\Object\Representation\SplFileInfoRepresentation::__construct |
| 43 |
|
*/ |
| 44 |
|
public function testConstructFile() |
| 45 |
|
{ |
| 46 |
|
$r = new SplFileInfoRepresentation(new SplFileInfo(__FILE__)); |
| 47 |
|
|
| 48 |
|
$this->assertSame(filesize(__FILE__), $r->size); |
| 49 |
|
$this->assertSame(filectime(__FILE__), $r->ctime); |
| 50 |
|
$this->assertSame(filemtime(__FILE__), $r->mtime); |
| 51 |
|
$this->assertSame(fileperms(__FILE__), $r->perms); |
| 52 |
|
$this->assertSame(fileowner(__FILE__), $r->owner); |
| 53 |
|
$this->assertSame(filegroup(__FILE__), $r->group); |
| 54 |
|
$this->assertSame('File', $r->typename); |
| 55 |
|
$this->assertSame('-', $r->typeflag); |
| 56 |
|
$this->assertSame(__FILE__, $r->path); |
| 57 |
|
$this->assertSame(__FILE__, $r->realpath); |
| 58 |
|
$this->assertNull($r->linktarget); |
| 59 |
|
|
| 60 |
|
if (filetype(__FILE__) === 'file') { |
| 61 |
|
$this->assertTrue($r->is_file); |
| 62 |
|
$this->assertFalse($r->is_dir); |
| 63 |
|
$this->assertFalse($r->is_link); |
| 64 |
|
} else { |
| 65 |
|
throw new UnexpectedValueException(__FILE__.' type is not "file"'); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** |
| 70 |
|
* @covers \Kint\Object\Representation\SplFileInfoRepresentation::__construct |
|
@@ 132-155 (lines=24) @@
|
| 129 |
|
/** |
| 130 |
|
* @covers \Kint\Object\Representation\SplFileInfoRepresentation::__construct |
| 131 |
|
*/ |
| 132 |
|
public function testConstructDir() |
| 133 |
|
{ |
| 134 |
|
$r = new SplFileInfoRepresentation(new SplFileInfo(__DIR__)); |
| 135 |
|
|
| 136 |
|
$this->assertSame(filesize(__DIR__), $r->size); |
| 137 |
|
$this->assertSame(filectime(__DIR__), $r->ctime); |
| 138 |
|
$this->assertSame(filemtime(__DIR__), $r->mtime); |
| 139 |
|
$this->assertSame(fileperms(__DIR__), $r->perms); |
| 140 |
|
$this->assertSame(fileowner(__DIR__), $r->owner); |
| 141 |
|
$this->assertSame(filegroup(__DIR__), $r->group); |
| 142 |
|
$this->assertSame('Directory', $r->typename); |
| 143 |
|
$this->assertSame('d', $r->typeflag); |
| 144 |
|
$this->assertSame(__DIR__, $r->path); |
| 145 |
|
$this->assertSame(__DIR__, $r->realpath); |
| 146 |
|
$this->assertNull($r->linktarget); |
| 147 |
|
|
| 148 |
|
if (filetype(__DIR__) === 'dir') { |
| 149 |
|
$this->assertFalse($r->is_file); |
| 150 |
|
$this->assertTrue($r->is_dir); |
| 151 |
|
$this->assertFalse($r->is_link); |
| 152 |
|
} else { |
| 153 |
|
throw new UnexpectedValueException(__DIR__.' type is not "dir"'); |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
/** |
| 158 |
|
* @covers \Kint\Object\Representation\SplFileInfoRepresentation::__construct |