X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fmikey179%2FvfsStream%2Fsrc%2Ftest%2Fphp%2Forg%2Fbovigo%2Fvfs%2FvfsStreamWrapperDirSeparatorTestCase.php;fp=vendor%2Fmikey179%2FvfsStream%2Fsrc%2Ftest%2Fphp%2Forg%2Fbovigo%2Fvfs%2FvfsStreamWrapperDirSeparatorTestCase.php;h=33dedee5421898885998aea0f49963015781c2f8;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php new file mode 100644 index 000000000..33dedee54 --- /dev/null +++ b/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php @@ -0,0 +1,72 @@ +root = vfsStream::setup(); + } + + /** + * @test + */ + public function fileCanBeAccessedUsingWinDirSeparator() + { + vfsStream::newFile('foo/bar/baz.txt') + ->at($this->root) + ->withContent('test'); + $this->assertEquals('test', file_get_contents('vfs://root/foo\bar\baz.txt')); + } + + + /** + * @test + */ + public function directoryCanBeCreatedUsingWinDirSeparator() + { + mkdir('vfs://root/dir\bar\foo', true, 0777); + $this->assertTrue($this->root->hasChild('dir')); + $this->assertTrue($this->root->getChild('dir')->hasChild('bar')); + $this->assertTrue($this->root->getChild('dir/bar')->hasChild('foo')); + } + + /** + * @test + */ + public function directoryExitsTestUsingTrailingWinDirSeparator() + { + $structure = array( + 'dir' => array( + 'bar' => array( + ) + ) + ); + vfsStream::create($structure, $this->root); + + $this->assertTrue(file_exists(vfsStream::url('root/').'dir\\')); + } +}