mirror of
https://github.com/danog/file.git
synced 2024-11-26 11:54:54 +01:00
Fix failing testMkdirRmdir
This commit is contained in:
parent
e6f3661e62
commit
7a96e10a35
@ -20,7 +20,7 @@ abstract class DriverTest extends TestCase {
|
||||
public function testScandir() {
|
||||
$this->execute(function () {
|
||||
$fixtureDir = Fixture::path();
|
||||
$actual = (yield File\scandir($fixtureDir));
|
||||
$actual = yield File\scandir($fixtureDir);
|
||||
$expected = ["dir", "small.txt"];
|
||||
$this->assertSame($expected, $actual);
|
||||
});
|
||||
@ -101,6 +101,13 @@ abstract class DriverTest extends TestCase {
|
||||
});
|
||||
}
|
||||
|
||||
public function testGet() {
|
||||
$this->execute(function () {
|
||||
$fixtureDir = Fixture::path();
|
||||
$this->assertSame("small", yield File\get("{$fixtureDir}/small.txt"));
|
||||
});
|
||||
}
|
||||
|
||||
public function testSize() {
|
||||
$this->execute(function () {
|
||||
$fixtureDir = Fixture::path();
|
||||
@ -219,7 +226,7 @@ abstract class DriverTest extends TestCase {
|
||||
|
||||
yield File\mkdir($dir);
|
||||
$stat = yield File\stat($dir);
|
||||
$this->assertTrue(($stat["mode"] & 0777) === 0644);
|
||||
$this->assertSame(0644, $stat["mode"] & 0777);
|
||||
yield File\rmdir($dir);
|
||||
$this->assertNull(yield File\stat($dir));
|
||||
|
||||
@ -227,7 +234,7 @@ abstract class DriverTest extends TestCase {
|
||||
|
||||
yield File\mkdir($dir, 0764, true); // the umask is 022 by default
|
||||
$stat = yield File\stat($dir);
|
||||
$this->assertTrue(($stat["mode"] & 0777) == 0744);
|
||||
$this->assertSame(0764, $stat["mode"] & 0777);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user