Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  Replace external FTP server by a local docker instance
  [PhpUnitBridge][Console][VarDumper] Fix handling NO_COLOR env var
  fix test
  [Validator] Add test for `D` regex modifier in `TimeValidator`
  • Loading branch information
nicolas-grekas committed Aug 13, 2024
2 parents b7df8a8 + d7eb6da commit d95bbf3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Tests/Iterator/RecursiveDirectoryIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,38 @@ protected function setUp(): void

/**
* @group network
* @group integration
*/
public function testRewindOnFtp()
{
$i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
if (!getenv('INTEGRATION_FTP_URL')) {
self::markTestSkipped('INTEGRATION_FTP_URL env var is not defined.');
}

$i = new RecursiveDirectoryIterator(getenv('INTEGRATION_FTP_URL').\DIRECTORY_SEPARATOR, \RecursiveDirectoryIterator::SKIP_DOTS);

$i->rewind();

$this->assertTrue(true);
$this->expectNotToPerformAssertions();
}

/**
* @group network
* @group integration
*/
public function testSeekOnFtp()
{
$i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
if (!getenv('INTEGRATION_FTP_URL')) {
self::markTestSkipped('INTEGRATION_FTP_URL env var is not defined.');
}

$ftpUrl = getenv('INTEGRATION_FTP_URL');

$i = new RecursiveDirectoryIterator($ftpUrl.\DIRECTORY_SEPARATOR, \RecursiveDirectoryIterator::SKIP_DOTS);

$contains = [
'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'pub',
'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'readme.txt',
$ftpUrl.\DIRECTORY_SEPARATOR.'pub',
$ftpUrl.\DIRECTORY_SEPARATOR.'readme.txt',
];
$actual = [];

Expand Down

0 comments on commit d95bbf3

Please sign in to comment.