16
16
class RecursiveDirectoryIteratorTest extends IteratorTestCase
17
17
{
18
18
/**
19
- * @dataProvider getPaths
20
- *
21
- * @param string $path
22
- * @param bool $seekable
23
- * @param bool $contains
24
- * @param string $message
19
+ * @group network
25
20
*/
26
- public function testRewind ( $ path , $ seekable , $ contains , $ message = null )
21
+ public function testRewindOnFtp ( )
27
22
{
28
23
try {
29
- $ i = new RecursiveDirectoryIterator ($ path , \RecursiveDirectoryIterator::SKIP_DOTS );
24
+ $ i = new RecursiveDirectoryIterator (' ftp://ftp.mozilla.org/ ' , \RecursiveDirectoryIterator::SKIP_DOTS );
30
25
} catch (\UnexpectedValueException $ e ) {
31
- $ this ->markTestSkipped (sprintf ( 'Unsupported stream "%s ". ' , $ path ) );
26
+ $ this ->markTestSkipped ('Unsupported stream "ftp ". ' );
32
27
}
33
28
34
29
$ i ->rewind ();
35
30
36
- $ this ->assertTrue (true , $ message );
31
+ $ this ->assertTrue (true );
37
32
}
38
33
39
34
/**
40
- * @dataProvider getPaths
41
- *
42
- * @param string $path
43
- * @param bool $seekable
44
- * @param bool $contains
45
- * @param string $message
35
+ * @group network
46
36
*/
47
- public function testSeek ( $ path , $ seekable , $ contains , $ message = null )
37
+ public function testSeekOnFtp ( )
48
38
{
49
39
try {
50
- $ i = new RecursiveDirectoryIterator ($ path , \RecursiveDirectoryIterator::SKIP_DOTS );
40
+ $ i = new RecursiveDirectoryIterator (' ftp://ftp.mozilla.org/ ' , \RecursiveDirectoryIterator::SKIP_DOTS );
51
41
} catch (\UnexpectedValueException $ e ) {
52
- $ this ->markTestSkipped (sprintf ( 'Unsupported stream "%s ". ' , $ path ) );
42
+ $ this ->markTestSkipped ('Unsupported stream "ftp ". ' );
53
43
}
54
44
45
+ $ contains = array (
46
+ 'ftp://ftp.mozilla.org ' .DIRECTORY_SEPARATOR .'README ' ,
47
+ 'ftp://ftp.mozilla.org ' .DIRECTORY_SEPARATOR .'pub ' ,
48
+ );
55
49
$ actual = array ();
56
50
57
51
$ i ->seek (0 );
@@ -62,18 +56,4 @@ public function testSeek($path, $seekable, $contains, $message = null)
62
56
63
57
$ this ->assertEquals ($ contains , $ actual );
64
58
}
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
- }
79
59
}
0 commit comments