Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / mikey179 / vfsStream / src / test / php / org / bovigo / vfs / vfsStreamTestCase.php
index 888e84c2b23f18d40c24c9452d648346b1f3ebb2..0dbfbb6c25d28764b5b635860cc437f625a12015 100644 (file)
@@ -8,6 +8,9 @@
  * @package  org\bovigo\vfs
  */
 namespace org\bovigo\vfs;
+
+use org\bovigo\vfs\content\LargeFileContent;
+
 /**
  * Test for org\bovigo\vfs\vfsStream.
  */
@@ -736,4 +739,42 @@ class vfsStreamTestCase extends \PHPUnit_Framework_TestCase
         $directory = vfsStream::newDirectory('foo/');
         $this->assertFalse($directory->hasChildren());
     }
+
+    /**
+     * @test
+     * @group  issue_149
+     */
+    public function addStructureHandlesVfsStreamFileObjects()
+    {
+        $structure = array(
+            'topLevel' => array(
+                'thisIsAFile' => 'file contents',
+                vfsStream::newFile('anotherFile'),
+            ),
+        );
+
+        vfsStream::setup();
+        $root = vfsStream::create($structure);
+
+        $this->assertTrue($root->hasChild('topLevel/anotherFile'));
+    }
+
+    /**
+     * @test
+     * @group  issue_149
+     */
+    public function createHandlesLargeFileContentObjects()
+    {
+        $structure = array(
+            'topLevel' => array(
+                'thisIsAFile' => 'file contents',
+                'anotherFile' => LargeFileContent::withMegabytes(2),
+            ),
+        );
+
+        vfsStream::setup();
+        $root = vfsStream::create($structure);
+
+        $this->assertTrue($root->hasChild('topLevel/anotherFile'));
+    }
 }