Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
conferinta_tbf
/
vendor
/
symfony
/
finder
/
Tests
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
GitignoreTest.php
| Size :
3.16
KB
Copy
<?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 PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Gitignore; class GitignoreTest extends TestCase { /** * @dataProvider provider */ public function testCases(string $patterns, array $matchingCases, array $nonMatchingCases) { $regex = Gitignore::toRegex($patterns); foreach ($matchingCases as $matchingCase) { $this->assertRegExp($regex, $matchingCase, sprintf('Failed asserting path [%s] matches gitignore patterns [%s] using regex [%s]', $matchingCase, $patterns, $regex)); } foreach ($nonMatchingCases as $nonMatchingCase) { $this->assertNotRegExp($regex, $nonMatchingCase, sprintf('Failed asserting path [%s] not matching gitignore patterns [%s] using regex [%s]', $nonMatchingCase, $patterns, $regex)); } } /** * @return array return is array of * [ * [ * '', // Git-ignore Pattern * [], // array of file paths matching * [], // array of file paths not matching * ], * ] */ public function provider() { return [ [ ' * !/bin/bash ', ['bin/cat', 'abc/bin/cat'], ['bin/bash'], ], [ 'fi#le.txt', [], ['#file.txt'], ], [ ' /bin/ /usr/local/ !/bin/bash !/usr/local/bin/bash ', ['bin/cat'], ['bin/bash'], ], [ '*.py[co]', ['file.pyc', 'file.pyc'], ['filexpyc', 'file.pycx', 'file.py'], ], [ 'dir1/**/dir2/', ['dir1/dirA/dir2/', 'dir1/dirA/dirB/dir2/'], [], ], [ 'dir1/*/dir2/', ['dir1/dirA/dir2/'], ['dir1/dirA/dirB/dir2/'], ], [ '/*.php', ['file.php'], ['app/file.php'], ], [ '\#file.txt', ['#file.txt'], [], ], [ '*.php', ['app/file.php', 'file.php'], ['file.phps', 'file.phps', 'filephps'], ], [ 'app/cache/', ['app/cache/file.txt', 'app/cache/dir1/dir2/file.txt', 'a/app/cache/file.txt'], [], ], [ ' #IamComment /app/cache/', ['app/cache/file.txt', 'app/cache/subdir/ile.txt'], ['a/app/cache/file.txt'], ], ]; } }
Back