Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
11
lib/composer/vendor/symfony/finder/CHANGELOG.md
vendored
11
lib/composer/vendor/symfony/finder/CHANGELOG.md
vendored
@@ -1,6 +1,17 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* deprecated `Symfony\Component\Finder\Iterator\FilterIterator`
|
||||
* added Finder::hasResults() method to check if any results were found
|
||||
|
||||
3.3.0
|
||||
-----
|
||||
|
||||
* added double-star matching to Glob::toRegex()
|
||||
|
||||
3.0.0
|
||||
-----
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace Symfony\Component\Finder\Comparator;
|
||||
class DateComparator extends Comparator
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $test A comparison string
|
||||
*
|
||||
* @throws \InvalidArgumentException If the test is not understood
|
||||
|
||||
@@ -35,9 +35,7 @@ namespace Symfony\Component\Finder\Comparator;
|
||||
class NumberComparator extends Comparator
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $test A comparison string
|
||||
* @param string|int $test A comparison string or an integer
|
||||
*
|
||||
* @throws \InvalidArgumentException If the test is not understood
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace Symfony\Component\Finder\Exception;
|
||||
|
||||
/**
|
||||
* @author Jean-François Simon <contact@jfsimon.fr>
|
||||
*
|
||||
* @deprecated since 3.3, to be removed in 4.0.
|
||||
*/
|
||||
interface ExceptionInterface
|
||||
{
|
||||
|
||||
79
lib/composer/vendor/symfony/finder/Finder.php
vendored
79
lib/composer/vendor/symfony/finder/Finder.php
vendored
@@ -61,9 +61,6 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
|
||||
private static $vcsPatterns = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg');
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES;
|
||||
@@ -72,7 +69,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Creates a new Finder.
|
||||
*
|
||||
* @return Finder A new Finder instance
|
||||
* @return static
|
||||
*/
|
||||
public static function create()
|
||||
{
|
||||
@@ -82,7 +79,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Restricts the matching to directories only.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function directories()
|
||||
{
|
||||
@@ -94,7 +91,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Restricts the matching to files only.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
@@ -111,9 +108,9 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
* $finder->depth('> 1') // the Finder will start matching at level 1.
|
||||
* $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
|
||||
*
|
||||
* @param int $level The depth level expression
|
||||
* @param string|int $level The depth level expression
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see DepthRangeFilterIterator
|
||||
* @see NumberComparator
|
||||
@@ -137,7 +134,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $date A date range string
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see strtotime
|
||||
* @see DateRangeFilterIterator
|
||||
@@ -161,7 +158,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp, a glob, or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@@ -177,7 +174,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp, a glob, or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@@ -198,7 +195,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (string or regexp)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilecontentFilterIterator
|
||||
*/
|
||||
@@ -219,7 +216,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (string or regexp)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilecontentFilterIterator
|
||||
*/
|
||||
@@ -242,7 +239,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@@ -265,7 +262,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@@ -283,9 +280,9 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
* $finder->size('<= 1Ki');
|
||||
* $finder->size(4);
|
||||
*
|
||||
* @param string $size A size range string
|
||||
* @param string|int $size A size range string or an integer
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SizeRangeFilterIterator
|
||||
* @see NumberComparator
|
||||
@@ -302,7 +299,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|array $dirs A directory path or an array of directories
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@@ -318,7 +315,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@@ -338,7 +335,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignoreVCS Whether to exclude VCS files or not
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@@ -376,9 +373,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @param \Closure $closure An anonymous function
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -394,7 +389,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -410,7 +405,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -428,7 +423,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -448,7 +443,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -466,7 +461,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@@ -483,9 +478,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
* The anonymous function receives a \SplFileInfo and must return false
|
||||
* to remove files.
|
||||
*
|
||||
* @param \Closure $closure An anonymous function
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see CustomFilterIterator
|
||||
*/
|
||||
@@ -499,7 +492,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Forces the following of symlinks.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function followLinks()
|
||||
{
|
||||
@@ -515,7 +508,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignore
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function ignoreUnreadableDirs($ignore = true)
|
||||
{
|
||||
@@ -529,7 +522,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|array $dirs A directory path or an array of directories
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException if one of the directories does not exist
|
||||
*/
|
||||
@@ -590,9 +583,9 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param mixed $iterator
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The finder
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException When the given argument is not iterable.
|
||||
* @throws \InvalidArgumentException when the given argument is not iterable
|
||||
*/
|
||||
public function append($iterator)
|
||||
{
|
||||
@@ -613,6 +606,20 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the any results were found.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasResults()
|
||||
{
|
||||
foreach ($this->getIterator() as $_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts all the results collected by the iterators.
|
||||
*
|
||||
|
||||
28
lib/composer/vendor/symfony/finder/Glob.php
vendored
28
lib/composer/vendor/symfony/finder/Glob.php
vendored
@@ -54,16 +54,28 @@ class Glob
|
||||
$sizeGlob = strlen($glob);
|
||||
for ($i = 0; $i < $sizeGlob; ++$i) {
|
||||
$car = $glob[$i];
|
||||
if ($firstByte) {
|
||||
if ($strictLeadingDot && '.' !== $car) {
|
||||
$regex .= '(?=[^\.])';
|
||||
}
|
||||
|
||||
$firstByte = false;
|
||||
if ($firstByte && $strictLeadingDot && '.' !== $car) {
|
||||
$regex .= '(?=[^\.])';
|
||||
}
|
||||
|
||||
if ('/' === $car) {
|
||||
$firstByte = true;
|
||||
$firstByte = '/' === $car;
|
||||
|
||||
if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) {
|
||||
$car = '[^/]++/';
|
||||
if (!isset($glob[$i + 3])) {
|
||||
$car .= '?';
|
||||
}
|
||||
|
||||
if ($strictLeadingDot) {
|
||||
$car = '(?=[^\.])'.$car;
|
||||
}
|
||||
|
||||
$car = '/(?:'.$car.')*';
|
||||
$i += 2 + isset($glob[$i + 3]);
|
||||
|
||||
if ('/' === $delimiter) {
|
||||
$car = str_replace('/', '\\/', $car);
|
||||
}
|
||||
}
|
||||
|
||||
if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
|
||||
|
||||
@@ -24,8 +24,6 @@ class CustomFilterIterator extends FilterIterator
|
||||
private $filters = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param callable[] $filters An array of PHP callbacks
|
||||
*
|
||||
|
||||
@@ -23,8 +23,6 @@ class DateRangeFilterIterator extends FilterIterator
|
||||
private $comparators = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param DateComparator[] $comparators An array of DateComparator instances
|
||||
*/
|
||||
@@ -44,7 +42,7 @@ class DateRangeFilterIterator extends FilterIterator
|
||||
{
|
||||
$fileinfo = $this->current();
|
||||
|
||||
if (!file_exists($fileinfo->getRealPath())) {
|
||||
if (!file_exists($fileinfo->getPathname())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ class DepthRangeFilterIterator extends FilterIterator
|
||||
private $minDepth = 0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \RecursiveIteratorIterator $iterator The Iterator to filter
|
||||
* @param int $minDepth The min depth
|
||||
* @param int $maxDepth The max depth
|
||||
|
||||
@@ -24,8 +24,6 @@ class ExcludeDirectoryFilterIterator extends FilterIterator implements \Recursiv
|
||||
private $excludedPattern;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param array $directories An array of directories to exclude
|
||||
*/
|
||||
|
||||
@@ -24,8 +24,6 @@ class FileTypeFilterIterator extends FilterIterator
|
||||
private $mode;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Symfony\Component\Finder\Iterator;
|
||||
* @see https://bugs.php.net/68557
|
||||
*
|
||||
* @author Alex Bogomazov
|
||||
*
|
||||
* @deprecated since 3.4, to be removed in 4.0.
|
||||
*/
|
||||
abstract class FilterIterator extends \FilterIterator
|
||||
{
|
||||
@@ -29,7 +31,7 @@ abstract class FilterIterator extends \FilterIterator
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
if (PHP_VERSION_ID > 50607 || (PHP_VERSION_ID > 50523 && PHP_VERSION_ID < 50600)) {
|
||||
if (\PHP_VERSION_ID > 50607 || (\PHP_VERSION_ID > 50523 && \PHP_VERSION_ID < 50600)) {
|
||||
parent::rewind();
|
||||
|
||||
return;
|
||||
|
||||
@@ -22,8 +22,6 @@ abstract class MultiplePcreFilterIterator extends FilterIterator
|
||||
protected $noMatchRegexps = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param array $matchPatterns An array of patterns that need to match
|
||||
* @param array $noMatchPatterns An array of patterns that need to not match
|
||||
|
||||
@@ -37,8 +37,6 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
private $directorySeparator = '/';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $path
|
||||
* @param int $flags
|
||||
* @param bool $ignoreUnreadableDirs
|
||||
@@ -119,7 +117,7 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
}
|
||||
|
||||
// @see https://bugs.php.net/68557
|
||||
if (PHP_VERSION_ID < 50523 || PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50607) {
|
||||
if (\PHP_VERSION_ID < 50523 || \PHP_VERSION_ID >= 50600 && \PHP_VERSION_ID < 50607) {
|
||||
parent::next();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ class SizeRangeFilterIterator extends FilterIterator
|
||||
private $comparators = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Iterator $iterator The Iterator to filter
|
||||
* @param NumberComparator[] $comparators An array of NumberComparator instances
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,6 @@ class SortableIterator implements \IteratorAggregate
|
||||
private $sort;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \Traversable $iterator The Iterator to filter
|
||||
* @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback)
|
||||
*
|
||||
@@ -41,7 +39,7 @@ class SortableIterator implements \IteratorAggregate
|
||||
|
||||
if (self::SORT_BY_NAME === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
return strcmp($a->getRealpath(), $b->getRealpath());
|
||||
return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
|
||||
};
|
||||
} elseif (self::SORT_BY_TYPE === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
@@ -51,7 +49,7 @@ class SortableIterator implements \IteratorAggregate
|
||||
return 1;
|
||||
}
|
||||
|
||||
return strcmp($a->getRealpath(), $b->getRealpath());
|
||||
return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
|
||||
};
|
||||
} elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
|
||||
2
lib/composer/vendor/symfony/finder/LICENSE
vendored
2
lib/composer/vendor/symfony/finder/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2004-2016 Fabien Potencier
|
||||
Copyright (c) 2004-2018 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -22,8 +22,6 @@ class SplFileInfo extends \SplFileInfo
|
||||
private $relativePathname;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $file The file name
|
||||
* @param string $relativePath The relative path
|
||||
* @param string $relativePathname The relative path name
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Comparator;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Finder\Comparator\Comparator;
|
||||
|
||||
class ComparatorTest extends \PHPUnit_Framework_TestCase
|
||||
class ComparatorTest extends TestCase
|
||||
{
|
||||
public function testGetSetOperator()
|
||||
{
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Comparator;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Finder\Comparator\DateComparator;
|
||||
|
||||
class DateComparatorTest extends \PHPUnit_Framework_TestCase
|
||||
class DateComparatorTest extends TestCase
|
||||
{
|
||||
public function testConstructor()
|
||||
{
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Comparator;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Finder\Comparator\NumberComparator;
|
||||
|
||||
class NumberComparatorTest extends \PHPUnit_Framework_TestCase
|
||||
class NumberComparatorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getConstructorTestData
|
||||
|
||||
@@ -312,7 +312,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
||||
|
||||
$finder = $this->buildFinder();
|
||||
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
|
||||
$a = array_values(array_map(function ($a) { return (string) $a; }, $a));
|
||||
$a = array_values(array_map('strval', $a));
|
||||
sort($a);
|
||||
$this->assertEquals($expected, $a, 'implements the \IteratorAggregate interface');
|
||||
}
|
||||
@@ -424,6 +424,20 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
||||
count($finder);
|
||||
}
|
||||
|
||||
public function testHasResults()
|
||||
{
|
||||
$finder = $this->buildFinder();
|
||||
$finder->in(__DIR__);
|
||||
$this->assertTrue($finder->hasResults());
|
||||
}
|
||||
|
||||
public function testNoResults()
|
||||
{
|
||||
$finder = $this->buildFinder();
|
||||
$finder->in(__DIR__)->name('DoesNotExist');
|
||||
$this->assertFalse($finder->hasResults());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getContainsTestData
|
||||
*/
|
||||
@@ -634,6 +648,10 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
||||
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, 'PHPUnit_Framework_ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
|
||||
}
|
||||
|
||||
if ($e instanceof \PHPUnit\Framework\ExpectationFailedException) {
|
||||
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, '\PHPUnit\Framework\ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
|
||||
}
|
||||
|
||||
$this->assertInstanceOf($expectedExceptionClass, $e);
|
||||
}
|
||||
}
|
||||
|
||||
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/a
vendored
Normal file
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/a
vendored
Normal file
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/b/c.neon
vendored
Normal file
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/b/c.neon
vendored
Normal file
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/b/d.neon
vendored
Normal file
0
lib/composer/vendor/symfony/finder/Tests/Fixtures/.dot/b/d.neon
vendored
Normal file
1
lib/composer/vendor/symfony/finder/Tests/Fixtures/one/.dot
vendored
Normal file
1
lib/composer/vendor/symfony/finder/Tests/Fixtures/one/.dot
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.dot
|
||||
72
lib/composer/vendor/symfony/finder/Tests/GlobTest.php
vendored
Executable file → Normal file
72
lib/composer/vendor/symfony/finder/Tests/GlobTest.php
vendored
Executable file → Normal file
@@ -11,9 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\Finder\Glob;
|
||||
|
||||
class GlobTest extends \PHPUnit_Framework_TestCase
|
||||
class GlobTest extends TestCase
|
||||
{
|
||||
public function testGlobToRegexDelimiters()
|
||||
{
|
||||
@@ -22,4 +24,72 @@ class GlobTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('^\.[^/]*$', Glob::toRegex('.*', true, true, ''));
|
||||
$this->assertEquals('/^\.[^/]*$/', Glob::toRegex('.*', true, true, '/'));
|
||||
}
|
||||
|
||||
public function testGlobToRegexDoubleStarStrictDots()
|
||||
{
|
||||
$finder = new Finder();
|
||||
$finder->ignoreDotFiles(false);
|
||||
$regex = Glob::toRegex('/**/*.neon');
|
||||
|
||||
foreach ($finder->in(__DIR__) as $k => $v) {
|
||||
$k = str_replace(DIRECTORY_SEPARATOR, '/', $k);
|
||||
if (preg_match($regex, substr($k, strlen(__DIR__)))) {
|
||||
$match[] = substr($k, 10 + strlen(__DIR__));
|
||||
}
|
||||
}
|
||||
sort($match);
|
||||
|
||||
$this->assertSame(array('one/b/c.neon', 'one/b/d.neon'), $match);
|
||||
}
|
||||
|
||||
public function testGlobToRegexDoubleStarNonStrictDots()
|
||||
{
|
||||
$finder = new Finder();
|
||||
$finder->ignoreDotFiles(false);
|
||||
$regex = Glob::toRegex('/**/*.neon', false);
|
||||
|
||||
foreach ($finder->in(__DIR__) as $k => $v) {
|
||||
$k = str_replace(DIRECTORY_SEPARATOR, '/', $k);
|
||||
if (preg_match($regex, substr($k, strlen(__DIR__)))) {
|
||||
$match[] = substr($k, 10 + strlen(__DIR__));
|
||||
}
|
||||
}
|
||||
sort($match);
|
||||
|
||||
$this->assertSame(array('.dot/b/c.neon', '.dot/b/d.neon', 'one/b/c.neon', 'one/b/d.neon'), $match);
|
||||
}
|
||||
|
||||
public function testGlobToRegexDoubleStarWithoutLeadingSlash()
|
||||
{
|
||||
$finder = new Finder();
|
||||
$finder->ignoreDotFiles(false);
|
||||
$regex = Glob::toRegex('/Fixtures/one/**');
|
||||
|
||||
foreach ($finder->in(__DIR__) as $k => $v) {
|
||||
$k = str_replace(DIRECTORY_SEPARATOR, '/', $k);
|
||||
if (preg_match($regex, substr($k, strlen(__DIR__)))) {
|
||||
$match[] = substr($k, 10 + strlen(__DIR__));
|
||||
}
|
||||
}
|
||||
sort($match);
|
||||
|
||||
$this->assertSame(array('one/a', 'one/b', 'one/b/c.neon', 'one/b/d.neon'), $match);
|
||||
}
|
||||
|
||||
public function testGlobToRegexDoubleStarWithoutLeadingSlashNotStrictLeadingDot()
|
||||
{
|
||||
$finder = new Finder();
|
||||
$finder->ignoreDotFiles(false);
|
||||
$regex = Glob::toRegex('/Fixtures/one/**', false);
|
||||
|
||||
foreach ($finder->in(__DIR__) as $k => $v) {
|
||||
$k = str_replace(DIRECTORY_SEPARATOR, '/', $k);
|
||||
if (preg_match($regex, substr($k, strlen(__DIR__)))) {
|
||||
$match[] = substr($k, 10 + strlen(__DIR__));
|
||||
}
|
||||
}
|
||||
sort($match);
|
||||
|
||||
$this->assertSame(array('one/.dot', 'one/a', 'one/b', 'one/b/c.neon', 'one/b/d.neon'), $match);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
/**
|
||||
* @author Alex Bogomazov
|
||||
*
|
||||
* @group legacy
|
||||
*/
|
||||
class FilterIteratorTest extends RealIteratorTestCase
|
||||
{
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
abstract class IteratorTestCase extends \PHPUnit_Framework_TestCase
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class IteratorTestCase extends TestCase
|
||||
{
|
||||
protected function assertIterator($expected, \Traversable $iterator)
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
class MockSplFileInfo extends \SplFileInfo
|
||||
{
|
||||
const TYPE_DIRECTORY = 1;
|
||||
const TYPE_FILE = 2;
|
||||
const TYPE_UNKNOWN = 3;
|
||||
const TYPE_DIRECTORY = 1;
|
||||
const TYPE_FILE = 2;
|
||||
const TYPE_UNKNOWN = 3;
|
||||
|
||||
private $contents = null;
|
||||
private $mode = null;
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Component\Finder\Tests\Iterator;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator;
|
||||
|
||||
class MultiplePcreFilterIteratorTest extends \PHPUnit_Framework_TestCase
|
||||
class MultiplePcreFilterIteratorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getIsRegexFixtures
|
||||
|
||||
@@ -77,7 +77,6 @@ class PathFilterIteratorTest extends IteratorTestCase
|
||||
array($inner, array('copy/A'), array(), array('abc.dat.copy', 'ab.dat.copy', 'a.dat.copy')),
|
||||
array($inner, array('copy/A/B'), array(), array('abc.dat.copy', 'ab.dat.copy')),
|
||||
array($inner, array('copy/A/B/C'), array(), array('abc.dat.copy')),
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||
{
|
||||
if (!is_callable($mode)) {
|
||||
switch ($mode) {
|
||||
case SortableIterator::SORT_BY_ACCESSED_TIME :
|
||||
case SortableIterator::SORT_BY_ACCESSED_TIME:
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
touch(self::toAbsolute('.git'));
|
||||
} else {
|
||||
@@ -41,12 +41,12 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||
sleep(1);
|
||||
file_get_contents(self::toAbsolute('.bar'));
|
||||
break;
|
||||
case SortableIterator::SORT_BY_CHANGED_TIME :
|
||||
case SortableIterator::SORT_BY_CHANGED_TIME:
|
||||
file_put_contents(self::toAbsolute('test.php'), 'foo');
|
||||
sleep(1);
|
||||
file_put_contents(self::toAbsolute('test.py'), 'foo');
|
||||
break;
|
||||
case SortableIterator::SORT_BY_MODIFIED_TIME :
|
||||
case SortableIterator::SORT_BY_MODIFIED_TIME:
|
||||
file_put_contents(self::toAbsolute('test.php'), 'foo');
|
||||
sleep(1);
|
||||
file_put_contents(self::toAbsolute('test.py'), 'foo');
|
||||
@@ -58,9 +58,9 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||
|
||||
$iterator = new SortableIterator($inner, $mode);
|
||||
|
||||
if ($mode === SortableIterator::SORT_BY_ACCESSED_TIME
|
||||
|| $mode === SortableIterator::SORT_BY_CHANGED_TIME
|
||||
|| $mode === SortableIterator::SORT_BY_MODIFIED_TIME
|
||||
if (SortableIterator::SORT_BY_ACCESSED_TIME === $mode
|
||||
|| SortableIterator::SORT_BY_CHANGED_TIME === $mode
|
||||
|| 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');
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
"php": "^5.5.9|>=7.0.8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\Finder\\": "" },
|
||||
@@ -27,7 +27,7 @@
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.1-dev"
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
failOnRisky="true"
|
||||
failOnWarning="true"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
|
||||
Reference in New Issue
Block a user