backport GlobTest from 2.7 branch

This commit is contained in:
Christian Flothmann 2016-02-01 12:48:21 +01:00
parent 27de563236
commit ceaeb43692
2 changed files with 24 additions and 0 deletions

View File

@ -248,6 +248,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
__DIR__.DIRECTORY_SEPARATOR.'BsdFinderTest.php',
__DIR__.DIRECTORY_SEPARATOR.'FinderTest.php',
__DIR__.DIRECTORY_SEPARATOR.'GnuFinderTest.php',
__DIR__.DIRECTORY_SEPARATOR.'GlobTest.php',
);
$this->assertIterator($expected, $iterator);

View File

@ -0,0 +1,23 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Finder\Tests;
use Symfony\Component\Finder\Glob;
class GlobTest extends \PHPUnit_Framework_TestCase
{
public function testGlobToRegexDelimiters()
{
$this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
$this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
}
}