mirror of https://github.com/adlawson/php-vfs.git
Bitwise `&` rather than `|` node stat types
We need all the bits to pass simple tests like `is_dir` and `is_file`. Fiexes #9.
This commit is contained in:
parent
64ad3204fb
commit
c937b5a286
|
@ -30,7 +30,7 @@ class Directory implements NodeContainerInterface
|
|||
*/
|
||||
public function __construct(array $nodes = [])
|
||||
{
|
||||
$this->mode = self::TYPE_BLOCK | self::TYPE_DIR;
|
||||
$this->mode = self::TYPE_BLOCK & self::TYPE_DIR;
|
||||
|
||||
$this->dateAccessed = new DateTime();
|
||||
$this->dateCreated = new DateTime();
|
||||
|
|
|
@ -25,7 +25,7 @@ class File implements FileInterface
|
|||
public function __construct($content = '')
|
||||
{
|
||||
$this->content = (string) $content;
|
||||
$this->mode = self::TYPE_BLOCK | self::TYPE_FILE;
|
||||
$this->mode = self::TYPE_BLOCK & self::TYPE_FILE;
|
||||
|
||||
$this->dateAccessed = new DateTime();
|
||||
$this->dateCreated = new DateTime();
|
||||
|
|
|
@ -120,7 +120,7 @@ class DirectoryTest extends UnitTestCase
|
|||
{
|
||||
$dir = new Directory();
|
||||
|
||||
$this->assertEquals(0170000 | 0040000, $dir->getMode());
|
||||
$this->assertEquals(0170000 & 0040000, $dir->getMode());
|
||||
}
|
||||
|
||||
public function testGetSize()
|
||||
|
|
|
@ -61,7 +61,7 @@ class FileTest extends UnitTestCase
|
|||
{
|
||||
$file = new File();
|
||||
|
||||
$this->assertEquals(0170000 | 0100000, $file->getMode());
|
||||
$this->assertEquals(0170000 & 0100000, $file->getMode());
|
||||
}
|
||||
|
||||
public function testGetSize()
|
||||
|
|
Loading…
Reference in New Issue