Skip to content

Commit 6733efd

Browse files
Merge branch '5.4' into 6.4
* 5.4: Replace external FTP server by a local docker instance [PhpUnitBridge][Console][VarDumper] Fix handling NO_COLOR env var
2 parents 5f199c1 + 1719fef commit 6733efd

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

.github/workflows/integration-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ jobs:
4444
LDAP_PORT_NUMBER: 3389
4545
LDAP_USERS: a
4646
LDAP_PASSWORDS: a
47+
ftp:
48+
image: onekilo79/ftpd_test
49+
ports:
50+
- 21:21
51+
- 30000-30009:30000-30009
52+
volumes:
53+
- ./:/hostmount
4754
redis:
4855
image: redis:6.2.8
4956
ports:
@@ -162,6 +169,11 @@ jobs:
162169
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
163170
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
164171
172+
- name: Create FTP fixtures
173+
run: |
174+
mkdir -p ./ftpusers/test/pub
175+
touch ./ftpusers/test/pub/example ./ftpusers/test/readme.txt
176+
165177
- name: Setup PHP
166178
uses: shivammathur/setup-php@v2
167179
with:
@@ -212,6 +224,7 @@ jobs:
212224
- name: Run tests
213225
run: ./phpunit --group integration -v
214226
env:
227+
INTEGRATION_FTP_URL: 'ftp://test:test@localhost'
215228
REDIS_HOST: 'localhost:16379'
216229
REDIS_AUTHENTICATED_HOST: 'localhost:16380'
217230
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ private static function hasColorSupport()
418418
}
419419

420420
// Follow https://no-color.org/
421-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
421+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
422422
return false;
423423
}
424424

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function doWrite(string $message, bool $newline)
9393
protected function hasColorSupport(): bool
9494
{
9595
// Follow https://no-color.org/
96-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
96+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
9797
return false;
9898
}
9999

src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,38 @@ protected function setUp(): void
2424

2525
/**
2626
* @group network
27+
* @group integration
2728
*/
2829
public function testRewindOnFtp()
2930
{
30-
$i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
31+
if (!getenv('INTEGRATION_FTP_URL')) {
32+
self::markTestSkipped('INTEGRATION_FTP_URL env var is not defined.');
33+
}
34+
35+
$i = new RecursiveDirectoryIterator(getenv('INTEGRATION_FTP_URL').\DIRECTORY_SEPARATOR, \RecursiveDirectoryIterator::SKIP_DOTS);
3136

3237
$i->rewind();
3338

34-
$this->assertTrue(true);
39+
$this->expectNotToPerformAssertions();
3540
}
3641

3742
/**
3843
* @group network
44+
* @group integration
3945
*/
4046
public function testSeekOnFtp()
4147
{
42-
$i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
48+
if (!getenv('INTEGRATION_FTP_URL')) {
49+
self::markTestSkipped('INTEGRATION_FTP_URL env var is not defined.');
50+
}
51+
52+
$ftpUrl = getenv('INTEGRATION_FTP_URL');
53+
54+
$i = new RecursiveDirectoryIterator($ftpUrl.\DIRECTORY_SEPARATOR, \RecursiveDirectoryIterator::SKIP_DOTS);
4355

4456
$contains = [
45-
'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'pub',
46-
'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'readme.txt',
57+
$ftpUrl.\DIRECTORY_SEPARATOR.'pub',
58+
$ftpUrl.\DIRECTORY_SEPARATOR.'readme.txt',
4759
];
4860
$actual = [];
4961

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ private function hasColorSupport(mixed $stream): bool
621621
}
622622

623623
// Follow https://no-color.org/
624-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
624+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
625625
return false;
626626
}
627627

0 commit comments

Comments
 (0)