mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-26 12:39:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
|
||||
use Symfony\Component\Finder\Comparator\DateComparator;
|
||||
use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
|
||||
|
||||
class DateRangeFilterIteratorTest extends RealIteratorTestCase
|
||||
{
|
||||
|
||||
@@ -19,9 +19,9 @@ abstract class IteratorTestCase extends TestCase
|
||||
{
|
||||
// set iterator_to_array $use_key to false to avoid values merge
|
||||
// this made FinderTest::testAppendWithAnArray() fail with GnuFinderAdapter
|
||||
$values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false));
|
||||
$values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', \DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false));
|
||||
|
||||
$expected = array_map(function ($path) { return str_replace('/', DIRECTORY_SEPARATOR, $path); }, $expected);
|
||||
$expected = array_map(function ($path) { return str_replace('/', \DIRECTORY_SEPARATOR, $path); }, $expected);
|
||||
|
||||
sort($values);
|
||||
sort($expected);
|
||||
@@ -52,7 +52,7 @@ abstract class IteratorTestCase extends TestCase
|
||||
|
||||
foreach ($expected as $subarray) {
|
||||
$temp = array();
|
||||
while (count($values) && count($temp) < count($subarray)) {
|
||||
while (\count($values) && \count($temp) < \count($subarray)) {
|
||||
$temp[] = array_shift($values);
|
||||
}
|
||||
sort($temp);
|
||||
|
||||
@@ -25,9 +25,9 @@ class MockSplFileInfo extends \SplFileInfo
|
||||
|
||||
public function __construct($param)
|
||||
{
|
||||
if (is_string($param)) {
|
||||
if (\is_string($param)) {
|
||||
parent::__construct($param);
|
||||
} elseif (is_array($param)) {
|
||||
} elseif (\is_array($param)) {
|
||||
$defaults = array(
|
||||
'name' => 'file.txt',
|
||||
'contents' => null,
|
||||
@@ -92,7 +92,7 @@ class MockSplFileInfo extends \SplFileInfo
|
||||
|
||||
public function setType($type)
|
||||
{
|
||||
if (is_string($type)) {
|
||||
if (\is_string($type)) {
|
||||
switch ($type) {
|
||||
case 'directory':
|
||||
case 'd':
|
||||
|
||||
@@ -31,37 +31,37 @@ class PathFilterIteratorTest extends IteratorTestCase
|
||||
//PATH: A/B/C/abc.dat
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'abc.dat',
|
||||
'relativePathname' => 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat',
|
||||
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
||||
));
|
||||
|
||||
//PATH: A/B/ab.dat
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'ab.dat',
|
||||
'relativePathname' => 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat',
|
||||
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
||||
));
|
||||
|
||||
//PATH: A/a.dat
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'a.dat',
|
||||
'relativePathname' => 'A'.DIRECTORY_SEPARATOR.'a.dat',
|
||||
'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'a.dat',
|
||||
));
|
||||
|
||||
//PATH: copy/A/B/C/abc.dat.copy
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'abc.dat.copy',
|
||||
'relativePathname' => 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat',
|
||||
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
|
||||
));
|
||||
|
||||
//PATH: copy/A/B/ab.dat.copy
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'ab.dat.copy',
|
||||
'relativePathname' => 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat',
|
||||
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
|
||||
));
|
||||
|
||||
//PATH: copy/A/a.dat.copy
|
||||
$inner[] = new MockSplFileInfo(array(
|
||||
'name' => 'a.dat.copy',
|
||||
'relativePathname' => 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'a.dat',
|
||||
'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'a.dat',
|
||||
));
|
||||
|
||||
return array(
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
|
||||
self::$files = array(
|
||||
'.git/',
|
||||
@@ -44,7 +44,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
}
|
||||
|
||||
foreach (self::$files as $file) {
|
||||
if (DIRECTORY_SEPARATOR === $file[strlen($file) - 1]) {
|
||||
if (\DIRECTORY_SEPARATOR === $file[\strlen($file) - 1]) {
|
||||
mkdir($file);
|
||||
} else {
|
||||
touch($file);
|
||||
@@ -84,24 +84,24 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
* Without the call to setUpBeforeClass() property can be null.
|
||||
*/
|
||||
if (!self::$tmpDir) {
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
|
||||
}
|
||||
|
||||
if (is_array($files)) {
|
||||
if (\is_array($files)) {
|
||||
$f = array();
|
||||
foreach ($files as $file) {
|
||||
if (is_array($file)) {
|
||||
if (\is_array($file)) {
|
||||
$f[] = self::toAbsolute($file);
|
||||
} else {
|
||||
$f[] = self::$tmpDir.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $file);
|
||||
$f[] = self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $file);
|
||||
}
|
||||
}
|
||||
|
||||
return $f;
|
||||
}
|
||||
|
||||
if (is_string($files)) {
|
||||
return self::$tmpDir.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $files);
|
||||
if (\is_string($files)) {
|
||||
return self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $files);
|
||||
}
|
||||
|
||||
return self::$tmpDir;
|
||||
@@ -111,7 +111,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase
|
||||
{
|
||||
$f = array();
|
||||
foreach ($files as $file) {
|
||||
$f[] = realpath(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.$file);
|
||||
$f[] = realpath(__DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.$file);
|
||||
}
|
||||
|
||||
return $f;
|
||||
|
||||
@@ -43,8 +43,8 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase
|
||||
}
|
||||
|
||||
$contains = array(
|
||||
'ftp://speedtest.tele2.net'.DIRECTORY_SEPARATOR.'1000GB.zip',
|
||||
'ftp://speedtest.tele2.net'.DIRECTORY_SEPARATOR.'100GB.zip',
|
||||
'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'1000GB.zip',
|
||||
'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'100GB.zip',
|
||||
);
|
||||
$actual = array();
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
|
||||
use Symfony\Component\Finder\Comparator\NumberComparator;
|
||||
use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
|
||||
|
||||
class SizeRangeFilterIteratorTest extends RealIteratorTestCase
|
||||
{
|
||||
|
||||
@@ -30,10 +30,10 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||
*/
|
||||
public function testAccept($mode, $expected)
|
||||
{
|
||||
if (!is_callable($mode)) {
|
||||
if (!\is_callable($mode)) {
|
||||
switch ($mode) {
|
||||
case SortableIterator::SORT_BY_ACCESSED_TIME:
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
touch(self::toAbsolute('.git'));
|
||||
} else {
|
||||
file_get_contents(self::toAbsolute('.git'));
|
||||
@@ -62,7 +62,7 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||
|| SortableIterator::SORT_BY_CHANGED_TIME === $mode
|
||||
|| SortableIterator::SORT_BY_MODIFIED_TIME === $mode
|
||||
) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR && SortableIterator::SORT_BY_MODIFIED_TIME !== $mode) {
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && SortableIterator::SORT_BY_MODIFIED_TIME !== $mode) {
|
||||
$this->markTestSkipped('Sorting by atime or ctime is not supported on Windows');
|
||||
}
|
||||
$this->assertOrderedIteratorForGroups($expected, $iterator);
|
||||
|
||||
Reference in New Issue
Block a user