4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Finder\Tests\Expression;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Finder\Expression\Expression;
20 class ExpressionTest extends TestCase
23 * @dataProvider getTypeGuesserData
25 public function testTypeGuesser($expr, $type)
27 $this->assertEquals($type, Expression::create($expr)->getType());
31 * @dataProvider getCaseSensitiveData
33 public function testCaseSensitive($expr, $isCaseSensitive)
35 $this->assertEquals($isCaseSensitive, Expression::create($expr)->isCaseSensitive());
39 * @dataProvider getRegexRenderingData
41 public function testRegexRendering($expr, $body)
43 $this->assertEquals($body, Expression::create($expr)->renderPattern());
46 public function getTypeGuesserData()
49 array('{foo}', Expression::TYPE_REGEX),
50 array('/foo/', Expression::TYPE_REGEX),
51 array('foo', Expression::TYPE_GLOB),
52 array('foo*', Expression::TYPE_GLOB),
56 public function getCaseSensitiveData()
59 array('{foo}m', true),
60 array('/foo/i', false),
65 public function getRegexRenderingData()
68 array('{foo}m', 'foo'),
69 array('/foo/i', 'foo'),