Skip to content

Commit 11a5cee

Browse files
committed
Add a group for tests of the finder against the FTP server
This allows to skip them easily when running the testsuite, as they represent a significant part of the testsuite time.
1 parent c7b0ff1 commit 11a5cee

File tree

1 file changed

+13
-33
lines changed

1 file changed

+13
-33
lines changed

Tests/Iterator/RecursiveDirectoryIteratorTest.php

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,36 @@
1616
class RecursiveDirectoryIteratorTest extends IteratorTestCase
1717
{
1818
/**
19-
* @dataProvider getPaths
20-
*
21-
* @param string $path
22-
* @param bool $seekable
23-
* @param bool $contains
24-
* @param string $message
19+
* @group network
2520
*/
26-
public function testRewind($path, $seekable, $contains, $message = null)
21+
public function testRewindOnFtp()
2722
{
2823
try {
29-
$i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
24+
$i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS);
3025
} catch (\UnexpectedValueException $e) {
31-
$this->markTestSkipped(sprintf('Unsupported stream "%s".', $path));
26+
$this->markTestSkipped('Unsupported stream "ftp".');
3227
}
3328

3429
$i->rewind();
3530

36-
$this->assertTrue(true, $message);
31+
$this->assertTrue(true);
3732
}
3833

3934
/**
40-
* @dataProvider getPaths
41-
*
42-
* @param string $path
43-
* @param bool $seekable
44-
* @param bool $contains
45-
* @param string $message
35+
* @group network
4636
*/
47-
public function testSeek($path, $seekable, $contains, $message = null)
37+
public function testSeekOnFtp()
4838
{
4939
try {
50-
$i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
40+
$i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS);
5141
} catch (\UnexpectedValueException $e) {
52-
$this->markTestSkipped(sprintf('Unsupported stream "%s".', $path));
42+
$this->markTestSkipped('Unsupported stream "ftp".');
5343
}
5444

45+
$contains = array(
46+
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README',
47+
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub',
48+
);
5549
$actual = array();
5650

5751
$i->seek(0);
@@ -62,18 +56,4 @@ public function testSeek($path, $seekable, $contains, $message = null)
6256

6357
$this->assertEquals($contains, $actual);
6458
}
65-
66-
public function getPaths()
67-
{
68-
$data = array();
69-
70-
// ftp
71-
$contains = array(
72-
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README',
73-
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub',
74-
);
75-
$data[] = array('ftp://ftp.mozilla.org/', false, $contains);
76-
77-
return $data;
78-
}
7959
}

0 commit comments

Comments
 (0)