From 51147e3aff9b3e8637214778f3f88754da93f0a1 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 26 Sep 2015 17:47:39 +0200 Subject: [PATCH] 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. --- .../RecursiveDirectoryIteratorTest.php | 46 ++++++------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php index 92c00b2ed9..b59d0d6f27 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @@ -16,42 +16,36 @@ use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator; class RecursiveDirectoryIteratorTest extends IteratorTestCase { /** - * @dataProvider getPaths - * - * @param string $path - * @param bool $seekable - * @param bool $contains - * @param string $message + * @group network */ - public function testRewind($path, $seekable, $contains, $message = null) + public function testRewindOnFtp() { try { - $i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { - $this->markTestSkipped(sprintf('Unsupported stream "%s".', $path)); + $this->markTestSkipped('Unsupported stream "ftp".'); } $i->rewind(); - $this->assertTrue(true, $message); + $this->assertTrue(true); } /** - * @dataProvider getPaths - * - * @param string $path - * @param bool $seekable - * @param bool $contains - * @param string $message + * @group network */ - public function testSeek($path, $seekable, $contains, $message = null) + public function testSeekOnFtp() { try { - $i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { - $this->markTestSkipped(sprintf('Unsupported stream "%s".', $path)); + $this->markTestSkipped('Unsupported stream "ftp".'); } + $contains = array( + 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README', + 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub', + ); $actual = array(); $i->seek(0); @@ -62,18 +56,4 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase $this->assertEquals($contains, $actual); } - - public function getPaths() - { - $data = array(); - - // ftp - $contains = array( - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README', - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub', - ); - $data[] = array('ftp://ftp.mozilla.org/', false, $contains); - - return $data; - } }