-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Finder] Disable failing test about open_basedir
- Loading branch information
1 parent
9915db2
commit a1b31d8
Showing
2 changed files
with
63 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* 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\Finder; | ||
|
||
class FinderOpenBasedirTest extends Iterator\RealIteratorTestCase | ||
{ | ||
/** | ||
* @runInSeparateProcess | ||
*/ | ||
public function testIgnoreVCSIgnoredWithOpenBasedir() | ||
{ | ||
$this->markTestIncomplete('Test case needs to be refactored so that PHPUnit can run it'); | ||
|
||
if (\ini_get('open_basedir')) { | ||
$this->markTestSkipped('Cannot test when open_basedir is set'); | ||
} | ||
|
||
$finder = $this->buildFinder(); | ||
$this->assertSame( | ||
$finder, | ||
$finder | ||
->ignoreVCS(true) | ||
->ignoreDotFiles(true) | ||
->ignoreVCSIgnored(true) | ||
); | ||
|
||
$this->iniSet('open_basedir', \dirname(__DIR__, 5).\PATH_SEPARATOR.self::toAbsolute('gitignore/search_root')); | ||
|
||
$this->assertIterator(self::toAbsolute([ | ||
'gitignore/search_root/b.txt', | ||
'gitignore/search_root/c.txt', | ||
'gitignore/search_root/dir', | ||
'gitignore/search_root/dir/a.txt', | ||
'gitignore/search_root/dir/c.txt', | ||
]), $finder->in(self::toAbsolute('gitignore/search_root'))->getIterator()); | ||
} | ||
|
||
protected function buildFinder() | ||
{ | ||
return Finder::create()->exclude('gitignore'); | ||
} | ||
|
||
protected function iniSet(string $varName, string $newValue): void | ||
{ | ||
if ('open_basedir' === $varName && $deprecationsFile = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) { | ||
$newValue .= \PATH_SEPARATOR.$deprecationsFile; | ||
} | ||
|
||
parent::iniSet($varName, $newValue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters