diff --git a/composer.lock b/composer.lock index e1f9771ee0bfe99fe4da622932aaea84ac032e6e..7b2dbb7ecb283e7e85796946d35fb7c4f1326def 100644 --- a/composer.lock +++ b/composer.lock @@ -648,22 +648,30 @@ }, { "name": "mikey179/vfsStream", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/mikey179/vfsStream.git", - "reference": "063fb10633f10c5ccbcac26227e94f46d9336f90" + "reference": "8571f349567e02af1b7efc0fc4e3a4a1c98e664e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/063fb10633f10c5ccbcac26227e94f46d9336f90", - "reference": "063fb10633f10c5ccbcac26227e94f46d9336f90", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/8571f349567e02af1b7efc0fc4e3a4a1c98e664e", + "reference": "8571f349567e02af1b7efc0fc4e3a4a1c98e664e", "shasum": "" }, "require": { "php": ">=5.3.0" }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, "autoload": { "psr-0": { "org\\bovigo\\vfs\\": "src/main/php" @@ -674,7 +682,7 @@ "BSD" ], "homepage": "http://vfs.bovigo.org/", - "time": "2013-04-01 10:41:02" + "time": "2014-07-21 20:15:54" }, { "name": "phpunit/php-code-coverage", @@ -2425,8 +2433,12 @@ "time": "2013-06-12 19:46:58" } ], - "packages-dev": [], - "aliases": [], + "packages-dev": [ + + ], + "aliases": [ + + ], "minimum-stability": "stable", "stability-flags": { "symfony/yaml": 20, @@ -2436,9 +2448,10 @@ "symfony-cmf/routing": 15, "phpunit/phpunit-mock-objects": 20 }, - "prefer-stable": false, "platform": { "php": ">=5.4.2" }, - "platform-dev": [] + "platform-dev": [ + + ] } diff --git a/core/vendor/composer/ClassLoader.php b/core/vendor/composer/ClassLoader.php index 443364959a541bf85ac0e77476f1ded4feb93747..a7105553143a422546083f2bb49dd6a79a280a6a 100644 --- a/core/vendor/composer/ClassLoader.php +++ b/core/vendor/composer/ClassLoader.php @@ -143,8 +143,6 @@ public function add($prefix, $paths, $prepend = false) * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-0 base directories * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,13 +202,10 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories */ - public function setPsr4($prefix, $paths) - { + public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php index f41b172e74af44e066c6f057fae6c77749670fc4..0ecdb36774e7d47ab993702dd89f365e3dad9ddd 100644 --- a/core/vendor/composer/autoload_real.php +++ b/core/vendor/composer/autoload_real.php @@ -23,6 +23,9 @@ public static function getLoader() self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitDrupal8', 'loadClassLoader')); + $vendorDir = dirname(__DIR__); + $baseDir = dirname(dirname($vendorDir)); + $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); set_include_path(join(PATH_SEPARATOR, $includePaths)); diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index fbc00eb8cd63322cafdf643d533fb44270a86661..cb411087ebb74c65eabee26beade5122f13398fe 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -2422,38 +2422,6 @@ "web service" ] }, - { - "name": "mikey179/vfsStream", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "063fb10633f10c5ccbcac26227e94f46d9336f90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/063fb10633f10c5ccbcac26227e94f46d9336f90", - "reference": "063fb10633f10c5ccbcac26227e94f46d9336f90", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2013-04-01 10:41:02", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "org\\bovigo\\vfs\\": "src/main/php" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "homepage": "http://vfs.bovigo.org/" - }, { "name": "symfony/serializer", "version": "v2.5.2", @@ -2504,5 +2472,45 @@ ], "description": "Symfony Serializer Component", "homepage": "http://symfony.com" + }, + { + "name": "mikey179/vfsStream", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/mikey179/vfsStream.git", + "reference": "8571f349567e02af1b7efc0fc4e3a4a1c98e664e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/8571f349567e02af1b7efc0fc4e3a4a1c98e664e", + "reference": "8571f349567e02af1b7efc0fc4e3a4a1c98e664e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, + "time": "2014-07-21 20:15:54", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "homepage": "http://vfs.bovigo.org/" } ] diff --git a/core/vendor/mikey179/vfsStream/.coveralls.yml b/core/vendor/mikey179/vfsStream/.coveralls.yml new file mode 100644 index 0000000000000000000000000000000000000000..f5485b0342424b96aa5ca6861ef68cfef8ccb036 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/.coveralls.yml @@ -0,0 +1,3 @@ +src_dir: src/main/php +coverage_clover: docs/phpunit/clover.xml +json_path: docs/phpunit/coveralls-upload.json \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/.gitignore b/core/vendor/mikey179/vfsStream/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76e2ab0790a50d5a323c1519dc52e62fe0ab84b7 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/.gitignore @@ -0,0 +1,4 @@ +/composer.lock +/docs +/nbproject +/vendor diff --git a/core/vendor/mikey179/vfsStream/.travis.yml b/core/vendor/mikey179/vfsStream/.travis.yml index 3d1a27c680009994e2413dc2beb36744fc3f50c3..060e2007dadd24a889df58ca0f9b984cfa594518 100644 --- a/core/vendor/mikey179/vfsStream/.travis.yml +++ b/core/vendor/mikey179/vfsStream/.travis.yml @@ -1,11 +1,25 @@ language: php php: + - hhvm + - 5.6 - 5.3 - 5.4 - 5.5 +matrix: + allow_failures: + - php: hhvm + - php: 5.6 + before_script: - - composer install --dev + - "mkdir -p ~/.composer" + - composer self-update + - composer install + - composer require satooshi/php-coveralls:dev-master + +script: + - vendor/bin/phpunit --coverage-text -script: phpunit --coverage-text +after_script: + - vendor/bin/coveralls diff --git a/core/vendor/mikey179/vfsStream/CHANGELOG.md b/core/vendor/mikey179/vfsStream/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..7a6b4cc14601e4a609b0c554aa2e49e5b48f7ccf --- /dev/null +++ b/core/vendor/mikey179/vfsStream/CHANGELOG.md @@ -0,0 +1,175 @@ +1.3.0 (2014-07-21) +------------------ + + * implemented #79: possibility to mock large files without large memory footprint, see https://github.com/mikey179/vfsStream/wiki/MockingLargeFiles + * implemented #67: added partial support for text-mode translation flag (i.e., no actual translation of line endings takes place) so it no longer throws an exception (provided by Anthon Pang) + * fixed issue #74: issue with trailing windows path separators (provided by Sebastian Krüger) + * fixed issue #50: difference between real file system and vfs with `RecursiveDirectoryIterator` + * fixed issue #80: touch with no arguments for modification and access time behave incorrect + * deprecated `org\bovigo\vfs\vfsStreamFile::readUntilEnd()` + * deprecated `org\bovigo\vfs\vfsStreamFile::getBytesRead()` + + +1.2.0 (2013-04-01) +------------------ + + * implemented issue #34: provide `url()` method on all `vfsStreamContent` instances + * added `org\bovigo\vfs\vfsStreamContent::url()` + * added `org\bovigo\vfs\vfsStreamContent::path()` + * fixed issue #40: flock implementation doesn't work correctly, patch provided by Kamil Dziedzic + * fixed issue #49: call to member function on a non-object when trying to delete a file one above root where a file with same name in root exists + * fixed issue #51: `unlink()` must consider permissions of directory where file is inside, not of the file to unlink itself + * fixed issue #52: `chmod()`, `chown()` and `chgrp()` must consider permissions of directory where file/directory is inside + * fixed issue #53: `chmod()`, `chown()` and `chgrp()` must consider current user and current owner of file/directoy to change + + +1.1.0 (2012-08-25) +------------------ + + * implemented issue #11: add support for `streamWrapper::stream_metadata()` vfsStream now supports `touch()`, `chown()`, `chgrp()` and `chmod()` + * implemented issue #33: add support for `stream_truncate()` (provided by https://github.com/nikcorg) + * implemented issue #35: size limit (quota) for VFS + + +1.0.0 (2012-05-15) +------------------ + + * raised requirement for PHP version to 5.3.0 + * migrated codebase to use namespaces + * changed distribution from PEAR to Composer + * implemented issue #30: support "c" mode for `fopen()` + * fixed issue #31: prohibit aquiring locks when already locked / release lock on `fclose()` + * fixed issue #32: problems when subfolder has same name as folder + * fixed issue #36: `vfsStreamWrapper::stream_open()` should return false while trying to open existing non-writable file, patch provided by Alexander Peresypkin + + +0.11.2 (2012-01-14) +------------------- + + * fixed issue #29: set permissions properly when using `vfsStream::copyFromFileSystem()`, patch provided by predakanga + * fixed failing tests under PHP > 5.3.2 + + +0.11.1 (2011-12-04) +------------------- + + * fixed issue #28: `mkdir()` overwrites existing directories/files + + +0.11.0 (2011-11-29) +------------------- + + * implemented issue #20: `vfsStream::create()` removes old structure + * implemented issue #4: possibility to copy structure from existing file system + * fixed issue #23: `unlink()` should not remove any directory + * fixed issue #25: `vfsStreamDirectory::hasChild()` gives false positives for nested paths, patch provided by Andrew Coulton + * fixed issue #26: opening a file for reading only should not update its modification time, reported and initial patch provided by Ludovic Chabant + + +0.10.1 (2011-08-22) +------------------- + + * fixed issue #16: replace `vfsStreamContent` to `vfsStreamContainer` for autocompletion + * fixed issue #17: `vfsStream::create()` has issues with numeric directories, patch provided by mathieuk + + +0.10.0 (2011-07-22) +------------------- + + * added new method `vfsStreamContainer::hasChildren()` and `vfsStreamDirectory::hasChildren()` + * implemented issue #14: less verbose way to initialize vfsStream + * implemented issue #13: remove deprecated method `vfsStreamContent::setFilemtime()` + * implemented issue #6: locking meachanism for files + * ensured that `stream_set_blocking()`, `stream_set_timeout()` and `stream_set_write_buffer()` on vfsStream urls have the same behaviour with PHP 5.2 and 5.3 + * implemented issue #10: method to print directory structure + + +0.9.0 (2011-07-13) +------------------ + + * implemented feature request issue #7: add support for `fileatime()` and `filectime()` + * fixed issue #3: add support for `streamWrapper::stream_cast()` + * fixed issue #9: resolve path not called everywhere its needed + * deprecated `vfsStreamAbstractContent::setFilemtime()`, use `vfsStreamAbstractContent::lastModified()` instead, will be removed with 0.10.0 + + +0.8.0 (2010-10-08) +------------------ + + * implemented enhancement #6: use `vfsStream::umask()` to influence initial file mode for files and directories + * implemented enhancement #19: support of .. in the url, patch provided by Guislain Duthieuw + * fixed issue #18: `getChild()` returns NULL when child's name contains parent name + * fixed bug with incomplete error message when accessing non-existing files on root level + + +0.7.0 (2010-06-08) +------------------ + + * added new `vfsStream::setup()` method to simplify vfsStream usage + * fixed issue #15: `mkdir()` creates a subfolder in a folder without permissions + + +0.6.0 (2010-02-15) +------------------ + + * added support for `$mode` param when opening files, implements enhancement #7 and fixes issue #13 + * `vfsStreamWrapper::stream_open()` now evaluates `$options` for `STREAM_REPORT_ERRORS` + + +0.5.0 (2010-01-25) +------------------ + + * added support for `rename()`, patch provided by Benoit Aubuchon + * added support for . as directory alias so that `vfs://foo/.` resolves to `vfs://foo`, can be used as workaround for bug #8 + + +0.4.0 (2009-07-13) +------------------ + + * added support for file modes, users and groups (with restrictions, see http://code.google.com/p/bovigo/wiki/vfsStreamDocsKnownIssues) + * fixed bug #5: `vfsStreamDirectory::addChild()` does not replace child with same name + * fixed bug with `is_writable()` because of missing `stat()` fields, patch provided by Sergey Galkin + + +0.3.2 (2009-02-16) +------------------ + + * support trailing slashes on directories in vfsStream urls, patch provided by Gabriel Birke + * fixed bug #4: vfsstream can only be read once, reported by Christoph Bloemer + * enabled multiple iterations at the same time over the same directory + + +0.3.1 (2008-02-18) +------------------ + + * fixed path/directory separator issues under linux systems + * fixed uid/gid issues under linux systems + + +0.3.0 (2008-01-02) +------------------ + + * added support for `rmdir()` + * added `vfsStream::newDirectory()`, dropped `vfsStreamDirectory::ceate()` + * added new interface `vfsStreamContainer` + * added `vfsStreamContent::at()` which allows code like `$file = vfsStream::newFile('file.txt.')->withContent('foo')->at($otherDir);` + * added `vfsStreamContent::lastModified()`, made `vfsStreamContent::setFilemtime()` an alias for this + * moved from Stubbles development environment to bovigo + * refactorings to reduce crap index of various methods + + +0.2.0 (2007-12-29) +------------------ + + * moved `vfsStreamWrapper::PROTOCOL` to `vfsStream::SCHEME` + * added new `vfsStream::url()` method to assist in creating correct vfsStream urls + * added `vfsStream::path()` method as opposite to `vfsStream::url()` + * a call to `vfsStreamWrapper::register()` will now reset the root to null, implemented on request from David Zuelke + * added support for `is_readable()`, `is_dir()`, `is_file()` + * added `vfsStream::newFile()` to be able to do `$file = vfsStream::newFile("foo.txt")->withContent("bar");` + + +0.1.0 (2007-12-14) +------------------ + + * Initial release. diff --git a/core/vendor/mikey179/vfsStream/CHANGES b/core/vendor/mikey179/vfsStream/CHANGES deleted file mode 100644 index c89563dda8c4fda4f9ecb9959180718af64ed4be..0000000000000000000000000000000000000000 --- a/core/vendor/mikey179/vfsStream/CHANGES +++ /dev/null @@ -1,175 +0,0 @@ -1.2.0, 2013-04-01 -================== -- implemented issue #34: provide url() method on all vfsStreamContent instances - - added org\bovigo\vfs\vfsStreamContent::url() - - added org\bovigo\vfs\vfsStreamContent::path() -- fixed issue #40: flock implementation doesn't work correctly, patch provided - by Kamil Dziedzic -- fixed issue #49: call to member function on a non-object when trying to delete - a file one above root where a file with same name in root exists -- fixed issue #51: unlink() must consider permissions of directory where file is - inside, not of the file to unlink itself -- fixed issue #52: chmod(), chown() and chgrp() must consider permissions of - directory where file/directory is inside -- fixed issue #53: chmod(), chown() and chgrp() must consider current user and - current owner of file/directoy to change - - -1.1.0, 2012-08-25 -================== -- implemented issue #11: add support for streamWrapper::stream_metadata() - vfsStream now supports touch(), chown(), chgrp() and chmod() -- implemented issue #33: add support for stream_truncate - (provided by https://github.com/nikcorg) -- implemented issue #35: size limit (quota) for VFS - - -1.0.0, 2012-05-15 -================== -- raised requirement for PHP version to 5.3.0 -- migrated codebase to use namespaces -- changed distribution from PEAR to Composer -- implemented issue #30: support "c" mode for fopen() -- fixed issue #31: prohibit aquiring locks when already locked / release lock on - fclose() -- fixed issue #32: problems when subfolder has same name as folder -- fixed issue #36: vfsStreamWrapper::stream_open should return false while - trying to open existing non-writable file, patch provided by Alexander Peresypkin - - -0.11.2, 2012-01-14 -================== -- fixed issue #29: set permissions properly when using - vfsStream::copyFromFileSystem(), patch provided by predakanga -- fixed failing tests under PHP > 5.3.2 - - -0.11.1, 2011-12-04 -================== -- fixed issue #28: mkdir overwrites existing directories/files - - -0.11.0, 2011-11-29 -================== -- implemented issue #20: vfsStream::create() removes old structure -- implemented issue #4: possibility to copy structure from existing file system -- fixed issue #23: unlink should not remove any directory -- fixed issue #25: vfsStreamDirectory::hasChild() gives false positives for - nested paths, patch provided by Andrew Coulton -- fixed issue #26: opening a file for reading only should not update its - modification time, reported and initial patch provided by Ludovic Chabant - - -0.10.1, 2011-08-22 -================== -- fixed issue #16: replace vfsStreamContent to vfsStreamContainer for - autocompletion -- fixed issue #17: vfsStream::create() has issues with numeric directories, - patch provided by mathieuk - - -0.10.0, 2011-07-22 -================== -- added new method vfsStreamContainer::hasChildren() and - vfsStreamDirectory::hasChildren() -- implemented issue #14: less verbose way to initialize vfsStream -- implemented issue #13: remove deprecated method vfsStreamContent::setFilemtime() -- implemented issue #6: locking meachanism for files -- ensured that stream_set_blocking(), stream_set_timeout() and - stream_set_write_buffer() on vfsStream urls have the same behaviour - with PHP 5.2 and 5.3 -- implemented issue #10: method to print directory structure - - -0.9.0, 2011-07-13 -================= -- implemented feature request issue #7: add support for fileatime() and filectime() -- fixed issue #3: add support for streamWrapper::stream_cast() -- fixed issue #9: resolve path not called everywhere its needed -- deprecated vfsStreamAbstractContent::setFilemtime(), use - vfsStreamAbstractContent::lastModified() instead, will be removed with 0.10.0 - - -0.8.0, 2010-10-08 -================= -- implemented enhancement #6: use vfsStream::umask() to influence initial file - mode for files and directories -- implemented enhancement #19: support of .. in the url, patch provided by - Guislain Duthieuw -- fixed issue #18: getChild() returns NULL when child's name contains parent name -- fixed bug with incomplete error message when accessing non-existing files on - root level - - -0.7.0, 2010-06-08 -================= -- added new vfsStream::setup() method to simplify vfsStream usage -- fixed issue #15: mkdir creates a subfolder in a folder without permissions - - -0.6.0, 2010-02-15 -================= -- added support for $mode param when opening files, implements enhancement #7 - and fixes issue #13 -- vfsStreamWrapper::stream_open() now evaluates $options for STREAM_REPORT_ERRORS - - -0.5.0, 2010-01-25 -================= -- added support for rename(), patch provided by Benoit Aubuchon -- added support for . as directory alias so that vfs://foo/. resolves to - vfs://foo, can be used as workaround for bug #8 - - -0.4.0, 2009-07-13 -================= -- added support for file modes, users and groups (with restrictions, see - http://code.google.com/p/bovigo/wiki/vfsStreamDocsKnownIssues) -- fixed bug #5: vfsStreamDirectory::addChild() does not replace child with same - name -- fixed bug with is_writable() because of missing stat() fields, patch provided - by Sergey Galkin - - -0.3.2, 2009-02-16 -================= -- support trailing slashes on directories in vfsStream urls, patch provided by - Gabriel Birke -- fixed bug #4: vfsstream can only be read once, reported by Christoph Bloemer -- enabled multiple iterations at the same time over the same directory - - -0.3.1, 2008-02-18 -================= -- fixed path/directory separator issues under linux systems -- fixed uid/gid issues under linux systems - - -0.3.0, 2008-01-02 -================= -- added support for rmdir() -- added vfsStream::newDirectory(), dropped vfsStreamDirectory::ceate() -- added new interface vfsStreamContainer -- added vfsStreamContent::at() which allows code like - $file = vfsStream::newFile('file.txt.')->withContent('foo')->at($otherDir); -- added vfsStreamContent::lastModified(), made vfsStreamContent::setFilemtime() - an alias for this -- moved from Stubbles development environment to bovigo -- refactorings to reduce crap index of various methods - - -0.2.0, 2007-12-29 -================= -- moved vfsStreamWrapper::PROTOCOL to vfsStream::SCHEME -- added new vfsStream::url() method to assist in creating correct vfsStream urls -- added vfsStream::path() method as opposite to vfsStream::url() -- a call to vfsStreamWrapper::register() will now reset the root to null, - implemented on request from David Zuelke -- added support for is_readable(), is_dir(), is_file() -- added vfsStream::newFile() to be able to do - $file = vfsStream::newFile("foo.txt")->withContent("bar"); - - -0.1.0, 2007-12-14 -================= -Initial release. diff --git a/core/vendor/mikey179/vfsStream/LICENSE b/core/vendor/mikey179/vfsStream/LICENSE index d53ff5299dd36094629a3788274904c98aa2bfb0..d8d73a0de9c24e8f7bdd4f67f21e231b1591c321 100644 --- a/core/vendor/mikey179/vfsStream/LICENSE +++ b/core/vendor/mikey179/vfsStream/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2007-2013, Frank Kleine +Copyright (c) 2007-2014, Frank Kleine All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/core/vendor/mikey179/vfsStream/composer.json b/core/vendor/mikey179/vfsStream/composer.json index 46b085c57a7453e22bd0a84ffe108c816d4d2d90..c6107a57810677cbeea85d322da81d5283eeddd4 100644 --- a/core/vendor/mikey179/vfsStream/composer.json +++ b/core/vendor/mikey179/vfsStream/composer.json @@ -6,7 +6,15 @@ "require": { "php": ">=5.3.0" }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, "autoload": { "psr-0": { "org\\bovigo\\vfs\\": "src/main/php" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } } } \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/phpunit.xml.dist b/core/vendor/mikey179/vfsStream/phpunit.xml.dist index 8d2140edce6df4291816e2859fc68eea8c424122..d6919d22f2537130745c8d4f49cdcdedb51a5226 100644 --- a/core/vendor/mikey179/vfsStream/phpunit.xml.dist +++ b/core/vendor/mikey179/vfsStream/phpunit.xml.dist @@ -32,6 +32,7 @@ <log type="coverage-html" target="docs/coverage" charset="UTF-8" yui="true" highlight="false" lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="docs/phpunit/clover.xml"/> <log type="junit" target="docs/phpunit/junit.xml" logIncompleteSkipped="false"/> <log type="testdox-html" target="docs/phpunit/testdox.html"/> </logging> diff --git a/core/vendor/mikey179/vfsStream/readme.md b/core/vendor/mikey179/vfsStream/readme.md index 1635eddd37d404b4d730d4b96bf0c2f2bcf6240b..9eb78c506f688aec603354c6f412bfe4e8cf2f24 100644 --- a/core/vendor/mikey179/vfsStream/readme.md +++ b/core/vendor/mikey179/vfsStream/readme.md @@ -1,3 +1,5 @@ For more information have a look in the [wiki](https://github.com/mikey179/vfsStream/wiki). -[](http://travis-ci.org/mikey179/vfsStream) \ No newline at end of file +[](http://travis-ci.org/mikey179/vfsStream) [](https://coveralls.io/r/mikey179/vfsStream?branch=master) + +[](https://packagist.org/packages/mikey179/vfsStream) [](//packagist.org/packages/mikey179/vfsStream) diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php new file mode 100644 index 0000000000000000000000000000000000000000..e9bc21588899fc7e60a3513b41d6d49bc7de03ae --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/DotDirectory.php @@ -0,0 +1,36 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs; +/** + * Directory container. + */ +class DotDirectory extends vfsStreamDirectory +{ + /** + * returns iterator for the children + * + * @return vfsStreamContainerIterator + */ + public function getIterator() + { + return new \ArrayIterator(array()); + } + + /** + * checks whether dir is a dot dir + * + * @return bool + */ + public function isDot() + { + return true; + } +} +?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php new file mode 100644 index 0000000000000000000000000000000000000000..de649a8a08d9ef7499baffca7c936c13cf1ec6e5 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/FileContent.php @@ -0,0 +1,71 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * Interface for actual file contents. + * + * @since 1.3.0 + */ +interface FileContent +{ + /** + * returns actual content + * + * @return string + */ + public function content(); + + /** + * returns size of content + * + * @return int + */ + public function size(); + + /** + * reads the given amount of bytes from content + * + * @param int $count + * @return string + */ + public function read($count); + + /** + * seeks to the given offset + * + * @param int $offset + * @param int $whence + * @return bool + */ + public function seek($offset, $whence); + + /** + * checks whether pointer is at end of file + * + * @return bool + */ + public function eof(); + + /** + * writes an amount of data + * + * @param string $data + * @return amount of written bytes + */ + public function write($data); + + /** + * Truncates a file to a given length + * + * @param int $size length to truncate file to + * @return bool + */ + public function truncate($size); +} \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/LargeFileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/LargeFileContent.php new file mode 100644 index 0000000000000000000000000000000000000000..6bc0afc743a0875c6ca1e3b08254474840c2d49d --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/LargeFileContent.php @@ -0,0 +1,167 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * File content implementation to mock large files. + * + * When content is written via write() the data will be written into the + * positions according to the current offset. + * When content is read via read() it will use the already written data. If no + * data is written at the offsets to read those offsets will be filled with + * spaces. + * Please note that accessing the whole content via content() will deliver a + * string with the length of the originally defined size. It is not advisable to + * do so with large sizes, except you have enough memory and time. :-) + * + * @since 1.3.0 + */ +class LargeFileContent extends SeekableFileContent implements FileContent +{ + /** + * byte array of written content + * + * @type char[] + */ + private $content = array(); + /** + * file size in bytes + * + * @type int + */ + private $size; + + /** + * constructor + * + * @param int $size file size in bytes + */ + public function __construct($size) + { + $this->size = $size; + } + + /** + * create large file with given size in kilobyte + * + * @param int $kilobyte + * @return LargeFileContent + */ + public static function withKilobytes($kilobyte) + { + return new self($kilobyte * 1024); + } + + /** + * create large file with given size in megabyte + * + * @param int $megabyte + * @return LargeFileContent + */ + public static function withMegabytes($megabyte) + { + return self::withKilobytes($megabyte * 1024); + } + + /** + * create large file with given size in gigabyte + * + * @param int $gigabyte + * @return LargeFileContent + */ + public static function withGigabytes($gigabyte) + { + return self::withMegabytes($gigabyte * 1024); + } + + /** + * returns actual content + * + * @return string + */ + public function content() + { + return $this->doRead(0, $this->size); + } + + /** + * returns size of content + * + * @return int + */ + public function size() + { + return $this->size; + } + + /** + * actual reading of given byte count starting at given offset + * + * @param int $offset + * @param int $count + */ + protected function doRead($offset, $count) + { + if (($offset + $count) > $this->size) { + $count = $this->size - $offset; + } + + $result = ''; + for ($i = 0; $i < $count; $i++) { + if (isset($this->content[$i + $offset])) { + $result .= $this->content[$i + $offset]; + } else { + $result .= ' '; + } + } + + return $result; + } + + /** + * actual writing of data with specified length at given offset + * + * @param string $data + * @param int $offset + * @param int $length + */ + protected function doWrite($data, $offset, $length) + { + for ($i = 0; $i < $length; $i++) { + $this->content[$i + $offset] = $data{$i}; + } + + if ($offset >= $this->size) { + $this->size += $length; + } elseif (($offset + $length) > $this->size) { + $this->size = $offset + $length; + } + } + + /** + * Truncates a file to a given length + * + * @param int $size length to truncate file to + * @return bool + */ + public function truncate($size) + { + $this->size = $size; + foreach (array_filter(array_keys($this->content), + function($pos) use ($size) + { + return $pos >= $size; + } + ) as $removePos) { + unset($this->content[$removePos]); + } + + return true; + } +} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php new file mode 100644 index 0000000000000000000000000000000000000000..e74800083868acf56917a394d9bb88b83e96f863 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/SeekableFileContent.php @@ -0,0 +1,129 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * Default implementation for file contents based on simple strings. + * + * @since 1.3.0 + */ +abstract class SeekableFileContent implements FileContent +{ + /** + * current position within content + * + * @type int + */ + private $offset = 0; + + /** + * reads the given amount of bytes from content + * + * @param int $count + * @return string + */ + public function read($count) + { + $data = $this->doRead($this->offset, $count); + $this->offset += $count; + return $data; + } + + /** + * actual reading of given byte count starting at given offset + * + * @param int $offset + * @param int $count + */ + protected abstract function doRead($offset, $count); + + /** + * seeks to the given offset + * + * @param int $offset + * @param int $whence + * @return bool + */ + public function seek($offset, $whence) + { + switch ($whence) { + case SEEK_CUR: + $this->offset += $offset; + return true; + + case SEEK_END: + $this->offset = $this->size() + $offset; + return true; + + case SEEK_SET: + $this->offset = $offset; + return true; + + default: + return false; + } + + return false; + } + + /** + * checks whether pointer is at end of file + * + * @return bool + */ + public function eof() + { + return $this->size() <= $this->offset; + } + + /** + * writes an amount of data + * + * @param string $data + * @return amount of written bytes + */ + public function write($data) + { + $dataLength = strlen($data); + $this->doWrite($data, $this->offset, $dataLength); + $this->offset += $dataLength; + return $dataLength; + } + + /** + * actual writing of data with specified length at given offset + * + * @param string $data + * @param int $offset + * @param int $length + */ + protected abstract function doWrite($data, $offset, $length); + + /** + * for backwards compatibility with vfsStreamFile::bytesRead() + * + * @return int + * @deprecated + */ + public function bytesRead() + { + return $this->offset; + } + + /** + * for backwards compatibility with vfsStreamFile::readUntilEnd() + * + * @return string + * @deprecated + */ + public function readUntilEnd() + { + return substr($this->content(), $this->offset); + } +} diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php new file mode 100644 index 0000000000000000000000000000000000000000..58bd214000a78fb34e33245065f477b9c5b0d41f --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/content/StringBasedFileContent.php @@ -0,0 +1,97 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * Default implementation for file contents based on simple strings. + * + * @since 1.3.0 + */ +class StringBasedFileContent extends SeekableFileContent implements FileContent +{ + /** + * actual content + * + * @type string + */ + private $content; + + /** + * constructor + * + * @param string $content + */ + public function __construct($content) + { + $this->content = $content; + } + + /** + * returns actual content + * + * @return string + */ + public function content() + { + return $this->content; + } + + /** + * returns size of content + * + * @return int + */ + public function size() + { + return strlen($this->content); + } + + /** + * actual reading of length starting at given offset + * + * @param int $offset + * @param int $count + */ + protected function doRead($offset, $count) + { + return substr($this->content, $offset, $count); + } + + /** + * actual writing of data with specified length at given offset + * + * @param string $data + * @param int $offset + * @param int $length + */ + protected function doWrite($data, $offset, $length) + { + $this->content = substr($this->content, 0, $offset) + . $data + . substr($this->content, $offset + $length); + } + + /** + * Truncates a file to a given length + * + * @param int $size length to truncate file to + * @return bool + */ + public function truncate($size) + { + if ($size > $this->size()) { + // Pad with null-chars if we're "truncating up" + $this->content .= str_repeat("\0", $size - $this->size()); + } else { + $this->content = substr($this->content, 0, $size); + } + + return true; + } +} \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php index f68fefd8ac1d0322b84f2da961cfed766a19bddf..f9a72096f6c56fb3a883e411f13f345f410107ad 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php @@ -19,37 +19,43 @@ class vfsStream /** * url scheme */ - const SCHEME = 'vfs'; + const SCHEME = 'vfs'; /** * owner: root */ - const OWNER_ROOT = 0; + const OWNER_ROOT = 0; /** * owner: user 1 */ - const OWNER_USER_1 = 1; + const OWNER_USER_1 = 1; /** * owner: user 2 */ - const OWNER_USER_2 = 2; + const OWNER_USER_2 = 2; /** * group: root */ - const GROUP_ROOT = 0; + const GROUP_ROOT = 0; /** * group: user 1 */ - const GROUP_USER_1 = 1; + const GROUP_USER_1 = 1; /** * group: user 2 */ - const GROUP_USER_2 = 2; + const GROUP_USER_2 = 2; /** * initial umask setting * * @type int */ - protected static $umask = 0000; + protected static $umask = 0000; + /** + * switch whether dotfiles are enabled in directory listings + * + * @type bool + */ + private static $dotFiles = true; /** * prepends the scheme to the given URL @@ -70,8 +76,8 @@ public static function url($path) */ public static function path($url) { - // remove line feeds and trailing whitespaces - $path = trim($url, " \t\r\n\0\x0B/"); + // remove line feeds and trailing whitespaces and path separators + $path = trim($url, " \t\r\n\0\x0B/\\"); $path = substr($path, strlen(self::SCHEME . '://')); $path = str_replace('\\', '/', $path); // replace double slashes with single slashes @@ -385,5 +391,36 @@ public static function setQuota($bytes) { vfsStreamWrapper::setQuota(new Quota($bytes)); } + + /** + * checks if vfsStream lists dotfiles in directory listings + * + * @return bool + * @since 1.3.0 + */ + public static function useDotfiles() + { + return self::$dotFiles; + } + + /** + * disable dotfiles in directory listings + * + * @since 1.3.0 + */ + public static function disableDotfiles() + { + self::$dotFiles = false; + } + + /** + * enable dotfiles in directory listings + * + * @since 1.3.0 + */ + public static function enableDotfiles() + { + self::$dotFiles = true; + } } ?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php index 0f3e3a7912a166d6d731a3fb280dac201883af7e..83943dc6b16e5aa5cab0f9438b8bbc2544559a34 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php @@ -28,6 +28,10 @@ class vfsStreamContainerIterator implements \Iterator public function __construct(array $children) { $this->children = $children; + if (vfsStream::useDotfiles()) { + array_unshift($this->children, new DotDirectory('.'), new DotDirectory('..')); + } + reset($this->children); } diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php index ba4c0171567455c1f4acdf66edba442819c56e9b..e17c835f7193c7f6cdd74ad136e8d24c7b980820 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamDirectory.php @@ -249,5 +249,19 @@ public function getIterator() { return new vfsStreamContainerIterator($this->children); } + + /** + * checks whether dir is a dot dir + * + * @return bool + */ + public function isDot() + { + if ('.' === $this->name || '..' === $this->name) { + return true; + } + + return false; + } } ?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php index 70c1be848a17c7619f92a7da18d49a2381796ab6..7e5f065ebd65a37ab28891f0e1813bb8d3e2b46d 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php @@ -8,6 +8,8 @@ * @package org\bovigo\vfs */ namespace org\bovigo\vfs; +use org\bovigo\vfs\content\FileContent; +use org\bovigo\vfs\content\StringBasedFileContent; /** * File container. * @@ -16,17 +18,11 @@ class vfsStreamFile extends vfsStreamAbstractContent { /** - * the real content of the file + * content of the file * - * @type string + * @type FileContent */ - protected $content; - /** - * amount of read bytes - * - * @type int - */ - protected $bytes_read = 0; + private $content; /** * Resource id which exclusively locked this file * @@ -48,7 +44,8 @@ class vfsStreamFile extends vfsStreamAbstractContent */ public function __construct($name, $permissions = null) { - $this->type = vfsStreamContent::TYPE_FILE; + $this->content = new StringBasedFileContent(null); + $this->type = vfsStreamContent::TYPE_FILE; parent::__construct($name, $permissions); } @@ -92,12 +89,20 @@ public function setContent($content) * Setting content with this method does not change the time when the file * was last modified. * - * @param string $content + * @param string]FileContent $content * @return vfsStreamFile + * @throws \InvalidArgumentException */ public function withContent($content) { - $this->content = $content; + if (is_string($content)) { + $this->content = new StringBasedFileContent($content); + } elseif ($content instanceof FileContent) { + $this->content = $content; + } else { + throw new \InvalidArgumentException('Given content must either be a string or an instance of org\bovigo\vfs\content\FileContent'); + } + return $this; } @@ -111,7 +116,7 @@ public function withContent($content) */ public function getContent() { - return $this->content; + return $this->content->content(); } /** @@ -121,7 +126,7 @@ public function getContent() */ public function open() { - $this->seek(0, SEEK_SET); + $this->content->seek(0, SEEK_SET); $this->lastAccessed = time(); } @@ -132,7 +137,7 @@ public function open() */ public function openForAppend() { - $this->seek(0, SEEK_END); + $this->content->seek(0, SEEK_END); $this->lastAccessed = time(); } @@ -144,7 +149,7 @@ public function openForAppend() public function openWithTruncate() { $this->open(); - $this->content = ''; + $this->content->truncate(0); $time = time(); $this->lastAccessed = $time; $this->lastModified = $time; @@ -160,10 +165,8 @@ public function openWithTruncate() */ public function read($count) { - $data = substr($this->content, $this->bytes_read, $count); - $this->bytes_read += $count; $this->lastAccessed = time(); - return $data; + return $this->content->read($count); } /** @@ -172,11 +175,12 @@ public function read($count) * Using this method changes the time when the file was last accessed. * * @return string + * @deprecated since 1.3.0 */ public function readUntilEnd() { $this->lastAccessed = time(); - return substr($this->content, $this->bytes_read); + return $this->content->readUntilEnd(); } /** @@ -189,11 +193,8 @@ public function readUntilEnd() */ public function write($data) { - $dataLen = strlen($data); - $this->content = substr($this->content, 0, $this->bytes_read) . $data . substr($this->content, $this->bytes_read + $dataLen); - $this->bytes_read += $dataLen; $this->lastModified = time(); - return $dataLen; + return $this->content->write($data); } /** @@ -203,14 +204,9 @@ public function write($data) * @return bool * @since 1.1.0 */ - public function truncate($size) { - if ($size > $this->size()) { - // Pad with null-chars if we're "truncating up" - $this->setContent($this->getContent() . str_repeat("\0", $size - $this->size())); - } else { - $this->setContent(substr($this->getContent(), 0, $size)); - } - + public function truncate($size) + { + $this->content->truncate($size); $this->lastModified = time(); return true; } @@ -222,17 +218,18 @@ public function truncate($size) { */ public function eof() { - return $this->bytes_read >= strlen($this->content); + return $this->content->eof(); } /** * returns the current position within the file * * @return int + * @deprecated since 1.3.0 */ public function getBytesRead() { - return $this->bytes_read; + return $this->content->bytesRead(); } /** @@ -244,24 +241,7 @@ public function getBytesRead() */ public function seek($offset, $whence) { - switch ($whence) { - case SEEK_CUR: - $this->bytes_read += $offset; - return true; - - case SEEK_END: - $this->bytes_read = strlen($this->content) + $offset; - return true; - - case SEEK_SET: - $this->bytes_read = $offset; - return true; - - default: - return false; - } - - return false; + return $this->content->seek($offset, $whence); } /** @@ -271,7 +251,7 @@ public function seek($offset, $whence) */ public function size() { - return strlen($this->content); + return $this->content->size(); } @@ -304,7 +284,7 @@ public function lock($resource, $operation) if ($this->hasExclusiveLock()) { return false; } - + $this->addSharedLock($resource); } @@ -313,7 +293,7 @@ public function lock($resource, $operation) /** * Removes lock from file acquired by given resource - * + * * @param resource|vfsStreamWrapper $resource * @see https://github.com/mikey179/vfsStream/issues/40 */ @@ -412,4 +392,3 @@ public function hasExclusiveLock($resource = null) return null !== $this->exclusiveLock; } } -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php index 73d328001fdbe8c4a3d52040786f0f1efd3e0188..ddb36f1421bac6c38884380f5b0b992122212d2c 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php @@ -251,10 +251,10 @@ protected function resolvePath($path) public function stream_open($path, $mode, $options, $opened_path) { $extended = ((strstr($mode, '+') !== false) ? (true) : (false)); - $mode = str_replace(array('b', '+'), '', $mode); + $mode = str_replace(array('t', 'b', '+'), '', $mode); if (in_array($mode, array('r', 'w', 'a', 'x', 'c')) === false) { if (($options & STREAM_REPORT_ERRORS) === STREAM_REPORT_ERRORS) { - trigger_error('Illegal mode ' . $mode . ', use r, w, a, x or c, flavoured with b and/or +', E_USER_WARNING); + trigger_error('Illegal mode ' . $mode . ', use r, w, a, x or c, flavoured with t, b and/or +', E_USER_WARNING); } return false; @@ -484,14 +484,9 @@ public function stream_metadata($path, $option, $var) $content = $this->createFile($path); } - if (isset($var[0])) { - $content->lastModified($var[0]); - } - - if (isset($var[1])) { - $content->lastAccessed($var[1]); - } - + $currentTime = time(); + $content->lastModified(((isset($var[0])) ? ($var[0]) : ($currentTime))) + ->lastAccessed(((isset($var[1])) ? ($var[1]) : ($currentTime))); return true; case STREAM_META_OWNER_NAME: @@ -982,4 +977,4 @@ public function url_stat($path, $flags) return array_merge(array_values($fileStat), $fileStat); } } -?> \ No newline at end of file +?> diff --git a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php index 6af70b6aece38ec3629bcfc70d09cb2835e54c38..6f7d1642afe52fba42177d6f2461a05d112faffa 100644 --- a/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php +++ b/core/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php @@ -32,7 +32,10 @@ public function visit(vfsStreamContent $content) break; case vfsStreamContent::TYPE_DIR: - $this->visitDirectory($content); + if (!$content->isDot()) { + $this->visitDirectory($content); + } + break; default: diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..4f30b038b6b0fd840260bd974d249dc7c95ebc90 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/DirectoryIterationTestCase.php @@ -0,0 +1,318 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs; +require_once __DIR__ . '/vfsStreamWrapperBaseTestCase.php'; +/** + * Test for directory iteration. + * + * @group dir + * @group iteration + */ +class DirectoryIterationTestCase extends vfsStreamWrapperBaseTestCase +{ + /** + * clean up test environment + */ + public function tearDown() + { + vfsStream::enableDotfiles(); + } + + /** + * @return array + */ + public function provideSwitchWithExpectations() + { + return array(array(function() { vfsStream::disableDotfiles(); }, array('bar', 'baz2')), + array(function() { vfsStream::enableDotfiles(); }, array('.', '..', 'bar', 'baz2')) + ); + } + + /** + * assertion for directoy count + * + * @param int $expectedCount + * @param int $actualCount + */ + private function assertDirectoryCount($expectedCount, $actualCount) + { + $this->assertEquals($expectedCount, + $actualCount, + 'Directory foo contains ' . $expectedCount . ' children, but got ' . $actualCount . ' children while iterating over directory contents' + ); + } + + /** + * @param \Closure $dotFilesSwitch + * @param string[] $expectedDirectories + * @test + * @dataProvider provideSwitchWithExpectations + */ + public function directoryIteration(\Closure $dotFilesSwitch, array $expectedDirectories) + { + $dotFilesSwitch(); + $dir = dir($this->fooURL); + $i = 0; + while (false !== ($entry = $dir->read())) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + $dir->rewind(); + $i = 0; + while (false !== ($entry = $dir->read())) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + $dir->close(); + } + + /** + * @param \Closure $dotFilesSwitch + * @param string[] $expectedDirectories + * @test + * @dataProvider provideSwitchWithExpectations + */ + public function directoryIterationWithDot(\Closure $dotFilesSwitch, array $expectedDirectories) + { + $dotFilesSwitch(); + $dir = dir($this->fooURL . '/.'); + $i = 0; + while (false !== ($entry = $dir->read())) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + $dir->rewind(); + $i = 0; + while (false !== ($entry = $dir->read())) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + $dir->close(); + } + + /** + * assure that a directory iteration works as expected + * + * @param \Closure $dotFilesSwitch + * @param string[] $expectedDirectories + * @test + * @dataProvider provideSwitchWithExpectations + * @group regression + * @group bug_2 + */ + public function directoryIterationWithOpenDir_Bug_2(\Closure $dotFilesSwitch, array $expectedDirectories) + { + $dotFilesSwitch(); + $handle = opendir($this->fooURL); + $i = 0; + while (false !== ($entry = readdir($handle))) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + + rewinddir($handle); + $i = 0; + while (false !== ($entry = readdir($handle))) { + $i++; + $this->assertTrue(in_array($entry, $expectedDirectories)); + } + + $this->assertDirectoryCount(count($expectedDirectories), $i); + closedir($handle); + } + + /** + * assure that a directory iteration works as expected + * + * @author Christoph Bloemer + * @param \Closure $dotFilesSwitch + * @param string[] $expectedDirectories + * @test + * @dataProvider provideSwitchWithExpectations + * @group regression + * @group bug_4 + */ + public function directoryIteration_Bug_4(\Closure $dotFilesSwitch, array $expectedDirectories) + { + $dotFilesSwitch(); + $dir = $this->fooURL; + $list1 = array(); + if ($handle = opendir($dir)) { + while (false !== ($listItem = readdir($handle))) { + if ('.' != $listItem && '..' != $listItem) { + if (is_file($dir . '/' . $listItem) === true) { + $list1[] = 'File:[' . $listItem . ']'; + } elseif (is_dir($dir . '/' . $listItem) === true) { + $list1[] = 'Folder:[' . $listItem . ']'; + } + } + } + + closedir($handle); + } + + $list2 = array(); + if ($handle = opendir($dir)) { + while (false !== ($listItem = readdir($handle))) { + if ('.' != $listItem && '..' != $listItem) { + if (is_file($dir . '/' . $listItem) === true) { + $list2[] = 'File:[' . $listItem . ']'; + } elseif (is_dir($dir . '/' . $listItem) === true) { + $list2[] = 'Folder:[' . $listItem . ']'; + } + } + } + + closedir($handle); + } + + $this->assertEquals($list1, $list2); + $this->assertEquals(2, count($list1)); + $this->assertEquals(2, count($list2)); + } + + /** + * assure that a directory iteration works as expected + * + * @param \Closure $dotFilesSwitch + * @param string[] $expectedDirectories + * @test + * @dataProvider provideSwitchWithExpectations + */ + public function directoryIterationShouldBeIndependent(\Closure $dotFilesSwitch, array $expectedDirectories) + { + $dotFilesSwitch(); + $list1 = array(); + $list2 = array(); + $handle1 = opendir($this->fooURL); + if (false !== ($listItem = readdir($handle1))) { + $list1[] = $listItem; + } + + $handle2 = opendir($this->fooURL); + if (false !== ($listItem = readdir($handle2))) { + $list2[] = $listItem; + } + + if (false !== ($listItem = readdir($handle1))) { + $list1[] = $listItem; + } + + if (false !== ($listItem = readdir($handle2))) { + $list2[] = $listItem; + } + + closedir($handle1); + closedir($handle2); + $this->assertEquals($list1, $list2); + $this->assertEquals(2, count($list1)); + $this->assertEquals(2, count($list2)); + } + + /** + * @test + * @group issue_50 + */ + public function recursiveDirectoryIterationWithDotsEnabled() + { + vfsStream::enableDotfiles(); + vfsStream::setup(); + $structure = array( + 'Core' => array( + 'AbstractFactory' => array( + 'test.php' => 'some text content', + 'other.php' => 'Some more text content', + 'Invalid.csv' => 'Something else', + ), + 'AnEmptyFolder' => array(), + 'badlocation.php' => 'some bad content', + ) + ); + $root = vfsStream::create($structure); + $rootPath = vfsStream::url($root->getName()); + + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootPath), + \RecursiveIteratorIterator::CHILD_FIRST); + $pathes = array(); + foreach ($iterator as $fullFileName => $fileSPLObject) { + $pathes[] = $fullFileName; + } + + $this->assertEquals(array('vfs://root'.DIRECTORY_SEPARATOR.'.', + 'vfs://root'.DIRECTORY_SEPARATOR.'..', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'.', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'..', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'.', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'..', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'test.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'other.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'Invalid.csv', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder'.DIRECTORY_SEPARATOR.'.', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder'.DIRECTORY_SEPARATOR.'..', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'badlocation.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core' + ), + $pathes + ); + } + + /** + * @test + * @group issue_50 + */ + public function recursiveDirectoryIterationWithDotsDisabled() + { + vfsStream::disableDotfiles(); + vfsStream::setup(); + $structure = array( + 'Core' => array( + 'AbstractFactory' => array( + 'test.php' => 'some text content', + 'other.php' => 'Some more text content', + 'Invalid.csv' => 'Something else', + ), + 'AnEmptyFolder' => array(), + 'badlocation.php' => 'some bad content', + ) + ); + $root = vfsStream::create($structure); + $rootPath = vfsStream::url($root->getName()); + + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootPath), + \RecursiveIteratorIterator::CHILD_FIRST); + $pathes = array(); + foreach ($iterator as $fullFileName => $fileSPLObject) { + $pathes[] = $fullFileName; + } + + $this->assertEquals(array('vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'test.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'other.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory'.DIRECTORY_SEPARATOR.'Invalid.csv', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AbstractFactory', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'AnEmptyFolder', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core'.DIRECTORY_SEPARATOR.'badlocation.php', + 'vfs://root'.DIRECTORY_SEPARATOR.'Core' + ), + $pathes + ); + } +} \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..c7a7458de23786541241d70b9f944200741f04c3 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/LargeFileContentTestCase.php @@ -0,0 +1,225 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * Test for org\bovigo\vfs\content\LargeFileContent. + * + * @since 1.3.0 + * @group issue_79 + */ +class LargeFileContentTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * instance to test + * + * @type LargeFileContent + */ + private $largeFileContent; + + /** + * set up test environment + */ + public function setUp() + { + $this->largeFileContent = new LargeFileContent(100); + } + + /** + * @test + */ + public function hasSizeOriginallyGiven() + { + $this->assertEquals(100, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function contentIsFilledUpWithSpacesIfNoDataWritten() + { + $this->assertEquals( + str_repeat(' ', 100), + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function readReturnsSpacesWhenNothingWrittenAtOffset() + { + $this->assertEquals( + str_repeat(' ', 10), + $this->largeFileContent->read(10) + ); + } + + /** + * @test + */ + public function readReturnsContentFilledWithSpaces() + { + $this->largeFileContent->write('foobarbaz'); + $this->largeFileContent->seek(0, SEEK_SET); + $this->assertEquals( + 'foobarbaz ', + $this->largeFileContent->read(10) + ); + } + + /** + * @test + */ + public function writesDataAtStartWhenOffsetNotMoved() + { + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals( + 'foobarbaz' . str_repeat(' ', 91), + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function writeDataAtStartDoesNotIncreaseSize() + { + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals(100, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function writesDataAtOffsetWhenOffsetMoved() + { + $this->largeFileContent->seek(50, SEEK_SET); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals( + str_repeat(' ', 50) . 'foobarbaz' . str_repeat(' ', 41), + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function writeDataInBetweenDoesNotIncreaseSize() + { + $this->largeFileContent->seek(50, SEEK_SET); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals(100, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function writesDataOverEndWhenOffsetAndDataLengthLargerThanSize() + { + $this->largeFileContent->seek(95, SEEK_SET); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals( + str_repeat(' ', 95) . 'foobarbaz', + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function writeDataOverLastOffsetIncreasesSize() + { + $this->largeFileContent->seek(95, SEEK_SET); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals(104, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function writesDataAfterEndWhenOffsetAfterEnd() + { + $this->largeFileContent->seek(0, SEEK_END); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals( + str_repeat(' ', 100) . 'foobarbaz', + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function writeDataAfterLastOffsetIncreasesSize() + { + $this->largeFileContent->seek(0, SEEK_END); + $this->assertEquals(9, $this->largeFileContent->write('foobarbaz')); + $this->assertEquals(109, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function truncateReducesSize() + { + $this->assertTrue($this->largeFileContent->truncate(50)); + $this->assertEquals(50, $this->largeFileContent->size()); + } + + /** + * @test + */ + public function truncateRemovesWrittenContentAfterOffset() + { + $this->largeFileContent->seek(45, SEEK_SET); + $this->largeFileContent->write('foobarbaz'); + $this->assertTrue($this->largeFileContent->truncate(50)); + $this->assertEquals( + str_repeat(' ', 45) . 'fooba', + $this->largeFileContent->content() + ); + } + + /** + * @test + */ + public function createInstanceWithKilobytes() + { + $this->assertEquals( + 100 * 1024, + LargeFileContent::withKilobytes(100) + ->size() + ); + } + + /** + * @test + */ + public function createInstanceWithMegabytes() + { + $this->assertEquals( + 100 * 1024 * 1024, + LargeFileContent::withMegabytes(100) + ->size() + ); + } + + /** + * @test + */ + public function createInstanceWithGigabytes() + { + $this->assertEquals( + 100 * 1024 * 1024 * 1024, + LargeFileContent::withGigabytes(100) + ->size() + ); + } +} diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..d0e15edb42aefbe175edeeb9b52e7e18f1d12ed4 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/content/StringBasedFileContentTestCase.php @@ -0,0 +1,230 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs\content; +/** + * Test for org\bovigo\vfs\content\StringBasedFileContent. + * + * @since 1.3.0 + * @group issue_79 + */ +class StringBasedFileContentTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * instance to test + * + * @type StringBasedFileContent + */ + private $stringBasedFileContent; + + /** + * set up test environment + */ + public function setUp() + { + $this->stringBasedFileContent = new StringBasedFileContent('foobarbaz'); + } + + /** + * @test + */ + public function hasContentOriginallySet() + { + $this->assertEquals('foobarbaz', $this->stringBasedFileContent->content()); + } + + /** + * @test + */ + public function hasNotReachedEofAfterCreation() + { + $this->assertFalse($this->stringBasedFileContent->eof()); + } + + /** + * @test + */ + public function sizeEqualsLengthOfGivenString() + { + $this->assertEquals(9, $this->stringBasedFileContent->size()); + } + + /** + * @test + */ + public function readReturnsSubstringWithRequestedLength() + { + $this->assertEquals('foo', $this->stringBasedFileContent->read(3)); + } + + /** + * @test + */ + public function readMovesOffset() + { + $this->assertEquals('foo', $this->stringBasedFileContent->read(3)); + $this->assertEquals('bar', $this->stringBasedFileContent->read(3)); + $this->assertEquals('baz', $this->stringBasedFileContent->read(3)); + } + + /** + * @test + */ + public function reaMoreThanSizeReturnsWholeContent() + { + $this->assertEquals('foobarbaz', $this->stringBasedFileContent->read(10)); + } + + /** + * @test + */ + public function readAfterEndReturnsEmptyString() + { + $this->stringBasedFileContent->read(9); + $this->assertEquals('', $this->stringBasedFileContent->read(3)); + } + + /** + * @test + */ + public function readDoesNotChangeSize() + { + $this->stringBasedFileContent->read(3); + $this->assertEquals(9, $this->stringBasedFileContent->size()); + } + + /** + * @test + */ + public function readLessThenSizeDoesNotReachEof() + { + $this->stringBasedFileContent->read(3); + $this->assertFalse($this->stringBasedFileContent->eof()); + } + + /** + * @test + */ + public function readSizeReachesEof() + { + $this->stringBasedFileContent->read(9); + $this->assertTrue($this->stringBasedFileContent->eof()); + } + + /** + * @test + */ + public function readMoreThanSizeReachesEof() + { + $this->stringBasedFileContent->read(10); + $this->assertTrue($this->stringBasedFileContent->eof()); + } + + /** + * @test + */ + public function seekWithInvalidOptionReturnsFalse() + { + $this->assertFalse($this->stringBasedFileContent->seek(0, 55)); + } + + /** + * @test + */ + public function canSeekToGivenOffset() + { + $this->assertTrue($this->stringBasedFileContent->seek(5, SEEK_SET)); + $this->assertEquals('rbaz', $this->stringBasedFileContent->read(10)); + } + + /** + * @test + */ + public function canSeekFromCurrentOffset() + { + $this->assertTrue($this->stringBasedFileContent->seek(5, SEEK_SET)); + $this->assertTrue($this->stringBasedFileContent->seek(2, SEEK_CUR)); + $this->assertEquals('az', $this->stringBasedFileContent->read(10)); + } + + /** + * @test + */ + public function canSeekToEnd() + { + $this->assertTrue($this->stringBasedFileContent->seek(0, SEEK_END)); + $this->assertEquals('', $this->stringBasedFileContent->read(10)); + } + + /** + * @test + */ + public function writeOverwritesExistingContentWhenOffsetNotAtEof() + { + $this->assertEquals(3, $this->stringBasedFileContent->write('bar')); + $this->assertEquals('barbarbaz', $this->stringBasedFileContent->content()); + } + + /** + * @test + */ + public function writeAppendsContentWhenOffsetAtEof() + { + $this->assertTrue($this->stringBasedFileContent->seek(0, SEEK_END)); + $this->assertEquals(3, $this->stringBasedFileContent->write('bar')); + $this->assertEquals('foobarbazbar', $this->stringBasedFileContent->content()); + } + + /** + * @test + * @group issue_33 + * @since 1.1.0 + */ + public function truncateRemovesSuperflouosContent() + { + $this->assertTrue($this->stringBasedFileContent->truncate(6)); + $this->assertEquals('foobar', $this->stringBasedFileContent->content()); + } + + /** + * @test + * @group issue_33 + * @since 1.1.0 + */ + public function truncateDecreasesSize() + { + $this->assertTrue($this->stringBasedFileContent->truncate(6)); + $this->assertEquals(6, $this->stringBasedFileContent->size()); + } + + /** + * @test + * @group issue_33 + * @since 1.1.0 + */ + public function truncateToGreaterSizeAddsZeroBytes() + { + $this->assertTrue($this->stringBasedFileContent->truncate(25)); + $this->assertEquals( + "foobarbaz\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + $this->stringBasedFileContent->content() + ); + } + + /** + * @test + * @group issue_33 + * @since 1.1.0 + */ + public function truncateToGreaterSizeIncreasesSize() + { + $this->assertTrue($this->stringBasedFileContent->truncate(25)); + $this->assertEquals(25, $this->stringBasedFileContent->size()); + } +} diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php index 9aa6960da28cd14c1b9ee102b2d8229d31889ab1..e1b4fe112069cc8e688bf05c39429fc930226de8 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamContainerIteratorTestCase.php @@ -14,42 +14,99 @@ class vfsStreamContainerIteratorTestCase extends \PHPUnit_Framework_TestCase { /** - * test method to be used for iterating + * instance to test * + * @type vfsStreamDirectory + */ + private $dir; + /** + * child one + * + * @type \PHPUnit_Framework_MockObject_MockObject + */ + private $mockChild1; + /** + * child two + * + * @type \PHPUnit_Framework_MockObject_MockObject + */ + private $mockChild2; + + /** + * set up test environment + */ + public function setUp() + { + $this->dir = new vfsStreamDirectory('foo'); + $this->mockChild1 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); + $this->mockChild1->expects($this->any()) + ->method('getName') + ->will($this->returnValue('bar')); + $this->dir->addChild($this->mockChild1); + $this->mockChild2 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); + $this->mockChild2->expects($this->any()) + ->method('getName') + ->will($this->returnValue('baz')); + $this->dir->addChild($this->mockChild2); + } + + /** + * clean up test environment + */ + public function tearDown() + { + vfsStream::enableDotfiles(); + } + + /** + * @return array + */ + public function provideSwitchWithExpectations() + { + return array(array(function() { vfsStream::disableDotfiles(); }, + array() + ), + array(function() { vfsStream::enableDotfiles(); }, + array('.', '..') + ) + ); + } + + private function getDirName($dir) + { + if (is_string($dir)) { + return $dir; + } + + + return $dir->getName(); + } + + /** + * @param \Closure $dotFilesSwitch + * @param array $dirNames * @test + * @dataProvider provideSwitchWithExpectations */ - public function iteration() + public function iteration(\Closure $dotFilesSwitch, array $dirs) { - $dir = new vfsStreamDirectory('foo'); - $mockChild1 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild1->expects($this->any()) - ->method('getName') - ->will($this->returnValue('bar')); - $dir->addChild($mockChild1); - $mockChild2 = $this->getMock('org\\bovigo\\vfs\\vfsStreamContent'); - $mockChild2->expects($this->any()) - ->method('getName') - ->will($this->returnValue('baz')); - $dir->addChild($mockChild2); - $dirIterator = $dir->getIterator(); - $this->assertEquals('bar', $dirIterator->key()); - $this->assertTrue($dirIterator->valid()); - $bar = $dirIterator->current(); - $this->assertSame($mockChild1, $bar); - $dirIterator->next(); - $this->assertEquals('baz', $dirIterator->key()); - $this->assertTrue($dirIterator->valid()); - $baz = $dirIterator->current(); - $this->assertSame($mockChild2, $baz); - $dirIterator->next(); + $dirs[] = $this->mockChild1; + $dirs[] = $this->mockChild2; + $dotFilesSwitch(); + $dirIterator = $this->dir->getIterator(); + foreach ($dirs as $dir) { + $this->assertEquals($this->getDirName($dir), $dirIterator->key()); + $this->assertTrue($dirIterator->valid()); + if (!is_string($dir)) { + $this->assertSame($dir, $dirIterator->current()); + } + + $dirIterator->next(); + } + $this->assertFalse($dirIterator->valid()); $this->assertNull($dirIterator->key()); $this->assertNull($dirIterator->current()); - $dirIterator->rewind(); - $this->assertTrue($dirIterator->valid()); - $this->assertEquals('bar', $dirIterator->key()); - $bar2 = $dirIterator->current(); - $this->assertSame($mockChild1, $bar2); } } ?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php index d93e99424a141f21074823484bd7b8978d2bbe3f..5fe15d030eb27e41c323af706d1490c754e16752 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php @@ -274,5 +274,33 @@ public function truncateToGreaterSizeAddsZeroBytes() $this->assertEquals(25, $this->file->size()); $this->assertEquals("lorem ipsum\0\0\0\0\0\0\0\0\0\0\0\0\0\0", $this->file->getContent()); } + + /** + * @test + * @group issue_79 + * @since 1.3.0 + */ + public function withContentAcceptsAnyFileContentInstance() + { + $mockFileContent = $this->getMock('org\bovigo\vfs\content\FileContent'); + $mockFileContent->expects($this->once()) + ->method('content') + ->will($this->returnValue('foobarbaz')); + $this->assertEquals( + 'foobarbaz', + $this->file->withContent($mockFileContent) + ->getContent() + ); + } + + /** + * @test + * @group issue_79 + * @expectedException \InvalidArgumentException + * @since 1.3.0 + */ + public function withContentThrowsInvalidArgumentExceptionWhenContentIsNoStringAndNoFileContent() + { + $this->file->withContent(313); + } } -?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamGlobTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamGlobTestCase.php old mode 100755 new mode 100644 diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php old mode 100755 new mode 100644 index a4d70b54ec2adb0850d8d0c2722747023dd9c9b6..6619505e01ee2e1394197fdaafcb438bac6abbb0 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamResolveIncludePathTestCase.php @@ -28,6 +28,10 @@ class vfsStreamResolveIncludePathTestCase extends \PHPUnit_Framework_TestCase */ public function setUp() { + if (defined('HPHP_VERSION')) { + $this->markTestSkipped('Requires https://github.com/facebook/hhvm/issues/1476 to be fixed'); + } + $this->backupIncludePath = get_include_path(); vfsStream::setup(); mkdir('vfs://root/a/path', 0777, true); diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php index f08f0a7fde3ab1f40179e2f34f184d1b911e7abd..1fd2a2d9c70cbd205560ab6ecb0a586d91889457 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirSeparatorTestCase.php @@ -53,5 +53,21 @@ public function directoryCanBeCreatedUsingWinDirSeparator() $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\\')); + } } ?> \ No newline at end of file diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php index cf4efdd4a9a30bedf0d3f974b17b6215b818607a..4f3c1693b5332e4f15c14e2e5f022746c6279fa1 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperDirTestCase.php @@ -262,163 +262,6 @@ public function canNotIterateOverNonReadableDirectory() $this->assertFalse(@dir(vfsStream::url('root'))); } - /** - * @test - */ - public function directoryIteration() - { - $dir = dir($this->fooURL); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - $dir->rewind(); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - $dir->close(); - } - - /** - * @test - */ - public function directoryIterationWithDot() - { - $dir = dir($this->fooURL . '/.'); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - $dir->rewind(); - $i = 0; - while (false !== ($entry = $dir->read())) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - $dir->close(); - } - - /** - * assure that a directory iteration works as expected - * - * @test - * @group regression - * @group bug_2 - */ - public function directoryIterationWithOpenDir_Bug_2() - { - $handle = opendir($this->fooURL); - $i = 0; - while (false !== ($entry = readdir($handle))) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - - rewind($handle); - $i = 0; - while (false !== ($entry = readdir($handle))) { - $i++; - $this->assertTrue('bar' === $entry || 'baz2' === $entry); - } - - $this->assertEquals(2, $i, 'Directory foo contains two children, but got ' . $i . ' children while iterating over directory contents'); - closedir($handle); - } - - /** - * assure that a directory iteration works as expected - * - * @author Christoph Bloemer - * @test - * @group regression - * @group bug_4 - */ - public function directoryIteration_Bug_4() - { - $dir = $this->fooURL; - $list1 = array(); - if ($handle = opendir($dir)) { - while (false !== ($listItem = readdir($handle))) { - if ('.' != $listItem && '..' != $listItem) { - if (is_file($dir . '/' . $listItem) === true) { - $list1[] = 'File:[' . $listItem . ']'; - } elseif (is_dir($dir . '/' . $listItem) === true) { - $list1[] = 'Folder:[' . $listItem . ']'; - } - } - } - - closedir($handle); - } - - $list2 = array(); - if ($handle = opendir($dir)) { - while (false !== ($listItem = readdir($handle))) { - if ('.' != $listItem && '..' != $listItem) { - if (is_file($dir . '/' . $listItem) === true) { - $list2[] = 'File:[' . $listItem . ']'; - } elseif (is_dir($dir . '/' . $listItem) === true) { - $list2[] = 'Folder:[' . $listItem . ']'; - } - } - } - - closedir($handle); - } - - $this->assertEquals($list1, $list2); - $this->assertEquals(2, count($list1)); - $this->assertEquals(2, count($list2)); - } - - /** - * assure that a directory iteration works as expected - * - * @test - */ - public function directoryIterationShouldBeIndependent() - { - $list1 = array(); - $list2 = array(); - $handle1 = opendir($this->fooURL); - if (false !== ($listItem = readdir($handle1))) { - $list1[] = $listItem; - } - - $handle2 = opendir($this->fooURL); - if (false !== ($listItem = readdir($handle2))) { - $list2[] = $listItem; - } - - if (false !== ($listItem = readdir($handle1))) { - $list1[] = $listItem; - } - - if (false !== ($listItem = readdir($handle2))) { - $list2[] = $listItem; - } - - closedir($handle1); - closedir($handle2); - $this->assertEquals($list1, $list2); - $this->assertEquals(2, count($list1)); - $this->assertEquals(2, count($list2)); - } - /** * assert is_dir() returns correct result * diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php old mode 100755 new mode 100644 diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..ca1a3f51c3a6688bd84e04cf58ff0cde8d801d42 --- /dev/null +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php @@ -0,0 +1,77 @@ +<?php +/** + * This file is part of vfsStream. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @package org\bovigo\vfs + */ +namespace org\bovigo\vfs; +use org\bovigo\vfs\content\LargeFileContent; +/** + * Test for large file mocks. + * + * @package bovigo_vfs + * @subpackage test + * @since 1.3.0 + * @group issue_79 + */ +class vfsStreamWrapperLargeFileTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * large file to test + * + * @var vfsStreamFile + */ + private $largeFile; + + /** + * set up test environment + */ + public function setUp() + { + $root = vfsStream::setup(); + $this->largeFile = vfsStream::newFile('large.txt') + ->withContent(LargeFileContent::withGigabytes(100)) + ->at($root); + } + + /** + * @test + */ + public function hasLargeFileSize() + { + $this->assertEquals( + 100 * 1024 * 1024 * 1024, + filesize($this->largeFile->url()) + ); + } + + /** + * @test + */ + public function canReadFromLargeFile() + { + $fp = fopen($this->largeFile->url(), 'rb'); + $data = fread($fp, 15); + fclose($fp); + $this->assertEquals(str_repeat(' ', 15), $data); + } + + /** + * @test + */ + public function canWriteIntoLargeFile() + { + $fp = fopen($this->largeFile->url(), 'rb+'); + fseek($fp, 100 * 1024 * 1024, SEEK_SET); + fwrite($fp, 'foobarbaz'); + fclose($fp); + $this->largeFile->seek((100 * 1024 * 1024) - 3, SEEK_SET); + $this->assertEquals( + ' foobarbaz ', + $this->largeFile->read(15) + ); + } +} diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php index 84c454619e0c1cc1bb42fb8e2acc75da1d310b01..afaeb47199c248b2d32a367aef3cc650467d1bd8 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperQuotaTestCase.php @@ -96,6 +96,10 @@ public function truncateToLessThanQuotaWritesEverything() $this->markTestSkipped('Requires PHP 5.4'); } + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); + } + $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); $this->assertTrue(ftruncate($fp, 9)); fclose($fp); @@ -117,6 +121,10 @@ public function truncateUpToQotaWritesEverything() $this->markTestSkipped('Requires PHP 5.4'); } + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); + } + $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); $this->assertTrue(ftruncate($fp, 10)); fclose($fp); @@ -138,6 +146,10 @@ public function truncateToMoreThanQotaWritesOnlyUpToQuota() $this->markTestSkipped('Requires PHP 5.4'); } + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); + } + $fp = fopen(vfsStream::url('root/file.txt'), 'w+'); $this->assertTrue(ftruncate($fp, 11)); fclose($fp); @@ -159,6 +171,10 @@ public function truncateConsidersAllFilesForQuota() $this->markTestSkipped('Requires PHP 5.4'); } + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); + } + vfsStream::newFile('bar.txt') ->withContent('bar') ->at(vfsStream::newDirectory('bar') @@ -185,6 +201,10 @@ public function canNotTruncateToGreaterLengthWhenDiscQuotaReached() $this->markTestSkipped('Requires PHP 5.4'); } + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); + } + vfsStream::newFile('bar.txt') ->withContent('1234567890') ->at(vfsStream::newDirectory('bar') diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperSetOptionTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperSetOptionTestCase.php old mode 100755 new mode 100644 diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperStreamSelectTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperStreamSelectTestCase.php old mode 100755 new mode 100644 diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php index fb3fab22feecf42e0dd5f27860aa4dc033c7ae56..01156299aded9dabef6dae92bd58e886cb6c5540 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php @@ -619,13 +619,14 @@ public function openFileWithoutDirectory() /** * @test - * @group issue_33 - * @since 1.1.0 + * @group issue_33 + * @since 1.1.0 + * @requires PHP 5.4.0 */ public function truncateRemovesSuperflouosContent() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); } $handle = fopen($this->baz1URL, "r+"); @@ -637,13 +638,14 @@ public function truncateRemovesSuperflouosContent() /** * @test - * @group issue_33 - * @since 1.1.0 + * @group issue_33 + * @since 1.1.0 + * @requires PHP 5.4.0 */ public function truncateToGreaterSizeAddsZeroBytes() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); + if (strstr(PHP_VERSION, 'hiphop') !== false) { + $this->markTestSkipped('Not supported on hhvm'); } $handle = fopen($this->baz1URL, "r+"); @@ -656,28 +658,22 @@ public function truncateToGreaterSizeAddsZeroBytes() /** * @test - * @group issue_11 + * @group issue_11 + * @requires PHP 5.4.0 */ public function touchCreatesNonExistingFile() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - $this->assertTrue(touch($this->fooURL . '/new.txt')); $this->assertTrue($this->foo->hasChild('new.txt')); } /** * @test - * @group issue_11 + * @group issue_11 + * @requires PHP 5.4.0 */ public function touchChangesAccessAndModificationTimeForFile() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - $this->assertTrue(touch($this->baz1URL, 303, 313)); $this->assertEquals(303, $this->baz1->filemtime()); $this->assertEquals(313, $this->baz1->fileatime()); @@ -685,29 +681,24 @@ public function touchChangesAccessAndModificationTimeForFile() /** * @test - * @group issue_11 + * @group issue_11 + * @group issue_80 + * @requires PHP 5.4.0 */ - public function touchDoesNotChangeTimesWhenNoTimesGiven() + public function touchChangesTimesToCurrentTimestampWhenNoTimesGiven() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - $this->assertTrue(touch($this->baz1URL)); - $this->assertEquals(300, $this->baz1->filemtime()); - $this->assertEquals(300, $this->baz1->fileatime()); + $this->assertEquals(time(), $this->baz1->filemtime(), '', 1); + $this->assertEquals(time(), $this->baz1->fileatime(), '', 1); } /** * @test - * @group issue_11 + * @group issue_11 + * @requires PHP 5.4.0 */ public function touchWithModifiedTimeChangesAccessAndModifiedTime() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - $this->assertTrue(touch($this->baz1URL, 303)); $this->assertEquals(303, $this->baz1->filemtime()); $this->assertEquals(303, $this->baz1->fileatime()); @@ -715,14 +706,11 @@ public function touchWithModifiedTimeChangesAccessAndModifiedTime() /** * @test - * @group issue_11 + * @group issue_11 + * @requires PHP 5.4.0 */ public function touchChangesAccessAndModificationTimeForDirectory() { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $this->markTestSkipped('Requires PHP 5.4'); - } - $this->assertTrue(touch($this->fooURL, 303, 313)); $this->assertEquals(303, $this->foo->filemtime()); $this->assertEquals(313, $this->foo->fileatime()); diff --git a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php index 45114c230594bb2818cca6d7a4a570dd096b149c..6aedcecd9220243df4ee45e7f66e805bec0b0457 100644 --- a/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php +++ b/core/vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php @@ -37,7 +37,7 @@ public function setUp() public function createZipArchive() { $zip = new ZipArchive(); - $this->assertTrue($zip->open(vfsStream::url('root/test.zip'), ZIPARCHIVE::CREATE)); + $this->assertTrue($zip->open(vfsStream::url('root/test.zip'), ZipArchive::CREATE)); $this->assertTrue($zip->addFromString("testfile1.txt", "#1 This is a test string added as testfile1.txt.\n")); $this->assertTrue($zip->addFromString("testfile2.txt", "#2 This is a test string added as testfile2.txt.\n")); $zip->setArchiveComment('a test'); diff --git a/core/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/emptyFolder/.gitignore b/core/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/emptyFolder/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/core/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/subfolder2/.gitignore b/core/vendor/mikey179/vfsStream/src/test/resources/filesystemcopy/withSubfolders/subfolder2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391