mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 16:44:07 +02:00
fix file name casing
This commit is contained in:
parent
8b563b4226
commit
f1d138eddd
2 changed files with 9 additions and 9 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Icewind\Streams\Tests;
|
namespace Icewind\Streams\Tests;
|
||||||
|
|
||||||
class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
class UrlCallback extends \PHPUnit_Framework_TestCase {
|
||||||
protected $tempDirs = array();
|
protected $tempDirs = array();
|
||||||
|
|
||||||
protected function getTempDir() {
|
protected function getTempDir() {
|
||||||
|
|
@ -45,7 +45,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
$callback = function () use (&$called) {
|
$callback = function () use (&$called) {
|
||||||
$called = true;
|
$called = true;
|
||||||
};
|
};
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap('php://temp', $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap('php://temp', $callback);
|
||||||
$fh = fopen($path, 'r');
|
$fh = fopen($path, 'r');
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
|
|
@ -56,7 +56,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
$callback = function () use (&$called) {
|
$callback = function () use (&$called) {
|
||||||
$called = true;
|
$called = true;
|
||||||
};
|
};
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($this->getTempDir(), null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($this->getTempDir(), null, $callback);
|
||||||
$fh = opendir($path);
|
$fh = opendir($path);
|
||||||
closedir($fh);
|
closedir($fh);
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
|
|
@ -68,7 +68,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
$called = true;
|
$called = true;
|
||||||
};
|
};
|
||||||
$dir = $this->getTempDir() . '/test';
|
$dir = $this->getTempDir() . '/test';
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($dir, null, null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($dir, null, null, $callback);
|
||||||
mkdir($path);
|
mkdir($path);
|
||||||
$this->assertTrue(file_exists($dir));
|
$this->assertTrue(file_exists($dir));
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
|
|
@ -81,7 +81,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
};
|
};
|
||||||
$dir = $this->getTempDir() . '/test';
|
$dir = $this->getTempDir() . '/test';
|
||||||
mkdir($dir);
|
mkdir($dir);
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($dir, null, null, null, null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($dir, null, null, null, null, $callback);
|
||||||
rmdir($path);
|
rmdir($path);
|
||||||
$this->assertFalse(file_exists($dir));
|
$this->assertFalse(file_exists($dir));
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
|
|
@ -94,7 +94,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
};
|
};
|
||||||
$source = $this->getTempDir() . '/test';
|
$source = $this->getTempDir() . '/test';
|
||||||
touch($source);
|
touch($source);
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($source, null, null, null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($source, null, null, null, $callback);
|
||||||
$target = $path->wrapPath($source . '_rename');
|
$target = $path->wrapPath($source . '_rename');
|
||||||
rename($path, $target);
|
rename($path, $target);
|
||||||
$this->assertTrue(file_exists($source . '_rename'));
|
$this->assertTrue(file_exists($source . '_rename'));
|
||||||
|
|
@ -108,7 +108,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
};
|
};
|
||||||
$file = $this->getTempDir() . '/test';
|
$file = $this->getTempDir() . '/test';
|
||||||
touch($file);
|
touch($file);
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($file, null, null, null, null, null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($file, null, null, null, null, null, $callback);
|
||||||
unlink($path);
|
unlink($path);
|
||||||
$this->assertFalse(file_exists($file));
|
$this->assertFalse(file_exists($file));
|
||||||
$this->assertTrue($called);
|
$this->assertTrue($called);
|
||||||
|
|
@ -121,7 +121,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
};
|
};
|
||||||
$file = $this->getTempDir() . '/test';
|
$file = $this->getTempDir() . '/test';
|
||||||
touch($file);
|
touch($file);
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($file, null, null, null, null, null, null, $callback);
|
$path = \Icewind\Streams\UrlCallback::wrap($file, null, null, null, null, null, null, $callback);
|
||||||
try {
|
try {
|
||||||
stat($path);
|
stat($path);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
@ -132,7 +132,7 @@ class UrlCallBack extends \PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
public function testMKDirRecursive() {
|
public function testMKDirRecursive() {
|
||||||
$dir = $this->getTempDir() . '/test/sad';
|
$dir = $this->getTempDir() . '/test/sad';
|
||||||
$path = \Icewind\Streams\UrlCallBack::wrap($dir);
|
$path = \Icewind\Streams\UrlCallback::wrap($dir);
|
||||||
mkdir($path, 0700, true);
|
mkdir($path, 0700, true);
|
||||||
$this->assertTrue(file_exists($dir));
|
$this->assertTrue(file_exists($dir));
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue