mirror of
https://github.com/danog/file.git
synced 2024-11-29 20:09:10 +01:00
Tabs <3 ? (Use spaces instead)
This commit is contained in:
parent
534f67f7ef
commit
2712356453
@ -7,7 +7,7 @@ use Amp\File as file;
|
|||||||
|
|
||||||
abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
||||||
private static $fixtureId;
|
private static $fixtureId;
|
||||||
private static $umask;
|
private static $umask;
|
||||||
|
|
||||||
private static function getFixturePath() {
|
private static function getFixturePath() {
|
||||||
if (empty(self::$fixtureId)) {
|
if (empty(self::$fixtureId)) {
|
||||||
@ -34,7 +34,7 @@ abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
|
|
||||||
self::clearFixtureDir();
|
self::clearFixtureDir();
|
||||||
self::$umask = umask(0022);
|
self::$umask = umask(0022);
|
||||||
|
|
||||||
if (!\mkdir($fixtureDir, $mode = 0777, $recursive = true)) {
|
if (!\mkdir($fixtureDir, $mode = 0777, $recursive = true)) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
@ -55,7 +55,7 @@ abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
public static function tearDownAfterClass() {
|
public static function tearDownAfterClass() {
|
||||||
self::clearFixtureDir();
|
self::clearFixtureDir();
|
||||||
umask(self::$umask);
|
umask(self::$umask);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
@ -265,10 +265,10 @@ abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
|||||||
amp\run(function () {
|
amp\run(function () {
|
||||||
$fixtureDir = self::getFixturePath();
|
$fixtureDir = self::getFixturePath();
|
||||||
$toUnlink = "{$fixtureDir}/unlink";
|
$toUnlink = "{$fixtureDir}/unlink";
|
||||||
$mask = umask(062);
|
$mask = umask(062);
|
||||||
yield file\put($toUnlink, "unlink me");
|
yield file\put($toUnlink, "unlink me");
|
||||||
umask($mask);
|
umask($mask);
|
||||||
$stat = (yield file\stat($toUnlink));
|
$stat = (yield file\stat($toUnlink));
|
||||||
$this->assertTrue(($stat["mode"] & 0777) == 0604);
|
$this->assertTrue(($stat["mode"] & 0777) == 0604);
|
||||||
yield file\unlink($toUnlink);
|
yield file\unlink($toUnlink);
|
||||||
$this->assertNull(yield file\stat($toUnlink));
|
$this->assertNull(yield file\stat($toUnlink));
|
||||||
@ -282,7 +282,7 @@ abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$dir = "{$fixtureDir}/newdir";
|
$dir = "{$fixtureDir}/newdir";
|
||||||
|
|
||||||
yield file\mkdir($dir);
|
yield file\mkdir($dir);
|
||||||
$stat = (yield file\stat($dir));
|
$stat = (yield file\stat($dir));
|
||||||
$this->assertTrue(($stat["mode"] & 0777) == 0644);
|
$this->assertTrue(($stat["mode"] & 0777) == 0644);
|
||||||
yield file\rmdir($dir);
|
yield file\rmdir($dir);
|
||||||
$this->assertNull(yield file\stat($dir));
|
$this->assertNull(yield file\stat($dir));
|
||||||
@ -290,8 +290,8 @@ abstract class DriverTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$dir = "{$fixtureDir}/newdir/with/recursive/creation";
|
$dir = "{$fixtureDir}/newdir/with/recursive/creation";
|
||||||
|
|
||||||
yield file\mkdir($dir, 0764, true); // the umask is 022 by default
|
yield file\mkdir($dir, 0764, true); // the umask is 022 by default
|
||||||
$stat = (yield file\stat($dir));
|
$stat = (yield file\stat($dir));
|
||||||
$this->assertTrue(($stat["mode"] & 0777) == 0744);
|
$this->assertTrue(($stat["mode"] & 0777) == 0744);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user