8000 Replace external FTP server by a local docker instance · core23/symfony@37b3ce9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 37b3ce9

Browse files
Replace external FTP server by a local docker instance
1 parent 0ae7140 commit 37b3ce9

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
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:
@@ -144,6 +151,11 @@ jobs:
144151
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
145152
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
146153
154+
- name: Create FTP fixtures
155+
run: |
156+
mkdir -p ./ftpusers/test/pub
157+
touch ./ftpusers/test/pub/example ./ftpusers/test/readme.txt
158+
147159
- name: Setup PHP
148160
uses: shivammathur/setup-php@v2
149161
with:
@@ -196,6 +208,7 @@ jobs:
196208
- name: Run tests
197209
run: ./phpunit --group integration -v
198210
env:
211+
INTEGRATION_FTP_URL: 'ftp://test:test@localhost'
199212
REDIS_HOST: 'localhost:16379'
200213
REDIS_AUTHENTICATED_HOST: 'localhost:16380'
201214
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'

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

0 commit comments

Comments
 (0)
0