diff vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 129ea1e6d783
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,59 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Finder\Tests\Iterator;
+
+use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
+
+class RecursiveDirectoryIteratorTest extends IteratorTestCase
+{
+    /**
+     * @group network
+     */
+    public function testRewindOnFtp()
+    {
+        try {
+            $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
+        } catch (\UnexpectedValueException $e) {
+            $this->markTestSkipped('Unsupported stream "ftp".');
+        }
+
+        $i->rewind();
+
+        $this->assertTrue(true);
+    }
+
+    /**
+     * @group network
+     */
+    public function testSeekOnFtp()
+    {
+        try {
+            $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
+        } catch (\UnexpectedValueException $e) {
+            $this->markTestSkipped('Unsupported stream "ftp".');
+        }
+
+        $contains = array(
+            'ftp://speedtest.tele2.net'.DIRECTORY_SEPARATOR.'1000GB.zip',
+            'ftp://speedtest.tele2.net'.DIRECTORY_SEPARATOR.'100GB.zip',
+        );
+        $actual = array();
+
+        $i->seek(0);
+        $actual[] = $i->getPathname();
+
+        $i->seek(1);
+        $actual[] = $i->getPathname();
+
+        $this->assertEquals($contains, $actual);
+    }
+}