Skip to content

Commit ceaeb43

Browse files
committed
backport GlobTest from 2.7 branch
1 parent 27de563 commit ceaeb43

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Symfony/Component/Finder/Tests/FinderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ public function testIn()
248248
__DIR__.DIRECTORY_SEPARATOR.'BsdFinderTest.php',
249249
__DIR__.DIRECTORY_SEPARATOR.'FinderTest.php',
250250
__DIR__.DIRECTORY_SEPARATOR.'GnuFinderTest.php',
251+
__DIR__.DIRECTORY_SEPARATOR.'GlobTest.php',
251252
);
252253

253254
$this->assertIterator($expected, $iterator);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Finder\Tests;
13+
14+
use Symfony\Component\Finder\Glob;
15+
16+
class GlobTest extends \PHPUnit_Framework_TestCase
17+
{
18+
public function testGlobToRegexDelimiters()
19+
{
20+
$this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
21+
$this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
22+
}
23+
}

0 commit comments

Comments
 (0)