gluon-web-remote

Web remote Administration for big size of gluon routers
git clone git://archive.git.mtrnord.blog/MTRNord/gluon-web-remote.git
Log | Files | Refs | README

commit 1b65986782ef8095f1945a8d163676653f5ba1e5
parent 6a672f07242a75b2deb6e6e66a8bd3a8da3d2ae9
Author: Marcel <info@nordgedanken.de>
Date:   Fri, 23 Oct 2015 19:17:53 +0200

retry to add libs

Diffstat:
Dlibs/php-ssh | 1-
Alibs/php-ssh/.travis.yml | 20++++++++++++++++++++
Alibs/php-ssh/LICENSE | 22++++++++++++++++++++++
Alibs/php-ssh/README.markdown | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/composer.json | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/composer.lock | 480+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/phpunit.xml.dist | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/AbstractResourceHolder.php | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication.php | 20++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication/Agent.php | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication/HostBasedFile.php | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication/None.php | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication/Password.php | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Authentication/PublicKeyFile.php | 48++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Configuration.php | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Exec.php | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Publickey.php | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/ResourceHolder.php | 18++++++++++++++++++
Alibs/php-ssh/src/Ssh/Session.php | 178+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Sftp.php | 301+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/SshConfigFileConfiguration.php | 169+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/src/Ssh/Subsystem.php | 44++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/AbstractResourceHolderTest.php | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Authentication/AgentTest.php | 19+++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Authentication/HostBasedFileTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Authentication/NoneTest.php | 19+++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Authentication/PasswordTest.php | 20++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Authentication/PublicKeyFileTest.php | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/ConfigurationTest.php | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/Fixtures/config_invalid | 4++++
Alibs/php-ssh/tests/Ssh/Fixtures/config_valid | 24++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/FunctionalTests/ExecTest.php | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/FunctionalTests/LoginTest.php | 43+++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/FunctionalTests/SftpTest.php | 262+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/SessionTest.php | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/SshConfigFileConfigurationTest.php | 157+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/Ssh/SubsystemTest.php | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/tests/bootstrap.php.dist | 13+++++++++++++
Alibs/php-ssh/vendor/autoload.php | 7+++++++
Alibs/php-ssh/vendor/bin/phpunit | 2++
Alibs/php-ssh/vendor/composer/ClassLoader.php | 413+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/composer/LICENSE | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/composer/autoload_classmap.php | 355+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/composer/autoload_namespaces.php | 10++++++++++
Alibs/php-ssh/vendor/composer/autoload_psr4.php | 11+++++++++++
Alibs/php-ssh/vendor/composer/autoload_real.php | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/composer/include_paths.php | 14++++++++++++++
Alibs/php-ssh/vendor/composer/installed.json | 480+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/php-code-coverage/.gitignore | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/.travis.yml | 20++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/CONTRIBUTING.md | 5+++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php | 801+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php.in | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver.php | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver/Xdebug.php | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Exception.php | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php | 349+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Clover.php | 346+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php | 280+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php | 224+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer.php | 285+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Dashboard.php | 240+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/File.php | 583+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist | 3+++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap-responsive.min.css | 9+++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css | 9+++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css | 770+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/style.css | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings-white.png | 0
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings.png | 0
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/d3.min.js | 6++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/html5shiv.js | 8++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/jquery.min.js | 6++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/nv.d3.min.js | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/method_item.html.dist | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node.php | 380+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Directory.php | 512+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/File.php | 721+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Iterator.php | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/PHP.php | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Text.php | 278+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util.php | 265+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util/InvalidArgumentHelper.php | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Version.php | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/README.md | 40++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/FilterTest.php | 305++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/CloverTest.php | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/FactoryTest.php | 263+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/UtilTest.php | 232+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverageTest.php | 560+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/TestCase.php | 303+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount-clover.xml | 26++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount.php | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccountTest.php | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassExtendedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesTest.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesWhitespaceTest.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionTest.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodOneLineAnnotationTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesWhitespaceTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNoneTest.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPrivateTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotProtectedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPublicTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNothingTest.php | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePrivateTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageProtectedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePublicTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageTwoDefaultClassAnnotations.php | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredClass.php | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredFunction.php | 4++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassExtendedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassPublicTest.php | 16++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassTest.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageMethodTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPrivateTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotProtectedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPublicTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePrivateTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageProtectedTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePublicTest.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveredClass.php | 38++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NotExistingCoveredElementTest.php | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/class-with-anonymous-function-clover.xml | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/ignored-lines-clover.xml | 17+++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_class_and_anonymous_function.php | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_ignore.php | 38++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_namespace.php | 20++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_oneline_annotations.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_ignore.php | 4++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_namespace.php | 18++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build.xml | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/ruleset.xml | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build/phpmd.xml | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/build/travis-ci.xml | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/composer.json | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/package.xml | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/phpunit.xml.dist | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_append.php | 5+++++
Alibs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/php-file-iterator/.gitignore | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/ChangeLog.md | 10++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/README.md | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/composer.json | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/src/Facade.php | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/src/Factory.php | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-file-iterator/src/Iterator.php | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-text-template/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/php-text-template/.gitignore | 5+++++
Alibs/php-ssh/vendor/phpunit/php-text-template/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-text-template/README.md | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-text-template/composer.json | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-text-template/src/Template.php | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/php-timer/.gitignore | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-timer/.travis.yml | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/README.md | 47+++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/composer.json | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/src/Timer.php | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-timer/tests/TimerTest.php | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/php-token-stream/.gitignore | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token.php | 732+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream.php | 627+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php | 226+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/README.md | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClassTest.php | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClosureTest.php | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/FunctionTest.php | 190+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/IncludeTest.php | 117+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/InterfaceTest.php | 236+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/NamespaceTest.php | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/TokenTest.php | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classExtendsNamespacedClass.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInNamespace.php | 6++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInScopedNamespace.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/closure.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue19.php | 3+++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue30.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingBraces.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingNonBraceSyntax.php | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source.php | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source2.php | 6++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source3.php | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source4.php | 30++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source5.php | 5+++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/build.xml | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/ruleset.xml | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/build/phpmd.xml | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/composer.json | 38++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/package.xml | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/php-token-stream/phpunit.xml.dist | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitignore | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/.travis.yml | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/CONTRIBUTING.md | 5+++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/ChangeLog.markdown | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php.in | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Identity.php | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/InvocationMocker.php | 193+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Match.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Namespace.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/ParametersMatch.php | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Stub.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php | 808+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_class.tpl.dist | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_clone.tpl.dist | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_object_method.tpl.dist | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_static_method.tpl.dist | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/trait_class.tpl.dist | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/unmocked_clone.tpl.dist | 5+++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_class.tpl.dist | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_method.tpl.dist | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation.php | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Object.php | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Static.php | 191+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/InvocationMocker.php | 201+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invokable.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher.php | 308+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyParameters.php | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Invocation.php | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php | 127+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedCount.php | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Parameters.php | 160+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockBuilder.php | 291++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockObject.php | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub.php | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Exception.php | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/MatcherCollection.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Return.php | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnArgument.php | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnCallback.php | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnSelf.php | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnValueMap.php | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Verifiable.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/GeneratorTest.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockBuilderTest.php | 152+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/ObjectTest.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/StaticTest.php | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class.phpt | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_clone.phpt | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_constructor.phpt | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_clone.phpt | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_constructor.phpt | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_call_parent_constructor.phpt | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_dont_call_parent_constructor.phpt | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_partial.phpt | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/interface.phpt | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_object_clone_object.phpt | 130+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_static_clone_object.phpt | 130+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class.phpt | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_clone.phpt | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_constructor.phpt | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_clone.phpt | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_constructor.phpt | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_call_parent_constructor.phpt | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_partial.phpt | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_interface.phpt | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class.phpt | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace.phpt | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace_starting_with_separator.phpt | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class.phpt | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_namespace.phpt | 38++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_partial.phpt | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php | 648+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AbstractMockTestClass.php | 5+++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AnInterface.php | 5+++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/FunctionCallback.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/GoogleSearch.wsdl | 198+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallback.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallbackByReference.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/Mockable.php | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/PartialMockTestClass.php | 18++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/SomeClass.php | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/StaticMockTestClass.php | 12++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build.xml | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/ruleset.xml | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/phpmd.xml | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/travis-ci.xml | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/composer.json | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/package.xml | 193+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit-mock-objects/phpunit.xml.dist | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/.gitattributes | 1+
Alibs/php-ssh/vendor/phpunit/phpunit/.gitignore | 20++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/.travis.yml | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/CONTRIBUTING.md | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/LICENSE | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php | 248+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in | 130+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php | 269+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php | 155+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php | 149+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php | 224+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php | 2847+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php | 2428+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in | 44++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php | 177+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php | 136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php | 105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php | 156+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php | 166+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php | 180+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php | 140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php | 215+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php | 173+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php | 190+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php | 110+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php | 203+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php | 157+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php | 105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php | 134+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php | 152+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Process/TestCaseMethod.tpl.dist | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php | 1902+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php | 179+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php | 956+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php | 954+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php | 125+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php | 189+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php | 897+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php | 664+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php | 818+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Class.php | 363+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php | 1039+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php | 201+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php | 292+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php | 207+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php | 427+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php | 261+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php | 482+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php | 250+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php | 339+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php | 208+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/String.php | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Test.php | 610++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php | 177+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php | 347+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Type.php | 303+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/XML.php | 920+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/README.md | 41+++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php | 4267+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/CountTest.php | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php | 3647+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php | 185+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php | 439+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021.phpt | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021/Issue1021Test.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523.phpt | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523/Issue523Test.php | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578.phpt | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578/Issue578Test.php | 20++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684.phpt | 26++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684/Issue684Test.php | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783.phpt | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ChildSuite.php | 15+++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/OneTest.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ParentSuite.php | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/TwoTest.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472.phpt | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472/Issue1472Test.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244.phpt | 40++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244/Issue244Test.php | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322.phpt | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/Issue322Test.php | 17+++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433.phpt | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433/Issue433Test.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445.phpt | 34++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445/Issue445Test.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498.phpt | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498/Issue498Test.php | 46++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503.phpt | 34++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503/Issue503Test.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581.phpt | 43+++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581/Issue581Test.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74.phpt | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765.phpt | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765/Issue765Test.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/863.phpt | 25+++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Runner/BaseTestRunnerTest.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/abstract-test-class.phpt | 30++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/concrete-test-class.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml-isolation.phpt | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml.phpt | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-testdox.phpt | 19+++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/debug.phpt | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default-isolation.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default.phpt | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies-isolation.phpt | 42++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies.phpt | 42++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2-isolation.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3-isolation.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3.phpt | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/empty-testcase.phpt | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exception-stack.phpt | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group-isolation.phpt | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure-isolation.phpt | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure.phpt | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal-isolation.phpt | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal.phpt | 17+++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class-isolation.phpt | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method-isolation.phpt | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-no-results.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group-isolation.phpt | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help.phpt | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help2.phpt | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/list-groups.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-json.phpt | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-tap.phpt | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-xml.phpt | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-incomplete.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-isolation.phpt | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/tap.phpt | 20++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-multiple.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-single.phpt | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-html.phpt | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-text.phpt | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox.phpt | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ClassTest.php | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php | 390+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/DiffTest.php | 268+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestTest.php | 241+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TypeTest.php | 269+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/Util/XMLTest.php | 328+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/AbstractTest.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Author.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccount.php | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php | 133+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php | 133+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Book.php | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Calculator.php | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ChangeCurrentWorkingDirectoryTest.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithNonPublicAttributes.php | 29+++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.my.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DataProviderTest.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyFailureTest.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencySuccessTest.php | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyTestSuite.php | 16++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DoubleTestCase.php | 25+++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/EmptyTestCaseTest.php | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Error.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPostConditionsTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPreConditionsTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInSetUpTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTearDownTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTest.php | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionNamespaceTest.php | 38++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionStack.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionTest.php | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Failure.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FailureTest.php | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FatalTest.php | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/IncompleteTest.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/InheritedTestCase.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/arrayObject.js | 1+
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject.js | 2++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject2.js | 2++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MockRunner.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MultiDependencyTest.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoArgTestCaseTest.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCaseClass.php | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCases.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NonStatic.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotPublicTestCase.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotVoidTestCase.php | 4++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NothingTest.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OneTestCase.php | 11+++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OutputTestCase.php | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OverrideTestCase.php | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsClassDocBlockTest.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsTest.php | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php | 32++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleClass.php | 14++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SelectorAssertionsFixture.html | 44++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Singleton.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/StackTest.php | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Struct.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Success.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TemplateMethodsTest.php | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator.php | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator2.php | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowExceptionTestCase.php | 8++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowNoExceptionTestCase.php | 7+++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/WasRun.php | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/bar.xml | 1+
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration.xml | 115+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration_xinclude.xml | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/expectedFileFormat.txt | 1+
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/foo.xml | 1+
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureAttributesAreSameButValuesAreNot.xml | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureExpected.xml | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIgnoreTextNodes.xml | 13+++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIsSameButDataIsNot.xml | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfAttributes.xml | 10++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfNodes.xml | 9+++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build.xml | 294+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php | 22++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/ruleset.xml | 35+++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/assertions.php | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/phar-autoload.php.in | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/phpmd.xml | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/build/travis-ci.xml | 36++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/composer.json | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/composer/bin/phpunit | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/phpdox.xml.dist | 24++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/phpunit.php | 46++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/phpunit.xml.dist | 40++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/phpunit/phpunit/phpunit.xsd | 251+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/.gitignore | 3+++
Alibs/php-ssh/vendor/symfony/filesystem/CHANGELOG.md | 28++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Exception/ExceptionInterface.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Exception/FileNotFoundException.php | 34++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Exception/IOException.php | 41+++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Exception/IOExceptionInterface.php | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Filesystem.php | 499+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/LICENSE | 19+++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/LockHandler.php | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/README.md | 47+++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Tests/ExceptionTest.php | 46++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTest.php | 1015+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTestCase.php | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/Tests/LockHandlerTest.php | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/composer.json | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/filesystem/phpunit.xml.dist | 27+++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/.gitignore | 3+++
Alibs/php-ssh/vendor/symfony/yaml/CHANGELOG.md | 8++++++++
Alibs/php-ssh/vendor/symfony/yaml/Dumper.php | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Escaper.php | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Exception/DumpException.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Exception/ExceptionInterface.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Exception/ParseException.php | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Exception/RuntimeException.php | 23+++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Inline.php | 546+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/LICENSE | 19+++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Parser.php | 704+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/README.md | 21+++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/DumperTest.php | 236+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsAnchorAlias.yml | 31+++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBasicTests.yml | 202+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBlockMapping.yml | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsDocumentSeparator.yml | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsErrorTests.yml | 25+++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFlowCollections.yml | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFoldedScalars.yml | 176+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsNullsAndEmpties.yml | 45+++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsSpecificationExamples.yml | 1697+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsTypeTransfers.yml | 244+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/embededPhp.yml | 1+
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/escapedCharacters.yml | 147+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/index.yml | 18++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfComments.yml | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfCompact.yml | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfObjects.yml | 11+++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfQuotes.yml | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml | 135+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/unindentedCollections.yml | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/InlineTest.php | 384+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/ParseExceptionTest.php | 41+++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/ParserTest.php | 773+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Tests/YamlTest.php | 37+++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Unescaper.php | 147+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/Yaml.php | 105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/composer.json | 33+++++++++++++++++++++++++++++++++
Alibs/php-ssh/vendor/symfony/yaml/phpunit.xml.dist | 28++++++++++++++++++++++++++++
693 files changed, 83642 insertions(+), 1 deletion(-)

diff --git a/libs/php-ssh b/libs/php-ssh @@ -1 +0,0 @@ -Subproject commit 13eec7eedfc7206bc537f6e636dfe193c1dcfcc9 diff --git a/libs/php-ssh/.travis.yml b/libs/php-ssh/.travis.yml @@ -0,0 +1,20 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - 5.6 + +before_script: + - sudo apt-get update -qq + - sudo apt-get install -y -qq libssh2-1-dev libssh2-php + - pecl install -f ssh2-beta < .noninteractive + - php -m | grep ssh2 + - composer self-update + - composer install --dev + - echo `whoami`":1234" | sudo chpasswd + +script: + - php vendor/bin/phpunit --coverage-text + - php vendor/bin/phpunit --group functional diff --git a/libs/php-ssh/LICENSE b/libs/php-ssh/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2010 Antoine Hérault + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/php-ssh/README.markdown b/libs/php-ssh/README.markdown @@ -0,0 +1,144 @@ +PHP SSH +======= + +[![Build Status](https://travis-ci.org/Herzult/php-ssh.png?branch=master)](https://travis-ci.org/Herzult/php-ssh) (master) + +Provides an object-oriented wrapper for the php ssh2 extension. + +Requirements +------------ + +You need PHP version 5.3+ with the [SSH2 extension](http://www.php.net/manual/en/book.ssh2.php). + +Installation +------------ + +The best way to add the library to your project is using [composer](http://getcomposer.org). + + $ composer require herzult/php-ssh:~1.0 + +Usage +----- + +### Configuration of the connection + +To establish an SSH connection, you must first define its configuration. +For that, create a Configuration instance with all the needed parameters. + +```php +<?php + +// simple configuration to connect "my-host" +$configuration = new Ssh\Configuration('my-host'); +``` + +The available configuration classes are: + +- `Configuration` +- `SshConfigFileConfiguration` + +Both connection configuration and public/private key authentication can be obtained from a ssh config file such as `~/.ssh/config` + +```php +<?php + +// simple configuration to connect "my-host" +$configuration = new Ssh\SshConfigFileConfiguration('/Users/username/.ssh/config', 'my-host'); +$authentication = $configuration->getAuthentication('optional_passphrase', 'optional_username'); +``` + +### Create a session + +The session is the central access point to the SSH functionality provided by the library. + +```php +<?php + +// ... the configuration creation + +$session = new Ssh\Session($configuration); +``` + +### Authentication + +The authentication classes allow you to authenticate over a SSH session. +When you define an authentication for a session, it will authenticate on connection. + +```php +<?php + +$configuration = new Ssh\Configuration('myhost'); +$authentication = new Ssh\Authentication\Password('John', 's3cr3t'); + +$session = new Session($configuration, $authentication); +``` + +The available authentication are: + + - `None` for username based authentication + - `Password` for password authentication + - `PublicKeyFile` to authenticate using a public key + - `HostBasedFile` to authenticate using a public hostkey + - `Agent` to authenticate using an ssh-agent + +### Authentication from SshConfigFileConfiguration + +If you use an ssh config file you can load your authentication and configuration from it as follows: + +```php +<?php + +$configuration = new Ssh\SshConfigFileConfiguration('~/.ssh/config', 'my-host'); + +$session = new Session($configuration, $configuration->getAuthentication()); +``` + +This will pick up your public and private keys from your config file Host and Identity declarations. + +### Subsystems + +Once you are authenticated over a SSH session, you can use the subsystems. + +#### Sftp + +You can easily access the sftp subsystem of a session using the `getSftp()` method: + +```php +<?php + +// the session creation + +$sftp = $session->getSftp(); +``` + +See the `Ssh\Sftp` class for more details on the available methods. + +#### Publickey + +The session also provides the `getPublickey()` method to access the publickey subsystem: + +```php +<?php + +// ... the session creation + +$publickey = $session->getPublickey(); +``` + +See the `Ssh\Publickey` class for more details on the available methods. + +#### Exec + +The session provides the `getExec()` method to access the exec subsystem + +```php +<?php + +// ... the session creation + +$exec = $session->getExec(); + +echo $exec->run('ls -lah'); +``` + +See the `Ssh\Exec` class for more details. diff --git a/libs/php-ssh/composer.json b/libs/php-ssh/composer.json @@ -0,0 +1,35 @@ +{ + "name": "herzult/php-ssh", + "type": "library", + "description": "Provides an object-oriented wrapper for the php ssh2 extension.", + "keywords": ["ssh", "ssh2"], + "license": "MIT", + "authors": [ + { + "name": "Antoine Hérault", + "homepage": "https://github.com/Herzult" + }, + { + "name": "The contributors", + "homepage": "http://github.com/Herzult/php-ssh/contributors" + } + ], + "require": { + "php": ">=5.3.2", + "herzult/php-ssh": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "symfony/filesystem": "~2.4" + }, + "autoload": { + "psr-0": { + "Ssh": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + } +} diff --git a/libs/php-ssh/composer.lock b/libs/php-ssh/composer.lock @@ -0,0 +1,480 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "31db5fd4d7571d95f4d8f799c0ae4874", + "packages": [], + "packages-dev": [ + { + "name": "phpunit/php-code-coverage", + "version": "1.2.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-09-02 10:13:14" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2015-06-21 08:01:12" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-03-03 05:10:30" + }, + { + "name": "phpunit/phpunit", + "version": "3.7.38", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-10-17 09:04:17" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2013-01-13 10:24:48" + }, + { + "name": "symfony/filesystem", + "version": "v2.7.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2015-09-09 17:42:36" + }, + { + "name": "symfony/yaml", + "version": "v2.7.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-09-14 14:14:09" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.2" + }, + "platform-dev": [] +} diff --git a/libs/php-ssh/phpunit.xml.dist b/libs/php-ssh/phpunit.xml.dist @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="tests/bootstrap.php.dist" +> + <testsuites> + <testsuite name="SSH Library Test Suite"> + <directory>./tests</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>src/Ssh</directory> + </whitelist> + </filter> + + <groups> + <exclude> + <group>functional</group> + </exclude> + </groups> +</phpunit> diff --git a/libs/php-ssh/src/Ssh/AbstractResourceHolder.php b/libs/php-ssh/src/Ssh/AbstractResourceHolder.php @@ -0,0 +1,37 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * An abstract resource holder + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +abstract class AbstractResourceHolder implements ResourceHolder +{ + protected $resource; + + /** + * Returns the underlying resource. If the resource does not exist, it will + * create it + * + * @return resource + */ + public function getResource() + { + if (!is_resource($this->resource)) { + $this->createResource(); + } + + return $this->resource; + } + + /** + * Creates the underlying resource + * + * @throws RuntimeException on resource creation failure + */ + abstract protected function createResource(); +} diff --git a/libs/php-ssh/src/Ssh/Authentication.php b/libs/php-ssh/src/Ssh/Authentication.php @@ -0,0 +1,20 @@ +<?php + +namespace Ssh; + +/** + * Interface that must be implemented by the authentication classes + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +interface Authentication +{ + /** + * Authenticates the given SSH session + * + * @param resource $session + * + * @return Boolean TRUE on success, or FALSE on failure + */ + function authenticate($session); +} diff --git a/libs/php-ssh/src/Ssh/Authentication/Agent.php b/libs/php-ssh/src/Ssh/Authentication/Agent.php @@ -0,0 +1,36 @@ +<?php + +namespace Ssh\Authentication; + +use Ssh\Authentication; + +/** + * SSH Agent authentication + * + * @author Cam Spiers <camspiers@gmail.com> + */ +class Agent implements Authentication +{ + protected $username; + + /** + * Constructor + * + * @param string $username The authentication username + */ + public function __construct($username) + { + $this->username = $username; + } + + /** + * {@inheritDoc} + */ + public function authenticate($session) + { + return ssh2_auth_agent( + $session, + $this->username + ); + } +} diff --git a/libs/php-ssh/src/Ssh/Authentication/HostBasedFile.php b/libs/php-ssh/src/Ssh/Authentication/HostBasedFile.php @@ -0,0 +1,57 @@ +<?php + +namespace Ssh\Authentication; + +use Ssh\Authentication; + +/** + * Host based file authentication + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class HostBasedFile implements Authentication +{ + protected $username; + protected $hostname; + protected $publicKeyFile; + protected $privateKeyFile; + protected $passPhrase; + protected $localUsername; + + /** + * Constructor + * + * @param string $username + * @param string $hostname + * @param string $publicKeyFile + * @param string $privateKeyFile + * @param string $passPhrase An optional pass phrase for the key + * @param string $localUsername An optional local usernale. If omitted, + * the username will be used + */ + public function __construct($username, $hostname, $publicKeyFile, $privateKeyFile, $passPhrase = null, $localUsername = null) + { + $this->username = $username; + $this->hostname = $hostname; + $this->publicKeyFile = $publicKeyFile; + $this->privateKeyFile = $privateKeyFile; + $this->passPhrase = $passPhrase; + $this->localUsername = $localUsername; + } + + /** + * {@inheritDoc} + */ + public function authenticate($session) + { + return ssh2_auth_hostbased_file( + $session, + $this->username, + $this->hostname, + $this->publicKeyFile, + $this->privateKeyFile, + $this->passPhrase, + $this->localUsername + ); + } +} diff --git a/libs/php-ssh/src/Ssh/Authentication/None.php b/libs/php-ssh/src/Ssh/Authentication/None.php @@ -0,0 +1,33 @@ +<?php + +namespace Ssh\Authentication; + +use Ssh\Authentication; + +/** + * Username based authentication + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class None implements Authentication +{ + protected $username; + + /** + * Constructor + * + * @param string $username The authentication username + */ + public function __construct($username) + { + $this->username = $username; + } + + /** + * {@inheritDoc} + */ + public function authenticate($session) + { + return true === ssh2_auth_none($session, $this->username); + } +} diff --git a/libs/php-ssh/src/Ssh/Authentication/Password.php b/libs/php-ssh/src/Ssh/Authentication/Password.php @@ -0,0 +1,37 @@ +<?php + +namespace Ssh\Authentication; + +use Ssh\Authentication; + +/** + * Password Authentication + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class Password implements Authentication +{ + protected $username; + protected $password; + + /** + * Constructor + * + * @param string $username The authentication username + * @param string $password The authentication password + */ + public function __construct($username, $password) + { + $this->username = $username; + $this->password = $password; + } + + /** + * {@inheritDoc} + */ + public function authenticate($session) + { + // This function generates a undocumented warning on authentification failure. + return @ssh2_auth_password($session, $this->username, $this->password); + } +} diff --git a/libs/php-ssh/src/Ssh/Authentication/PublicKeyFile.php b/libs/php-ssh/src/Ssh/Authentication/PublicKeyFile.php @@ -0,0 +1,48 @@ +<?php + +namespace Ssh\Authentication; + +use Ssh\Authentication; + +/** + * Public key file authentication + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class PublicKeyFile implements Authentication +{ + protected $username; + protected $publicKeyFile; + protected $privateKeyFile; + protected $passPhrase; + + /** + * Constructor + * + * @param string $username The authentication username + * @param string $publicKeyFile The path of the public key file + * @param string $privateKeyFile The path of the private key file + * @param string $passPhrase An optional pass phrase for the key + */ + public function __construct($username, $publicKeyFile, $privateKeyFile, $passPhrase = null) + { + $this->username = $username; + $this->publicKeyFile = $publicKeyFile; + $this->privateKeyFile = $privateKeyFile; + $this->passPhrase = $passPhrase; + } + + /** + * {@inheritDoc} + */ + public function authenticate($session) + { + return ssh2_auth_pubkey_file( + $session, + $this->username, + $this->publicKeyFile, + $this->privateKeyFile, + $this->passPhrase + ); + } +} diff --git a/libs/php-ssh/src/Ssh/Configuration.php b/libs/php-ssh/src/Ssh/Configuration.php @@ -0,0 +1,146 @@ +<?php + +namespace Ssh; + +/** + * Configuration of an SSH connection + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class Configuration +{ + protected $host; + protected $port; + protected $methods; + protected $callbacks; + protected $identity; + + /** + * Constructor + * + * @param string $host + * @param integer $port + * @param array $methods + * @param array $callbacks + * @param string $identity + */ + public function __construct($host, $port = 22, array $methods = array(), array $callbacks = array(), $identity = null) + { + $this->host = $host; + $this->port = $port; + $this->methods = $methods; + $this->callbacks = $callbacks; + $this->identity = $identity; + } + + /** + * Defines the host + * + * @param string $host + */ + public function setHost($host) + { + $this->host = $host; + } + + /** + * Returns the host + * + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Defines the port + * + * @param integer $port + */ + public function setPort($port) + { + $this->port = $port; + } + + /** + * Returns the port + * + * @return integer + */ + public function getPort() + { + return $this->port; + } + + /** + * Defines the methods + * + * @param array $methods + */ + public function setMethods(array $methods) + { + $this->methods = $methods; + } + + /** + * Returns the methods + * + * @return array + */ + public function getMethods() + { + return $this->methods; + } + + /** + * Defines the callbacks + * + * @param array $callbacks + */ + public function setCallbacks(array $callbacks) + { + $this->callbacks = $callbacks; + } + + /** + * Returns the callbacks + * + * @return array $callbacks + */ + public function getCallbacks() + { + return $this->callbacks; + } + + /** + * Returns an array of argument designed for the ssh2_connect function + * + * @return array + */ + public function asArguments() + { + return array( + $this->host, + $this->port, + $this->methods, + $this->callbacks + ); + } + + /** + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * @param string $identity + */ + public function setIdentity($identity) + { + $this->identity = $identity; + } +} diff --git a/libs/php-ssh/src/Ssh/Exec.php b/libs/php-ssh/src/Ssh/Exec.php @@ -0,0 +1,37 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * Wrapper for ssh2_exec + * + * @author Cam Spiers <camspiers@gmail.com> + * @author Greg Militello <junk@thinkof.net> + * @author Gildas Quéméner <gildas.quemener@gmail.com> + */ +class Exec extends Subsystem +{ + protected function createResource() + { + $this->resource = $this->getSessionResource(); + } + + public function run($cmd, $pty = null, array $env = array(), $width = 80, $height = 25, $width_height_type = SSH2_TERM_UNIT_CHARS) + { + $cmd .= ';echo -ne "[return_code:$?]"'; + $stdout = ssh2_exec($this->getResource(), $cmd, $pty, $env, $width, $height, $width_height_type); + $stderr = ssh2_fetch_stream($stdout, SSH2_STREAM_STDERR); + stream_set_blocking($stderr, true); + stream_set_blocking($stdout, true); + + $output = stream_get_contents($stdout); + preg_match('/\[return_code:(.*?)\]/', $output, $match); + if ((int) $match[1] !== 0) { + throw new RuntimeException(stream_get_contents($stderr), (int) $match[1]); + } + + return preg_replace('/\[return_code:(.*?)\]/', '', $output); + } +} diff --git a/libs/php-ssh/src/Ssh/Publickey.php b/libs/php-ssh/src/Ssh/Publickey.php @@ -0,0 +1,73 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * Wrapper for the SSH publickey subsystem + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class Publickey extends Subsystem +{ + /** + * Adds an authorized publickey + * + * @param string $algoname The algorithm (e.g: ssh-dss, ssh-rsa) + * @param string $blob The blob as binary data + * @param Boolean $overwrite Whether to overwrite the key if it already + * exist + * @param array $attributes An associative array of attributes to assign + * to the publickey. To mark an attribute as + * mandatory, precede its name with an asterisk. + * If the server is unable to support an + * attribute marked mandatory, it will abort + * the add process. + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function add($algoname, $blob, $overwrite = false, array $attributes = array()) + { + return ssh2_publickey_add($this->getResource(), $algoname, $blob, $overwrite, $attributes); + } + + /** + * Lists the currently authorized publickeys + * + * @return array A numerically indexed array of keys, each of which is an + * associative array containing: name, blob, and attrs + * elements. + */ + public function getList() + { + return ssh2_publickey_list($this->getResource()); + } + + /** + * Removes an authorized publickey + * + * @param string $algoname The algorithm (e.g: ssh-dss, ssh-rsa) + * @param string $blob The blob as binary data + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function remove($algoname, $blob) + { + return ssh2_publickey_remove($this->getResource(), $algoname, $blob); + } + + /** + * {@inheritDoc} + */ + public function createResource() + { + $resource = ssh2_publickey_init($this->getSessionResource()); + + if (!is_resource($resource)) { + throw new RuntimeException('The initialization of the publickey subsystem failed.'); + } + + $this->resource = $resource; + } +} diff --git a/libs/php-ssh/src/Ssh/ResourceHolder.php b/libs/php-ssh/src/Ssh/ResourceHolder.php @@ -0,0 +1,18 @@ +<?php + +namespace Ssh; + +/** + * Interface that must be implemented by that handle a resource + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +interface ResourceHolder +{ + /** + * Returns the underlying resource + * + * @return resource + */ + function getResource(); +} diff --git a/libs/php-ssh/src/Ssh/Session.php b/libs/php-ssh/src/Ssh/Session.php @@ -0,0 +1,178 @@ +<?php + +namespace Ssh; + +use InvalidArgumentException, RuntimeException; + +/** + * SSH session + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class Session extends AbstractResourceHolder +{ + protected $configuration; + protected $authentication; + protected $subsystems; + + /** + * Constructor + * + * @param Configuration A Configuration instance + * @param Authentication An optional Authentication instance + */ + public function __construct(Configuration $configuration, Authentication $authentication = null) + { + $this->configuration = $configuration; + $this->authentication = $authentication; + $this->subsystem = array(); + } + + /** + * Defines the authentication. If the + * + * @param Authentication $authentication + */ + public function setAuthentication(Authentication $authentication) + { + $firstAuthentication = null === $this->authentication; + + $this->authentication = $authentication; + + if ($firstAuthentication && is_resource($this->resource)) { + $this->authenticate(); + } + } + + /** + * Returns the Sftp subsystem + * + * @return Sftp + */ + public function getSftp() + { + return $this->getSubsystem('sftp'); + } + + /** + * Returns the Publickey subsystem + * + * @return Publickey + */ + public function getPublickey() + { + return $this->getSubsystem('publickey'); + } + + /** + * Returns the Exec subsystem + * + * @return Exec + */ + public function getExec() + { + return $this->getSubsystem('exec'); + } + + /** + * Returns the specified subsystem + * + * If the subsystem does not exists, it will create it + * + * @param string $name The subsystem's name + * + * @return Subsystem + */ + public function getSubsystem($name) + { + if (!isset($this->subsystems[$name])) { + $this->createSubsystem($name); + } + + return $this->subsystems[$name]; + } + + /** + * Creates the specified subsystem + * + * @param string $name The subsystem's name + * + * @throws InvalidArgumentException if the specified subsystem is no + * supported (e.g does not exist) + */ + protected function createSubsystem($name) + { + switch ($name) { + case 'sftp': + $subsystem = new Sftp($this); + break; + case 'publickey': + $subsystem = new Publickey($this); + break; + case 'exec': + $subsystem = new Exec($this); + break; + default: + throw new InvalidArgumentException(sprintf('The subsystem \'%s\' is not supported.', $name)); + } + + $this->subsystems[$name] = $subsystem; + } + + /** + * Creates the session resource + * + * If there is a defined authentication, it will authenticate the session + * + * @throws RuntimeException if the connection fail + */ + protected function createResource() + { + $resource = $this->connect($this->configuration->asArguments()); + + if (!is_resource($resource)) { + throw new RuntimeException('The SSH connection failed.'); + } + + $this->resource = $resource; + + if (null !== $this->authentication) { + $this->authenticate(); + } + } + + /** + * Opens a connection with the remote server using the given arguments + * + * @param array $arguments An array of arguments + * + * @return resource + */ + protected function connect(array $arguments) + { + return call_user_func_array('ssh2_connect', $arguments); + } + + /** + * Authenticates over the current SSH session and using the defined + * authentication + * + * @throws RuntimeException on authentication failure + */ + protected function authenticate() + { + $authenticated = $this->authentication->authenticate($this->resource); + + if (!$authenticated) { + throw new RuntimeException('The authentication over the current SSH connection failed.'); + } + } + + /** + * @return Configuration + */ + public function getConfiguration() + { + return $this->configuration; + } +} diff --git a/libs/php-ssh/src/Ssh/Sftp.php b/libs/php-ssh/src/Ssh/Sftp.php @@ -0,0 +1,301 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * Secure File Transfer Protocol + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +class Sftp extends Subsystem +{ + /** + * Stats a symbolic link + * + * @param string $path The path of the symbolic link + * + * @return array + */ + public function lstat($path) + { + return ssh2_sftp_lstat($this->getResource(), $path); + } + + /** + * Creates a directory + * + * @param string $dirname The name of the new directory + * @param int $mod The permissions on the new directory + * @param Boolean $recursive Whether to automatically create any required + * parent directory + * + * @return Boolean + */ + public function mkdir($dirname, $mod = 0777, $recursive = false) + { + return ssh2_sftp_mkdir($this->getResource(), $dirname, $mod, $recursive); + } + + /** + * Returns the target of a symbolic link + * + * @param string $link The path of the symbolic link + * + * @return string The target of the symbolic link + */ + public function readlink($link) + { + return ssh2_sftp_readlink($this->getResource(), $link); + } + + /** + * Resolves the realpath of a provided path string + * + * @param string $filename The filename to resolve + * + * @return string The real path of the file + */ + public function realpath($filename) + { + // This function creates a not documented warning on failure. + return @ssh2_sftp_realpath($this->getResource(), $filename); + } + + /** + * Renames a remote file + * + * @param string $from The current file that is being renamed + * @param string $to The new file name that replaces from + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function rename($from, $to) + { + return ssh2_sftp_rename($this->getResource(), $from, $to); + } + + /** + * Removes a directory + * + * @param string $dirname The directory that is being removed + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function rmdir($dirname) + { + return ssh2_sftp_rmdir($this->getResource(), $dirname); + } + + /** + * Stats a file on the remote filesystem + * + * @param string $path The path of the file + * + * @return array + */ + public function stat($path) + { + // This function creates a undocumented warning on missing files. + return @ssh2_sftp_stat($this->getResource(), $path); + } + + /** + * Creates a symlink + * + * @param string $target The target of the symlink + * @param string $link The path of the link + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function symlink($target, $link) + { + return ssh2_sftp_symlink($this->getResource(), $target, $link); + } + + /** + * Deletes a file + * + * @param string $filename The name of the file that is being deleted + * + * @return Boolean TRUE on success, or FALSE on failure + */ + public function unlink($filename) + { + return ssh2_sftp_unlink($this->getResource(), $filename); + } + + /** + * Indicates whether the specified distant file exists + * + * @param string $filename The distant filename + * + * @return boolean + */ + public function exists($filename) + { + return file_exists($this->getUrl($filename)); + } + + /** + * Reads the content of the specified remote file. + * Will return false if file does not exist. + * + * @param string $filename The remote filename + * + * @return string|false + */ + public function read($filename) + { + // Suppress a warning, when file does not exist. + return @file_get_contents($this->getUrl($filename)); + } + + /** + * Writes the given content to the specified remote file + * + * @param string $filename The remote filename + * + * @return integer The number of bytes that were written into the file, or + * FALSE on failure + */ + public function write($filename, $content) + { + return file_put_contents($this->getUrl($filename), $content); + } + + /** + * Receive the specified distant file as the specified local file + * + * @param string $distant The distant filename + * @param string $local The local filename + * + * @return boolean TRUE on success, or FALSE on failure + */ + public function receive($distant, $local) + { + return file_put_contents($local, $this->read($distant)); + } + + /** + * Sends the specified local file as the specified remote file + * + * @param string $local The local filename + * @param string $distant The distant filename + * + * @return integer|false The number of bytes that were sent, + * or FALSE on failure + */ + public function send($local, $distant) + { + return $this->write($distant, file_get_contents($local)); + } + + /** + * Returns the URL of the specified file with the ssh2.sftp protocol. The + * result URL is suitable for stream resource creation (e.g using fopen) + * + * @param string $filename The distant filename + * + * @return string + */ + public function getUrl($filename) + { + return sprintf('ssh2.sftp://%s/%s', $this->getResource(), $filename); + } + + /** + * Lists files and directories of the specified directory + * + * The returned array is of the form: + * + * array( + * 'files' => array(...), + * 'directories' => array(...) + * ) + * + * @param string $directory + * @param Boolean $recursive + * + * @return array + */ + public function listDirectory($directory, $recursive = false) + { + $results = $this->scanDirectory($directory, $recursive); + + if (false === $results) { + throw new \RuntimeException(sprintf( + 'Unable to list directory "%s", maybe it is not a directory '. + 'or it does not exist.', + $directory + )); + } + + return array( + 'files' => $results[0], + 'directories' => $results[1] + ); + } + + /** + * {@inheritDoc} + */ + protected function createResource() + { + $resource = ssh2_sftp($this->getSessionResource()); + + if (!is_resource($resource)) { + throw new RuntimeException('The initialization of the SFTP subsystem failed.'); + } + + $this->resource = $resource; + } + + /** + * Scans a directory + * + * Unfortunately, using a (recursive) directory iterator is not possible + * over SFTP: see https://bugs.php.net/bug.php?id=57378. Also, is_dir() is + * unreliable and often returns false for valid directories. Therefore, I + * use @scandir() instead. + * + * @param string $directory + * @param Boolean $recursive + * + * @return array + */ + private function scanDirectory($directory, $recursive) + { + if (!$results = @scandir($this->getUrl($directory))) { + return false; + } + + $files = array(); + $directories = array(); + + foreach ($results as $result) { + if (in_array($result, array('.', '..'))) { + continue; + } + + $filename = sprintf('%s/%s', $directory, $result); + + if (false === @scandir($this->getUrl($filename))) { + $files[] = $filename; + } else { + $directories[] = $filename; + + if ($recursive) { + $children = $this->scanDirectory($filename, $recursive); + if (is_array($children)) { + $files = array_merge($files, $children[0]); + $directories = array_merge($directories, $children[1]); + } + } + } + } + + return array($files, $directories); + } +} diff --git a/libs/php-ssh/src/Ssh/SshConfigFileConfiguration.php b/libs/php-ssh/src/Ssh/SshConfigFileConfiguration.php @@ -0,0 +1,168 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * SSH Config File Configuration + * + * @author Cam Spiers <camspiers@gmail.com> + */ +class SshConfigFileConfiguration extends Configuration +{ + + const DEFAULT_SSH_IDENTITY = '~/.ssh/id_rsa'; + + protected $configs = array(); + protected $config; + protected $match = array(); + + /** + * Constructor + * + * @param string $file + * @param string $host + * @param integer $port + * @param array $methods + * @param array $callbacks + * @param string $identity + */ + public function __construct( + $file, $host, $port = 22, array $methods = array(), array $callbacks = array(), $identity = null + ) + { + $this->parseSshConfigFile($this->processPath($file)); + $this->identity = is_null($identity) ? self::DEFAULT_SSH_IDENTITY : $identity; + $this->config = $this->getConfigForHost($host); + + parent::__construct( + isset($this->config['hostname']) ? $this->config['hostname'] : $host, + isset($this->config['port']) ? $this->config['port'] : $port, + $methods, + $callbacks + ); + } + + /** + * Replaces '~'' with users home path + * @param string $path + * @return string + */ + protected function processPath($path) + { + return preg_replace('/^~/', getenv('HOME'), $path); + } + + /** + * Parses the ssh config file into an array of configs for later matching against hosts + * @param string $file + */ + protected function parseSshConfigFile($file) + { + if (!file_exists($file) || !is_readable($file)) { + throw new RuntimeException("The file '$file' does not exist or is not readable"); + } + $contents = file_get_contents($file); + $configs = array(); + $lineNumber = 1; + foreach (explode(PHP_EOL, $contents) as $line) { + $line = trim($line); + if ($line == '' || $line[0] == '#') { + continue; + } + $pos = strpos($line, '='); + if ($pos !== false) { + $key = strtolower(trim(substr($line, 0, $pos))); + $value = trim(substr($line, $pos + 1, strlen($line))); + } else { + $i = 0; + while ($i < strlen($line)) { + if ($line[$i] == ' ') { + break; + } + $i++; + } + if ($i == strlen($line)) { + throw new RuntimeException("The file '$file' is not parsable at line '$lineNumber'"); + } + $key = strtolower(trim(substr($line, 0, $i))); + $value = trim(substr($line, $i + 1, strlen($line))); + } + if ($key == 'host') { + $this->configs = array_merge($this->configs, $configs); + $configs = array(); + $hosts = explode(' ', $value); + foreach ($hosts as $host) { + $configs[] = array('host' => $host); + } + + } else { + foreach ($configs as $host => $config) { + $configs[$host][$key] = $value; + } + } + $lineNumber++; + } + $this->configs = array_merge($this->configs, $configs); + } + + /** + * Merges matches of the host in the config file using fnmatch and a length comparison + * @param string $host + * @return array + */ + public function getConfigForHost($host) + { + $matches = array(); + foreach ($this->configs as $config) { + if (fnmatch($config['host'], $host)) { + $matches[] = $config; + } + } + if (count($matches) == 0) { + throw new RuntimeException("Unable to find configuration for host '{$host}'"); + } + usort($matches, function ($a, $b) { + return strlen($a['host']) > strlen($b['host']); + }); + $result = array(); + foreach ($matches as $match) { + $result = array_merge($result, $match); + } + unset($result['host']); + if (isset($result['identityfile'])) { + $result['identityfile'] = $this->processPath($result['identityfile']); + } else if (file_exists($file = $this->processPath($this->getIdentity()))) { + $result['identityfile'] = $file; + } + + return $result; + } + + /** + * Return an authentication mechanism based on the configuration file + * @param string|null $passphrase + * @param string|null $user + * @return PublicKeyFile|None + */ + public function getAuthentication($passphrase = null, $user = null) + { + if (is_null($user) && !isset($this->config['user'])) { + throw new RuntimeException("Can not authenticate for '{$this->host}' could not find user to authenticate as"); + } + $user = $user ?: $this->config['user']; + if (isset($this->config['identityfile'])) { + return new Authentication\PublicKeyFile( + $user, + $this->config['identityfile'] . '.pub', + $this->config['identityfile'], + $passphrase + ); + } else { + return new Authentication\None( + $user + ); + } + } +} +\ No newline at end of file diff --git a/libs/php-ssh/src/Ssh/Subsystem.php b/libs/php-ssh/src/Ssh/Subsystem.php @@ -0,0 +1,44 @@ +<?php + +namespace Ssh; + +use RuntimeException; + +/** + * Abstract class for the SSH subsystems as Sftp and Publickey + * + * @author Antoine Hérault <antoine.herault@gmail.com> + */ +abstract class Subsystem extends AbstractResourceHolder +{ + protected $session; + protected $resource; + + /** + * Constructor + * + * @param mixed $session A Session instance or a SSH session resource + */ + public function __construct($session) + { + if (!$session instanceof Session && !is_resource($session)) { + throw new \InvalidArgumentException('The session must be either a Session instance or a SSH session resource.'); + } + + $this->session = $session; + } + + /** + * Returns the SSH session resource + * + * @return resource + */ + public function getSessionResource() + { + if ($this->session instanceof Session) { + return $this->session->getResource(); + } else { + return $this->session; + } + } +} diff --git a/libs/php-ssh/tests/Ssh/AbstractResourceHolderTest.php b/libs/php-ssh/tests/Ssh/AbstractResourceHolderTest.php @@ -0,0 +1,33 @@ +<?php + +namespace Ssh; + +/** + * @covers \Ssh\AbstractResourceHolder + */ +class AbstractResourceHolderTest extends \PHPUnit_Framework_TestCase +{ + public function testResourceIsCreatedIfItDoesNotExist() + { + $holder = $this->getMockForAbstractClass('Ssh\AbstractResourceHolder'); + $holder->expects($this->once()) + ->method('createResource'); + + $holder->getResource(); + } + + public function testResourceIsCreatedOnlyOne() + { + $holder = $this->getMockForAbstractClass('Ssh\AbstractResourceHolder'); + $holder->expects($this->never()) + ->method('createResource'); + + $resource = tmpfile(); + + $property = new \ReflectionProperty($holder, 'resource'); + $property->setAccessible(true); + $property->setValue($holder, $resource); + + $this->assertEquals($resource, $holder->getResource()); + } +} diff --git a/libs/php-ssh/tests/Ssh/Authentication/AgentTest.php b/libs/php-ssh/tests/Ssh/Authentication/AgentTest.php @@ -0,0 +1,18 @@ +<?php + + +namespace Ssh\Authentication; + +/** + * @covers \Ssh\Authentication\Agent + */ +class AgentTest extends \PHPUnit_Framework_TestCase +{ + public function testClass() { + $agent = new Agent('user'); + $this->assertInstanceOf('\Ssh\Authentication', $agent); + + $this->assertAttributeEquals('user', 'username', $agent); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/Authentication/HostBasedFileTest.php b/libs/php-ssh/tests/Ssh/Authentication/HostBasedFileTest.php @@ -0,0 +1,34 @@ +<?php + + +namespace Ssh\Authentication; + +/** + * @covers \Ssh\Authentication\HostBasedFile + */ +class HostBasedFileTest extends \PHPUnit_Framework_TestCase +{ + public function testClass() { + $auth = new HostBasedFile('user', 'example.com', 'path/public.key', 'path/private.key', 'passPhrase', 'localUsername'); + $this->assertInstanceOf('\Ssh\Authentication', $auth); + + $this->assertAttributeEquals('user', 'username', $auth); + $this->assertAttributeEquals('example.com', 'hostname', $auth); + $this->assertAttributeEquals('path/public.key', 'publicKeyFile', $auth); + $this->assertAttributeEquals('path/private.key', 'privateKeyFile', $auth); + $this->assertAttributeEquals('passPhrase', 'passPhrase', $auth); + $this->assertAttributeEquals('localUsername', 'localUsername', $auth); + } + + public function testClassOptionals() { + $auth = new HostBasedFile('user', 'example.com', 'path/public.key', 'path/private.key'); + + $this->assertAttributeEquals('user', 'username', $auth); + $this->assertAttributeEquals('example.com', 'hostname', $auth); + $this->assertAttributeEquals('path/public.key', 'publicKeyFile', $auth); + $this->assertAttributeEquals('path/private.key', 'privateKeyFile', $auth); + $this->assertAttributeEquals(null, 'passPhrase', $auth); + $this->assertAttributeEquals(null, 'localUsername', $auth); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/Authentication/NoneTest.php b/libs/php-ssh/tests/Ssh/Authentication/NoneTest.php @@ -0,0 +1,18 @@ +<?php + + +namespace Ssh\Authentication; + +/** + * @covers \Ssh\Authentication\None + */ +class NoneTest extends \PHPUnit_Framework_TestCase +{ + public function testClass() { + $agent = new None('user'); + $this->assertInstanceOf('\Ssh\Authentication', $agent); + + $this->assertAttributeEquals('user', 'username', $agent); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/Authentication/PasswordTest.php b/libs/php-ssh/tests/Ssh/Authentication/PasswordTest.php @@ -0,0 +1,19 @@ +<?php + + +namespace Ssh\Authentication; + +/** + * @covers \Ssh\Authentication\Password + */ +class PasswordTest extends \PHPUnit_Framework_TestCase +{ + public function testClass() { + $pass = new Password('user', 'pass'); + $this->assertInstanceOf('\Ssh\Authentication', $pass); + + $this->assertAttributeEquals('user', 'username', $pass); + $this->assertAttributeEquals('pass', 'password', $pass); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/Authentication/PublicKeyFileTest.php b/libs/php-ssh/tests/Ssh/Authentication/PublicKeyFileTest.php @@ -0,0 +1,30 @@ +<?php + + +namespace Ssh\Authentication; + +/** + * @covers \Ssh\Authentication\PublicKeyFile + */ +class PublicKeyFileTest extends \PHPUnit_Framework_TestCase +{ + public function testClass() { + $auth = new PublicKeyFile('user', 'path/public.key', 'path/private.key', 'passPhrase'); + $this->assertInstanceOf('\Ssh\Authentication', $auth); + + $this->assertAttributeEquals('user', 'username', $auth); + $this->assertAttributeEquals('path/public.key', 'publicKeyFile', $auth); + $this->assertAttributeEquals('path/private.key', 'privateKeyFile', $auth); + $this->assertAttributeEquals('passPhrase', 'passPhrase', $auth); + } + + public function testClassOptionals() { + $auth = new PublicKeyFile('user', 'path/public.key', 'path/private.key'); + + $this->assertAttributeEquals('user', 'username', $auth); + $this->assertAttributeEquals('path/public.key', 'publicKeyFile', $auth); + $this->assertAttributeEquals('path/private.key', 'privateKeyFile', $auth); + $this->assertAttributeEquals(null, 'passPhrase', $auth); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/ConfigurationTest.php b/libs/php-ssh/tests/Ssh/ConfigurationTest.php @@ -0,0 +1,106 @@ +<?php + +namespace Ssh; + +/** + * @covers \Ssh\Configuration + */ +class ConfigurationTest extends \PHPUnit_Framework_TestCase +{ + public function testDefaultPortIs22() + { + $configuration = new Configuration('my-host'); + + $this->assertAttributeEquals(22, 'port', $configuration); + } + + public function testSetHost() + { + $configuration = new Configuration('my-host'); + $configuration->setHost('other-host'); + + $this->assertAttributeEquals('other-host', 'host', $configuration); + } + + public function testGetHost() + { + $configuration = new Configuration('my-host'); + + $this->assertEquals('my-host', $configuration->getHost()); + } + + public function testSetPort() + { + $configuration = new Configuration('my-host'); + $configuration->setPort(1234); + + $this->assertAttributeEquals(1234, 'port', $configuration); + } + + public function testGetPort() + { + $configuration = new Configuration('my-host', 1234); + + $this->assertEquals(1234, $configuration->getPort()); + } + + public function testSetMethods() + { + $configuration = new Configuration('my-host'); + $configuration->setMethods(array('toto' => 'tata')); + + $this->assertAttributeEquals(array('toto' => 'tata'), 'methods', $configuration); + } + + public function testGetMethods() + { + $configuration = new Configuration('my-host', 22, array('toto' => 'tata')); + + $this->assertEquals(array('toto' => 'tata'), $configuration->getMethods()); + } + + public function testSetCallbacks() + { + $configuration = new Configuration('my-host'); + $configuration->setCallbacks(array('toto' => 'tata')); + + $this->assertAttributeEquals(array('toto' => 'tata'), 'callbacks', $configuration); + } + + public function testGetCallbacks() + { + $configuration = new Configuration('my-host', 22, array(), array('toto' => 'tata')); + + $this->assertEquals(array('toto' => 'tata'), $configuration->getCallbacks()); + } + + /** + * @dataProvider getAsArgumentsData + */ + public function testAsArguments($configuration, $expected) + { + $this->assertEquals($expected, $configuration->asArguments()); + } + + public function getAsArgumentsData() + { + return array( + array( + new Configuration('my-host'), + array('my-host', 22, array(), array()) + ), + array( + new Configuration('my-host', 2222), + array('my-host', 2222, array(), array()) + ), + array( + new Configuration('my-host', 22, array('toto' => 'tata')), + array('my-host', 22, array('toto' => 'tata'), array()) + ), + array( + new Configuration('my-host', 22, array(), array('toto' => 'tata')), + array('my-host', 22, array(), array('toto' => 'tata')) + ) + ); + } +} diff --git a/libs/php-ssh/tests/Ssh/Fixtures/config_invalid b/libs/php-ssh/tests/Ssh/Fixtures/config_invalid @@ -0,0 +1,4 @@ +Host + +Something + diff --git a/libs/php-ssh/tests/Ssh/Fixtures/config_valid b/libs/php-ssh/tests/Ssh/Fixtures/config_valid @@ -0,0 +1,24 @@ +Host hello hello.com +HostName hello.com +Port 1234 + +#This is a comment which won't appear in the parsed array + +Host test + HostName test.com + +Host testuser.com +User test +IdentityFile test + +Host = tamp +HostName = tamp.yo + +Host identity +User identity +IdentityFile ~/identity + +Host ta* +User bob +Port = 12345 +HostName test.com diff --git a/libs/php-ssh/tests/Ssh/FunctionalTests/ExecTest.php b/libs/php-ssh/tests/Ssh/FunctionalTests/ExecTest.php @@ -0,0 +1,62 @@ +<?php + + +namespace Ssh\FunctionalTests; + + +use Ssh\Authentication\Password; +use Ssh\Configuration; +use Ssh\Session; + +/** + * @author Julius Beckmann + * + * @group functional + * + * @covers \Ssh\Exec + */ +class ExecTest extends \PHPUnit_Framework_TestCase +{ + public function testExecuteWhoami() + { + $configuration = new Configuration('localhost'); + $authentication = new Password(TEST_USER, TEST_PASSWORD); + $session = new Session($configuration, $authentication); + + $exec = $session->getExec(); + $output = $exec->run('whoami'); + + $this->assertEquals(TEST_USER, trim($output)); + } + + public function testExecuteMultilineOutput() + { + $configuration = new Configuration('localhost'); + $authentication = new Password(TEST_USER, TEST_PASSWORD); + $session = new Session($configuration, $authentication); + + $exec = $session->getExec(); + $output = $exec->run('echo -e "a\nb\nc"'); + + // In case our SystemUnderTest differs + $output = str_replace("\r\n", "\n", $output); + + $this->assertEquals("a\nb\nc\n", $output); + } + + /** + * @expectedException \RuntimeException + */ + public function testExecuteErrorOutput() + { + $configuration = new Configuration('localhost'); + $authentication = new Password(TEST_USER, TEST_PASSWORD); + $session = new Session($configuration, $authentication); + + $exec = $session->getExec(); + $output = $exec->run('false'); + + $this->assertEquals('', trim($output)); + } +} + diff --git a/libs/php-ssh/tests/Ssh/FunctionalTests/LoginTest.php b/libs/php-ssh/tests/Ssh/FunctionalTests/LoginTest.php @@ -0,0 +1,42 @@ +<?php + + +namespace Ssh\FunctionalTests; + + +use Ssh\Authentication\Password; +use Ssh\Configuration; +use Ssh\Session; + +/** + * @author Julius Beckmann + * + * @group functional + * + * @covers \Ssh\Session + * @covers \Ssh\Authentication\Password + */ +class LoginTest extends \PHPUnit_Framework_TestCase +{ + + public function testLoginPassword() + { + $configuration = new Configuration('localhost'); + $session = new Session($configuration); + + $authentication = new Password(TEST_USER, TEST_PASSWORD); + $login = $authentication->authenticate($session->getResource()); + $this->assertTrue($login, 'Authentification failed.'); + } + + public function testLoginPasswordFailed() + { + $configuration = new Configuration('localhost'); + $session = new Session($configuration); + + $authentication = new Password(TEST_USER, 'invalid'); + $login = $authentication->authenticate($session->getResource()); + $this->assertFalse($login, 'Authentification should have failed.'); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/FunctionalTests/SftpTest.php b/libs/php-ssh/tests/Ssh/FunctionalTests/SftpTest.php @@ -0,0 +1,261 @@ +<?php + + +namespace Ssh\FunctionalTests; + + +use Ssh\Authentication\Password; +use Ssh\Configuration; +use Ssh\Session; +use Ssh\Sftp; +use Symfony\Component\Filesystem\Filesystem; + +/** + * @author Julius Beckmann + * + * @group functional + * + * @covers \Ssh\Sftp + */ +class SftpTest extends \PHPUnit_Framework_TestCase +{ + /** @var Configuration */ + private $configuration; + + /** @var Password */ + private $auth; + + /** @var Session */ + private $session; + + /** @var Sftp */ + private $sftp; + + /** @var string */ + private $tmpDir; + + protected function setUp() + { + $this->configuration = new Configuration('localhost'); + $this->auth = new Password(TEST_USER, TEST_PASSWORD); + $this->session = new Session($this->configuration, $this->auth); + + $this->sftp = $this->session->getSftp(); + + $this->createFixtures(); + } + + protected function createFixtures() + { + $this->tmpDir = rtrim(sys_get_temp_dir(), '/') . '/' . 'HerzultPHPSSH'; + + $fs = new Filesystem(); + + $fs->remove($this->tmpDir); + $fs->mkdir($this->tmpDir); + + $fs->touch($this->tmpDir . '/foo.txt'); + + $fs->mkdir($this->tmpDir . '/bar'); + $fs->mkdir($this->tmpDir . '/bar/alice'); + $fs->dumpFile($this->tmpDir . '/bar/bob.txt', 'SomeContent'); + + $fs->chmod($this->tmpDir, 0777, 0000, true); + } + + protected function createLargeDirectoryTree() + { + $basePath = $this->tmpDir . '/tree'; + $fs = new Filesystem(); + + // Create a larger directory tree + foreach (range('a', 'c') as $a) { + $fs->mkdir($basePath . '/' . $a); + foreach (range('a', 'c') as $b) { + $fs->mkdir($basePath . '/' . $a . '/' . $b); + foreach (range('a', 'c') as $c) { + $fs->mkdir($basePath . '/' . $a . '/' . $b . '/' . $c); + foreach (range('1', '3') as $file) { + $fs->touch($basePath . '/' . $a . '/' . $b . '/' . $c . '/' . $file . '.txt'); + } + } + } + } + $fs->chmod($basePath, 0777, 0000, true); + } + + public function testSymlinks() + { + $path = $this->tmpDir . '/symlink'; + $pathTarget = $this->tmpDir . '/bar/bob.txt'; + + $this->assertTrue($this->sftp->symlink($pathTarget, $path)); + $this->assertEquals($pathTarget, $this->sftp->readlink($path)); + $this->assertEquals( + array( + 7, + 'size', + 4, + 'uid', + 5, + 'gid', + 2, + 'mode', + 8, + 'atime', + 9, + 'mtime' + ), + array_keys($this->sftp->lstat($path)) + ); + } + + public function testListlargeDirectory() + { + $this->createLargeDirectoryTree(); + + $list = $this->sftp->listDirectory($this->tmpDir . '/tree', true); + + $this->assertCount(81, $list['files']); + $this->assertCount(39, $list['directories']); + } + + public function testReadFile() + { + $this->assertEquals('SomeContent', $this->sftp->read($this->tmpDir . '/bar/bob.txt')); + + $this->assertEquals(false, $this->sftp->read($this->tmpDir . '/not_existing.txt')); + } + + public function testWriteAndReadFile() + { + $path = $this->tmpDir . '/new.txt'; + + // Creating new file. + $this->assertEquals(true, $this->sftp->write($path, 'MyContent')); + $this->assertEquals('MyContent', $this->sftp->read($path)); + + // Overwriting. + $this->assertEquals(true, $this->sftp->write($path, 'AnotherContent')); + $this->assertEquals('AnotherContent', $this->sftp->read($path)); + } + + public function testRealpath() + { + // Will work. + $this->assertEquals('/etc/hosts', $this->sftp->realpath('/usr//../../../../etc//hosts')); + + // This should not work. + $this->assertEquals(false, $this->sftp->realpath('/foo/bar//../../../../etc//hosts')); + } + + public function testUnlinkFile() + { + $path = $this->tmpDir . '/bar/bob.txt'; + + $this->assertTrue(is_array($this->sftp->stat($path))); + + $this->assertTrue($this->sftp->unlink($path)); + + $this->assertFalse($this->sftp->stat($path)); + + // Unlinking a second time should not work. + $this->assertFalse($this->sftp->unlink($path)); + } + + public function testRenameFile() + { + $path = $this->tmpDir . '/bar/bob.txt'; + $pathTarget = $this->tmpDir . '/bar/bob.txt_moved'; + + $this->assertTrue(is_array($this->sftp->stat($path))); + $this->assertFalse($this->sftp->stat($pathTarget)); + + $this->assertTrue($this->sftp->rename($path, $pathTarget)); + + $this->assertTrue(is_array($this->sftp->stat($pathTarget))); + $this->assertFalse($this->sftp->stat($path)); + } + + public function testListDirectory() + { + $path = $this->tmpDir . '/bar'; + + $list = $this->sftp->listDirectory($path); + + $this->assertEquals( + array( + 'files' => array($path . '/bob.txt'), + 'directories' => array($path . '/alice'), + ), + $list + ); + } + + /** + * @expectedException \RuntimeException + */ + public function testListNotExistingDirectory() + { + $path = $this->tmpDir . '/does_not_exist'; + + $this->sftp->listDirectory($path); + } + + public function testCreateStatAndRemoveDir() + { + $path = $this->tmpDir . '/a_dir'; + + // Check + $this->assertFalse($this->sftp->stat($path)); + + // Create + $this->assertTrue($this->sftp->mkdir($path)); + + //var_dump($this->sftp->stat($path)); die(); + + $this->assertEquals( + array( + 7, + 'size', + 4, + 'uid', + 5, + 'gid', + 2, + 'mode', + 8, + 'atime', + 9, + 'mtime' + ), + array_keys($this->sftp->stat($path)) + ); + + + // Remove + $this->assertTrue($this->sftp->rmdir($path)); + $this->assertFalse($this->sftp->stat($path)); + } + + public function testTestNotExistingFile() + { + $path = $this->tmpDir . '/foo.bar'; + + $this->assertFalse($this->sftp->exists($path)); + + $list = $this->sftp->listDirectory($this->tmpDir); + $this->assertNotContains($path, $list['files']); + } + + public function testTestExistingFile() + { + $path = $this->tmpDir . '/foo.txt'; + + $this->assertTrue($this->sftp->exists($path)); + + $list = $this->sftp->listDirectory($this->tmpDir); + $this->assertContains($path, $list['files']); + } +} + +\ No newline at end of file diff --git a/libs/php-ssh/tests/Ssh/SessionTest.php b/libs/php-ssh/tests/Ssh/SessionTest.php @@ -0,0 +1,153 @@ +<?php + +namespace Ssh; + +/** + * @covers \Ssh\Session + */ +class SessionTest extends \PHPUnit_Framework_TestCase +{ + protected $configuration; + + public function setUp() + { + $this->configuration = $this->getMock('Ssh\Configuration', array('asArguments'), array('my-host')); + $this->configuration->expects($this->any()) + ->method('asArguments') + ->will($this->returnValue(array('my-host', 21, array(), array()))); + } + + public function testAuthenticateOnResourceCreation() + { + $resource = tmpfile(); + + $authentication = $this->getMock('Ssh\Authentication\Password', array(), array('John', 's3cr3t')); + $authentication->expects($this->once()) + ->method('authenticate') + ->with($this->equalTo($resource)) + ->will($this->returnValue(true)); + + $session = $this->getMock('Ssh\Session', array('connect'), array($this->configuration, $authentication)); + $session->expects($this->once()) + ->method('connect') + ->will($this->returnValue($resource)); + + $session->getResource(); + } + + public function testAuthenticateOnAuthenticationDefinition() + { + $resource = tmpfile(); + + $session = new Session($this->configuration); + + $property = new \ReflectionProperty($session, 'resource'); + $property->setAccessible(true); + $property->setValue($session, $resource); + + $authentication = $this->getMock('Ssh\Authentication\Password', array('authenticate'), array('John', 's3cr3t')); + $authentication->expects($this->once()) + ->method('authenticate') + ->with($this->equalTo($resource)) + ->will($this->returnValue(true)); + + $session->setAuthentication($authentication); + } + + public function testCreateResourceWillThrowAnExceptionOnConnectionFailure() + { + $session = $this->getMock('Ssh\Session', array('connect'), array($this->configuration)); + $session->expects($this->any()) + ->method('connect') + ->will($this->returnValue(false)); + + $method = new \ReflectionMethod($session, 'createResource'); + $method->setAccessible(true); + + $this->setExpectedException('RuntimeException'); + + $method->invoke($session); + } + + public function testCreateResourceWillThrowAnExceptionOnAuthenticationFailure() + { + $authentication = $this->getMock('Ssh\Authentication\Password', array('authenticate'), array('John', 's3cr3t')); + $authentication->expects($this->any()) + ->method('authenticate') + ->will($this->returnValue(false)); + + $session = $this->getMock('Ssh\Session', array('connect'), array($this->configuration, $authentication)); + $session->expects($this->any()) + ->method('connect') + ->will($this->returnValue(true)); + + $method = new \ReflectionMethod($session, 'createResource'); + $method->setAccessible(true); + + $this->setExpectedException('RuntimeException'); + + $method->invoke($session); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The subsystem 'does_not_exist' is not supported. + */ + public function testCreateInvalidSubsystem() + { + $session = new Session($this->configuration); + + $session->getSubsystem('does_not_exist'); + } + + public function testGetConfiguration() + { + $session = new Session($this->configuration); + + $this->assertEquals($this->configuration, $session->getConfiguration()); + } + + public function testGetSubsystemSftp() + { + $session = new Session($this->configuration); + + $this->assertInstanceOf('\Ssh\Sftp', $session->getSftp()); + } + + public function testGetSubsystemPublickey() + { + $session = new Session($this->configuration); + + $this->assertInstanceOf('\Ssh\Publickey', $session->getPublickey()); + } + + public function testGetSubsystemExec() + { + $session = new Session($this->configuration); + + $this->assertInstanceOf('\Ssh\Exec', $session->getExec()); + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage The authentication over the current SSH connection failed. + */ + public function testAuthenficationException() + { + // A Authentication that will always fail. + $authentication = $this->getMock('Ssh\Authentication\Password', array(), array('John', 's3cr3t')); + $authentication->expects($this->once()) + ->method('authenticate') + ->will($this->returnValue(false)); + + $session = new Session($this->configuration); + + // We need to inject a resource, to trigger the authentification. + $resource = tmpfile(); + $property = new \ReflectionProperty($session, 'resource'); + $property->setAccessible(true); + $property->setValue($session, $resource); + + $session->setAuthentication($authentication); + } +} diff --git a/libs/php-ssh/tests/Ssh/SshConfigFileConfigurationTest.php b/libs/php-ssh/tests/Ssh/SshConfigFileConfigurationTest.php @@ -0,0 +1,157 @@ +<?php + +namespace Ssh; + +class SshConfigFileConfigurationTest extends \PHPUnit_Framework_TestCase +{ + public function testParseValidSshConfigFile() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'test'); + + $this->assertAttributeEquals(array( + array( + 'host' => 'hello', + 'hostname' => 'hello.com', + 'port' => '1234' + ), + array( + 'host' => 'hello.com', + 'hostname' => 'hello.com', + 'port' => '1234' + ), + array( + 'host' => 'test', + 'hostname' => 'test.com' + ), + array( + 'host' => 'testuser.com', + 'user' => 'test', + 'identityfile' => 'test' + ), + array( + 'host' => 'tamp', + 'hostname' => 'tamp.yo' + ), + array( + 'host' => 'identity', + 'user' => 'identity', + 'identityfile' => '~/identity' + ), + array( + 'host' => 'ta*', + 'user' => 'bob', + 'port' => '12345', + 'hostname' => 'test.com' + ) + ), 'configs', $config); + } + + /** + * @expectedException RuntimeException + * @expectedExceptionMessage Unable to find configuration for host 'notfound' + */ + public function testParseSshConfigFileHostNotFound() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'notfound'); + } + + public function testParseInvalidSshConfigFile() + { + $exceptions = 0; + $file = __DIR__ . '/Fixtures/config_invalid'; + try { + new SshConfigFileConfiguration($file, 'test'); + } catch (\RuntimeException $e) { + $exceptions++; + $this->assertEquals("The file '$file' is not parsable at line '1'", $e->getMessage()); + } + $this->assertEquals(1, $exceptions); + } + + public function testHostNameFromConfig() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'tamp'); + $this->assertAttributeEquals('tamp.yo', 'host', $config); + } + + public function testPortFromConfig() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'tamp'); + $this->assertAttributeEquals('12345', 'port', $config); + } + + /** + * @expectedException RuntimeException + * @expectedExceptionMessage The file 'fakefile' does not exist or is not readable + */ + public function testParseNonExsistantSshConfigFile() + { + new SshConfigFileConfiguration('fakefile', 'test'); + } + + /** + * @covers \Ssh\SshConfigFileConfiguration + */ + public function testGetAuthentication() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'test'); + + $identity = getenv('HOME') . "/.ssh/id_rsa"; + + if (file_exists($identity)) { + $this->assertEquals(new Authentication\PublicKeyFile( + 'test', + "{$identity}.pub", + $identity, + null + ), $config->getAuthentication(null, 'test')); + + } else { + $this->assertEquals(new Authentication\None('test'), $config->getAuthentication(null, 'test')); + } + + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'testuser.com'); + + $this->assertEquals( + new Authentication\PublicKeyFile( + 'test', + 'test.pub', + 'test', + null + ), + $config->getAuthentication() + ); + + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'testuser.com'); + + $this->assertEquals( + new Authentication\PublicKeyFile( + 'otheruser', + 'test.pub', + 'test', + null + ), + $config->getAuthentication(null, 'otheruser') + ); + + } + + public function testIdentityFilePath() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'identity'); + $this->assertAttributeEquals(array( + 'user' => 'identity', + 'identityfile' => getenv('HOME') . '/identity' + ), 'config', $config); + } + + /** + * @expectedException RuntimeException + * @expectedExceptionMessage Can not authenticate for 'test.com' could not find user to authenticate as + */ + public function testGetAuthenticationFailed() + { + $config = new SshConfigFileConfiguration(__DIR__ . '/Fixtures/config_valid', 'test'); + $config->getAuthentication(); + } +} diff --git a/libs/php-ssh/tests/Ssh/SubsystemTest.php b/libs/php-ssh/tests/Ssh/SubsystemTest.php @@ -0,0 +1,51 @@ +<?php + +namespace Ssh; + +/** + * @covers \Ssh\Subsystem + */ +class SubsystemTest extends \PHPUnit_Framework_TestCase +{ + public function testSessionResourceIsNotUsedOnCreation() + { + $session = $this->getMock( + 'Ssh\Session', array(), array(), '', false + ); + + $session->expects($this->never())->method('getResource'); + + $subsystem = $this->getMockForAbstractClass( + 'Ssh\Subsystem', array($session) + ); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The session must be either a Session instance or a SSH session resource. + */ + public function testInvalidContructorArgumentException() + { + new Exec(false); + } + + public function testGetSessionResourceWillReturnResource() + { + $resource = tmpfile(); + $exec = new Exec($resource); + + $this->assertEquals($resource, $exec->getSessionResource()); + } + + public function testGetSessionResourceWillCallSessionGetResource() + { + $session = $this->getMock( + 'Ssh\Session', array('getResource'), array(), '', false + ); + $session->expects($this->once())->method('getResource')->will($this->returnValue('aResource')); + + $exec = new Exec($session); + + $this->assertEquals('aResource', $exec->getSessionResource()); + } +} diff --git a/libs/php-ssh/tests/bootstrap.php.dist b/libs/php-ssh/tests/bootstrap.php.dist @@ -0,0 +1,13 @@ +<?php + +$filename = __DIR__.'/../vendor/autoload.php'; + +if (!file_exists($filename)) { + echo 'You must first install the vendors using composer.'.PHP_EOL; + exit(1); +} + +define('TEST_USER', get_current_user()); +define('TEST_PASSWORD', '1234'); + +require_once $filename; diff --git a/libs/php-ssh/vendor/autoload.php b/libs/php-ssh/vendor/autoload.php @@ -0,0 +1,7 @@ +<?php + +// autoload.php @generated by Composer + +require_once __DIR__ . '/composer' . '/autoload_real.php'; + +return ComposerAutoloaderInit2f5a01170bf43cdaec84ae027f3079b4::getLoader(); diff --git a/libs/php-ssh/vendor/bin/phpunit b/libs/php-ssh/vendor/bin/phpunit @@ -0,0 +1 @@ +../phpunit/phpunit/composer/bin/phpunit +\ No newline at end of file diff --git a/libs/php-ssh/vendor/composer/ClassLoader.php b/libs/php-ssh/vendor/composer/ClassLoader.php @@ -0,0 +1,413 @@ +<?php + +/* + * This file is part of Composer. + * + * (c) Nils Adermann <naderman@naderman.de> + * Jordi Boggiano <j.boggiano@seld.be> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0 class loader + * + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Jordi Boggiano <j.boggiano@seld.be> + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + + private $classMapAuthoritative = false; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @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) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $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 + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative) { + return false; + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if ($file === null && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if ($file === null) { + // Remember that this class does not exist. + return $this->classMap[$class] = false; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { + if (0 === strpos($class, $prefix)) { + foreach ($this->prefixDirsPsr4[$prefix] as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/libs/php-ssh/vendor/composer/LICENSE b/libs/php-ssh/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) 2015 Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/libs/php-ssh/vendor/composer/autoload_classmap.php b/libs/php-ssh/vendor/composer/autoload_classmap.php @@ -0,0 +1,355 @@ +<?php + +// autoload_classmap.php @generated by Composer + +$vendorDir = dirname(dirname(__FILE__)); +$baseDir = dirname($vendorDir); + +return array( + 'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/src/Iterator.php', + 'File_Iterator_Facade' => $vendorDir . '/phpunit/php-file-iterator/src/Facade.php', + 'File_Iterator_Factory' => $vendorDir . '/phpunit/php-file-iterator/src/Factory.php', + 'PHPUnit_Extensions_GroupTestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php', + 'PHPUnit_Extensions_PhptTestCase' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php', + 'PHPUnit_Extensions_PhptTestCase_Logger' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php', + 'PHPUnit_Extensions_PhptTestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php', + 'PHPUnit_Extensions_RepeatedTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php', + 'PHPUnit_Extensions_TestDecorator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php', + 'PHPUnit_Extensions_TicketListener' => $vendorDir . '/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php', + 'PHPUnit_Framework_Assert' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Assert.php', + 'PHPUnit_Framework_AssertionFailedError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php', + 'PHPUnit_Framework_Comparator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator.php', + 'PHPUnit_Framework_ComparatorFactory' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php', + 'PHPUnit_Framework_Comparator_Array' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php', + 'PHPUnit_Framework_Comparator_DOMDocument' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php', + 'PHPUnit_Framework_Comparator_Double' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php', + 'PHPUnit_Framework_Comparator_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php', + 'PHPUnit_Framework_Comparator_MockObject' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php', + 'PHPUnit_Framework_Comparator_Numeric' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php', + 'PHPUnit_Framework_Comparator_Object' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php', + 'PHPUnit_Framework_Comparator_Resource' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php', + 'PHPUnit_Framework_Comparator_Scalar' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php', + 'PHPUnit_Framework_Comparator_SplObjectStorage' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php', + 'PHPUnit_Framework_Comparator_Type' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php', + 'PHPUnit_Framework_ComparisonFailure' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php', + 'PHPUnit_Framework_Constraint' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint.php', + 'PHPUnit_Framework_Constraint_And' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php', + 'PHPUnit_Framework_Constraint_ArrayHasKey' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php', + 'PHPUnit_Framework_Constraint_Attribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php', + 'PHPUnit_Framework_Constraint_Callback' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php', + 'PHPUnit_Framework_Constraint_ClassHasAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php', + 'PHPUnit_Framework_Constraint_ClassHasStaticAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php', + 'PHPUnit_Framework_Constraint_Composite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php', + 'PHPUnit_Framework_Constraint_Count' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php', + 'PHPUnit_Framework_Constraint_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php', + 'PHPUnit_Framework_Constraint_ExceptionCode' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php', + 'PHPUnit_Framework_Constraint_ExceptionMessage' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php', + 'PHPUnit_Framework_Constraint_FileExists' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php', + 'PHPUnit_Framework_Constraint_GreaterThan' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php', + 'PHPUnit_Framework_Constraint_IsAnything' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php', + 'PHPUnit_Framework_Constraint_IsEmpty' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php', + 'PHPUnit_Framework_Constraint_IsEqual' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php', + 'PHPUnit_Framework_Constraint_IsFalse' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php', + 'PHPUnit_Framework_Constraint_IsIdentical' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php', + 'PHPUnit_Framework_Constraint_IsInstanceOf' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php', + 'PHPUnit_Framework_Constraint_IsJson' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php', + 'PHPUnit_Framework_Constraint_IsNull' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php', + 'PHPUnit_Framework_Constraint_IsTrue' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php', + 'PHPUnit_Framework_Constraint_IsType' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php', + 'PHPUnit_Framework_Constraint_JsonMatches' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php', + 'PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php', + 'PHPUnit_Framework_Constraint_LessThan' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php', + 'PHPUnit_Framework_Constraint_Not' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php', + 'PHPUnit_Framework_Constraint_ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php', + 'PHPUnit_Framework_Constraint_Or' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php', + 'PHPUnit_Framework_Constraint_PCREMatch' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php', + 'PHPUnit_Framework_Constraint_SameSize' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php', + 'PHPUnit_Framework_Constraint_StringContains' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php', + 'PHPUnit_Framework_Constraint_StringEndsWith' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php', + 'PHPUnit_Framework_Constraint_StringMatches' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php', + 'PHPUnit_Framework_Constraint_StringStartsWith' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php', + 'PHPUnit_Framework_Constraint_TraversableContains' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php', + 'PHPUnit_Framework_Constraint_TraversableContainsOnly' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php', + 'PHPUnit_Framework_Constraint_Xor' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php', + 'PHPUnit_Framework_Error' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error.php', + 'PHPUnit_Framework_Error_Deprecated' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php', + 'PHPUnit_Framework_Error_Notice' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php', + 'PHPUnit_Framework_Error_Warning' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php', + 'PHPUnit_Framework_Exception' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Exception.php', + 'PHPUnit_Framework_ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php', + 'PHPUnit_Framework_IncompleteTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php', + 'PHPUnit_Framework_IncompleteTestError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php', + 'PHPUnit_Framework_MockObject_Builder_Identity' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Identity.php', + 'PHPUnit_Framework_MockObject_Builder_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/InvocationMocker.php', + 'PHPUnit_Framework_MockObject_Builder_Match' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Match.php', + 'PHPUnit_Framework_MockObject_Builder_MethodNameMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php', + 'PHPUnit_Framework_MockObject_Builder_Namespace' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Namespace.php', + 'PHPUnit_Framework_MockObject_Builder_ParametersMatch' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/ParametersMatch.php', + 'PHPUnit_Framework_MockObject_Builder_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Stub.php', + 'PHPUnit_Framework_MockObject_Generator' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php', + 'PHPUnit_Framework_MockObject_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation.php', + 'PHPUnit_Framework_MockObject_InvocationMocker' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/InvocationMocker.php', + 'PHPUnit_Framework_MockObject_Invocation_Object' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Object.php', + 'PHPUnit_Framework_MockObject_Invocation_Static' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Static.php', + 'PHPUnit_Framework_MockObject_Invokable' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invokable.php', + 'PHPUnit_Framework_MockObject_Matcher' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher.php', + 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php', + 'PHPUnit_Framework_MockObject_Matcher_AnyParameters' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyParameters.php', + 'PHPUnit_Framework_MockObject_Matcher_Invocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Invocation.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedCount' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedCount.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php', + 'PHPUnit_Framework_MockObject_Matcher_MethodName' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php', + 'PHPUnit_Framework_MockObject_Matcher_Parameters' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Parameters.php', + 'PHPUnit_Framework_MockObject_Matcher_StatelessInvocation' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php', + 'PHPUnit_Framework_MockObject_MockBuilder' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockBuilder.php', + 'PHPUnit_Framework_MockObject_MockObject' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockObject.php', + 'PHPUnit_Framework_MockObject_Stub' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub.php', + 'PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php', + 'PHPUnit_Framework_MockObject_Stub_Exception' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Exception.php', + 'PHPUnit_Framework_MockObject_Stub_MatcherCollection' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/MatcherCollection.php', + 'PHPUnit_Framework_MockObject_Stub_Return' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Return.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnArgument' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnArgument.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnCallback' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnCallback.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnSelf' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnSelf.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnValueMap' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnValueMap.php', + 'PHPUnit_Framework_MockObject_Verifiable' => $vendorDir . '/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Verifiable.php', + 'PHPUnit_Framework_OutputError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/OutputError.php', + 'PHPUnit_Framework_SelfDescribing' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php', + 'PHPUnit_Framework_SkippedTest' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php', + 'PHPUnit_Framework_SkippedTestError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php', + 'PHPUnit_Framework_SkippedTestSuiteError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php', + 'PHPUnit_Framework_SyntheticError' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php', + 'PHPUnit_Framework_Test' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Test.php', + 'PHPUnit_Framework_TestCase' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestCase.php', + 'PHPUnit_Framework_TestFailure' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestFailure.php', + 'PHPUnit_Framework_TestListener' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestListener.php', + 'PHPUnit_Framework_TestResult' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestResult.php', + 'PHPUnit_Framework_TestSuite' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestSuite.php', + 'PHPUnit_Framework_TestSuite_DataProvider' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php', + 'PHPUnit_Framework_Warning' => $vendorDir . '/phpunit/phpunit/PHPUnit/Framework/Warning.php', + 'PHPUnit_Runner_BaseTestRunner' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php', + 'PHPUnit_Runner_StandardTestSuiteLoader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php', + 'PHPUnit_Runner_TestSuiteLoader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php', + 'PHPUnit_Runner_Version' => $vendorDir . '/phpunit/phpunit/PHPUnit/Runner/Version.php', + 'PHPUnit_TextUI_Command' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/Command.php', + 'PHPUnit_TextUI_ResultPrinter' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php', + 'PHPUnit_TextUI_TestRunner' => $vendorDir . '/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php', + 'PHPUnit_Util_Class' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Class.php', + 'PHPUnit_Util_Configuration' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Configuration.php', + 'PHPUnit_Util_DeprecatedFeature' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php', + 'PHPUnit_Util_DeprecatedFeature_Logger' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php', + 'PHPUnit_Util_Diff' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Diff.php', + 'PHPUnit_Util_ErrorHandler' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php', + 'PHPUnit_Util_Fileloader' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Fileloader.php', + 'PHPUnit_Util_Filesystem' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Filesystem.php', + 'PHPUnit_Util_Filter' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Filter.php', + 'PHPUnit_Util_Getopt' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Getopt.php', + 'PHPUnit_Util_GlobalState' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/GlobalState.php', + 'PHPUnit_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php', + 'PHPUnit_Util_Log_JSON' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/JSON.php', + 'PHPUnit_Util_Log_JUnit' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php', + 'PHPUnit_Util_Log_TAP' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Log/TAP.php', + 'PHPUnit_Util_PHP' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP.php', + 'PHPUnit_Util_PHP_Default' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP/Default.php', + 'PHPUnit_Util_PHP_Windows' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php', + 'PHPUnit_Util_Printer' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Printer.php', + 'PHPUnit_Util_String' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/String.php', + 'PHPUnit_Util_Test' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Test.php', + 'PHPUnit_Util_TestDox_NamePrettifier' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php', + 'PHPUnit_Util_TestDox_ResultPrinter' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php', + 'PHPUnit_Util_TestDox_ResultPrinter_HTML' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php', + 'PHPUnit_Util_TestDox_ResultPrinter_Text' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php', + 'PHPUnit_Util_TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php', + 'PHPUnit_Util_Type' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/Type.php', + 'PHPUnit_Util_XML' => $vendorDir . '/phpunit/phpunit/PHPUnit/Util/XML.php', + 'PHP_CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage.php', + 'PHP_CodeCoverage_Driver' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Driver.php', + 'PHP_CodeCoverage_Driver_Xdebug' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Driver/Xdebug.php', + 'PHP_CodeCoverage_Exception' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Exception.php', + 'PHP_CodeCoverage_Filter' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php', + 'PHP_CodeCoverage_Report_Clover' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Clover.php', + 'PHP_CodeCoverage_Report_Factory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php', + 'PHP_CodeCoverage_Report_HTML' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php', + 'PHP_CodeCoverage_Report_HTML_Renderer' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_Dashboard' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Dashboard.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_Directory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_File' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/File.php', + 'PHP_CodeCoverage_Report_Node' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node.php', + 'PHP_CodeCoverage_Report_Node_Directory' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Directory.php', + 'PHP_CodeCoverage_Report_Node_File' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/File.php', + 'PHP_CodeCoverage_Report_Node_Iterator' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Iterator.php', + 'PHP_CodeCoverage_Report_PHP' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/PHP.php', + 'PHP_CodeCoverage_Report_Text' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Text.php', + 'PHP_CodeCoverage_Util' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Util.php', + 'PHP_CodeCoverage_Util_InvalidArgumentHelper' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Util/InvalidArgumentHelper.php', + 'PHP_CodeCoverage_Version' => $vendorDir . '/phpunit/php-code-coverage/PHP/CodeCoverage/Version.php', + 'PHP_Timer' => $vendorDir . '/phpunit/php-timer/src/Timer.php', + 'PHP_Token' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_TokenWithScope' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_TokenWithScopeAndVisibility' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ABSTRACT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_AMPERSAND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_AND_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ARRAY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ARRAY_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_AS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_AT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BACKTICK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BAD_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BOOLEAN_AND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BOOLEAN_OR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BOOL_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_BREAK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CALLABLE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CARET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CASE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CATCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CHARACTER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLASS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLASS_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLASS_NAME_CONSTANT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLONE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLOSE_BRACKET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLOSE_CURLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLOSE_SQUARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CLOSE_TAG' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_COLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_COMMA' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_COMMENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CONCAT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CONST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CONSTANT_ENCAPSED_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CONTINUE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_CURLY_OPEN' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DEC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DECLARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DEFAULT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DIR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DIV' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DIV_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DNUMBER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOC_COMMENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOLLAR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOUBLE_ARROW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOUBLE_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOUBLE_COLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_DOUBLE_QUOTES' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ECHO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ELSE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ELSEIF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EMPTY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENCAPSED_AND_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDDECLARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDFOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDFOREACH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDIF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDSWITCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ENDWHILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_END_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EVAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EXCLAMATION_MARK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EXIT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_EXTENDS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FINAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FINALLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FOREACH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FUNCTION' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_FUNC_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_GLOBAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_GOTO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_GT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_HALT_COMPILER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IMPLEMENTS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INCLUDE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INCLUDE_ONCE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INLINE_HTML' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INSTANCEOF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INSTEADOF' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INTERFACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_INT_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_ISSET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_GREATER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_NOT_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_NOT_IDENTICAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_IS_SMALLER_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_Includes' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LINE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LIST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LNUMBER' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LOGICAL_AND' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LOGICAL_OR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LOGICAL_XOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_LT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_METHOD_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_MINUS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_MINUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_MOD_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_MULT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_MUL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_NAMESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_NEW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_NS_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_NS_SEPARATOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_NUM_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OBJECT_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OBJECT_OPERATOR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OPEN_BRACKET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OPEN_CURLY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OPEN_SQUARE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OPEN_TAG' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OPEN_TAG_WITH_ECHO' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_OR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PERCENT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PIPE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PLUS' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PLUS_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PRINT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PRIVATE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PROTECTED' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_PUBLIC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_QUESTION_MARK' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_REQUIRE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_REQUIRE_ONCE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_RETURN' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SEMICOLON' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SL_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_START_HEREDOC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_STATIC' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_STRING' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_STRING_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_STRING_VARNAME' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_SWITCH' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_Stream' => $vendorDir . '/phpunit/php-token-stream/PHP/Token/Stream.php', + 'PHP_Token_Stream_CachingFactory' => $vendorDir . '/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php', + 'PHP_Token_THROW' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_TILDE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_TRAIT' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_TRAIT_C' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_TRY' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_UNSET' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_UNSET_CAST' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_USE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_VAR' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_VARIABLE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_WHILE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_WHITESPACE' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_XOR_EQUAL' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'PHP_Token_YIELD' => $vendorDir . '/phpunit/php-token-stream/PHP/Token.php', + 'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php', +); diff --git a/libs/php-ssh/vendor/composer/autoload_namespaces.php b/libs/php-ssh/vendor/composer/autoload_namespaces.php @@ -0,0 +1,10 @@ +<?php + +// autoload_namespaces.php @generated by Composer + +$vendorDir = dirname(dirname(__FILE__)); +$baseDir = dirname($vendorDir); + +return array( + 'Ssh' => array($baseDir . '/src'), +); diff --git a/libs/php-ssh/vendor/composer/autoload_psr4.php b/libs/php-ssh/vendor/composer/autoload_psr4.php @@ -0,0 +1,11 @@ +<?php + +// autoload_psr4.php @generated by Composer + +$vendorDir = dirname(dirname(__FILE__)); +$baseDir = dirname($vendorDir); + +return array( + 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), + 'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'), +); diff --git a/libs/php-ssh/vendor/composer/autoload_real.php b/libs/php-ssh/vendor/composer/autoload_real.php @@ -0,0 +1,54 @@ +<?php + +// autoload_real.php @generated by Composer + +class ComposerAutoloaderInit2f5a01170bf43cdaec84ae027f3079b4 +{ + private static $loader; + + public static function loadClassLoader($class) + { + if ('Composer\Autoload\ClassLoader' === $class) { + require __DIR__ . '/ClassLoader.php'; + } + } + + public static function getLoader() + { + if (null !== self::$loader) { + return self::$loader; + } + + spl_autoload_register(array('ComposerAutoloaderInit2f5a01170bf43cdaec84ae027f3079b4', 'loadClassLoader'), true, true); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + spl_autoload_unregister(array('ComposerAutoloaderInit2f5a01170bf43cdaec84ae027f3079b4', 'loadClassLoader')); + + $includePaths = require __DIR__ . '/include_paths.php'; + array_push($includePaths, get_include_path()); + set_include_path(join(PATH_SEPARATOR, $includePaths)); + + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + + $loader->register(true); + + return $loader; + } +} + +function composerRequire2f5a01170bf43cdaec84ae027f3079b4($file) +{ + require $file; +} diff --git a/libs/php-ssh/vendor/composer/include_paths.php b/libs/php-ssh/vendor/composer/include_paths.php @@ -0,0 +1,14 @@ +<?php + +// include_paths.php @generated by Composer + +$vendorDir = dirname(dirname(__FILE__)); +$baseDir = dirname($vendorDir); + +return array( + $vendorDir . '/phpunit/phpunit-mock-objects', + $vendorDir . '/phpunit/php-token-stream', + $vendorDir . '/phpunit/php-code-coverage', + $vendorDir . '/phpunit/phpunit', + $vendorDir . '/symfony/yaml', +); diff --git a/libs/php-ssh/vendor/composer/installed.json b/libs/php-ssh/vendor/composer/installed.json @@ -0,0 +1,480 @@ +[ + { + "name": "symfony/yaml", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-09-14 14:14:09", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2015-06-21 13:50:34", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ] + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "1.2.3", + "version_normalized": "1.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "time": "2013-01-13 10:24:48", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ] + }, + { + "name": "phpunit/php-timer", + "version": "1.0.7", + "version_normalized": "1.0.7.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2015-06-21 08:01:12", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ] + }, + { + "name": "phpunit/php-token-stream", + "version": "1.2.2", + "version_normalized": "1.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", + "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "time": "2014-03-03 05:10:30", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ] + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2015-06-21 13:08:43", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ] + }, + { + "name": "phpunit/php-code-coverage", + "version": "1.2.18", + "version_normalized": "1.2.18.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "time": "2014-09-02 10:13:14", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ] + }, + { + "name": "phpunit/phpunit", + "version": "3.7.38", + "version_normalized": "3.7.38.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "time": "2014-10-17 09:04:17", + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ] + }, + { + "name": "symfony/filesystem", + "version": "v2.7.5", + "version_normalized": "2.7.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "reference": "a17f8a17c20e8614c15b8e116e2f4bcde102cfab", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-09-09 17:42:36", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com" + } +] diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/.gitattributes b/libs/php-ssh/vendor/phpunit/php-code-coverage/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/.gitignore b/libs/php-ssh/vendor/phpunit/php-code-coverage/.gitignore @@ -0,0 +1,12 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +cache.properties +phpunit.xml +/vendor +/composer.lock +/composer.phar +/.idea + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/.travis.yml b/libs/php-ssh/vendor/phpunit/php-code-coverage/.travis.yml @@ -0,0 +1,20 @@ +language: php + +php: + - 5.3.3 + - 5.3 + - 5.4 + - 5.5 + - 5.6 + +before_script: + - COMPOSER_ROOT_VERSION=dev-master composer install --dev --prefer-source + +script: vendor/bin/phpunit --configuration ./build/travis-ci.xml + +notifications: + email: false + irc: + channels: + - "irc.freenode.org#phpunit" + use_notice: true diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/CONTRIBUTING.md b/libs/php-ssh/vendor/phpunit/php-code-coverage/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Pull Requests for bug fixes should be made against the current release branch (1.2). + +Pull Requests for new features should be made against master. + +For further notes please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/LICENSE b/libs/php-ssh/vendor/phpunit/php-code-coverage/LICENSE @@ -0,0 +1,33 @@ +PHP_CodeCoverage + +Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php @@ -0,0 +1,801 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +// @codeCoverageIgnoreStart +// @codingStandardsIgnoreStart +/** + * @SuppressWarnings(PHPMD) + */ +if (!function_exists('trait_exists')) { + function trait_exists($name) + { + return FALSE; + } +} +// @codingStandardsIgnoreEnd +// @codeCoverageIgnoreEnd + +/** + * Provides collection functionality for PHP code coverage information. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage +{ + /** + * @var PHP_CodeCoverage_Driver + */ + protected $driver; + + /** + * @var PHP_CodeCoverage_Filter + */ + protected $filter; + + /** + * @var boolean + */ + protected $cacheTokens = FALSE; + + /** + * @var boolean + */ + protected $forceCoversAnnotation = FALSE; + + /** + * @var boolean + */ + protected $mapTestClassNameToCoveredClassName = FALSE; + + /** + * @var boolean + */ + protected $addUncoveredFilesFromWhitelist = TRUE; + + /** + * @var boolean + */ + protected $processUncoveredFilesFromWhitelist = FALSE; + + /** + * @var mixed + */ + protected $currentId; + + /** + * Code coverage data. + * + * @var array + */ + protected $data = array(); + + /** + * Test data. + * + * @var array + */ + protected $tests = array(); + + /** + * Constructor. + * + * @param PHP_CodeCoverage_Driver $driver + * @param PHP_CodeCoverage_Filter $filter + */ + public function __construct(PHP_CodeCoverage_Driver $driver = NULL, PHP_CodeCoverage_Filter $filter = NULL) + { + if ($driver === NULL) { + $driver = new PHP_CodeCoverage_Driver_Xdebug; + } + + if ($filter === NULL) { + $filter = new PHP_CodeCoverage_Filter; + } + + $this->driver = $driver; + $this->filter = $filter; + } + + /** + * Returns the PHP_CodeCoverage_Report_Node_* object graph + * for this PHP_CodeCoverage object. + * + * @return PHP_CodeCoverage_Report_Node_Directory + * @since Method available since Release 1.1.0 + */ + public function getReport() + { + $factory = new PHP_CodeCoverage_Report_Factory; + + return $factory->create($this); + } + + /** + * Clears collected code coverage data. + */ + public function clear() + { + $this->currentId = NULL; + $this->data = array(); + $this->tests = array(); + } + + /** + * Returns the PHP_CodeCoverage_Filter used. + * + * @return PHP_CodeCoverage_Filter + */ + public function filter() + { + return $this->filter; + } + + /** + * Returns the collected code coverage data. + * + * @return array + * @since Method available since Release 1.1.0 + */ + public function getData() + { + if ($this->addUncoveredFilesFromWhitelist) { + $this->addUncoveredFilesFromWhitelist(); + } + + // We need to apply the blacklist filter a second time + // when no whitelist is used. + if (!$this->filter->hasWhitelist()) { + $this->applyListsFilter($this->data); + } + + return $this->data; + } + + /** + * Returns the test data. + * + * @return array + * @since Method available since Release 1.1.0 + */ + public function getTests() + { + return $this->tests; + } + + /** + * Start collection of code coverage information. + * + * @param mixed $id + * @param boolean $clear + * @throws PHP_CodeCoverage_Exception + */ + public function start($id, $clear = FALSE) + { + if (!is_bool($clear)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + if ($clear) { + $this->clear(); + } + + $this->currentId = $id; + + $this->driver->start(); + } + + /** + * Stop collection of code coverage information. + * + * @param boolean $append + * @return array + * @throws PHP_CodeCoverage_Exception + */ + public function stop($append = TRUE) + { + if (!is_bool($append)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $data = $this->driver->stop(); + $this->append($data, NULL, $append); + + $this->currentId = NULL; + + return $data; + } + + /** + * Appends code coverage data. + * + * @param array $data + * @param mixed $id + * @param boolean $append + */ + public function append(array $data, $id = NULL, $append = TRUE) + { + if ($id === NULL) { + $id = $this->currentId; + } + + if ($id === NULL) { + throw new PHP_CodeCoverage_Exception; + } + + $this->applyListsFilter($data); + $this->initializeFilesThatAreSeenTheFirstTime($data); + + if (!$append) { + return; + } + + if ($id != 'UNCOVERED_FILES_FROM_WHITELIST') { + $this->applyCoversAnnotationFilter($data, $id); + } + + if (empty($data)) { + return; + } + + $status = NULL; + + if ($id instanceof PHPUnit_Framework_TestCase) { + $status = $id->getStatus(); + $id = get_class($id) . '::' . $id->getName(); + } + + else if ($id instanceof PHPUnit_Extensions_PhptTestCase) { + $id = $id->getName(); + } + + $this->tests[$id] = $status; + + foreach ($data as $file => $lines) { + if (!$this->filter->isFile($file)) { + continue; + } + + foreach ($lines as $k => $v) { + if ($v == 1) { + $this->data[$file][$k][] = $id; + } + } + } + } + + /** + * Merges the data from another instance of PHP_CodeCoverage. + * + * @param PHP_CodeCoverage $that + */ + public function merge(PHP_CodeCoverage $that) + { + foreach ($that->data as $file => $lines) { + if (!isset($this->data[$file])) { + if (!$this->filter->isFiltered($file)) { + $this->data[$file] = $lines; + } + + continue; + } + + foreach ($lines as $line => $data) { + if ($data !== NULL) { + if (!isset($this->data[$file][$line])) { + $this->data[$file][$line] = $data; + } else { + $this->data[$file][$line] = array_unique( + array_merge($this->data[$file][$line], $data) + ); + } + } + } + } + + $this->tests = array_merge($this->tests, $that->getTests()); + } + + /** + * @param boolean $flag + * @throws PHP_CodeCoverage_Exception + * @since Method available since Release 1.1.0 + */ + public function setCacheTokens($flag) + { + if (!is_bool($flag)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $this->cacheTokens = $flag; + } + + /** + * @param boolean $flag + * @since Method available since Release 1.1.0 + */ + public function getCacheTokens() + { + return $this->cacheTokens; + } + + /** + * @param boolean $flag + * @throws PHP_CodeCoverage_Exception + */ + public function setForceCoversAnnotation($flag) + { + if (!is_bool($flag)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $this->forceCoversAnnotation = $flag; + } + + /** + * @param boolean $flag + * @throws PHP_CodeCoverage_Exception + */ + public function setMapTestClassNameToCoveredClassName($flag) + { + if (!is_bool($flag)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $this->mapTestClassNameToCoveredClassName = $flag; + } + + /** + * @param boolean $flag + * @throws PHP_CodeCoverage_Exception + */ + public function setAddUncoveredFilesFromWhitelist($flag) + { + if (!is_bool($flag)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $this->addUncoveredFilesFromWhitelist = $flag; + } + + /** + * @param boolean $flag + * @throws PHP_CodeCoverage_Exception + */ + public function setProcessUncoveredFilesFromWhitelist($flag) + { + if (!is_bool($flag)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + $this->processUncoveredFilesFromWhitelist = $flag; + } + + /** + * Applies the @covers annotation filtering. + * + * @param array $data + * @param mixed $id + */ + protected function applyCoversAnnotationFilter(&$data, $id) + { + if ($id instanceof PHPUnit_Framework_TestCase) { + $testClassName = get_class($id); + $linesToBeCovered = $this->getLinesToBeCovered( + $testClassName, $id->getName() + ); + + if ($linesToBeCovered === FALSE) { + $data = array(); + return; + } + + if ($this->mapTestClassNameToCoveredClassName && + empty($linesToBeCovered)) { + $testedClass = substr($testClassName, 0, -4); + + if (class_exists($testedClass)) { + $class = new ReflectionClass($testedClass); + + $linesToBeCovered = array( + $class->getFileName() => range( + $class->getStartLine(), $class->getEndLine() + ) + ); + } + } + } else { + $linesToBeCovered = array(); + } + + if (!empty($linesToBeCovered)) { + $data = array_intersect_key($data, $linesToBeCovered); + + foreach (array_keys($data) as $filename) { + $data[$filename] = array_intersect_key( + $data[$filename], array_flip($linesToBeCovered[$filename]) + ); + } + } + + else if ($this->forceCoversAnnotation) { + $data = array(); + } + } + + /** + * Applies the blacklist/whitelist filtering. + * + * @param array $data + */ + protected function applyListsFilter(&$data) + { + foreach (array_keys($data) as $filename) { + if ($this->filter->isFiltered($filename)) { + unset($data[$filename]); + } + } + } + + /** + * @since Method available since Release 1.1.0 + */ + protected function initializeFilesThatAreSeenTheFirstTime($data) + { + foreach ($data as $file => $lines) { + if ($this->filter->isFile($file) && !isset($this->data[$file])) { + $this->data[$file] = array(); + + foreach ($lines as $k => $v) { + $this->data[$file][$k] = $v == -2 ? NULL : array(); + } + } + } + } + + /** + * Processes whitelisted files that are not covered. + */ + protected function addUncoveredFilesFromWhitelist() + { + $data = array(); + $uncoveredFiles = array_diff( + $this->filter->getWhitelist(), array_keys($this->data) + ); + + foreach ($uncoveredFiles as $uncoveredFile) { + if (!file_exists($uncoveredFile)) { + continue; + } + + if ($this->processUncoveredFilesFromWhitelist) { + $this->processUncoveredFileFromWhitelist( + $uncoveredFile, $data, $uncoveredFiles + ); + } else { + $data[$uncoveredFile] = array(); + + $lines = count(file($uncoveredFile)); + + for ($i = 1; $i <= $lines; $i++) { + $data[$uncoveredFile][$i] = -1; + } + } + } + + $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST'); + } + + /** + * @param string $uncoveredFile + * @param array $data + * @param array $uncoveredFiles + */ + protected function processUncoveredFileFromWhitelist($uncoveredFile, array &$data, array $uncoveredFiles) + { + $this->driver->start(); + include_once $uncoveredFile; + $coverage = $this->driver->stop(); + + foreach ($coverage as $file => $fileCoverage) { + if (!isset($data[$file]) && + in_array($file, $uncoveredFiles)) { + foreach (array_keys($fileCoverage) as $key) { + if ($fileCoverage[$key] == 1) { + $fileCoverage[$key] = -1; + } + } + + $data[$file] = $fileCoverage; + } + } + } + + /** + * Returns the files and lines a test method wants to cover. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 1.2.0 + */ + protected function getLinesToBeCovered($className, $methodName) + { + $codeToCoverList = array(); + $result = array(); + + // @codeCoverageIgnoreStart + if (($pos = strpos($methodName, ' ')) !== FALSE) { + $methodName = substr($methodName, 0, $pos); + } + // @codeCoverageIgnoreEnd + + $class = new ReflectionClass($className); + + try { + $method = new ReflectionMethod($className, $methodName); + } + + catch (ReflectionException $e) { + return array(); + } + + $docComment = substr($class->getDocComment(), 3, -2) . PHP_EOL . substr($method->getDocComment(), 3, -2); + + $templateMethods = array( + 'setUp', 'assertPreConditions', 'assertPostConditions', 'tearDown' + ); + + foreach ($templateMethods as $templateMethod) { + if ($class->hasMethod($templateMethod)) { + $reflector = $class->getMethod($templateMethod); + $docComment .= PHP_EOL . substr($reflector->getDocComment(), 3, -2); + unset($reflector); + } + } + + if (strpos($docComment, '@coversNothing') !== FALSE) { + return FALSE; + } + + $classShortcut = preg_match_all( + '(@coversDefaultClass\s+(?P<coveredClass>[^\s]++)\s*$)m', + $class->getDocComment(), + $matches + ); + + if ($classShortcut) { + if ($classShortcut > 1) { + throw new PHP_CodeCoverage_Exception( + sprintf( + 'More than one @coversClass annotation in class or interface "%s".', + $className + ) + ); + } + + $classShortcut = $matches['coveredClass'][0]; + } + + $match = preg_match_all( + '(@covers\s+(?P<coveredElement>[^\s()]++)[\s()]*$)m', + $docComment, + $matches + ); + + if ($match) { + foreach ($matches['coveredElement'] as $coveredElement) { + if ($classShortcut && strncmp($coveredElement, '::', 2) === 0) { + $coveredElement = $classShortcut . $coveredElement; + } + + $codeToCoverList = array_merge( + $codeToCoverList, + $this->resolveCoversToReflectionObjects($coveredElement) + ); + } + + foreach ($codeToCoverList as $codeToCover) { + $fileName = $codeToCover->getFileName(); + + if (!isset($result[$fileName])) { + $result[$fileName] = array(); + } + + $result[$fileName] = array_unique( + array_merge( + $result[$fileName], + range( + $codeToCover->getStartLine(), $codeToCover->getEndLine() + ) + ) + ); + } + } + + return $result; + } + + /** + * @param string $coveredElement + * @return array + * @since Method available since Release 1.2.0 + */ + protected function resolveCoversToReflectionObjects($coveredElement) + { + $codeToCoverList = array(); + + if (strpos($coveredElement, '::') !== FALSE) { + list($className, $methodName) = explode('::', $coveredElement); + + if (isset($methodName[0]) && $methodName[0] == '<') { + $classes = array($className); + + foreach ($classes as $className) { + if (!class_exists($className) && + !interface_exists($className)) { + throw new PHP_CodeCoverage_Exception( + sprintf( + 'Trying to @cover not existing class or ' . + 'interface "%s".', + $className + ) + ); + } + + $class = new ReflectionClass($className); + $methods = $class->getMethods(); + $inverse = isset($methodName[1]) && $methodName[1] == '!'; + + if (strpos($methodName, 'protected')) { + $visibility = 'isProtected'; + } + + else if (strpos($methodName, 'private')) { + $visibility = 'isPrivate'; + } + + else if (strpos($methodName, 'public')) { + $visibility = 'isPublic'; + } + + foreach ($methods as $method) { + if ($inverse && !$method->$visibility()) { + $codeToCoverList[] = $method; + } + + else if (!$inverse && $method->$visibility()) { + $codeToCoverList[] = $method; + } + } + } + } else { + $classes = array($className); + + foreach ($classes as $className) { + if ($className == '' && function_exists($methodName)) { + $codeToCoverList[] = new ReflectionFunction( + $methodName + ); + } else { + if (!((class_exists($className) || + interface_exists($className) || + trait_exists($className)) && + method_exists($className, $methodName))) { + throw new PHP_CodeCoverage_Exception( + sprintf( + 'Trying to @cover not existing method "%s::%s".', + $className, + $methodName + ) + ); + } + + $codeToCoverList[] = new ReflectionMethod( + $className, $methodName + ); + } + } + } + } else { + $extended = FALSE; + + if (strpos($coveredElement, '<extended>') !== FALSE) { + $coveredElement = str_replace( + '<extended>', '', $coveredElement + ); + + $extended = TRUE; + } + + $classes = array($coveredElement); + + if ($extended) { + $classes = array_merge( + $classes, + class_implements($coveredElement), + class_parents($coveredElement) + ); + } + + foreach ($classes as $className) { + if (!class_exists($className) && + !interface_exists($className) && + !trait_exists($className)) { + throw new PHP_CodeCoverage_Exception( + sprintf( + 'Trying to @cover not existing class or ' . + 'interface "%s".', + $className + ) + ); + } + + $codeToCoverList[] = new ReflectionClass($className); + } + } + + return $codeToCoverList; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php @@ -0,0 +1,94 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2010 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +if (defined('PHPUNIT_COMPOSER_INSTALL')) { + return; +} + +require_once 'File/Iterator/Autoload.php'; +require_once 'PHP/Token/Stream/Autoload.php'; +require_once 'Text/Template/Autoload.php'; + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + 'php_codecoverage' => '/CodeCoverage.php', + 'php_codecoverage_driver' => '/CodeCoverage/Driver.php', + 'php_codecoverage_driver_xdebug' => '/CodeCoverage/Driver/Xdebug.php', + 'php_codecoverage_exception' => '/CodeCoverage/Exception.php', + 'php_codecoverage_filter' => '/CodeCoverage/Filter.php', + 'php_codecoverage_report_clover' => '/CodeCoverage/Report/Clover.php', + 'php_codecoverage_report_factory' => '/CodeCoverage/Report/Factory.php', + 'php_codecoverage_report_html' => '/CodeCoverage/Report/HTML.php', + 'php_codecoverage_report_html_renderer' => '/CodeCoverage/Report/HTML/Renderer.php', + 'php_codecoverage_report_html_renderer_dashboard' => '/CodeCoverage/Report/HTML/Renderer/Dashboard.php', + 'php_codecoverage_report_html_renderer_directory' => '/CodeCoverage/Report/HTML/Renderer/Directory.php', + 'php_codecoverage_report_html_renderer_file' => '/CodeCoverage/Report/HTML/Renderer/File.php', + 'php_codecoverage_report_node' => '/CodeCoverage/Report/Node.php', + 'php_codecoverage_report_node_directory' => '/CodeCoverage/Report/Node/Directory.php', + 'php_codecoverage_report_node_file' => '/CodeCoverage/Report/Node/File.php', + 'php_codecoverage_report_node_iterator' => '/CodeCoverage/Report/Node/Iterator.php', + 'php_codecoverage_report_php' => '/CodeCoverage/Report/PHP.php', + 'php_codecoverage_report_text' => '/CodeCoverage/Report/Text.php', + 'php_codecoverage_util' => '/CodeCoverage/Util.php', + 'php_codecoverage_util_invalidargumenthelper' => '/CodeCoverage/Util/InvalidArgumentHelper.php', + 'php_codecoverage_version' => '/CodeCoverage/Version.php' + ); + + $path = dirname(dirname(__FILE__)); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php.in b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php.in @@ -0,0 +1,74 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2010 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +if (defined('PHPUNIT_COMPOSER_INSTALL')) { + return; +} + +require_once 'File/Iterator/Autoload.php'; +require_once 'PHP/Token/Stream/Autoload.php'; +require_once 'Text/Template/Autoload.php'; + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + + $path = dirname(dirname(__FILE__)); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver.php @@ -0,0 +1,70 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Interface for code coverage drivers. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +interface PHP_CodeCoverage_Driver +{ + /** + * Start collection of code coverage information. + */ + public function start(); + + /** + * Stop collection of code coverage information. + * + * @return array + */ + public function stop(); +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver/Xdebug.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Driver/Xdebug.php @@ -0,0 +1,97 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Driver for Xdebug's code coverage functionality. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + * @codeCoverageIgnore + */ +class PHP_CodeCoverage_Driver_Xdebug implements PHP_CodeCoverage_Driver +{ + /** + * Constructor. + */ + public function __construct() + { + if (!extension_loaded('xdebug')) { + throw new PHP_CodeCoverage_Exception('Xdebug is not loaded.'); + } + + if (version_compare(phpversion('xdebug'), '2.2.0-dev', '>=') && + !ini_get('xdebug.coverage_enable')) { + throw new PHP_CodeCoverage_Exception( + 'You need to set xdebug.coverage_enable=On in your php.ini.' + ); + } + } + + /** + * Start collection of code coverage information. + */ + public function start() + { + xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); + } + + /** + * Stop collection of code coverage information. + * + * @return array + */ + public function stop() + { + $codeCoverage = xdebug_get_code_coverage(); + xdebug_stop_code_coverage(); + + return $codeCoverage; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Exception.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Exception.php @@ -0,0 +1,59 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Exception class for PHP_CodeCoverage component. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Exception extends RuntimeException +{ +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Filter.php @@ -0,0 +1,349 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Filter for blacklisting and whitelisting of code coverage information. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_Filter +{ + /** + * Source files that are blacklisted. + * + * @var array + */ + protected $blacklistedFiles = array(); + + /** + * Source files that are whitelisted. + * + * @var array + */ + protected $whitelistedFiles = array(); + + /** + * @var boolean + */ + protected $blacklistPrefilled = FALSE; + + /** + * Adds a directory to the blacklist (recursively). + * + * @param string $directory + * @param string $suffix + * @param string $prefix + */ + public function addDirectoryToBlacklist($directory, $suffix = '.php', $prefix = '') + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + $directory, $suffix, $prefix + ); + + foreach ($files as $file) { + $this->addFileToBlacklist($file); + } + } + + /** + * Adds a file to the blacklist. + * + * @param string $filename + */ + public function addFileToBlacklist($filename) + { + $this->blacklistedFiles[realpath($filename)] = TRUE; + } + + /** + * Adds files to the blacklist. + * + * @param array $files + */ + public function addFilesToBlacklist(array $files) + { + foreach ($files as $file) { + $this->addFileToBlacklist($file); + } + } + + /** + * Removes a directory from the blacklist (recursively). + * + * @param string $directory + * @param string $suffix + * @param string $prefix + */ + public function removeDirectoryFromBlacklist($directory, $suffix = '.php', $prefix = '') + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + $directory, $suffix, $prefix + ); + + foreach ($files as $file) { + $this->removeFileFromBlacklist($file); + } + } + + /** + * Removes a file from the blacklist. + * + * @param string $filename + */ + public function removeFileFromBlacklist($filename) + { + $filename = realpath($filename); + + if (isset($this->blacklistedFiles[$filename])) { + unset($this->blacklistedFiles[$filename]); + } + } + + /** + * Adds a directory to the whitelist (recursively). + * + * @param string $directory + * @param string $suffix + * @param string $prefix + */ + public function addDirectoryToWhitelist($directory, $suffix = '.php', $prefix = '') + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + $directory, $suffix, $prefix + ); + + foreach ($files as $file) { + $this->addFileToWhitelist($file); + } + } + + /** + * Adds a file to the whitelist. + * + * @param string $filename + */ + public function addFileToWhitelist($filename) + { + $this->whitelistedFiles[realpath($filename)] = TRUE; + } + + /** + * Adds files to the whitelist. + * + * @param array $files + */ + public function addFilesToWhitelist(array $files) + { + foreach ($files as $file) { + $this->addFileToWhitelist($file); + } + } + + /** + * Removes a directory from the whitelist (recursively). + * + * @param string $directory + * @param string $suffix + * @param string $prefix + */ + public function removeDirectoryFromWhitelist($directory, $suffix = '.php', $prefix = '') + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + $directory, $suffix, $prefix + ); + + foreach ($files as $file) { + $this->removeFileFromWhitelist($file); + } + } + + /** + * Removes a file from the whitelist. + * + * @param string $filename + */ + public function removeFileFromWhitelist($filename) + { + $filename = realpath($filename); + + if (isset($this->whitelistedFiles[$filename])) { + unset($this->whitelistedFiles[$filename]); + } + } + + /** + * Checks whether a filename is a real filename. + * + * @param string $filename + */ + public function isFile($filename) + { + if ($filename == '-' || + strpos($filename, 'vfs://') === 0 || + strpos($filename, 'xdebug://debug-eval') !== FALSE || + strpos($filename, 'eval()\'d code') !== FALSE || + strpos($filename, 'runtime-created function') !== FALSE || + strpos($filename, 'runkit created function') !== FALSE || + strpos($filename, 'assert code') !== FALSE || + strpos($filename, 'regexp code') !== FALSE) { + return FALSE; + } + + return TRUE; + } + + /** + * Checks whether or not a file is filtered. + * + * When the whitelist is empty (default), blacklisting is used. + * When the whitelist is not empty, whitelisting is used. + * + * @param string $filename + * @param boolean $ignoreWhitelist + * @return boolean + * @throws PHP_CodeCoverage_Exception + */ + public function isFiltered($filename) + { + $filename = realpath($filename); + + if (!empty($this->whitelistedFiles)) { + return !isset($this->whitelistedFiles[$filename]); + } + + if (!$this->blacklistPrefilled) { + $this->prefillBlacklist(); + } + + return isset($this->blacklistedFiles[$filename]); + } + + /** + * Returns the list of blacklisted files. + * + * @return array + */ + public function getBlacklist() + { + return array_keys($this->blacklistedFiles); + } + + /** + * Returns the list of whitelisted files. + * + * @return array + */ + public function getWhitelist() + { + return array_keys($this->whitelistedFiles); + } + + /** + * Returns whether this filter has a whitelist. + * + * @return boolean + * @since Method available since Release 1.1.0 + */ + public function hasWhitelist() + { + return !empty($this->whitelistedFiles); + } + + /** + * @since Method available since Release 1.2.3 + */ + protected function prefillBlacklist() + { + if (defined('__PHPUNIT_PHAR__')) { + $this->addFileToBlacklist(__PHPUNIT_PHAR__); + } + + $this->addDirectoryContainingClassToBlacklist('File_Iterator'); + $this->addDirectoryContainingClassToBlacklist('PHP_CodeCoverage'); + $this->addDirectoryContainingClassToBlacklist('PHP_Invoker'); + $this->addDirectoryContainingClassToBlacklist('PHP_Timer'); + $this->addDirectoryContainingClassToBlacklist('PHP_Token'); + $this->addDirectoryContainingClassToBlacklist('PHPUnit_Framework_TestCase', 2); + $this->addDirectoryContainingClassToBlacklist('PHPUnit_Extensions_Database_TestCase', 2); + $this->addDirectoryContainingClassToBlacklist('PHPUnit_Framework_MockObject_Generator', 2); + $this->addDirectoryContainingClassToBlacklist('PHPUnit_Extensions_SeleniumTestCase', 2); + $this->addDirectoryContainingClassToBlacklist('PHPUnit_Extensions_Story_TestCase', 2); + $this->addDirectoryContainingClassToBlacklist('Text_Template'); + $this->addDirectoryContainingClassToBlacklist('Symfony\Component\Yaml\Yaml'); + + $this->blacklistPrefilled = TRUE; + } + + /** + * @param string $className + * @param integer $parent + * @since Method available since Release 1.2.3 + */ + protected function addDirectoryContainingClassToBlacklist($className, $parent = 1) + { + if (!class_exists($className)) { + return; + } + + $reflector = new ReflectionClass($className); + $directory = $reflector->getFileName(); + + for ($i = 0; $i < $parent; $i++) { + $directory = dirname($directory); + } + + $this->addDirectoryToBlacklist($directory); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Clover.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Clover.php @@ -0,0 +1,346 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Generates a Clover XML logfile from an PHP_CodeCoverage object. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_Report_Clover +{ + /** + * @param PHP_CodeCoverage $coverage + * @param string $target + * @param string $name + * @return string + */ + public function process(PHP_CodeCoverage $coverage, $target = NULL, $name = NULL) + { + $xmlDocument = new DOMDocument('1.0', 'UTF-8'); + $xmlDocument->formatOutput = TRUE; + + $xmlCoverage = $xmlDocument->createElement('coverage'); + $xmlCoverage->setAttribute('generated', (int)$_SERVER['REQUEST_TIME']); + $xmlDocument->appendChild($xmlCoverage); + + $xmlProject = $xmlDocument->createElement('project'); + $xmlProject->setAttribute('timestamp', (int)$_SERVER['REQUEST_TIME']); + + if (is_string($name)) { + $xmlProject->setAttribute('name', $name); + } + + $xmlCoverage->appendChild($xmlProject); + + $packages = array(); + $report = $coverage->getReport(); + unset($coverage); + + foreach ($report as $item) { + $namespace = 'global'; + + if (!$item instanceof PHP_CodeCoverage_Report_Node_File) { + continue; + } + + $xmlFile = $xmlDocument->createElement('file'); + $xmlFile->setAttribute('name', $item->getPath()); + + $classes = $item->getClassesAndTraits(); + $coverage = $item->getCoverageData(); + $lines = array(); + $ignoredLines = $item->getIgnoredLines(); + + foreach ($classes as $className => $class) { + $classStatements = 0; + $coveredClassStatements = 0; + $coveredMethods = 0; + + foreach ($class['methods'] as $methodName => $method) { + $methodCount = 0; + $methodLines = 0; + $methodLinesCovered = 0; + + for ($i = $method['startLine']; + $i <= $method['endLine']; + $i++) { + if (isset($ignoredLines[$i])) { + continue; + } + + $add = TRUE; + $count = 0; + + if (isset($coverage[$i])) { + if ($coverage[$i] !== NULL) { + $classStatements++; + $methodLines++; + } else { + $add = FALSE; + } + + $count = count($coverage[$i]); + + if ($count > 0) { + $coveredClassStatements++; + $methodLinesCovered++; + } + } else { + $add = FALSE; + } + + $methodCount = max($methodCount, $count); + + if ($add) { + $lines[$i] = array( + 'count' => $count, 'type' => 'stmt' + ); + } + } + + if ($methodCount > 0) { + $coveredMethods++; + } + + $lines[$method['startLine']] = array( + 'count' => $methodCount, + 'crap' => $method['crap'], + 'type' => 'method', + 'name' => $methodName + ); + } + + if (!empty($class['package']['namespace'])) { + $namespace = $class['package']['namespace']; + } + + $xmlClass = $xmlDocument->createElement('class'); + $xmlClass->setAttribute('name', $className); + $xmlClass->setAttribute('namespace', $namespace); + + if (!empty($class['package']['fullPackage'])) { + $xmlClass->setAttribute( + 'fullPackage', $class['package']['fullPackage'] + ); + } + + if (!empty($class['package']['category'])) { + $xmlClass->setAttribute( + 'category', $class['package']['category'] + ); + } + + if (!empty($class['package']['package'])) { + $xmlClass->setAttribute( + 'package', $class['package']['package'] + ); + } + + if (!empty($class['package']['subpackage'])) { + $xmlClass->setAttribute( + 'subpackage', $class['package']['subpackage'] + ); + } + + $xmlFile->appendChild($xmlClass); + + $xmlMetrics = $xmlDocument->createElement('metrics'); + $xmlMetrics->setAttribute('methods', count($class['methods'])); + $xmlMetrics->setAttribute('coveredmethods', $coveredMethods); + $xmlMetrics->setAttribute('conditionals', 0); + $xmlMetrics->setAttribute('coveredconditionals', 0); + $xmlMetrics->setAttribute('statements', $classStatements); + $xmlMetrics->setAttribute( + 'coveredstatements', $coveredClassStatements + ); + $xmlMetrics->setAttribute( + 'elements', + count($class['methods']) + + $classStatements + /* + conditionals */); + $xmlMetrics->setAttribute( + 'coveredelements', + $coveredMethods + + $coveredClassStatements + /* + coveredconditionals */ + ); + $xmlClass->appendChild($xmlMetrics); + } + + foreach ($coverage as $line => $data) { + if ($data === NULL || + isset($lines[$line]) || + isset($ignoredLines[$line])) { + continue; + } + + $lines[$line] = array( + 'count' => count($data), 'type' => 'stmt' + ); + } + + ksort($lines); + + foreach ($lines as $line => $data) { + if (isset($ignoredLines[$line])) { + continue; + } + + $xmlLine = $xmlDocument->createElement('line'); + $xmlLine->setAttribute('num', $line); + $xmlLine->setAttribute('type', $data['type']); + + if (isset($data['name'])) { + $xmlLine->setAttribute('name', $data['name']); + } + + if (isset($data['crap'])) { + $xmlLine->setAttribute('crap', $data['crap']); + } + + $xmlLine->setAttribute('count', $data['count']); + $xmlFile->appendChild($xmlLine); + } + + $linesOfCode = $item->getLinesOfCode(); + + $xmlMetrics = $xmlDocument->createElement('metrics'); + $xmlMetrics->setAttribute('loc', $linesOfCode['loc']); + $xmlMetrics->setAttribute('ncloc', $linesOfCode['ncloc']); + $xmlMetrics->setAttribute('classes', $item->getNumClassesAndTraits()); + $xmlMetrics->setAttribute('methods', $item->getNumMethods()); + $xmlMetrics->setAttribute( + 'coveredmethods', $item->getNumTestedMethods() + ); + $xmlMetrics->setAttribute('conditionals', 0); + $xmlMetrics->setAttribute('coveredconditionals', 0); + $xmlMetrics->setAttribute( + 'statements', $item->getNumExecutableLines() + ); + $xmlMetrics->setAttribute( + 'coveredstatements', $item->getNumExecutedLines() + ); + $xmlMetrics->setAttribute( + 'elements', + $item->getNumMethods() + + $item->getNumExecutableLines() + /* + conditionals */ + ); + $xmlMetrics->setAttribute( + 'coveredelements', + $item->getNumTestedMethods() + + $item->getNumExecutedLines() + /* + coveredconditionals */ + ); + $xmlFile->appendChild($xmlMetrics); + + if ($namespace == 'global') { + $xmlProject->appendChild($xmlFile); + } else { + if (!isset($packages[$namespace])) { + $packages[$namespace] = $xmlDocument->createElement( + 'package' + ); + + $packages[$namespace]->setAttribute('name', $namespace); + $xmlProject->appendChild($packages[$namespace]); + } + + $packages[$namespace]->appendChild($xmlFile); + } + } + + $linesOfCode = $report->getLinesOfCode(); + + $xmlMetrics = $xmlDocument->createElement('metrics'); + $xmlMetrics->setAttribute('files', count($report)); + $xmlMetrics->setAttribute('loc', $linesOfCode['loc']); + $xmlMetrics->setAttribute('ncloc', $linesOfCode['ncloc']); + $xmlMetrics->setAttribute( + 'classes', $report->getNumClassesAndTraits() + ); + $xmlMetrics->setAttribute('methods', $report->getNumMethods()); + $xmlMetrics->setAttribute( + 'coveredmethods', $report->getNumTestedMethods() + ); + $xmlMetrics->setAttribute('conditionals', 0); + $xmlMetrics->setAttribute('coveredconditionals', 0); + $xmlMetrics->setAttribute( + 'statements', $report->getNumExecutableLines() + ); + $xmlMetrics->setAttribute( + 'coveredstatements', $report->getNumExecutedLines() + ); + $xmlMetrics->setAttribute( + 'elements', + $report->getNumMethods() + + $report->getNumExecutableLines() + /* + conditionals */ + ); + $xmlMetrics->setAttribute( + 'coveredelements', + $report->getNumTestedMethods() + + $report->getNumExecutedLines() + /* + coveredconditionals */ + ); + $xmlProject->appendChild($xmlMetrics); + + if ($target !== NULL) { + if (!is_dir(dirname($target))) { + mkdir(dirname($target), 0777, TRUE); + } + + return $xmlDocument->save($target); + } else { + return $xmlDocument->saveXML(); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php @@ -0,0 +1,280 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Factory for PHP_CodeCoverage_Report_Node_* object graphs. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_Factory +{ + /** + * @param PHP_CodeCoverage $coverage + */ + public function create(PHP_CodeCoverage $coverage) + { + $files = $coverage->getData(); + $commonPath = $this->reducePaths($files); + $root = new PHP_CodeCoverage_Report_Node_Directory( + $commonPath, NULL + ); + + $this->addItems( + $root, + $this->buildDirectoryStructure($files), + $coverage->getTests(), + $coverage->getCacheTokens() + ); + + return $root; + } + + /** + * @param PHP_CodeCoverage_Report_Node_Directory $root + * @param array $items + * @param array $tests + * @param boolean $cacheTokens + */ + protected function addItems(PHP_CodeCoverage_Report_Node_Directory $root, array $items, array $tests, $cacheTokens) + { + foreach ($items as $key => $value) { + if (substr($key, -2) == '/f') { + $key = substr($key, 0, -2); + + if (file_exists($root->getPath() . DIRECTORY_SEPARATOR . $key)) { + $root->addFile($key, $value, $tests, $cacheTokens); + } + } else { + $child = $root->addDirectory($key); + $this->addItems($child, $value, $tests, $cacheTokens); + } + } + } + + /** + * Builds an array representation of the directory structure. + * + * For instance, + * + * <code> + * Array + * ( + * [Money.php] => Array + * ( + * ... + * ) + * + * [MoneyBag.php] => Array + * ( + * ... + * ) + * ) + * </code> + * + * is transformed into + * + * <code> + * Array + * ( + * [.] => Array + * ( + * [Money.php] => Array + * ( + * ... + * ) + * + * [MoneyBag.php] => Array + * ( + * ... + * ) + * ) + * ) + * </code> + * + * @param array $files + * @return array + */ + protected function buildDirectoryStructure($files) + { + $result = array(); + + foreach ($files as $path => $file) { + $path = explode('/', $path); + $pointer = &$result; + $max = count($path); + + for ($i = 0; $i < $max; $i++) { + if ($i == ($max - 1)) { + $type = '/f'; + } else { + $type = ''; + } + + $pointer = &$pointer[$path[$i] . $type]; + } + + $pointer = $file; + } + + return $result; + } + + /** + * Reduces the paths by cutting the longest common start path. + * + * For instance, + * + * <code> + * Array + * ( + * [/home/sb/Money/Money.php] => Array + * ( + * ... + * ) + * + * [/home/sb/Money/MoneyBag.php] => Array + * ( + * ... + * ) + * ) + * </code> + * + * is reduced to + * + * <code> + * Array + * ( + * [Money.php] => Array + * ( + * ... + * ) + * + * [MoneyBag.php] => Array + * ( + * ... + * ) + * ) + * </code> + * + * @param array $files + * @return string + */ + protected function reducePaths(&$files) + { + if (empty($files)) { + return '.'; + } + + $commonPath = ''; + $paths = array_keys($files); + + if (count($files) == 1) { + $commonPath = dirname($paths[0]) . '/'; + $files[basename($paths[0])] = $files[$paths[0]]; + + unset($files[$paths[0]]); + + return $commonPath; + } + + $max = count($paths); + + for ($i = 0; $i < $max; $i++) { + // strip phar:// prefixes + if (strpos($paths[$i], 'phar://') === 0) { + $paths[$i] = substr($paths[$i], 7); + } + $paths[$i] = explode(DIRECTORY_SEPARATOR, $paths[$i]); + + if (empty($paths[$i][0])) { + $paths[$i][0] = DIRECTORY_SEPARATOR; + } + } + + $done = FALSE; + $max = count($paths); + + while (!$done) { + for ($i = 0; $i < $max - 1; $i++) { + if (!isset($paths[$i][0]) || + !isset($paths[$i+1][0]) || + $paths[$i][0] != $paths[$i+1][0]) { + $done = TRUE; + break; + } + } + + if (!$done) { + $commonPath .= $paths[0][0]; + + if ($paths[0][0] != DIRECTORY_SEPARATOR) { + $commonPath .= DIRECTORY_SEPARATOR; + } + + for ($i = 0; $i < $max; $i++) { + array_shift($paths[$i]); + } + } + } + + $original = array_keys($files); + $max = count($original); + + for ($i = 0; $i < $max; $i++) { + $files[join('/', $paths[$i])] = $files[$original[$i]]; + unset($files[$original[$i]]); + } + + ksort($files); + + return substr($commonPath, 0, -1); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php @@ -0,0 +1,224 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Generates an HTML report from an PHP_CodeCoverage object. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_Report_HTML +{ + /** + * @var string + */ + protected $templatePath; + + /** + * @var string + */ + protected $charset; + + /** + * @var string + */ + protected $generator; + + /** + * @var integer + */ + protected $lowUpperBound; + + /** + * @var integer + */ + protected $highLowerBound; + + /** + * @var boolean + */ + protected $highlight; + + /** + * Constructor. + * + * @param array $options + */ + public function __construct($charset = 'UTF-8', $highlight = FALSE, $lowUpperBound = 35, $highLowerBound = 70, $generator = '') + { + $this->charset = $charset; + $this->generator = $generator; + $this->highLowerBound = $highLowerBound; + $this->highlight = $highlight; + $this->lowUpperBound = $lowUpperBound; + + $this->templatePath = sprintf( + '%s%sHTML%sRenderer%sTemplate%s', + + dirname(__FILE__), + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR + ); + } + + /** + * @param PHP_CodeCoverage $coverage + * @param string $target + */ + public function process(PHP_CodeCoverage $coverage, $target) + { + $target = $this->getDirectory($target); + $report = $coverage->getReport(); + unset($coverage); + + if (!isset($_SERVER['REQUEST_TIME'])) { + $_SERVER['REQUEST_TIME'] = time(); + } + + $date = date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']); + + $dashboard = new PHP_CodeCoverage_Report_HTML_Renderer_Dashboard( + $this->templatePath, + $this->charset, + $this->generator, + $date, + $this->lowUpperBound, + $this->highLowerBound + ); + + $directory = new PHP_CodeCoverage_Report_HTML_Renderer_Directory( + $this->templatePath, + $this->charset, + $this->generator, + $date, + $this->lowUpperBound, + $this->highLowerBound + ); + + $file = new PHP_CodeCoverage_Report_HTML_Renderer_File( + $this->templatePath, + $this->charset, + $this->generator, + $date, + $this->lowUpperBound, + $this->highLowerBound, + $this->highlight + ); + + $dashboard->render($report, $target . 'index.dashboard.html'); + $directory->render($report, $target . 'index.html'); + + foreach ($report as $node) { + $id = $node->getId(); + + if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) { + $dashboard->render($node, $target . $id . '.dashboard.html'); + $directory->render($node, $target . $id . '.html'); + } else { + $file->render($node, $target . $id . '.html'); + } + } + + $this->copyFiles($target); + } + + /** + * @param string $target + */ + protected function copyFiles($target) + { + $dir = $this->getDirectory($target . 'css'); + copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css'); + copy($this->templatePath . 'css/bootstrap-responsive.min.css', $dir . 'bootstrap-responsive.min.css'); + copy($this->templatePath . 'css/nv.d3.css', $dir . 'nv.d3.css'); + copy($this->templatePath . 'css/style.css', $dir . 'style.css'); + + $dir = $this->getDirectory($target . 'js'); + copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); + copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js'); + copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js'); + copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); + copy($this->templatePath . 'js/html5shiv.js', $dir . 'html5shiv.js'); + + $dir = $this->getDirectory($target . 'img'); + copy($this->templatePath . 'img/glyphicons-halflings.png', $dir . 'glyphicons-halflings.png'); + copy($this->templatePath . 'img/glyphicons-halflings-white.png', $dir . 'glyphicons-halflings-white.png'); + } + + /** + * @param string $directory + * @return string + * @throws PHP_CodeCoverage_Exception + * @since Method available since Release 1.2.0 + */ + protected function getDirectory($directory) + { + if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) { + $directory .= DIRECTORY_SEPARATOR; + } + + if (is_dir($directory)) { + return $directory; + } + + if (@mkdir($directory, 0777, TRUE)) { + return $directory; + } + + throw new PHP_CodeCoverage_Exception( + sprintf( + 'Directory "%s" does not exist.', + $directory + ) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer.php @@ -0,0 +1,285 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Base class for PHP_CodeCoverage_Report_Node renderers. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +abstract class PHP_CodeCoverage_Report_HTML_Renderer +{ + /** + * @var string + */ + protected $templatePath; + + /** + * @var string + */ + protected $charset; + + /** + * @var string + */ + protected $generator; + + /** + * @var string + */ + protected $date; + + /** + * @var integer + */ + protected $lowUpperBound; + + /** + * @var integer + */ + protected $highLowerBound; + + /** + * Constructor. + * + * @param string $templatePath + * @param string $charset + * @param string $generator + * @param string $date + * @param integer $lowUpperBound + * @param integer $highLowerBound + */ + public function __construct($templatePath, $charset, $generator, $date, $lowUpperBound, $highLowerBound) + { + $this->templatePath = $templatePath; + $this->charset = $charset; + $this->generator = $generator; + $this->date = $date; + $this->lowUpperBound = $lowUpperBound; + $this->highLowerBound = $highLowerBound; + } + + /** + * @param Text_Template $template + * @param array $data + * @return string + */ + protected function renderItemTemplate(Text_Template $template, array $data) + { + $numSeperator = '&nbsp;/&nbsp;'; + $classesBar = '&nbsp;'; + $classesLevel = 'None'; + $classesNumber = '&nbsp;'; + + if (isset($data['numClasses']) && $data['numClasses'] > 0) { + $classesLevel = $this->getColorLevel($data['testedClassesPercent']); + + $classesNumber = $data['numTestedClasses'] . $numSeperator . + $data['numClasses']; + + $classesBar = $this->getCoverageBar( + $data['testedClassesPercent'] + ); + } + + $methodsBar = '&nbsp;'; + $methodsLevel = 'None'; + $methodsNumber = '&nbsp;'; + + if ($data['numMethods'] > 0) { + $methodsLevel = $this->getColorLevel($data['testedMethodsPercent']); + + $methodsNumber = $data['numTestedMethods'] . $numSeperator . + $data['numMethods']; + + $methodsBar = $this->getCoverageBar( + $data['testedMethodsPercent'] + ); + } + + $linesBar = '&nbsp;'; + $linesLevel = 'None'; + $linesNumber = '&nbsp;'; + + if ($data['numExecutableLines'] > 0) { + $linesLevel = $this->getColorLevel($data['linesExecutedPercent']); + + $linesNumber = $data['numExecutedLines'] . $numSeperator . + $data['numExecutableLines']; + + $linesBar = $this->getCoverageBar( + $data['linesExecutedPercent'] + ); + } + + $template->setVar( + array( + 'icon' => isset($data['icon']) ? $data['icon'] : '', + 'crap' => isset($data['crap']) ? $data['crap'] : '', + 'name' => $data['name'], + 'lines_bar' => $linesBar, + 'lines_executed_percent' => $data['linesExecutedPercentAsString'], + 'lines_level' => $linesLevel, + 'lines_number' => $linesNumber, + 'methods_bar' => $methodsBar, + 'methods_tested_percent' => $data['testedMethodsPercentAsString'], + 'methods_level' => $methodsLevel, + 'methods_number' => $methodsNumber, + 'classes_bar' => $classesBar, + 'classes_tested_percent' => isset($data['testedClassesPercentAsString']) ? $data['testedClassesPercentAsString'] : '', + 'classes_level' => $classesLevel, + 'classes_number' => $classesNumber + ) + ); + + return $template->render(); + } + + /** + * @param Text_Template $template + * @param PHP_CodeCoverage_Report_Node $node + */ + protected function setCommonTemplateVariables(Text_Template $template, PHP_CodeCoverage_Report_Node $node) + { + $template->setVar( + array( + 'id' => $node->getId(), + 'full_path' => $node->getPath(), + 'breadcrumbs' => $this->getBreadcrumbs($node), + 'charset' => $this->charset, + 'date' => $this->date, + 'version' => PHP_CodeCoverage_Version::id(), + 'php_version' => PHP_VERSION, + 'generator' => $this->generator, + 'low_upper_bound' => $this->lowUpperBound, + 'high_lower_bound' => $this->highLowerBound + ) + ); + } + + protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) + { + $breadcrumbs = ''; + + $path = $node->getPathAsArray(); + + foreach ($path as $step) { + if ($step !== $node) { + $breadcrumbs .= $this->getInactiveBreadcrumb($step); + } else { + $breadcrumbs .= $this->getActiveBreadcrumb( + $step, + $node instanceof PHP_CodeCoverage_Report_Node_Directory + ); + } + } + + return $breadcrumbs; + } + + protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node, $isDirectory) + { + $buffer = sprintf( + ' <li class="active">%s</li>' . "\n", + $node->getName() + ); + + if ($isDirectory) { + $buffer .= sprintf( + ' <li>(<a href="%s.dashboard.html">Dashboard</a>)</li>' . "\n", + $node->getId() + ); + } + + return $buffer; + } + + protected function getInactiveBreadcrumb(PHP_CodeCoverage_Report_Node $node) + { + return sprintf( + ' <li><a href="%s.html">%s</a> <span class="divider">/</span></li>' . "\n", + $node->getId(), + $node->getName() + ); + } + + protected function getCoverageBar($percent) + { + $level = $this->getColorLevel($percent); + + $template = new Text_Template( + $this->templatePath . 'coverage_bar.html', '{{', '}}' + ); + + $template->setVar(array('level' => $level, 'percent' => sprintf("%.2F", $percent))); + + return $template->render(); + } + + /** + * @param integer $percent + * @return string + */ + protected function getColorLevel($percent) + { + if ($percent < $this->lowUpperBound) { + return 'danger'; + } + + else if ($percent >= $this->lowUpperBound && + $percent < $this->highLowerBound) { + return 'warning'; + } + + else { + return 'success'; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Dashboard.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Dashboard.php @@ -0,0 +1,240 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Renders the dashboard for a PHP_CodeCoverage_Report_Node_Directory node. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_HTML_Renderer_Dashboard extends PHP_CodeCoverage_Report_HTML_Renderer +{ + /** + * @param PHP_CodeCoverage_Report_Node_Directory $node + * @param string $file + */ + public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file) + { + $classes = $node->getClassesAndTraits(); + $template = new Text_Template( + $this->templatePath . 'dashboard.html', '{{', '}}' + ); + + $this->setCommonTemplateVariables($template, $node); + + $template->setVar( + array( + 'least_tested_methods' => $this->leastTestedMethods($classes), + 'top_project_risks' => $this->topProjectRisks($classes), + 'cc_values' => $this->classComplexity($classes), + 'ccd_values' => $this->classCoverageDistribution($classes), + 'backlink' => basename(str_replace('.dashboard', '', $file)) + ) + ); + + $template->renderTo($file); + } + + /** + * Returns the data for the Class Complexity chart. + * + * @param array $classes + * @return string + */ + protected function classComplexity(array $classes) + { + $data = array(); + + foreach ($classes as $name => $class) { + $data[] = array( + $class['coverage'], + $class['ccn'], + sprintf( + '<a href="%s">%s</a>', + $class['link'], + $name + ) + ); + } + + return json_encode($data); + } + + /** + * Returns the data for the Class Coverage Distribution chart. + * + * @param array $classes + * @return string + */ + protected function classCoverageDistribution(array $classes) + { + $data = array( + '0%' => 0, + '0-10%' => 0, + '10-20%' => 0, + '20-30%' => 0, + '30-40%' => 0, + '40-50%' => 0, + '50-60%' => 0, + '60-70%' => 0, + '70-80%' => 0, + '80-90%' => 0, + '90-100%' => 0, + '100%' => 0 + ); + + foreach ($classes as $class) { + if ($class['coverage'] == 0) { + $data['0%']++; + } + + else if ($class['coverage'] == 100) { + $data['100%']++; + } + + else { + $key = floor($class['coverage']/10)*10; + $key = $key . '-' . ($key + 10) . '%'; + $data[$key]++; + } + } + + return json_encode(array_values($data)); + } + + /** + * Returns the least tested methods. + * + * @param array $classes + * @param integer $max + * @return string + */ + protected function leastTestedMethods(array $classes, $max = 10) + { + $methods = array(); + + foreach ($classes as $className => $class) { + foreach ($class['methods'] as $methodName => $method) { + if ($method['coverage'] < 100) { + if ($className != '*') { + $key = $className . '::' . $methodName; + } else { + $key = $methodName; + } + + $methods[$key] = $method['coverage']; + } + } + } + + asort($methods); + + $methods = array_slice($methods, 0, min($max, count($methods))); + $buffer = ''; + + foreach ($methods as $name => $coverage) { + list($class, $method) = explode('::', $name); + + $buffer .= sprintf( + ' <li><a href="%s">%s</a> (%d%%)</li>' . "\n", + $classes[$class]['methods'][$method]['link'], + $name, + $coverage + ); + } + + return $buffer; + } + + /** + * Returns the top project risks according to the CRAP index. + * + * @param array $classes + * @param integer $max + * @return string + */ + protected function topProjectRisks(array $classes, $max = 10) + { + $risks = array(); + + foreach ($classes as $className => $class) { + if ($class['coverage'] < 100 && + $class['ccn'] > count($class['methods'])) { + $risks[$className] = $class['crap']; + } + } + + arsort($risks); + + $buffer = ''; + $risks = array_slice($risks, 0, min($max, count($risks))); + + foreach ($risks as $name => $crap) { + $buffer .= sprintf( + ' <li><a href="%s">%s</a> (%d)</li>' . "\n", + $classes[$name]['link'], + $name, + $crap + ); + } + + return $buffer; + } + + protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node, $isDirectory) + { + return sprintf( + ' <li><a href="%s.html">%s</a></li>' . "\n" . + ' <li class="active">(Dashboard)</li>' . "\n", + $node->getId(), + $node->getName() + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php @@ -0,0 +1,132 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Renders a PHP_CodeCoverage_Report_Node_Directory node. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_HTML_Renderer_Directory extends PHP_CodeCoverage_Report_HTML_Renderer +{ + /** + * @param PHP_CodeCoverage_Report_Node_Directory $node + * @param string $file + */ + public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file) + { + $template = new Text_Template($this->templatePath . 'directory.html', '{{', '}}'); + + $this->setCommonTemplateVariables($template, $node); + + $items = $this->renderItem($node, TRUE); + + foreach ($node->getDirectories() as $item) { + $items .= $this->renderItem($item); + } + + foreach ($node->getFiles() as $item) { + $items .= $this->renderItem($item); + } + + $template->setVar( + array( + 'id' => $node->getId(), + 'items' => $items + ) + ); + + $template->renderTo($file); + } + + /** + * @param PHP_CodeCoverage_Report_Node $item + * @param boolean $total + * @return string + */ + protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = FALSE) + { + $data = array( + 'numClasses' => $item->getNumClassesAndTraits(), + 'numTestedClasses' => $item->getNumTestedClassesAndTraits(), + 'numMethods' => $item->getNumMethods(), + 'numTestedMethods' => $item->getNumTestedMethods(), + 'linesExecutedPercent' => $item->getLineExecutedPercent(FALSE), + 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), + 'numExecutedLines' => $item->getNumExecutedLines(), + 'numExecutableLines' => $item->getNumExecutableLines(), + 'testedMethodsPercent' => $item->getTestedMethodsPercent(FALSE), + 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), + 'testedClassesPercent' => $item->getTestedClassesAndTraitsPercent(FALSE), + 'testedClassesPercentAsString' => $item->getTestedClassesAndTraitsPercent() + ); + + if ($total) { + $data['name'] = 'Total'; + } else { + $data['name'] = sprintf( + '<a href="%s.html">%s</a>', + $item->getId(), + $item->getName() + ); + + if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) { + $data['icon'] = '<i class="icon-folder-open"></i> '; + } else { + $data['icon'] = '<i class="icon-file"></i> '; + } + } + + return $this->renderItemTemplate( + new Text_Template($this->templatePath . 'directory_item.html', '{{', '}}'), + $data + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/File.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/File.php @@ -0,0 +1,583 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +// @codeCoverageIgnoreStart +if (!defined('T_TRAIT')) { + define('T_TRAIT', 1001); +} + +if (!defined('T_INSTEADOF')) { + define('T_INSTEADOF', 1002); +} + +if (!defined('T_CALLABLE')) { + define('T_CALLABLE', 1003); +} +// @codeCoverageIgnoreEnd + +/** + * Renders a PHP_CodeCoverage_Report_Node_File node. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_HTML_Renderer_File extends PHP_CodeCoverage_Report_HTML_Renderer +{ + /** + * @var boolean + */ + protected $highlight; + + /** + * Constructor. + * + * @param string $templatePath + * @param string $charset + * @param string $generator + * @param string $date + * @param integer $lowUpperBound + * @param integer $highLowerBound + * @param boolean $highlight + */ + public function __construct($templatePath, $charset, $generator, $date, $lowUpperBound, $highLowerBound, $highlight) + { + parent::__construct( + $templatePath, + $charset, + $generator, + $date, + $lowUpperBound, + $highLowerBound + ); + + $this->highlight = $highlight; + } + + /** + * @param PHP_CodeCoverage_Report_Node_File $node + * @param string $file + */ + public function render(PHP_CodeCoverage_Report_Node_File $node, $file) + { + $template = new Text_Template($this->templatePath . 'file.html', '{{', '}}'); + + $template->setVar( + array( + 'items' => $this->renderItems($node), + 'lines' => $this->renderSource($node) + ) + ); + + $this->setCommonTemplateVariables($template, $node); + + $template->renderTo($file); + } + + /** + * @param PHP_CodeCoverage_Report_Node_File $node + * @return string + */ + protected function renderItems(PHP_CodeCoverage_Report_Node_File $node) + { + $template = new Text_Template($this->templatePath . 'file_item.html', '{{', '}}'); + + $methodItemTemplate = new Text_Template( + $this->templatePath . 'method_item.html', '{{', '}}' + ); + + $items = $this->renderItemTemplate( + $template, + array( + 'name' => 'Total', + 'numClasses' => $node->getNumClassesAndTraits(), + 'numTestedClasses' => $node->getNumTestedClassesAndTraits(), + 'numMethods' => $node->getNumMethods(), + 'numTestedMethods' => $node->getNumTestedMethods(), + 'linesExecutedPercent' => $node->getLineExecutedPercent(FALSE), + 'linesExecutedPercentAsString' => $node->getLineExecutedPercent(), + 'numExecutedLines' => $node->getNumExecutedLines(), + 'numExecutableLines' => $node->getNumExecutableLines(), + 'testedMethodsPercent' => $node->getTestedMethodsPercent(FALSE), + 'testedMethodsPercentAsString' => $node->getTestedMethodsPercent(), + 'testedClassesPercent' => $node->getTestedClassesAndTraitsPercent(FALSE), + 'testedClassesPercentAsString' => $node->getTestedClassesAndTraitsPercent(), + 'crap' => '<abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr>' + ) + ); + + $items .= $this->renderFunctionItems( + $node->getFunctions(), $methodItemTemplate + ); + + $items .= $this->renderTraitOrClassItems( + $node->getTraits(), $template, $methodItemTemplate + ); + + $items .= $this->renderTraitOrClassItems( + $node->getClasses(), $template, $methodItemTemplate + ); + + return $items; + } + + /** + * @param array $items + * @param Text_Template $template + * @return string + */ + protected function renderTraitOrClassItems(array $items, Text_Template $template, Text_Template $methodItemTemplate) + { + if (empty($items)) { + return ''; + } + + $buffer = ''; + + foreach ($items as $name => $item) { + $numMethods = count($item['methods']); + $numTestedMethods = 0; + + foreach ($item['methods'] as $method) { + if ($method['executedLines'] == $method['executableLines']) { + $numTestedMethods++; + } + } + + $buffer .= $this->renderItemTemplate( + $template, + array( + 'name' => $name, + 'numClasses' => 1, + 'numTestedClasses' => $numTestedMethods == $numMethods ? 1 : 0, + 'numMethods' => $numMethods, + 'numTestedMethods' => $numTestedMethods, + 'linesExecutedPercent' => PHP_CodeCoverage_Util::percent( + $item['executedLines'], + $item['executableLines'], + FALSE + ), + 'linesExecutedPercentAsString' => PHP_CodeCoverage_Util::percent( + $item['executedLines'], + $item['executableLines'], + TRUE + ), + 'numExecutedLines' => $item['executedLines'], + 'numExecutableLines' => $item['executableLines'], + 'testedMethodsPercent' => PHP_CodeCoverage_Util::percent( + $numTestedMethods, + $numMethods, + FALSE + ), + 'testedMethodsPercentAsString' => PHP_CodeCoverage_Util::percent( + $numTestedMethods, + $numMethods, + TRUE + ), + 'testedClassesPercent' => PHP_CodeCoverage_Util::percent( + $numTestedMethods == $numMethods ? 1 : 0, + 1, + FALSE + ), + 'testedClassesPercentAsString' => PHP_CodeCoverage_Util::percent( + $numTestedMethods == $numMethods ? 1 : 0, + 1, + TRUE + ), + 'crap' => $item['crap'] + ) + ); + + foreach ($item['methods'] as $method) { + $buffer .= $this->renderFunctionOrMethodItem( + $methodItemTemplate, $method, '&nbsp;' + ); + } + } + + return $buffer; + } + + /** + * @param array $functions + * @param Text_Template $template + * @return string + */ + protected function renderFunctionItems(array $functions, Text_Template $template) + { + if (empty($functions)) { + return ''; + } + + $buffer = ''; + + foreach ($functions as $function) { + $buffer .= $this->renderFunctionOrMethodItem( + $template, $function + ); + } + + return $buffer; + } + + /** + * @param Text_Template $template + * @return string + */ + protected function renderFunctionOrMethodItem(Text_Template $template, array $item, $indent = '') + { + $numTestedItems = $item['executedLines'] == $item['executableLines'] ? 1 : 0; + + return $this->renderItemTemplate( + $template, + array( + 'name' => sprintf( + '%s<a href="#%d">%s</a>', + $indent, + $item['startLine'], + htmlspecialchars($item['signature']) + ), + 'numMethods' => 1, + 'numTestedMethods' => $numTestedItems, + 'linesExecutedPercent' => PHP_CodeCoverage_Util::percent( + $item['executedLines'], + $item['executableLines'], + FALSE + ), + 'linesExecutedPercentAsString' => PHP_CodeCoverage_Util::percent( + $item['executedLines'], + $item['executableLines'], + TRUE + ), + 'numExecutedLines' => $item['executedLines'], + 'numExecutableLines' => $item['executableLines'], + 'testedMethodsPercent' => PHP_CodeCoverage_Util::percent( + $numTestedItems, + 1, + FALSE + ), + 'testedMethodsPercentAsString' => PHP_CodeCoverage_Util::percent( + $numTestedItems, + 1, + TRUE + ), + 'crap' => $item['crap'] + ) + ); + } + + /** + * @param PHP_CodeCoverage_Report_Node_File $node + * @return string + */ + protected function renderSource(PHP_CodeCoverage_Report_Node_File $node) + { + $coverageData = $node->getCoverageData(); + $ignoredLines = $node->getIgnoredLines(); + $testData = $node->getTestData(); + $codeLines = $this->loadFile($node->getPath()); + $lines = ''; + $i = 1; + + foreach ($codeLines as $line) { + $numTests = ''; + $trClass = ''; + $popoverContent = ''; + $popoverTitle = ''; + + if (!isset($ignoredLines[$i]) && array_key_exists($i, $coverageData)) { + $numTests = count($coverageData[$i]); + + if ($coverageData[$i] === NULL) { + $trClass = ' class="warning"'; + } + + else if ($numTests == 0) { + $trClass = ' class="danger"'; + } + + else { + $trClass = ' class="success popin"'; + $popoverContent = '<ul>'; + + if ($numTests > 1) { + $popoverTitle = $numTests . ' tests cover line ' . $i; + } else { + $popoverTitle = '1 test covers line ' . $i; + } + + foreach ($coverageData[$i] as $test) { + switch ($testData[$test]) { + case 0: { + $testCSS = ' class="success"'; + } + break; + + case 1: + case 2: { + $testCSS = ' class="warning"'; + } + break; + + case 3: { + $testCSS = ' class="danger"'; + } + break; + + case 4: { + $testCSS = ' class="danger"'; + } + break; + + default: { + $testCSS = ''; + } + } + + $popoverContent .= sprintf( + '<li%s>%s</li>', + + $testCSS, + htmlspecialchars($test) + ); + } + + $popoverContent .= '</ul>'; + } + } + + if (!empty($popoverTitle)) { + $popover = sprintf( + ' data-title="%s" data-content="%s" data-placement="bottom" data-html="true"', + $popoverTitle, + htmlspecialchars($popoverContent) + ); + } else { + $popover = ''; + } + + $lines .= sprintf( + ' <tr%s%s><td><div align="right"><a name="%d"></a><a href="#%d">%d</a></div></td><td class="codeLine">%s</td></tr>' . "\n", + $trClass, + $popover, + $i, + $i, + $i, + !$this->highlight ? htmlspecialchars($line) : $line + ); + + $i++; + } + + return $lines; + } + + /** + * @param string $file + * @return array + */ + protected function loadFile($file) + { + $buffer = file_get_contents($file); + $lines = explode("\n", str_replace("\t", ' ', $buffer)); + $result = array(); + + if (count($lines) == 0) { + return $result; + } + + $lines = array_map('rtrim', $lines); + + if (!$this->highlight) { + unset($lines[count($lines)-1]); + return $lines; + } + + $tokens = token_get_all($buffer); + $stringFlag = FALSE; + $i = 0; + $result[$i] = ''; + + foreach ($tokens as $j => $token) { + if (is_string($token)) { + if ($token === '"' && $tokens[$j - 1] !== '\\') { + $result[$i] .= sprintf( + '<span class="string">%s</span>', + + htmlspecialchars($token) + ); + + $stringFlag = !$stringFlag; + } else { + $result[$i] .= sprintf( + '<span class="keyword">%s</span>', + + htmlspecialchars($token) + ); + } + + continue; + } + + list ($token, $value) = $token; + + $value = str_replace( + array("\t", ' '), + array('&nbsp;&nbsp;&nbsp;&nbsp;', '&nbsp;'), + htmlspecialchars($value) + ); + + if ($value === "\n") { + $result[++$i] = ''; + } else { + $lines = explode("\n", $value); + + foreach ($lines as $jj => $line) { + $line = trim($line); + + if ($line !== '') { + if ($stringFlag) { + $colour = 'string'; + } else { + switch ($token) { + case T_INLINE_HTML: { + $colour = 'html'; + } + break; + + case T_COMMENT: + case T_DOC_COMMENT: { + $colour = 'comment'; + } + break; + + case T_ABSTRACT: + case T_ARRAY: + case T_AS: + case T_BREAK: + case T_CALLABLE: + case T_CASE: + case T_CATCH: + case T_CLASS: + case T_CLONE: + case T_CONTINUE: + case T_DEFAULT: + case T_ECHO: + case T_ELSE: + case T_ELSEIF: + case T_EMPTY: + case T_ENDDECLARE: + case T_ENDFOR: + case T_ENDFOREACH: + case T_ENDIF: + case T_ENDSWITCH: + case T_ENDWHILE: + case T_EXIT: + case T_EXTENDS: + case T_FINAL: + case T_FOREACH: + case T_FUNCTION: + case T_GLOBAL: + case T_IF: + case T_IMPLEMENTS: + case T_INCLUDE: + case T_INCLUDE_ONCE: + case T_INSTANCEOF: + case T_INSTEADOF: + case T_INTERFACE: + case T_ISSET: + case T_LOGICAL_AND: + case T_LOGICAL_OR: + case T_LOGICAL_XOR: + case T_NAMESPACE: + case T_NEW: + case T_PRIVATE: + case T_PROTECTED: + case T_PUBLIC: + case T_REQUIRE: + case T_REQUIRE_ONCE: + case T_RETURN: + case T_STATIC: + case T_THROW: + case T_TRAIT: + case T_TRY: + case T_UNSET: + case T_USE: + case T_VAR: + case T_WHILE: { + $colour = 'keyword'; + } + break; + + default: { + $colour = 'default'; + } + } + } + + $result[$i] .= sprintf( + '<span class="%s">%s</span>', + + $colour, + $line + ); + } + + if (isset($lines[$jj + 1])) { + $result[++$i] = ''; + } + } + } + } + + unset($result[count($result)-1]); + + return $result; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.dist @@ -0,0 +1,3 @@ + <div class="progress progress-{{level}}" style="width: 100px;"> + <div class="bar" style="width: {{percent}}%;"></div> + </div> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap-responsive.min.css b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/nv.d3.css @@ -0,0 +1,769 @@ + +/******************** + * HTML CSS + */ + + +.chartWrap { + margin: 0; + padding: 0; + overflow: hidden; +} + +/******************** + Box shadow and border radius styling +*/ +.nvtooltip.with-3d-shadow, .with-3d-shadow .nvtooltip { + -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); + -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); + box-shadow: 0 5px 10px rgba(0,0,0,.2); + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +/******************** + * TOOLTIP CSS + */ + +.nvtooltip { + position: absolute; + background-color: rgba(255,255,255,1.0); + padding: 1px; + border: 1px solid rgba(0,0,0,.2); + z-index: 10000; + + font-family: Arial; + font-size: 13px; + text-align: left; + pointer-events: none; + + white-space: nowrap; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +/*Give tooltips that old fade in transition by + putting a "with-transitions" class on the container div. +*/ +.nvtooltip.with-transitions, .with-transitions .nvtooltip { + transition: opacity 250ms linear; + -moz-transition: opacity 250ms linear; + -webkit-transition: opacity 250ms linear; + + transition-delay: 250ms; + -moz-transition-delay: 250ms; + -webkit-transition-delay: 250ms; +} + +.nvtooltip.x-nvtooltip, +.nvtooltip.y-nvtooltip { + padding: 8px; +} + +.nvtooltip h3 { + margin: 0; + padding: 4px 14px; + line-height: 18px; + font-weight: normal; + background-color: rgba(247,247,247,0.75); + text-align: center; + + border-bottom: 1px solid #ebebeb; + + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} + +.nvtooltip p { + margin: 0; + padding: 5px 14px; + text-align: center; +} + +.nvtooltip span { + display: inline-block; + margin: 2px 0; +} + +.nvtooltip table { + margin: 6px; + border-spacing:0; +} + + +.nvtooltip table td { + padding: 2px 9px 2px 0; + vertical-align: middle; +} + +.nvtooltip table td.key { + font-weight:normal; +} +.nvtooltip table td.value { + text-align: right; + font-weight: bold; +} + +.nvtooltip table tr.highlight td { + padding: 1px 9px 1px 0; + border-bottom-style: solid; + border-bottom-width: 1px; + border-top-style: solid; + border-top-width: 1px; +} + +.nvtooltip table td.legend-color-guide div { + width: 8px; + height: 8px; + vertical-align: middle; +} + +.nvtooltip .footer { + padding: 3px; + text-align: center; +} + + +.nvtooltip-pending-removal { + position: absolute; + pointer-events: none; +} + + +/******************** + * SVG CSS + */ + + +svg { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Trying to get SVG to act like a greedy block in all browsers */ + display: block; + width:100%; + height:100%; +} + + +svg text { + font: normal 12px Arial; +} + +svg .title { + font: bold 14px Arial; +} + +.nvd3 .nv-background { + fill: white; + fill-opacity: 0; + /* + pointer-events: none; + */ +} + +.nvd3.nv-noData { + font-size: 18px; + font-weight: bold; +} + + +/********** +* Brush +*/ + +.nv-brush .extent { + fill-opacity: .125; + shape-rendering: crispEdges; +} + + + +/********** +* Legend +*/ + +.nvd3 .nv-legend .nv-series { + cursor: pointer; +} + +.nvd3 .nv-legend .disabled circle { + fill-opacity: 0; +} + + + +/********** +* Axes +*/ +.nvd3 .nv-axis { + pointer-events:none; +} + +.nvd3 .nv-axis path { + fill: none; + stroke: #000; + stroke-opacity: .75; + shape-rendering: crispEdges; +} + +.nvd3 .nv-axis path.domain { + stroke-opacity: .75; +} + +.nvd3 .nv-axis.nv-x path.domain { + stroke-opacity: 0; +} + +.nvd3 .nv-axis line { + fill: none; + stroke: #e5e5e5; + shape-rendering: crispEdges; +} + +.nvd3 .nv-axis .zero line, +/*this selector may not be necessary*/ .nvd3 .nv-axis line.zero { + stroke-opacity: .75; +} + +.nvd3 .nv-axis .nv-axisMaxMin text { + font-weight: bold; +} + +.nvd3 .x .nv-axis .nv-axisMaxMin text, +.nvd3 .x2 .nv-axis .nv-axisMaxMin text, +.nvd3 .x3 .nv-axis .nv-axisMaxMin text { + text-anchor: middle +} + + + +/********** +* Brush +*/ + +.nv-brush .resize path { + fill: #eee; + stroke: #666; +} + + + +/********** +* Bars +*/ + +.nvd3 .nv-bars .negative rect { + zfill: brown; +} + +.nvd3 .nv-bars rect { + zfill: steelblue; + fill-opacity: .75; + + transition: fill-opacity 250ms linear; + -moz-transition: fill-opacity 250ms linear; + -webkit-transition: fill-opacity 250ms linear; +} + +.nvd3 .nv-bars rect.hover { + fill-opacity: 1; +} + +.nvd3 .nv-bars .hover rect { + fill: lightblue; +} + +.nvd3 .nv-bars text { + fill: rgba(0,0,0,0); +} + +.nvd3 .nv-bars .hover text { + fill: rgba(0,0,0,1); +} + + +/********** +* Bars +*/ + +.nvd3 .nv-multibar .nv-groups rect, +.nvd3 .nv-multibarHorizontal .nv-groups rect, +.nvd3 .nv-discretebar .nv-groups rect { + stroke-opacity: 0; + + transition: fill-opacity 250ms linear; + -moz-transition: fill-opacity 250ms linear; + -webkit-transition: fill-opacity 250ms linear; +} + +.nvd3 .nv-multibar .nv-groups rect:hover, +.nvd3 .nv-multibarHorizontal .nv-groups rect:hover, +.nvd3 .nv-discretebar .nv-groups rect:hover { + fill-opacity: 1; +} + +.nvd3 .nv-discretebar .nv-groups text, +.nvd3 .nv-multibarHorizontal .nv-groups text { + font-weight: bold; + fill: rgba(0,0,0,1); + stroke: rgba(0,0,0,0); +} + +/*********** +* Pie Chart +*/ + +.nvd3.nv-pie path { + stroke-opacity: 0; + transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; + -moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; + -webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; + +} + +.nvd3.nv-pie .nv-slice text { + stroke: #000; + stroke-width: 0; +} + +.nvd3.nv-pie path { + stroke: #fff; + stroke-width: 1px; + stroke-opacity: 1; +} + +.nvd3.nv-pie .hover path { + fill-opacity: .7; +} +.nvd3.nv-pie .nv-label { + pointer-events: none; +} +.nvd3.nv-pie .nv-label rect { + fill-opacity: 0; + stroke-opacity: 0; +} + +/********** +* Lines +*/ + +.nvd3 .nv-groups path.nv-line { + fill: none; + stroke-width: 1.5px; + /* + stroke-linecap: round; + shape-rendering: geometricPrecision; + + transition: stroke-width 250ms linear; + -moz-transition: stroke-width 250ms linear; + -webkit-transition: stroke-width 250ms linear; + + transition-delay: 250ms + -moz-transition-delay: 250ms; + -webkit-transition-delay: 250ms; + */ +} + +.nvd3 .nv-groups path.nv-line.nv-thin-line { + stroke-width: 1px; +} + + +.nvd3 .nv-groups path.nv-area { + stroke: none; + /* + stroke-linecap: round; + shape-rendering: geometricPrecision; + + stroke-width: 2.5px; + transition: stroke-width 250ms linear; + -moz-transition: stroke-width 250ms linear; + -webkit-transition: stroke-width 250ms linear; + + transition-delay: 250ms + -moz-transition-delay: 250ms; + -webkit-transition-delay: 250ms; + */ +} + +.nvd3 .nv-line.hover path { + stroke-width: 6px; +} + +/* +.nvd3.scatter .groups .point { + fill-opacity: 0.1; + stroke-opacity: 0.1; +} + */ + +.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point { + fill-opacity: 0; + stroke-opacity: 0; +} + +.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point { + fill-opacity: .5 !important; + stroke-opacity: .5 !important; +} + + +.with-transitions .nvd3 .nv-groups .nv-point { + transition: stroke-width 250ms linear, stroke-opacity 250ms linear; + -moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; + -webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; + +} + +.nvd3.nv-scatter .nv-groups .nv-point.hover, +.nvd3 .nv-groups .nv-point.hover { + stroke-width: 7px; + fill-opacity: .95 !important; + stroke-opacity: .95 !important; +} + + +.nvd3 .nv-point-paths path { + stroke: #aaa; + stroke-opacity: 0; + fill: #eee; + fill-opacity: 0; +} + + + +.nvd3 .nv-indexLine { + cursor: ew-resize; +} + + +/********** +* Distribution +*/ + +.nvd3 .nv-distribution { + pointer-events: none; +} + + + +/********** +* Scatter +*/ + +/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere +.nvd3 .nv-groups .nv-point { + pointer-events: none; +} +*/ + +.nvd3 .nv-groups .nv-point.hover { + stroke-width: 20px; + stroke-opacity: .5; +} + +.nvd3 .nv-scatter .nv-point.hover { + fill-opacity: 1; +} + +/* +.nv-group.hover .nv-point { + fill-opacity: 1; +} +*/ + + +/********** +* Stacked Area +*/ + +.nvd3.nv-stackedarea path.nv-area { + fill-opacity: .7; + /* + stroke-opacity: .65; + fill-opacity: 1; + */ + stroke-opacity: 0; + + transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; + -moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; + -webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; + + /* + transition-delay: 500ms; + -moz-transition-delay: 500ms; + -webkit-transition-delay: 500ms; + */ + +} + +.nvd3.nv-stackedarea path.nv-area.hover { + fill-opacity: .9; + /* + stroke-opacity: .85; + */ +} +/* +.d3stackedarea .groups path { + stroke-opacity: 0; +} + */ + + + +.nvd3.nv-stackedarea .nv-groups .nv-point { + stroke-opacity: 0; + fill-opacity: 0; +} + +/* +.nvd3.nv-stackedarea .nv-groups .nv-point.hover { + stroke-width: 20px; + stroke-opacity: .75; + fill-opacity: 1; +}*/ + + + +/********** +* Line Plus Bar +*/ + +.nvd3.nv-linePlusBar .nv-bar rect { + fill-opacity: .75; +} + +.nvd3.nv-linePlusBar .nv-bar rect:hover { + fill-opacity: 1; +} + + +/********** +* Bullet +*/ + +.nvd3.nv-bullet { font: 10px sans-serif; } +.nvd3.nv-bullet .nv-measure { fill-opacity: .8; } +.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; } +.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; } +.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; } +.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; } +.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; } +.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; } +.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; } +.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; } +.nvd3.nv-bullet .nv-subtitle { fill: #999; } + + +.nvd3.nv-bullet .nv-range { + fill: #bababa; + fill-opacity: .4; +} +.nvd3.nv-bullet .nv-range:hover { + fill-opacity: .7; +} + + + +/********** +* Sparkline +*/ + +.nvd3.nv-sparkline path { + fill: none; +} + +.nvd3.nv-sparklineplus g.nv-hoverValue { + pointer-events: none; +} + +.nvd3.nv-sparklineplus .nv-hoverValue line { + stroke: #333; + stroke-width: 1.5px; + } + +.nvd3.nv-sparklineplus, +.nvd3.nv-sparklineplus g { + pointer-events: all; +} + +.nvd3 .nv-hoverArea { + fill-opacity: 0; + stroke-opacity: 0; +} + +.nvd3.nv-sparklineplus .nv-xValue, +.nvd3.nv-sparklineplus .nv-yValue { + /* + stroke: #666; + */ + stroke-width: 0; + font-size: .9em; + font-weight: normal; +} + +.nvd3.nv-sparklineplus .nv-yValue { + stroke: #f66; +} + +.nvd3.nv-sparklineplus .nv-maxValue { + stroke: #2ca02c; + fill: #2ca02c; +} + +.nvd3.nv-sparklineplus .nv-minValue { + stroke: #d62728; + fill: #d62728; +} + +.nvd3.nv-sparklineplus .nv-currentValue { + /* + stroke: #444; + fill: #000; + */ + font-weight: bold; + font-size: 1.1em; +} + +/********** +* historical stock +*/ + +.nvd3.nv-ohlcBar .nv-ticks .nv-tick { + stroke-width: 2px; +} + +.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover { + stroke-width: 4px; +} + +.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive { + stroke: #2ca02c; +} + +.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative { + stroke: #d62728; +} + +.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel { + font-weight: bold; +} + +.nvd3.nv-historicalStockChart .nv-dragTarget { + fill-opacity: 0; + stroke: none; + cursor: move; +} + +.nvd3 .nv-brush .extent { + /* + cursor: ew-resize !important; + */ + fill-opacity: 0 !important; +} + +.nvd3 .nv-brushBackground rect { + stroke: #000; + stroke-width: .4; + fill: #fff; + fill-opacity: .7; +} + + + +/********** +* Indented Tree +*/ + + +/** + * TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library + */ +.nvd3.nv-indentedtree .name { + margin-left: 5px; +} + +.nvd3.nv-indentedtree .clickable { + color: #08C; + cursor: pointer; +} + +.nvd3.nv-indentedtree span.clickable:hover { + color: #005580; + text-decoration: underline; +} + + +.nvd3.nv-indentedtree .nv-childrenCount { + display: inline-block; + margin-left: 5px; +} + +.nvd3.nv-indentedtree .nv-treeicon { + cursor: pointer; + /* + cursor: n-resize; + */ +} + +.nvd3.nv-indentedtree .nv-treeicon.nv-folded { + cursor: pointer; + /* + cursor: s-resize; + */ +} + +/********** +* Parallel Coordinates +*/ + +.nvd3 .background path { + fill: none; + stroke: #ccc; + stroke-opacity: .4; + shape-rendering: crispEdges; +} + +.nvd3 .foreground path { + fill: none; + stroke: steelblue; + stroke-opacity: .7; +} + +.nvd3 .brush .extent { + fill-opacity: .3; + stroke: #fff; + shape-rendering: crispEdges; +} + +.nvd3 .axis line, .axis path { + fill: none; + stroke: #000; + shape-rendering: crispEdges; +} + +.nvd3 .axis text { + text-shadow: 0 1px 0 #fff; +} + +/**** +Interactive Layer +*/ +.nvd3 .nv-interactiveGuideLine { + pointer-events:none; +} +.nvd3 line.nv-guideline { + stroke: #ccc; +} +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/style.css b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/css/style.css @@ -0,0 +1,93 @@ +body { + padding-top: 10px; +} + +.popover { + width: 600px; +} + +.table td { + padding-top: 3px; + padding-bottom: 3px; +} + +.table-condensed td { + padding-top: 0; + padding-bottom: 0; +} + +.table .progress { + margin-bottom: inherit; +} + +.table-borderless th, .table-borderless td { + border: 0 !important; +} + +.table tbody td.success, li.success, span.success { + background-color: #dff0d8; +} + +.table tbody tr.danger, .table tbody td.danger, li.danger, span.danger { + background-color: #f2dede; +} + +.table tbody td.warning, li.warning, span.warning { + background-color: #fcf8e3; +} + +.table tbody td.info { + background-color: #d9edf7; +} + +td.big { + width: 100px; +} + +td.small { +} + +td.codeLine { + font-family: monospace; + white-space: pre; +} + +td span.comment { + color: #888a85; +} + +td span.default { + color: #2e3436; +} + +td span.html { + color: #888a85; +} + +td span.keyword { + color: #2e3436; + font-weight: bold; +} + +pre span.string { + color: #2e3436; +} + +span.success, span.warning, span.danger { + margin-right: 2px; + padding-left: 10px; + padding-right: 10px; + text-align: center; +} + +#classCoverageDistribution, #classComplexity { + height: 200px; + width: 475px; +} + +svg text { + font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #666; + fill: #666; +} +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist @@ -0,0 +1,164 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="{{charset}}"> + <title>Dashboard for {{full_path}}</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="css/bootstrap.min.css" rel="stylesheet"> + <link href="css/bootstrap-responsive.min.css" rel="stylesheet"> + <link href="css/nv.d3.css" rel="stylesheet"> + <link href="css/style.css" rel="stylesheet"> + <!--[if lt IE 9]> + <script src="js/html5shiv.js"></script> + <![endif]--> + </head> + <body> + <header> + <div class="container"> + <div class="row"> + <div class="span12"> + <ul class="breadcrumb"> +{{breadcrumbs}} + </ul> + </div> + </div> + </div> + </header> + <div class="container"> + <div class="row"> + <div class="span6"> + <h2>Class Coverage Distribution</h2> + <div id="classCoverageDistribution"> + <svg></svg> + </div> + </div> + <div class="span6"> + <h2>Class Complexity</h2> + <div id="classComplexity"> + <svg></svg> + </div> + </div> + </div> + <div class="row"> + <div class="span6"> + <h2>Top Project Risks</h2> + <ul> +{{top_project_risks}} + </ul> + </div> + <div class="span6"> + <h2>Least Tested Methods</h2> + <ul> +{{least_tested_methods}} + </ul> + </div> + </div> + <footer> + <p> + <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage {{version}}</a> using <a href="http://www.php.net/" target="_top">PHP {{php_version}}</a>{{generator}} at {{date}}.</small> + </p> + </footer> + </div> + <script src="js/jquery.min.js" type="text/javascript"></script> + <script src="js/bootstrap.min.js" type="text/javascript"></script> + <script src="js/d3.min.js" type="text/javascript"></script> + <script src="js/nv.d3.min.js" type="text/javascript"></script> + <script type="text/javascript"> +$(document).ready(function() { + nv.addGraph(function() { + var chart = nv.models.multiBarChart(); + chart.tooltips(false) + .showControls(false) + .showLegend(false) + .reduceXTicks(false) + .staggerLabels(true) + .yAxis.tickFormat(d3.format('d')); + + d3.select('#classCoverageDistribution svg') + .datum(getCoverageDistributionData({{ccd_values}}, "Class Coverage")) + .transition().duration(500).call(chart); + + nv.utils.windowResize(chart.update); + + return chart; + }); + + function getCoverageDistributionData(data, label) { + var labels = [ + '0%', + '0-10%', + '10-20%', + '20-30%', + '30-40%', + '40-50%', + '50-60%', + '60-70%', + '70-80%', + '80-90%', + '90-100%', + '100%' + ]; + var values = []; + $.each(labels, function(key) { + values.push({x: labels[key], y: data[key]}); + }); + + return [ + { + key: label, + values: values, + color: "#4572A7" + } + ]; + } + + nv.addGraph(function() { + var chart = nv.models.scatterChart() + .showDistX(true) + .showDistY(true) + .showLegend(false) + .forceX([0, 100]); + chart.scatter.onlyCircles(false); + chart.tooltipContent(function(key, y, e, graph) { + return '<p>' + graph.point.class + '</p>'; + }); + + chart.xAxis.axisLabel('Code Coverage (in percent)'); + chart.yAxis.axisLabel('Cyclomatic Complexity'); + + d3.select('#classComplexity svg') + .datum(getComplexityData({{cc_values}}, 'Class Complexity')) + .transition() + .duration(500) + .call(chart); + + nv.utils.windowResize(chart.update); + + return chart; + }); + + function getComplexityData(data, label) { + var values = []; + $.each(data, function(key) { + var value = Math.round(data[key][0]*100) / 100; + values.push({ + x: value, + y: data[key][1], + class: data[key][2], + size: 0.05, + shape: 'diamond' + }); + }); + + return [ + { + key: label, + values: values, + color: "#4572A7" + } + ]; + } +}); + </script> + </body> +</html> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory.html.dist @@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="{{charset}}"> + <title>Code Coverage for {{full_path}}</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="css/bootstrap.min.css" rel="stylesheet"> + <link href="css/bootstrap-responsive.min.css" rel="stylesheet"> + <link href="css/style.css" rel="stylesheet"> + <!--[if lt IE 9]> + <script src="js/html5shiv.js"></script> + <![endif]--> + </head> + <body> + <header> + <div class="container"> + <div class="row"> + <div class="span12"> + <ul class="breadcrumb"> +{{breadcrumbs}} + </ul> + </div> + </div> + </div> + </header> + <div class="container"> + <table class="table table-bordered"> + <thead> + <tr> + <td>&nbsp;</td> + <td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td> + </tr> + <tr> + <td>&nbsp;</td> + <td colspan="3"><div align="center"><strong>Lines</strong></div></td> + <td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td> + <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td> + </tr> + </thead> + <tbody> +{{items}} + </tbody> + </table> + <footer> + <h4>Legend</h4> + <p> + <span class="danger"><strong>Low</strong>: 0% to {{low_upper_bound}}%</span> + <span class="warning"><strong>Medium</strong>: {{low_upper_bound}}% to {{high_lower_bound}}%</span> + <span class="success"><strong>High</strong>: {{high_lower_bound}}% to 100%</span> + </p> + <p> + <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage {{version}}</a> using <a href="http://www.php.net/" target="_top">PHP {{php_version}}</a>{{generator}} at {{date}}.</small> + </p> + </footer> + </div> + <script src="js/jquery.min.js" type="text/javascript"></script> + <script src="js/bootstrap.min.js" type="text/javascript"></script> + </body> +</html> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/directory_item.html.dist @@ -0,0 +1,13 @@ + <tr> + <td class="{{lines_level}}">{{icon}}{{name}}</td> + <td class="{{lines_level}} big">{{lines_bar}}</td> + <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td> + <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td> + <td class="{{methods_level}} big">{{methods_bar}}</td> + <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td> + <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td> + <td class="{{classes_level}} big">{{classes_bar}}</td> + <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td> + <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td> + </tr> + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file.html.dist @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="{{charset}}"> + <title>Code Coverage for {{full_path}}</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="css/bootstrap.min.css" rel="stylesheet"> + <link href="css/bootstrap-responsive.min.css" rel="stylesheet"> + <link href="css/style.css" rel="stylesheet"> + <!--[if lt IE 9]> + <script src="js/html5shiv.js"></script> + <![endif]--> + </head> + <body> + <header> + <div class="container"> + <div class="row"> + <div class="span12"> + <ul class="breadcrumb"> +{{breadcrumbs}} + </ul> + </div> + </div> + </div> + </header> + <div class="container"> + <table class="table table-bordered"> + <thead> + <tr> + <td>&nbsp;</td> + <td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td> + </tr> + <tr> + <td>&nbsp;</td> + <td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td> + <td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td> + <td colspan="3"><div align="center"><strong>Lines</strong></div></td> + </tr> + </thead> + <tbody> +{{items}} + </tbody> + </table> + <table class="table table-borderless table-condensed"> + <tbody> +{{lines}} + </tbody> + </table> + <footer> + <h4>Legend</h4> + <p> + <span class="success"><strong>Executed</strong></span> + <span class="danger"><strong>Not Executed</strong></span> + <span class="warning"><strong>Dead Code</strong></span> + </p> + <p> + <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage {{version}}</a> using <a href="http://www.php.net/" target="_top">PHP {{php_version}}</a>{{generator}} at {{date}}.</small> + </p> + </footer> + </div> + <script src="js/jquery.min.js" type="text/javascript"></script> + <script src="js/bootstrap.min.js" type="text/javascript"></script> + <script type="text/javascript">$('.popin').popover({trigger: 'hover'});</script> + </body> +</html> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/file_item.html.dist @@ -0,0 +1,14 @@ + <tr> + <td class="{{classes_level}}">{{name}}</td> + <td class="{{classes_level}} big">{{classes_bar}}</td> + <td class="{{classes_level}} small"><div align="right">{{classes_tested_percent}}</div></td> + <td class="{{classes_level}} small"><div align="right">{{classes_number}}</div></td> + <td class="{{methods_level}} big">{{methods_bar}}</td> + <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td> + <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td> + <td class="{{methods_level}} small">{{crap}}</td> + <td class="{{lines_level}} big">{{lines_bar}}</td> + <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td> + <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td> + </tr> + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings-white.png b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings-white.png Binary files differ. diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings.png b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings.png Binary files differ. diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(document.body),this.$backdrop.click("static"==this.options.backdrop?$.proxy(this.$element[0].focus,this.$element[0]):$.proxy(this.hide,this)),doAnimate&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),doAnimate?this.$backdrop.one($.support.transition.end,callback):callback()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one($.support.transition.end,$.proxy(this.removeBackdrop,this)):this.removeBackdrop()):callback&&callback()}};var old=$.fn.modal;$.fn.modal=function(option){return this.each(function(){var $this=$(this),data=$this.data("modal"),options=$.extend({},$.fn.modal.defaults,$this.data(),"object"==typeof option&&option);data||$this.data("modal",data=new Modal(this,options)),"string"==typeof option?data[option]():options.show&&data.show()})},$.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},$.fn.modal.Constructor=Modal,$.fn.modal.noConflict=function(){return $.fn.modal=old,this},$(document).on("click.modal.data-api",'[data-toggle="modal"]',function(e){var $this=$(this),href=$this.attr("href"),$target=$($this.attr("data-target")||href&&href.replace(/.*(?=#[^\s]+$)/,"")),option=$target.data("modal")?"toggle":$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data());e.preventDefault(),$target.modal(option).one("hide",function(){$this.focus()})})}(window.jQuery),!function($){"use strict";var Tooltip=function(element,options){this.init("tooltip",element,options)};Tooltip.prototype={constructor:Tooltip,init:function(type,element,options){var eventIn,eventOut;this.type=type,this.$element=$(element),this.options=this.getOptions(options),this.enabled=!0,"click"==this.options.trigger?this.$element.on("click."+this.type,this.options.selector,$.proxy(this.toggle,this)):"manual"!=this.options.trigger&&(eventIn="hover"==this.options.trigger?"mouseenter":"focus",eventOut="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(eventIn+"."+this.type,this.options.selector,$.proxy(this.enter,this)),this.$element.on(eventOut+"."+this.type,this.options.selector,$.proxy(this.leave,this))),this.options.selector?this._options=$.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(options){return options=$.extend({},$.fn[this.type].defaults,options,this.$element.data()),options.delay&&"number"==typeof options.delay&&(options.delay={show:options.delay,hide:options.delay}),options},enter:function(e){var self=$(e.currentTarget)[this.type](this._options).data(this.type);return self.options.delay&&self.options.delay.show?(clearTimeout(this.timeout),self.hoverState="in",this.timeout=setTimeout(function(){"in"==self.hoverState&&self.show()},self.options.delay.show),void 0):self.show()},leave:function(e){var self=$(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),self.options.delay&&self.options.delay.hide?(self.hoverState="out",this.timeout=setTimeout(function(){"out"==self.hoverState&&self.hide()},self.options.delay.hide),void 0):self.hide()},show:function(){var $tip,inside,pos,actualWidth,actualHeight,placement,tp;if(this.hasContent()&&this.enabled){switch($tip=this.tip(),this.setContent(),this.options.animation&&$tip.addClass("fade"),placement="function"==typeof this.options.placement?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement,inside=/in/.test(placement),$tip.detach().css({top:0,left:0,display:"block"}).insertAfter(this.$element),pos=this.getPosition(inside),actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight,inside?placement.split(" ")[1]:placement){case"bottom":tp={top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2};break;case"top":tp={top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2};break;case"left":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth};break;case"right":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}$tip.offset(tp).addClass(placement).addClass("in")}},setContent:function(){var $tip=this.tip(),title=this.getTitle();$tip.find(".tooltip-inner")[this.options.html?"html":"text"](title),$tip.removeClass("fade in top bottom left right")},hide:function(){function removeWithAnimation(){var timeout=setTimeout(function(){$tip.off($.support.transition.end).detach()},500);$tip.one($.support.transition.end,function(){clearTimeout(timeout),$tip.detach()})}var $tip=this.tip();return $tip.removeClass("in"),$.support.transition&&this.$tip.hasClass("fade")?removeWithAnimation():$tip.detach(),this},fixTitle:function(){var $e=this.$element;($e.attr("title")||"string"!=typeof $e.attr("data-original-title"))&&$e.attr("data-original-title",$e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(inside){return $.extend({},inside?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var title,$e=this.$element,o=this.options;return title=$e.attr("data-original-title")||("function"==typeof o.title?o.title.call($e[0]):o.title)},tip:function(){return this.$tip=this.$tip||$(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(e){var self=$(e.currentTarget)[this.type](this._options).data(this.type);self[self.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var old=$.fn.tooltip;$.fn.tooltip=function(option){return this.each(function(){var $this=$(this),data=$this.data("tooltip"),options="object"==typeof option&&option;data||$this.data("tooltip",data=new Tooltip(this,options)),"string"==typeof option&&data[option]()})},$.fn.tooltip.Constructor=Tooltip,$.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,html:!1},$.fn.tooltip.noConflict=function(){return $.fn.tooltip=old,this}}(window.jQuery),!function($){"use strict";var Popover=function(element,options){this.init("popover",element,options)};Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype,{constructor:Popover,setContent:function(){var $tip=this.tip(),title=this.getTitle(),content=this.getContent();$tip.find(".popover-title")[this.options.html?"html":"text"](title),$tip.find(".popover-content")[this.options.html?"html":"text"](content),$tip.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var content,$e=this.$element,o=this.options;return content=$e.attr("data-content")||("function"==typeof o.content?o.content.call($e[0]):o.content)},tip:function(){return this.$tip||(this.$tip=$(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var old=$.fn.popover;$.fn.popover=function(option){return this.each(function(){var $this=$(this),data=$this.data("popover"),options="object"==typeof option&&option;data||$this.data("popover",data=new Popover(this,options)),"string"==typeof option&&data[option]()})},$.fn.popover.Constructor=Popover,$.fn.popover.defaults=$.extend({},$.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'}),$.fn.popover.noConflict=function(){return $.fn.popover=old,this}}(window.jQuery),!function($){"use strict";function ScrollSpy(element,options){var href,process=$.proxy(this.process,this),$element=$(element).is("body")?$(window):$(element);this.options=$.extend({},$.fn.scrollspy.defaults,options),this.$scrollElement=$element.on("scroll.scroll-spy.data-api",process),this.selector=(this.options.target||(href=$(element).attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=$("body"),this.refresh(),this.process()}ScrollSpy.prototype={constructor:ScrollSpy,refresh:function(){var $targets,self=this;this.offsets=$([]),this.targets=$([]),$targets=this.$body.find(this.selector).map(function(){var $el=$(this),href=$el.data("target")||$el.attr("href"),$href=/^#\w/.test(href)&&$(href);return $href&&$href.length&&[[$href.position().top+self.$scrollElement.scrollTop(),href]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){self.offsets.push(this[0]),self.targets.push(this[1])})},process:function(){var i,scrollTop=this.$scrollElement.scrollTop()+this.options.offset,scrollHeight=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,maxScroll=scrollHeight-this.$scrollElement.height(),offsets=this.offsets,targets=this.targets,activeTarget=this.activeTarget;if(scrollTop>=maxScroll)return activeTarget!=(i=targets.last()[0])&&this.activate(i);for(i=offsets.length;i--;)activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(!offsets[i+1]||offsets[i+1]>=scrollTop)&&this.activate(targets[i])},activate:function(target){var active,selector;this.activeTarget=target,$(this.selector).parent(".active").removeClass("active"),selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]',active=$(selector).parent("li").addClass("active"),active.parent(".dropdown-menu").length&&(active=active.closest("li.dropdown").addClass("active")),active.trigger("activate")}};var old=$.fn.scrollspy;$.fn.scrollspy=function(option){return this.each(function(){var $this=$(this),data=$this.data("scrollspy"),options="object"==typeof option&&option;data||$this.data("scrollspy",data=new ScrollSpy(this,options)),"string"==typeof option&&data[option]()})},$.fn.scrollspy.Constructor=ScrollSpy,$.fn.scrollspy.defaults={offset:10},$.fn.scrollspy.noConflict=function(){return $.fn.scrollspy=old,this},$(window).on("load",function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this);$spy.scrollspy($spy.data())})})}(window.jQuery),!function($){"use strict";var Tab=function(element){this.element=$(element)};Tab.prototype={constructor:Tab,show:function(){var previous,$target,e,$this=this.element,$ul=$this.closest("ul:not(.dropdown-menu)"),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$this.parent("li").hasClass("active")||(previous=$ul.find(".active:last a")[0],e=$.Event("show",{relatedTarget:previous}),$this.trigger(e),e.isDefaultPrevented()||($target=$(selector),this.activate($this.parent("li"),$ul),this.activate($target,$target.parent(),function(){$this.trigger({type:"shown",relatedTarget:previous})})))},activate:function(element,container,callback){function next(){$active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),element.addClass("active"),transition?(element[0].offsetWidth,element.addClass("in")):element.removeClass("fade"),element.parent(".dropdown-menu")&&element.closest("li.dropdown").addClass("active"),callback&&callback()}var $active=container.find("> .active"),transition=callback&&$.support.transition&&$active.hasClass("fade");transition?$active.one($.support.transition.end,next):next(),$active.removeClass("in")}};var old=$.fn.tab;$.fn.tab=function(option){return this.each(function(){var $this=$(this),data=$this.data("tab");data||$this.data("tab",data=new Tab(this)),"string"==typeof option&&data[option]()})},$.fn.tab.Constructor=Tab,$.fn.tab.noConflict=function(){return $.fn.tab=old,this},$(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault(),$(this).tab("show")})}(window.jQuery),!function($){"use strict";var Typeahead=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.typeahead.defaults,options),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=$(this.options.menu),this.shown=!1,this.listen()};Typeahead.prototype={constructor:Typeahead,select:function(){var val=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(val)).change(),this.hide()},updater:function(item){return item},show:function(){var pos=$.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:pos.top+pos.height,left:pos.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var items;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(items=$.isFunction(this.source)?this.source(this.query,$.proxy(this.process,this)):this.source,items?this.process(items):this)},process:function(items){var that=this;return items=$.grep(items,function(item){return that.matcher(item)}),items=this.sorter(items),items.length?this.render(items.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(item){return~item.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(items){for(var item,beginswith=[],caseSensitive=[],caseInsensitive=[];item=items.shift();)item.toLowerCase().indexOf(this.query.toLowerCase())?~item.indexOf(this.query)?caseSensitive.push(item):caseInsensitive.push(item):beginswith.push(item);return beginswith.concat(caseSensitive,caseInsensitive)},highlighter:function(item){var query=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return item.replace(RegExp("("+query+")","ig"),function($1,match){return"<strong>"+match+"</strong>"})},render:function(items){var that=this;return items=$(items).map(function(i,item){return i=$(that.options.item).attr("data-value",item),i.find("a").html(that.highlighter(item)),i[0]}),items.first().addClass("active"),this.$menu.html(items),this},next:function(){var active=this.$menu.find(".active").removeClass("active"),next=active.next();next.length||(next=$(this.$menu.find("li")[0])),next.addClass("active")},prev:function(){var active=this.$menu.find(".active").removeClass("active"),prev=active.prev();prev.length||(prev=this.$menu.find("li").last()),prev.addClass("active")},listen:function(){this.$element.on("blur",$.proxy(this.blur,this)).on("keypress",$.proxy(this.keypress,this)).on("keyup",$.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",$.proxy(this.keydown,this)),this.$menu.on("click",$.proxy(this.click,this)).on("mouseenter","li",$.proxy(this.mouseenter,this))},eventSupported:function(eventName){var isSupported=eventName in this.$element;return isSupported||(this.$element.setAttribute(eventName,"return;"),isSupported="function"==typeof this.$element[eventName]),isSupported},move:function(e){if(this.shown){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()}},keydown:function(e){this.suppressKeyPressRepeat=~$.inArray(e.keyCode,[40,38,9,13,27]),this.move(e)},keypress:function(e){this.suppressKeyPressRepeat||this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(){var that=this;setTimeout(function(){that.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(e){this.$menu.find(".active").removeClass("active"),$(e.currentTarget).addClass("active")}};var old=$.fn.typeahead;$.fn.typeahead=function(option){return this.each(function(){var $this=$(this),data=$this.data("typeahead"),options="object"==typeof option&&option;data||$this.data("typeahead",data=new Typeahead(this,options)),"string"==typeof option&&data[option]()})},$.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},$.fn.typeahead.Constructor=Typeahead,$.fn.typeahead.noConflict=function(){return $.fn.typeahead=old,this},$(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var $this=$(this);$this.data("typeahead")||(e.preventDefault(),$this.typeahead($this.data()))})}(window.jQuery),!function($){"use strict";var Affix=function(element,options){this.options=$.extend({},$.fn.affix.defaults,options),this.$window=$(window).on("scroll.affix.data-api",$.proxy(this.checkPosition,this)).on("click.affix.data-api",$.proxy(function(){setTimeout($.proxy(this.checkPosition,this),1)},this)),this.$element=$(element),this.checkPosition()};Affix.prototype.checkPosition=function(){if(this.$element.is(":visible")){var affix,scrollHeight=$(document).height(),scrollTop=this.$window.scrollTop(),position=this.$element.offset(),offset=this.options.offset,offsetBottom=offset.bottom,offsetTop=offset.top,reset="affix affix-top affix-bottom";"object"!=typeof offset&&(offsetBottom=offsetTop=offset),"function"==typeof offsetTop&&(offsetTop=offset.top()),"function"==typeof offsetBottom&&(offsetBottom=offset.bottom()),affix=null!=this.unpin&&scrollTop+this.unpin<=position.top?!1:null!=offsetBottom&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":null!=offsetTop&&offsetTop>=scrollTop?"top":!1,this.affixed!==affix&&(this.affixed=affix,this.unpin="bottom"==affix?position.top-scrollTop:null,this.$element.removeClass(reset).addClass("affix"+(affix?"-"+affix:"")))}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this),data=$this.data("affix"),options="object"==typeof option&&option;data||$this.data("affix",data=new Affix(this,options)),"string"==typeof option&&data[option]()})},$.fn.affix.Constructor=Affix,$.fn.affix.defaults={offset:0},$.fn.affix.noConflict=function(){return $.fn.affix=old,this},$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this),data=$spy.data();data.offset=data.offset||{},data.offsetBottom&&(data.offset.bottom=data.offsetBottom),data.offsetTop&&(data.offset.top=data.offsetTop),$spy.affix(data)})})}(window.jQuery); +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/d3.min.js b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/d3.min.js @@ -0,0 +1,5 @@ +d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(){}function o(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function a(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=Do.length;r>e;++e){var u=Do[e]+t;if(u in n)return u}}function c(){}function l(){}function s(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new u;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function f(){mo.event.preventDefault()}function h(){for(var n,t=mo.event;n=t.sourceEvent;)t=n;return t}function g(n){for(var t=new l,e=0,r=arguments.length;++e<r;)t[arguments[e]]=s(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=mo.event;u.target=n,mo.event=u,t[u.type].apply(e,r)}finally{mo.event=i}}},t}function p(n){return Lo(n,Ro),n}function d(n){return"function"==typeof n?n:function(){return Ho(n,this)}}function v(n){return"function"==typeof n?n:function(){return Fo(n,this)}}function m(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=mo.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function y(n){return n.trim().replace(/\s+/g," ")}function M(n){return new RegExp("(?:^|\\s+)"+mo.requote(n)+"(?:\\s+|$)","g")}function x(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=n.trim().split(/\s+/).map(b);var u=n.length;return"function"==typeof t?r:e}function b(n){var t=M(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",y(u+" "+n))):e.setAttribute("class",y(u.replace(t," ")))}}function _(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function w(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function S(n){return"function"==typeof n?n:(n=mo.ns.qualify(n)).local?function(){return xo.createElementNS(n.space,n.local)}:function(){return xo.createElementNS(this.namespaceURI,n)}}function E(n){return{__data__:n}}function k(n){return function(){return Oo(this,n)}}function A(n){return arguments.length||(n=mo.ascending),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function N(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function T(n){return Lo(n,Io),n}function q(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function z(){var n=this.__transition__;n&&++n.active}function C(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=l(t,Mo(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+mo.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=D;a>0&&(n=n.substring(0,a));var s=Zo.get(n);return s&&(n=s,l=j),a?t?u:r:t?c:i}function D(n,t){return function(e){var r=mo.event;mo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{mo.event=r}}}function j(n,t){var e=D(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function L(){var n=".dragsuppress-"+ ++Xo,t="touchmove"+n,e="selectstart"+n,r="dragstart"+n,u="click"+n,i=mo.select(_o).on(t,f).on(e,f).on(r,f),o=bo.style,a=o[Vo];return o[Vo]="none",function(t){function e(){i.on(u,null)}i.on(n,null),o[Vo]=a,t&&(i.on(u,function(){f(),e()},!0),setTimeout(e,0))}}function H(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>$o&&(_o.scrollX||_o.scrollY)){e=mo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();$o=!(u.f||u.e),e.remove()}return $o?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function F(n){return n>0?1:0>n?-1:0}function P(n){return n>1?0:-1>n?Bo:Math.acos(n)}function O(n){return n>1?Bo/2:-1>n?-Bo/2:Math.asin(n)}function R(n){return(Math.exp(n)-Math.exp(-n))/2}function Y(n){return(Math.exp(n)+Math.exp(-n))/2}function I(n){return R(n)/Y(n)}function U(n){return(n=Math.sin(n/2))*n}function Z(){}function V(n,t,e){return new X(n,t,e)}function X(n,t,e){this.h=n,this.s=t,this.l=e}function $(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,ot(u(n+120),u(n),u(n-120))}function B(n,t,e){return new W(n,t,e)}function W(n,t,e){this.h=n,this.c=t,this.l=e}function J(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),G(e,Math.cos(n*=Go)*t,Math.sin(n)*t)}function G(n,t,e){return new K(n,t,e)}function K(n,t,e){this.l=n,this.a=t,this.b=e}function Q(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=tt(u)*ca,r=tt(r)*la,i=tt(i)*sa,ot(rt(3.2404542*u-1.5371385*r-.4985314*i),rt(-.969266*u+1.8760108*r+.041556*i),rt(.0556434*u-.2040259*r+1.0572252*i))}function nt(n,t,e){return n>0?B(Math.atan2(e,t)*Ko,Math.sqrt(t*t+e*e),n):B(0/0,0/0,n)}function tt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function et(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function rt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n){return ot(n>>16,255&n>>8,255&n)}function it(n){return ut(n)+""}function ot(n,t,e){return new at(n,t,e)}function at(n,t,e){this.r=n,this.g=t,this.b=e}function ct(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function lt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(gt(u[0]),gt(u[1]),gt(u[2]))}return(i=ga.get(n))?t(i.r,i.g,i.b):(null!=n&&"#"===n.charAt(0)&&(4===n.length?(o=n.charAt(1),o+=o,a=n.charAt(2),a+=a,c=n.charAt(3),c+=c):7===n.length&&(o=n.substring(1,3),a=n.substring(3,5),c=n.substring(5,7)),o=parseInt(o,16),a=parseInt(a,16),c=parseInt(c,16)),t(o,a,c))}function st(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),V(r,u,c)}function ft(n,t,e){n=ht(n),t=ht(t),e=ht(e);var r=et((.4124564*n+.3575761*t+.1804375*e)/ca),u=et((.2126729*n+.7151522*t+.072175*e)/la),i=et((.0193339*n+.119192*t+.9503041*e)/sa);return G(116*u-16,500*(r-u),200*(u-i))}function ht(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function pt(n){return"function"==typeof n?n:function(){return n}}function dt(n){return n}function vt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),mt(t,e,n,r)}}function mt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=mo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!_o.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=mo.event;mo.event=n;try{o.progress.call(i,c)}finally{mo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Mo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},mo.rebind(i,o,"on"),null==r?i:i.get(yt(r))}function yt(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Mt(){var n=bt(),t=_t()-n;t>24?(isFinite(t)&&(clearTimeout(ma),ma=setTimeout(Mt,t)),va=0):(va=1,Ma(Mt))}function xt(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now()),ya.callback=n,ya.time=e+t}function bt(){var n=Date.now();for(ya=pa;ya;)n>=ya.time&&(ya.flush=ya.callback(n-ya.time)),ya=ya.next;return n}function _t(){for(var n,t=pa,e=1/0;t;)t.flush?t=n?n.next=t.next:pa=t.next:(t.time<e&&(e=t.time),t=(n=t).next);return da=n,e}function wt(n,t){var e=Math.pow(10,3*Math.abs(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function St(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Et(n){return n+""}function kt(){}function At(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function Nt(n,t){n&&za.hasOwnProperty(n.type)&&za[n.type](n,t)}function Tt(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function qt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)Tt(n[e],t,1);t.polygonEnd()}function zt(){function n(n,t){n*=Go,t=t*Go/2+Bo/4;var e=n-r,o=Math.cos(t),a=Math.sin(t),c=i*a,l=u*o+c*Math.cos(e),s=c*Math.sin(e);Da.add(Math.atan2(s,l)),r=n,u=o,i=a}var t,e,r,u,i;ja.point=function(o,a){ja.point=n,r=(t=o)*Go,u=Math.cos(a=(e=a)*Go/2+Bo/4),i=Math.sin(a)},ja.lineEnd=function(){n(t,e)}}function Ct(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function Dt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function jt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Lt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Ht(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Ft(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function Pt(n){return[Math.atan2(n[1],n[0]),O(n[2])]}function Ot(n,t){return Math.abs(n[0]-t[0])<Wo&&Math.abs(n[1]-t[1])<Wo}function Rt(n,t){n*=Go;var e=Math.cos(t*=Go);Yt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function Yt(n,t,e){++La,Fa+=(n-Fa)/La,Pa+=(t-Pa)/La,Oa+=(e-Oa)/La}function It(){function n(n,u){n*=Go;var i=Math.cos(u*=Go),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);Ha+=l,Ra+=l*(t+(t=o)),Ya+=l*(e+(e=a)),Ia+=l*(r+(r=c)),Yt(t,e,r)}var t,e,r;Xa.point=function(u,i){u*=Go;var o=Math.cos(i*=Go);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),Xa.point=n,Yt(t,e,r)}}function Ut(){Xa.point=Rt}function Zt(){function n(n,t){n*=Go;var e=Math.cos(t*=Go),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-P(g)/h,d=Math.atan2(h,g);Ua+=p*l,Za+=p*s,Va+=p*f,Ha+=d,Ra+=d*(r+(r=o)),Ya+=d*(u+(u=a)),Ia+=d*(i+(i=c)),Yt(r,u,i)}var t,e,r,u,i;Xa.point=function(o,a){t=o,e=a,Xa.point=n,o*=Go;var c=Math.cos(a*=Go);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),Yt(r,u,i)},Xa.lineEnd=function(){n(t,e),Xa.lineEnd=Ut,Xa.point=Rt}}function Vt(){return!0}function Xt(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(Ot(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c={point:e,points:n,other:null,visited:!1,entry:!0,subject:!0},l={point:e,points:[e],other:c,visited:!1,entry:!1,subject:!1};c.other=l,i.push(c),o.push(l),c={point:r,points:[r],other:null,visited:!1,entry:!1,subject:!0},l={point:r,points:[r],other:c,visited:!1,entry:!0,subject:!1},c.other=l,i.push(c),o.push(l)}}),o.sort(t),$t(i),$t(o),i.length){if(e)for(var a=1,c=!e(o[0].point),l=o.length;l>a;++a)o[a].entry=c=!c;for(var s,f,h,g=i[0];;){for(s=g;s.visited;)if((s=s.next)===g)return;f=s.points,u.lineStart();do{if(s.visited=s.other.visited=!0,s.entry){if(s.subject)for(var a=0;a<f.length;a++)u.point((h=f[a])[0],h[1]);else r(s.point,s.next.point,1,u);s=s.next}else{if(s.subject){f=s.prev.points;for(var a=f.length;--a>=0;)u.point((h=f[a])[0],h[1])}else r(s.point,s.prev.point,-1,u);s=s.prev}s=s.other,f=s.points}while(!s.visited);u.lineEnd()}}}function $t(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.next=e=n[r],e.prev=u,u=e;u.next=e=n[0],e.prev=u}}function Bt(n,t,e,r){return function(u){function i(t,e){n(t,e)&&u.point(t,e)}function o(n,t){d.point(n,t)}function a(){v.point=o,d.lineStart()}function c(){v.point=i,d.lineEnd()}function l(n,t){y.point(n,t),p.push([n,t])}function s(){y.lineStart(),p=[]}function f(){l(p[0][0],p[0][1]),y.lineEnd();var n,t=y.clean(),e=m.buffer(),r=e.length;if(p.pop(),g.push(p),p=null,r){if(1&t){n=e[0];var i,r=n.length-1,o=-1;for(u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);return u.lineEnd(),void 0}r>1&&2&t&&e.push(e.pop().concat(e.shift())),h.push(e.filter(Wt))}}var h,g,p,d=t(u),v={point:i,lineStart:a,lineEnd:c,polygonStart:function(){v.point=l,v.lineStart=s,v.lineEnd=f,h=[],g=[],u.polygonStart()},polygonEnd:function(){v.point=i,v.lineStart=a,v.lineEnd=c,h=mo.merge(h),h.length?Xt(h,Gt,null,e,u):r(g)&&(u.lineStart(),e(null,null,1,u),u.lineEnd()),u.polygonEnd(),h=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},m=Jt(),y=t(m);return v}}function Wt(n){return n.length>1}function Jt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:c,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Gt(n,t){return((n=n.point)[0]<0?n[1]-Bo/2-Wo:Bo/2-n[1])-((t=t.point)[0]<0?t[1]-Bo/2-Wo:Bo/2-t[1])}function Kt(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;Da.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+Bo/4,p=Math.sin(g),d=Math.cos(g),v=1;;){v===s&&(v=0),n=l[v];var m=n[0],y=n[1]/2+Bo/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=Math.abs(b)>Bo,w=p*M;if(Da.add(Math.atan2(w*Math.sin(b),d*x+w*Math.cos(b))),i+=_?b+(b>=0?2:-2)*Bo:b,_^h>=e^m>=e){var S=jt(Ct(f),Ct(n));Ft(S);var E=jt(u,S);Ft(E);var k=(_^b>=0?-1:1)*O(E[2]);r>k&&(o+=_^b>=0?1:-1)}if(!v++)break;h=m,p=M,d=x,f=n}}return(-Wo>i||Wo>i&&0>Da)^1&o}function Qt(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?Bo:-Bo,c=Math.abs(i-e);Math.abs(c-Bo)<Wo?(n.point(e,r=(r+o)/2>0?Bo/2:-Bo/2),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=Bo&&(Math.abs(e-u)<Wo&&(e-=u*Wo),Math.abs(i-a)<Wo&&(i-=a*Wo),r=ne(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function ne(n,t,e,r){var u,i,o=Math.sin(n-e);return Math.abs(o)>Wo?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function te(n,t,e,r){var u;if(null==n)u=e*Bo/2,r.point(-Bo,u),r.point(0,u),r.point(Bo,u),r.point(Bo,0),r.point(Bo,-u),r.point(0,-u),r.point(-Bo,-u),r.point(-Bo,0),r.point(-Bo,u);else if(Math.abs(n[0]-t[0])>Wo){var i=(n[0]<t[0]?1:-1)*Bo;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function ee(n){return Kt(Ba,n)}function re(n){function t(n,t){return Math.cos(n)*Math.cos(t)>o}function e(n){var e,i,o,c,s;return{lineStart:function(){c=o=!1,s=1},point:function(f,h){var g,p=[f,h],d=t(f,h),v=a?d?0:u(f,h):d?u(f+(0>f?Bo:-Bo),h):0;if(!e&&(c=o=d)&&n.lineStart(),d!==o&&(g=r(e,p),(Ot(e,g)||Ot(p,g))&&(p[0]+=Wo,p[1]+=Wo,d=t(p[0],p[1]))),d!==o)s=0,d?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(l&&e&&a^d){var m;v&i||!(m=r(p,e,!0))||(s=0,a?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!d||e&&Ot(e,p)||n.point(p[0],p[1]),e=p,o=d,i=v},lineEnd:function(){o&&n.lineEnd(),e=null},clean:function(){return s|(c&&o)<<1}}}function r(n,t,e){var r=Ct(n),u=Ct(t),i=[1,0,0],a=jt(r,u),c=Dt(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=o*c/s,h=-o*l/s,g=jt(i,a),p=Ht(i,f),d=Ht(a,h);Lt(p,d);var v=g,m=Dt(p,v),y=Dt(v,v),M=m*m-y*(Dt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=Ht(v,(-m-x)/y);if(Lt(b,p),b=Pt(b),!e)return b;var _,w=n[0],S=t[0],E=n[1],k=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=Math.abs(A-Bo)<Wo,T=N||Wo>A;if(!N&&E>k&&(_=E,E=k,k=_),T?N?E+k>0^b[1]<(Math.abs(b[0]-w)<Wo?E:k):E<=b[1]&&b[1]<=k:A>Bo^(w<=b[0]&&b[0]<=S)){var q=Ht(v,(-m+x)/y);return Lt(q,p),[b,Pt(q)]}}}function u(t,e){var r=a?n:Bo-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}function i(n){return Kt(c,n)}var o=Math.cos(n),a=o>0,c=[n,0],l=Math.abs(o)>Wo,s=Te(n,6*Go);return Bt(t,e,s,i)}function ue(n,t,e,r){function u(r,u){return Math.abs(r[0]-n)<Wo?u>0?0:3:Math.abs(r[0]-e)<Wo?u>0?2:1:Math.abs(r[1]-t)<Wo?u>0?1:0:u>0?3:2}function i(n,t){return o(n.point,t.point)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}function a(u,i){var o=i[0]-u[0],a=i[1]-u[1],c=[0,1];return Math.abs(o)<Wo&&Math.abs(a)<Wo?n<=u[0]&&u[0]<=e&&t<=u[1]&&u[1]<=r:ie(n-u[0],o,c)&&ie(u[0]-e,-o,c)&&ie(t-u[1],a,c)&&ie(u[1]-r,-a,c)?(c[1]<1&&(i[0]=u[0]+c[1]*o,i[1]=u[1]+c[1]*a),c[0]>0&&(u[0]+=c[0]*o,u[1]+=c[0]*a),!0):!1}return function(c){function l(i){var o=u(i,-1),a=s([0===o||3===o?n:e,o>1?r:t]);return a}function s(n){for(var t=0,e=M.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=M[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&f(l,i,n)>0&&++t:i[1]<=r&&f(l,i,n)<0&&--t,l=i;return 0!==t}function f(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(e[0]-n[0])*(t[1]-n[1])}function h(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function g(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function p(n,t){g(n,t)&&c.point(n,t)}function d(){q.point=m,M&&M.push(x=[]),A=!0,k=!1,S=E=0/0}function v(){y&&(m(b,_),w&&k&&T.rejoin(),y.push(T.buffer())),q.point=p,k&&c.lineEnd()}function m(n,t){n=Math.max(-Wa,Math.min(Wa,n)),t=Math.max(-Wa,Math.min(Wa,t));var e=g(n,t);if(M&&x.push([n,t]),A)b=n,_=t,w=e,A=!1,e&&(c.lineStart(),c.point(n,t));else if(e&&k)c.point(n,t);else{var r=[S,E],u=[n,t];a(r,u)?(k||(c.lineStart(),c.point(r[0],r[1])),c.point(u[0],u[1]),e||c.lineEnd()):e&&(c.lineStart(),c.point(n,t))}S=n,E=t,k=e}var y,M,x,b,_,w,S,E,k,A,N=c,T=Jt(),q={point:p,lineStart:d,lineEnd:v,polygonStart:function(){c=T,y=[],M=[]},polygonEnd:function(){c=N,(y=mo.merge(y)).length?(c.polygonStart(),Xt(y,i,l,h,c),c.polygonEnd()):s([n,t])&&(c.polygonStart(),c.lineStart(),h(null,null,1,c),c.lineEnd(),c.polygonEnd()),y=M=x=null}};return q}}function ie(n,t,e){if(Math.abs(t)<Wo)return 0>=n;var r=n/t;if(t>0){if(r>e[1])return!1;r>e[0]&&(e[0]=r)}else{if(r<e[0])return!1;r<e[1]&&(e[1]=r)}return!0}function oe(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function ae(n){var t=0,e=Bo/3,r=_e(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*Bo/180,e=n[1]*Bo/180):[180*(t/Bo),180*(e/Bo)]},u}function ce(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,O((i-(n*n+e*e)*u*u)/(2*u))]},e}function le(){function n(n,t){Ga+=u*n-r*t,r=n,u=t}var t,e,r,u;ec.point=function(i,o){ec.point=n,t=r=i,e=u=o},ec.lineEnd=function(){n(t,e)}}function se(n,t){Ka>n&&(Ka=n),n>nc&&(nc=n),Qa>t&&(Qa=t),t>tc&&(tc=t)}function fe(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=he(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=he(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function he(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function ge(n,t){Fa+=n,Pa+=t,++Oa}function pe(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);Ra+=o*(t+n)/2,Ya+=o*(e+r)/2,Ia+=o,ge(t=n,e=r)}var t,e;uc.point=function(r,u){uc.point=n,ge(t=r,e=u)}}function de(){uc.point=ge}function ve(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);Ra+=o*(r+n)/2,Ya+=o*(u+t)/2,Ia+=o,o=u*n-r*t,Ua+=o*(r+n),Za+=o*(u+t),Va+=3*o,ge(r=n,u=t)}var t,e,r,u;uc.point=function(i,o){uc.point=n,ge(t=r=i,e=u=o)},uc.lineEnd=function(){n(t,e)}}function me(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,2*Bo)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:c};return a}function ye(n){function t(t){function r(e,r){e=n(e,r),t.point(e[0],e[1])}function u(){M=0/0,S.point=o,t.lineStart()}function o(r,u){var o=Ct([r,u]),a=n(r,u);e(M,x,y,b,_,w,M=a[0],x=a[1],y=r,b=o[0],_=o[1],w=o[2],i,t),t.point(M,x)}function a(){S.point=r,t.lineEnd()}function c(){u(),S.point=l,S.lineEnd=s}function l(n,t){o(f=n,h=t),g=M,p=x,d=b,v=_,m=w,S.point=o}function s(){e(M,x,y,b,_,w,g,p,f,d,v,m,i,t),S.lineEnd=a,a()}var f,h,g,p,d,v,m,y,M,x,b,_,w,S={point:r,lineStart:u,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=u}};return S}function e(t,i,o,a,c,l,s,f,h,g,p,d,v,m){var y=s-t,M=f-i,x=y*y+M*M;if(x>4*r&&v--){var b=a+g,_=c+p,w=l+d,S=Math.sqrt(b*b+_*_+w*w),E=Math.asin(w/=S),k=Math.abs(Math.abs(w)-1)<Wo?(o+h)/2:Math.atan2(_,b),A=n(k,E),N=A[0],T=A[1],q=N-t,z=T-i,C=M*q-y*z;(C*C/x>r||Math.abs((y*q+M*z)/x-.5)>.3||u>a*g+c*p+l*d)&&(e(t,i,o,a,c,l,N,T,k,b/=S,_/=S,w,v,m),m.point(N,T),e(N,T,k,b,_,w,s,f,h,g,p,d,v,m))}}var r=.5,u=Math.cos(30*Go),i=16;return t.precision=function(n){return arguments.length?(i=(r=n*n)>0&&16,t):Math.sqrt(r)},t}function Me(n){this.stream=n}function xe(n){var t=ye(function(t,e){return n([t*Ko,e*Ko])});return function(n){var e=new Me(n=t(n));return e.point=function(t,e){n.point(t*Go,e*Go)},e}}function be(n){return _e(function(){return n})()}function _e(n){function t(n){return n=a(n[0]*Go,n[1]*Go),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Ko,n[1]*Ko]}function r(){a=oe(o=Ee(m,y,M),i);var n=i(d,v);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=ye(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,d=0,v=0,m=0,y=0,M=0,x=$a,b=dt,_=null,w=null;return t.stream=function(n){return s&&(s.valid=!1),s=we(o,x(f(b(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(x=null==n?(_=n,$a):re((_=+n)*Go),u()):_},t.clipExtent=function(n){return arguments.length?(w=n,b=n?ue(n[0][0],n[0][1],n[1][0],n[1][1]):dt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(d=n[0]%360*Go,v=n[1]%360*Go,r()):[d*Ko,v*Ko]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Go,y=n[1]%360*Go,M=n.length>2?n[2]%360*Go:0,r()):[m*Ko,y*Ko,M*Ko]},mo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function we(n,t){var e=new Me(t);return e.point=function(e,r){r=n(e*Go,r*Go),e=r[0],t.point(e>Bo?e-2*Bo:-Bo>e?e+2*Bo:e,r[1])},e}function Se(n,t){return[n,t]}function Ee(n,t,e){return n?t||e?oe(Ae(n),Ne(t,e)):Ae(n):t||e?Ne(t,e):Se}function ke(n){return function(t,e){return t+=n,[t>Bo?t-2*Bo:-Bo>t?t+2*Bo:t,e]}}function Ae(n){var t=ke(n);return t.invert=ke(-n),t}function Ne(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),O(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),O(s*r-a*u)]},e}function Te(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=qe(e,u),i=qe(e,i),(o>0?i>u:u>i)&&(u+=2*o*Bo)):(u=n+2*o*Bo,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=Pt([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function qe(n,t){var e=Ct(t);e[0]-=n,Ft(e);var r=P(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Wo)%(2*Math.PI)}function ze(n,t,e){var r=mo.range(n,t-Wo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function Ce(n,t,e){var r=mo.range(n,t-Wo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function De(n){return n.source}function je(n){return n.target}function Le(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(U(r-t)+u*o*U(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ko,Math.atan2(o,Math.sqrt(r*r+u*u))*Ko]}:function(){return[n*Ko,t*Ko]};return p.distance=h,p}function He(){function n(n,u){var i=Math.sin(u*=Go),o=Math.cos(u),a=Math.abs((n*=Go)-t),c=Math.cos(a);ic+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;oc.point=function(u,i){t=u*Go,e=Math.sin(i*=Go),r=Math.cos(i),oc.point=n},oc.lineEnd=function(){oc.point=oc.lineEnd=c}}function Fe(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function Pe(n,t){function e(n,t){var e=Math.abs(Math.abs(t)-Bo/2)<Wo?0:o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(Bo/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=F(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Bo/2]},e):Re}function Oe(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Math.abs(u)<Wo?Se:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-F(u)*Math.sqrt(n*n+e*e)]},e)}function Re(n,t){return[n,Math.log(Math.tan(Bo/4+t/2))]}function Ye(n){var t,e=be(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=Bo*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ie(n,t){var e=Math.cos(t)*Math.sin(n);return[Math.log((1+e)/(1-e))/2,Math.atan2(Math.tan(t),Math.cos(n))]}function Ue(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=pt(e),p=pt(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Ze,r=Ve,u=Vt,i=Xe,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=hc.get(n)||Xe).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function Ze(n){return n[0]}function Ve(n){return n[1]}function Xe(n){return n.join("L")}function $e(n){return Xe(n)+"Z"}function Be(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function We(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function Je(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function Ge(n,t){return n.length<4?Xe(n):n[1]+nr(n.slice(1,n.length-1),tr(n,t))}function Ke(n,t){return n.length<3?Xe(n):n[0]+nr((n.push(n[0]),n),tr([n[n.length-2]].concat(n,[n[1]]),t))}function Qe(n,t){return n.length<3?Xe(n):n[0]+nr(n,tr(n,t))}function nr(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return Xe(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function tr(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function er(n){if(n.length<3)return Xe(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",or(dc,o),",",or(dc,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),ar(c,o,a);return n.pop(),c.push("L",r),c.join("")}function rr(n){if(n.length<4)return Xe(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(or(dc,i)+","+or(dc,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),ar(e,i,o);return e.join("")}function ur(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[or(dc,o),",",or(dc,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),ar(t,o,a);return t.join("")}function ir(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return er(n)}function or(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function ar(n,t,e){n.push("C",or(gc,t),",",or(gc,e),",",or(pc,t),",",or(pc,e),",",or(dc,t),",",or(dc,e))}function cr(n,t){return(t[1]-n[1])/(t[0]-n[0])}function lr(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=cr(u,i);++t<e;)r[t]=(o+(o=cr(u=i,i=n[t+1])))/2; +return r[t]=o,r}function sr(n){for(var t,e,r,u,i=[],o=lr(n),a=-1,c=n.length-1;++a<c;)t=cr(n[a],n[a+1]),Math.abs(t)<1e-6?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function fr(n){return n.length<3?Xe(n):n[0]+nr(n,sr(n))}function hr(n,t,e,r){var u,i,o,a,c,l,s;return u=r[n],i=u[0],o=u[1],u=r[t],a=u[0],c=u[1],u=r[e],l=u[0],s=u[1],(s-o)*(a-i)-(c-o)*(l-i)>0}function gr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function pr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function dr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function vr(n,t){var e={list:n.map(function(n,t){return{index:t,x:n[0],y:n[1]}}).sort(function(n,t){return n.y<t.y?-1:n.y>t.y?1:n.x<t.x?-1:n.x>t.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(n,t){return{edge:n,side:t,vertex:null,l:null,r:null}},insert:function(n,t){t.l=n,t.r=n.r,n.r.l=t,n.r=t},leftBound:function(n){var t=r.leftEnd;do t=t.r;while(t!=r.rightEnd&&u.rightOf(t,n));return t=t.l},del:function(n){n.l.r=n.r,n.r.l=n.l,n.edge=null},right:function(n){return n.r},left:function(n){return n.l},leftRegion:function(n){return null==n.edge?e.bottomSite:n.edge.region[n.side]},rightRegion:function(n){return null==n.edge?e.bottomSite:n.edge.region[mc[n.side]]}},u={bisect:function(n,t){var e={region:{l:n,r:t},ep:{l:null,r:null}},r=t.x-n.x,u=t.y-n.y,i=r>0?r:-r,o=u>0?u:-u;return e.c=n.x*r+n.y*u+.5*(r*r+u*u),i>o?(e.a=1,e.b=u/r,e.c/=r):(e.b=1,e.a=r/u,e.c/=u),e},intersect:function(n,t){var e=n.edge,r=t.edge;if(!e||!r||e.region.r==r.region.r)return null;var u=e.a*r.b-e.b*r.a;if(Math.abs(u)<1e-10)return null;var i,o,a=(e.c*r.b-r.c*e.b)/u,c=(r.c*e.a-e.c*r.a)/u,l=e.region.r,s=r.region.r;l.y<s.y||l.y==s.y&&l.x<s.x?(i=n,o=e):(i=t,o=r);var f=a>=o.region.r.x;return f&&"l"===i.side||!f&&"r"===i.side?null:{x:a,y:c}},rightOf:function(n,t){var e=n.edge,r=e.region.r,u=t.x>r.x;if(u&&"l"===n.side)return 1;if(!u&&"r"===n.side)return 0;if(1===e.a){var i=t.y-r.y,o=t.x-r.x,a=0,c=0;if(!u&&e.b<0||u&&e.b>=0?c=a=i>=e.b*o:(c=t.x+t.y*e.b>e.c,e.b<0&&(c=!c),c||(a=1)),!a){var l=r.x-e.region.l.x;c=e.b*(o*o-i*i)<l*i*(1+2*o/l+e.b*e.b),e.b<0&&(c=!c)}}else{var s=e.c-e.a*t.x,f=t.y-s,h=t.x-r.x,g=s-r.y;c=f*f>h*h+g*g}return"l"===n.side?c:!c},endPoint:function(n,e,r){n.ep[e]=r,n.ep[mc[e]]&&t(n)},distance:function(n,t){var e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}},i={list:[],insert:function(n,t,e){n.vertex=t,n.ystar=t.y+e;for(var r=0,u=i.list,o=u.length;o>r;r++){var a=u[r];if(!(n.ystar>a.ystar||n.ystar==a.ystar&&t.x>a.vertex.x))break}u.splice(r,0,n)},del:function(n){for(var t=0,e=i.list,r=e.length;r>t&&e[t]!=n;++t);e.splice(t,1)},empty:function(){return 0===i.list.length},nextEvent:function(n){for(var t=0,e=i.list,r=e.length;r>t;++t)if(e[t]==n)return e[t+1];return null},min:function(){var n=i.list[0];return{x:n.vertex.x,y:n.ystar}},extractMin:function(){return i.list.shift()}};r.init(),e.bottomSite=e.list.shift();for(var o,a,c,l,s,f,h,g,p,d,v,m,y,M=e.list.shift();;)if(i.empty()||(o=i.min()),M&&(i.empty()||M.y<o.y||M.y==o.y&&M.x<o.x))a=r.leftBound(M),c=r.right(a),h=r.rightRegion(a),m=u.bisect(h,M),f=r.createHalfEdge(m,"l"),r.insert(a,f),d=u.intersect(a,f),d&&(i.del(a),i.insert(a,d,u.distance(d,M))),a=f,f=r.createHalfEdge(m,"r"),r.insert(a,f),d=u.intersect(f,c),d&&i.insert(f,d,u.distance(d,M)),M=e.list.shift();else{if(i.empty())break;a=i.extractMin(),l=r.left(a),c=r.right(a),s=r.right(c),h=r.leftRegion(a),g=r.rightRegion(c),v=a.vertex,u.endPoint(a.edge,a.side,v),u.endPoint(c.edge,c.side,v),r.del(a),i.del(c),r.del(c),y="l",h.y>g.y&&(p=h,h=g,g=p,y="r"),m=u.bisect(h,g),f=r.createHalfEdge(m,y),r.insert(l,f),u.endPoint(m,mc[y],v),d=u.intersect(l,f),d&&(i.del(l),i.insert(l,d,u.distance(d,h))),d=u.intersect(f,s),d&&i.insert(f,d,u.distance(d,h))}for(a=r.right(r.leftEnd);a!=r.rightEnd;a=r.right(a))t(a.edge)}function mr(n){return n.x}function yr(n){return n.y}function Mr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function xr(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&xr(n,c[0],e,r,o,a),c[1]&&xr(n,c[1],o,r,u,a),c[2]&&xr(n,c[2],e,a,o,i),c[3]&&xr(n,c[3],o,a,u,i)}}function br(n,t){n=mo.rgb(n),t=mo.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+ct(Math.round(e+i*n))+ct(Math.round(r+o*n))+ct(Math.round(u+a*n))}}function _r(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Er(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function wr(n,t){return t-=n=+n,function(e){return n+t*e}}function Sr(n,t){var e,r,u,i,o,a=0,c=0,l=[],s=[];for(n+="",t+="",yc.lastIndex=0,r=0;e=yc.exec(t);++r)e.index&&l.push(t.substring(a,c=e.index)),s.push({i:l.length,x:e[0]}),l.push(null),a=yc.lastIndex;for(a<t.length&&l.push(t.substring(a)),r=0,i=s.length;(e=yc.exec(n))&&i>r;++r)if(o=s[r],o.x==e[0]){if(o.i)if(null==l[o.i+1])for(l[o.i-1]+=o.x,l.splice(o.i,1),u=r+1;i>u;++u)s[u].i--;else for(l[o.i-1]+=o.x+l[o.i+1],l.splice(o.i,2),u=r+1;i>u;++u)s[u].i-=2;else if(null==l[o.i+1])l[o.i]=o.x;else for(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1),u=r+1;i>u;++u)s[u].i--;s.splice(r,1),i--,r--}else o.x=wr(parseFloat(e[0]),parseFloat(o.x));for(;i>r;)o=s.pop(),null==l[o.i+1]?l[o.i]=o.x:(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1)),i--;return 1===l.length?null==l[0]?(o=s[0].x,function(n){return o(n)+""}):function(){return t}:function(n){for(r=0;i>r;++r)l[(o=s[r]).i]=o.x(n);return l.join("")}}function Er(n,t){for(var e,r=mo.interpolators.length;--r>=0&&!(e=mo.interpolators[r](n,t)););return e}function kr(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Er(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Ar(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function Nr(n){return function(t){return 1-n(1-t)}}function Tr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function qr(n){return n*n}function zr(n){return n*n*n}function Cr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Dr(n){return function(t){return Math.pow(t,n)}}function jr(n){return 1-Math.cos(n*Bo/2)}function Lr(n){return Math.pow(2,10*(n-1))}function Hr(n){return 1-Math.sqrt(1-n*n)}function Fr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/(2*Bo)*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,10*-r)*Math.sin(2*(r-e)*Bo/t)}}function Pr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Or(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=mo.hcl(n),t=mo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return J(e+i*n,r+o*n,u+a*n)+""}}function Yr(n,t){n=mo.hsl(n),t=mo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return $(e+i*n,r+o*n,u+a*n)+""}}function Ir(n,t){n=mo.lab(n),t=mo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return Q(e+i*n,r+o*n,u+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Zr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Xr(t),u=Vr(t,e),i=Xr($r(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ko,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ko:0}function Vr(n,t){return n[0]*t[0]+n[1]*t[1]}function Xr(n){var t=Math.sqrt(Vr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function $r(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Br(n,t){var e,r=[],u=[],i=mo.transform(n),o=mo.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:wr(a[0],c[0])},{i:3,x:wr(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:wr(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:wr(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:wr(g[0],p[0])},{i:e-2,x:wr(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Wr(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return(e-n)*t}}function Jr(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return Math.max(0,Math.min(1,(e-n)*t))}}function Gr(n){for(var t=n.source,e=n.target,r=Qr(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Kr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Qr(n,t){if(n===t)return n;for(var e=Kr(n),r=Kr(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function nu(n){n.fixed|=2}function tu(n){n.fixed&=-7}function eu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function ru(n){n.fixed&=-5}function uu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(uu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function iu(n,t){return mo.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=lu,n}function ou(n){return n.children}function au(n){return n.value}function cu(n,t){return t.value-n.value}function lu(n){return mo.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function su(n){return n.x}function fu(n){return n.y}function hu(n,t,e){n.y0=t,n.y=e}function gu(n){return mo.range(n.length)}function pu(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function du(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function vu(n){return n.reduce(mu,0)}function mu(n,t){return n+t[1]}function yu(n,t){return Mu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Mu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function xu(n){return[mo.min(n),mo.max(n)]}function bu(n,t){return n.parent==t.parent?1:2}function _u(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function wu(n){var t,e=n.children;return e&&(t=e.length)?e[t-1]:n._tree.thread}function Su(n,t){var e=n.children;if(e&&(u=e.length))for(var r,u,i=-1;++i<u;)t(r=Su(e[i],t),n)>0&&(n=r);return n}function Eu(n,t){return n.x-t.x}function ku(n,t){return t.x-n.x}function Au(n,t){return n.depth-t.depth}function Nu(n,t){function e(n,r){var u=n.children;if(u&&(o=u.length))for(var i,o,a=null,c=-1;++c<o;)i=u[c],e(i,a),a=i;t(n,r)}e(n,null)}function Tu(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i]._tree,t.prelim+=e,t.mod+=e,e+=t.shift+(r+=t.change)}function qu(n,t,e){n=n._tree,t=t._tree;var r=e/(t.number-n.number);n.change+=r,t.change-=r,t.shift+=e,t.prelim+=e,t.mod+=e}function zu(n,t,e){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:e}function Cu(n,t){return n.value-t.value}function Du(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function ju(n,t){n._pack_next=t,t._pack_prev=n}function Lu(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Hu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(Fu),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],Ru(r,u,i),t(i),Du(r,i),r._pack_prev=i,Du(i,u),u=r._pack_next,o=3;l>o;o++){Ru(r,u,i=e[o]);var p=0,d=1,v=1;for(a=u._pack_next;a!==u;a=a._pack_next,d++)if(Lu(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!Lu(c,i);c=c._pack_prev,v++);p?(v>d||d==v&&u.r<r.r?ju(r,u=a):ju(r=c,u),o--):(Du(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Pu)}}function Fu(n){n._pack_next=n._pack_prev=n}function Pu(n){delete n._pack_next,delete n._pack_prev}function Ou(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)Ou(u[i],t,e,r)}function Ru(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function Yu(n){return 1+mo.max(n,function(n){return n.y})}function Iu(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Uu(n){var t=n.children;return t&&t.length?Uu(t[0]):n}function Zu(n){var t,e=n.children;return e&&(t=e.length)?Zu(e[t-1]):n}function Vu(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Xu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function $u(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Bu(n){return n.rangeExtent?n.rangeExtent():$u(n.range())}function Wu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ju(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Gu(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Nc}function Ku(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=mo.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Qu(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Ku:Wu,c=r?Jr:Wr;return o=u(n,t,c,e),a=u(t,n,c,Er),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Ur)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return ri(n,t)},i.tickFormat=function(t,e){return ui(n,t,e)},i.nice=function(t){return ti(n,t),u()},i.copy=function(){return Qu(n,t,e,r)},u()}function ni(n,t){return mo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function ti(n,t){return Ju(n,Gu(ei(n,t)[2]))}function ei(n,t){null==t&&(t=10);var e=$u(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function ri(n,t){return mo.range.apply(mo,ei(n,t))}function ui(n,t,e){var r=-Math.floor(Math.log(ei(n,t)[2])/Math.LN10+.01);return mo.format(e?e.replace(Ea,function(n,t,e,u,i,o,a,c,l,s){return[t,e,u,i,o,a,c,l||"."+(r-2*("%"===s)),s].join("")}):",."+r+"f")}function ii(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ju(r.map(u),e?Math:qc);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=$u(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Tc;arguments.length<2?t=Tc:"function"!=typeof t&&(t=mo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return ii(n.copy(),t,e,r)},ni(o,n)}function oi(n,t,e){function r(t){return n(u(t))}var u=ai(t),i=ai(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return ri(e,n)},r.tickFormat=function(n,t){return ui(e,n,t)},r.nice=function(n){return r.domain(ti(e,n))},r.exponent=function(o){return arguments.length?(u=ai(t=o),i=ai(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return oi(n.copy(),t,e)},ni(r,n)}function ai(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ci(n,t){function e(e){return o[((i.get(e)||"range"===t.t&&i.set(e,n.push(e)))-1)%o.length]}function r(t,e){return mo.range(n.length).map(function(n){return t+e*n})}var i,o,a;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new u;for(var o,a=-1,c=r.length;++a<c;)i.has(o=r[a])||i.set(o,n.push(o));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(o=n,a=0,t={t:"range",a:arguments},e):o},e.rangePoints=function(u,i){arguments.length<2&&(i=0);var c=u[0],l=u[1],s=(l-c)/(Math.max(1,n.length-1)+i);return o=r(n.length<2?(c+l)/2:c+s*i/2,s),a=0,t={t:"rangePoints",a:arguments},e},e.rangeBands=function(u,i,c){arguments.length<2&&(i=0),arguments.length<3&&(c=i);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-i+2*c);return o=r(s+h*c,h),l&&o.reverse(),a=h*(1-i),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,i,c){arguments.length<2&&(i=0),arguments.length<3&&(c=i);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-i+2*c)),g=f-s-(n.length-i)*h;return o=r(s+Math.round(g/2),h),l&&o.reverse(),a=Math.round(h*(1-i)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return $u(t.a[0])},e.copy=function(){return ci(n,t)},e.domain(n)}function li(n,t){function e(){var e=0,i=t.length;for(u=[];++e<i;)u[e-1]=mo.quantile(n,e/i);return r}function r(n){return isNaN(n=+n)?void 0:t[mo.bisect(u,n)]}var u;return r.domain=function(t){return arguments.length?(n=t.filter(function(n){return!isNaN(n)}).sort(mo.ascending),e()):n},r.range=function(n){return arguments.length?(t=n,e()):t},r.quantiles=function(){return u},r.invertExtent=function(e){return e=t.indexOf(e),0>e?[0/0,0/0]:[e>0?u[e-1]:n[0],e<u.length?u[e]:n[n.length-1]]},r.copy=function(){return li(n,t)},e()}function si(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return si(n,t,e)},u()}function fi(n,t){function e(e){return e>=e?t[mo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return fi(n,t)},e}function hi(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return ri(n,t)},t.tickFormat=function(t,e){return ui(n,t,e)},t.copy=function(){return hi(n)},t}function gi(n){return n.innerRadius}function pi(n){return n.outerRadius}function di(n){return n.startAngle}function vi(n){return n.endAngle}function mi(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]+Lc,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function yi(n){function t(t){function c(){d.push("M",a(n(m),f),s,l(n(v.reverse()),f),"Z")}for(var h,g,p,d=[],v=[],m=[],y=-1,M=t.length,x=pt(e),b=pt(u),_=e===r?function(){return g}:pt(r),w=u===i?function(){return p}:pt(i);++y<M;)o.call(this,h=t[y],y)?(v.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):v.length&&(c(),v=[],m=[]);return v.length&&c(),d.length?d.join(""):null}var e=Ze,r=Ze,u=0,i=Ve,o=Vt,a=Xe,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=hc.get(n)||Xe).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Mi(n){return n.radius}function xi(n){return[n.x,n.y]}function bi(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]+Lc;return[e*Math.cos(r),e*Math.sin(r)]}}function _i(){return 64}function wi(){return"circle"}function Si(n){var t=Math.sqrt(n/Bo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Ei(n,t){return Lo(n,Ic),n.id=t,n}function ki(n,t,e,r){var u=n.id;return N(n,"function"==typeof e?function(n,i,o){n.__transition__[u].tween.set(t,r(e.call(n,n.__data__,i,o)))}:(e=r(e),function(n){n.__transition__[u].tween.set(t,e)}))}function Ai(n){return null==n&&(n=""),function(){this.textContent=n}}function Ni(n,t,e,r){var i=n.__transition__||(n.__transition__={active:0,count:0}),o=i[e];if(!o){var a=r.time;o=i[e]={tween:new u,time:a,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,mo.timer(function(r){function u(r){return i.active>e?l():(i.active=e,o.event&&o.event.start.call(n,s,t),o.tween.forEach(function(e,r){(r=r.call(n,s,t))&&p.push(r)}),c(r)?1:(xt(c,0,a),void 0))}function c(r){if(i.active!==e)return l();for(var u=(r-h)/g,a=f(u),c=p.length;c>0;)p[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,s,t),l()):void 0}function l(){return--i.count?delete i[e]:delete n.__transition__,1}var s=n.__data__,f=o.ease,h=o.delay,g=o.duration,p=[];return r>=h?u(r):(xt(u,h,a),void 0)},0,a)}}function Ti(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function qi(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function zi(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ci(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new Wc(e-1)),1),e}function i(n,e){return t(n=new Wc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{Wc=zi;var r=new zi;return r._=n,o(r,t,e)}finally{Wc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Di(n);return c.floor=c,c.round=Di(r),c.ceil=Di(u),c.offset=Di(i),c.range=a,n}function Di(n){return function(t,e){try{Wc=zi;var r=new zi;return r._=t,n(r,e)._}finally{Wc=Date}}}function ji(n){function t(t){for(var r,u,i,o=[],a=-1,c=0;++a<e;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=pl[r=n.charAt(++a)])&&(r=n.charAt(++a)),(i=dl[r])&&(r=i(t,null==u?"e"===r?" ":"0":u)),o.push(r),c=a+1);return o.push(n.substring(c,a)),o.join("")}var e=n.length;return t.parse=function(t){var e={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},r=Li(e,n,t,0);if(r!=t.length)return null;"p"in e&&(e.H=e.H%12+12*e.p);var u=null!=e.Z&&Wc!==zi,i=new(u?zi:Wc);return"j"in e?i.setFullYear(e.y,0,e.j):"w"in e&&("W"in e||"U"in e)?(i.setFullYear(e.y,0,1),i.setFullYear(e.y,0,"W"in e?(e.w+6)%7+7*e.W-(i.getDay()+5)%7:e.w+7*e.U-(i.getDay()+6)%7)):i.setFullYear(e.y,e.m,e.d),i.setHours(e.H+Math.floor(e.Z/100),e.M+e.Z%100,e.S,e.L),u?i._:i},t.toString=function(){return n},t}function Li(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=vl[o in pl?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function Hi(n){return new RegExp("^(?:"+n.map(mo.requote).join("|")+")","i")}function Fi(n){for(var t=new u,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Pi(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Oi(n,t,e){al.lastIndex=0;var r=al.exec(t.substring(e));return r?(n.w=cl.get(r[0].toLowerCase()),e+r[0].length):-1}function Ri(n,t,e){il.lastIndex=0;var r=il.exec(t.substring(e));return r?(n.w=ol.get(r[0].toLowerCase()),e+r[0].length):-1}function Yi(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Ii(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e));return r?(n.U=+r[0],e+r[0].length):-1}function Ui(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e));return r?(n.W=+r[0],e+r[0].length):-1}function Zi(n,t,e){fl.lastIndex=0;var r=fl.exec(t.substring(e));return r?(n.m=hl.get(r[0].toLowerCase()),e+r[0].length):-1}function Vi(n,t,e){ll.lastIndex=0;var r=ll.exec(t.substring(e));return r?(n.m=sl.get(r[0].toLowerCase()),e+r[0].length):-1}function Xi(n,t,e){return Li(n,dl.c.toString(),t,e)}function $i(n,t,e){return Li(n,dl.x.toString(),t,e)}function Bi(n,t,e){return Li(n,dl.X.toString(),t,e)}function Wi(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Ji(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.y=Ki(+r[0]),e+r[0].length):-1}function Gi(n,t,e){return/^[+-]\d{4}$/.test(t=t.substring(e,e+5))?(n.Z=+t,e+5):-1}function Ki(n){return n+(n>68?1900:2e3)}function Qi(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function no(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function to(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function eo(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ro(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function uo(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function io(n,t,e){ml.lastIndex=0;var r=ml.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function oo(n,t,e){var r=yl.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}function ao(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(Math.abs(t)/60),u=Math.abs(t)%60;return e+Pi(r,"0",2)+Pi(u,"0",2)}function co(n,t,e){gl.lastIndex=0;var r=gl.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function lo(n){function t(n){try{Wc=zi;var t=new Wc;return t._=n,e(t)}finally{Wc=Date}}var e=ji(n);return t.parse=function(n){try{Wc=zi;var t=e.parse(n);return t&&t._}finally{Wc=Date}},t.toString=e.toString,t}function so(n){return n.toISOString()}function fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=mo.bisect(xl,u);return i==xl.length?[t.year,ei(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/xl[i-1]<xl[i]/u?i-1:i]:[Sl,ei(n,e)[2]]}return r.invert=function(t){return ho(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(ho)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,ho(+e+1),t).length}var i=r.domain(),o=$u(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Ju(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=ho(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ho(+t+1);return t}}:n))},r.ticks=function(n,t){var e=$u(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ho(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return fo(n.copy(),t,e)},ni(r,n)}function ho(n){return new Date(n)}function go(n){return function(t){for(var e=n.length-1,r=n[e];!r[1](t);)r=n[--e];return r[0](t)}}function po(n){return JSON.parse(n.responseText)}function vo(n){var t=xo.createRange();return t.selectNode(xo.body),t.createContextualFragment(n.responseText)}var mo={version:"3.3.5"};Date.now||(Date.now=function(){return+new Date});var yo=[].slice,Mo=function(n){return yo.call(n)},xo=document,bo=xo.documentElement,_o=window;try{Mo(bo.childNodes)[0].nodeType}catch(wo){Mo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{xo.createElement("div").style.setProperty("opacity",0,"")}catch(So){var Eo=_o.Element.prototype,ko=Eo.setAttribute,Ao=Eo.setAttributeNS,No=_o.CSSStyleDeclaration.prototype,To=No.setProperty;Eo.setAttribute=function(n,t){ko.call(this,n,t+"")},Eo.setAttributeNS=function(n,t,e){Ao.call(this,n,t,e+"")},No.setProperty=function(n,t,e){To.call(this,n,t+"",e)}}mo.ascending=function(n,t){return t>n?-1:n>t?1:n>=t?0:0/0},mo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},mo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},mo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},mo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o&&!(null!=(e=u=n[i])&&e>=e);)e=u=void 0;for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o&&!(null!=(e=u=t.call(n,n[i],i))&&e>=e);)e=void 0;for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},mo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(e=+n[i])||(r+=e);else for(;++i<u;)isNaN(e=+t.call(n,n[i],i))||(r+=e);return r},mo.mean=function(t,e){var r,u=t.length,i=0,o=-1,a=0;if(1===arguments.length)for(;++o<u;)n(r=t[o])&&(i+=(r-i)/++a);else for(;++o<u;)n(r=e.call(t,t[o],o))&&(i+=(r-i)/++a);return a?i:void 0},mo.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},mo.median=function(t,e){return arguments.length>1&&(t=t.map(e)),t=t.filter(n),t.length?mo.quantile(t.sort(mo.ascending),.5):void 0},mo.bisector=function(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n.call(t,t[i],i)<e?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;e<n.call(t,t[i],i)?u=i:r=i+1}return r}}};var qo=mo.bisector(function(n){return n});mo.bisectLeft=qo.left,mo.bisect=mo.bisectRight=qo.right,mo.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},mo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},mo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},mo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,e=mo.min(arguments,t),r=new Array(e);++n<e;)for(var u,i=-1,o=r[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return r},mo.transpose=function(n){return mo.zip.apply(mo,n)},mo.keys=function(n){var t=[];for(var e in n)t.push(e);return t},mo.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},mo.entries=function(n){var t=[]; +for(var e in n)t.push({key:e,value:n[e]});return t},mo.merge=function(n){return Array.prototype.concat.apply([],n)},mo.range=function(n,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/r)throw new Error("infinite range");var u,i=[],o=e(Math.abs(r)),a=-1;if(n*=o,t*=o,r*=o,0>r)for(;(u=n+r*++a)>t;)i.push(u/o);else for(;(u=n+r*++a)<t;)i.push(u/o);return i},mo.map=function(n){var t=new u;if(n instanceof u)n.forEach(function(n,e){t.set(n,e)});else for(var e in n)t.set(e,n[e]);return t},r(u,{has:function(n){return zo+n in this},get:function(n){return this[zo+n]},set:function(n,t){return this[zo+n]=t},remove:function(n){return n=zo+n,n in this&&delete this[n]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var n=[];return this.forEach(function(t,e){n.push(e)}),n},entries:function(){var n=[];return this.forEach(function(t,e){n.push({key:t,value:e})}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Co&&n.call(this,t.substring(1),this[t])}});var zo="\0",Co=zo.charCodeAt(0);mo.nest=function(){function n(t,a,c){if(c>=o.length)return r?r.call(i,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,d=o[c++],v=new u;++g<p;)(h=v.get(l=d(s=a[g])))?h.push(s):v.set(l,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,c))}):(s={},f=function(e,r){s[e]=n(t,r,c)}),v.forEach(f),s}function t(n,e){if(e>=o.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,i={},o=[],a=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(mo.map,e,0),0)},i.key=function(n){return o.push(n),i},i.sortKeys=function(n){return a[o.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},mo.set=function(n){var t=new i;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},r(i,{has:function(n){return zo+n in this},add:function(n){return this[zo+n]=!0,n},remove:function(n){return n=zo+n,n in this&&delete this[n]},values:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Co&&n.call(this,t.substring(1))}}),mo.behavior={},mo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=o(n,t,t[e]);return n};var Do=["webkit","ms","moz","Moz","o","O"];mo.dispatch=function(){for(var n=new l,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=s(n);return n},l.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},mo.event=null,mo.requote=function(n){return n.replace(jo,"\\$&")};var jo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Lo={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ho=function(n,t){return t.querySelector(n)},Fo=function(n,t){return t.querySelectorAll(n)},Po=bo[a(bo,"matchesSelector")],Oo=function(n,t){return Po.call(n,t)};"function"==typeof Sizzle&&(Ho=function(n,t){return Sizzle(n,t)[0]||null},Fo=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},Oo=Sizzle.matchesSelector),mo.selection=function(){return Uo};var Ro=mo.selection.prototype=[];Ro.select=function(n){var t,e,r,u,i=[];n=d(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return p(i)},Ro.selectAll=function(n){var t,e,r=[];n=v(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=Mo(n.call(e,e.__data__,a,u))),t.parentNode=e);return p(r)};var Yo={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};mo.ns={prefix:Yo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.substring(0,t),n=n.substring(t+1)),Yo.hasOwnProperty(e)?{space:Yo[e],local:n}:n}},Ro.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=mo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(m(t,n[t]));return this}return this.each(m(n,t))},Ro.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=n.trim().split(/^|\s+/g)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!M(n[u]).test(t))return!1;return!0}for(t in n)this.each(x(t,n[t]));return this}return this.each(x(n,t))},Ro.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(_(e,n[e],t));return this}if(2>r)return _o.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(_(n,t,e))},Ro.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(w(t,n[t]));return this}return this.each(w(n,t))},Ro.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Ro.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Ro.append=function(n){return n=S(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Ro.insert=function(n,t){return n=S(n),t=d(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments))})},Ro.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},Ro.data=function(n,t){function e(n,e){var r,i,o,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),d=new Array(a);if(t){var v,m=new u,y=new u,M=[];for(r=-1;++r<a;)v=t.call(i=n[r],i.__data__,r),m.has(v)?d[r]=i:m.set(v,i),M.push(v);for(r=-1;++r<f;)v=t.call(e,o=e[r],r),(i=m.get(v))?(g[r]=i,i.__data__=o):y.has(v)||(p[r]=E(o)),y.set(v,o),m.remove(v);for(r=-1;++r<a;)m.has(M[r])&&(d[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],o=e[r],i?(i.__data__=o,g[r]=i):p[r]=E(o);for(;f>r;++r)p[r]=E(e[r]);for(;a>r;++r)d[r]=n[r]}p.update=g,p.parentNode=g.parentNode=d.parentNode=n.parentNode,c.push(p),l.push(g),s.push(d)}var r,i,o=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++o<a;)(i=r[o])&&(n[o]=i.__data__);return n}var c=T([]),l=p([]),s=p([]);if("function"==typeof n)for(;++o<a;)e(r=this[o],n.call(r,r.parentNode.__data__,o));else for(;++o<a;)e(r=this[o],n);return l.enter=function(){return c},l.exit=function(){return s},l},Ro.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Ro.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=k(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a)&&t.push(r)}return p(u)},Ro.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Ro.sort=function(n){n=A.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Ro.each=function(n){return N(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Ro.call=function(n){var t=Mo(arguments);return n.apply(t[0]=this,t),this},Ro.empty=function(){return!this.node()},Ro.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Ro.size=function(){var n=0;return this.each(function(){++n}),n};var Io=[];mo.selection.enter=T,mo.selection.enter.prototype=Io,Io.append=Ro.append,Io.empty=Ro.empty,Io.node=Ro.node,Io.call=Ro.call,Io.size=Ro.size,Io.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return p(o)},Io.insert=function(n,t){return arguments.length<2&&(t=q(this)),Ro.insert.call(this,n,t)},Ro.transition=function(){for(var n,t,e=Pc||++Uc,r=[],u=Oc||{time:Date.now(),ease:Cr,delay:0,duration:250},i=-1,o=this.length;++i<o;){r.push(n=[]);for(var a=this[i],c=-1,l=a.length;++c<l;)(t=a[c])&&Ni(t,c,e,u),n.push(t)}return Ei(r,e)},Ro.interrupt=function(){return this.each(z)},mo.select=function(n){var t=["string"==typeof n?Ho(n,xo):n];return t.parentNode=bo,p([t])},mo.selectAll=function(n){var t=Mo("string"==typeof n?Fo(n,xo):n);return t.parentNode=bo,p([t])};var Uo=mo.select(bo);Ro.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(C(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(C(n,t,e))};var Zo=mo.map({mouseenter:"mouseover",mouseleave:"mouseout"});Zo.forEach(function(n){"on"+n in xo&&Zo.remove(n)});var Vo=a(bo.style,"userSelect"),Xo=0;mo.mouse=function(n){return H(n,h())};var $o=/WebKit/.test(_o.navigator.userAgent)?-1:0;mo.touches=function(n,t){return arguments.length<2&&(t=h().touches),t?Mo(t).map(function(t){var e=H(n,t);return e.identifier=t.identifier,e}):[]},mo.behavior.drag=function(){function n(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function t(){return mo.event.changedTouches[0].identifier}function e(n,t){return mo.touches(n).filter(function(n){return n.identifier===t})[0]}function r(n,t,e,r){return function(){function o(){var n=t(s,g),e=n[0]-d[0],r=n[1]-d[1];v|=e|r,d=n,f({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:e,dy:r})}function a(){m.on(e+"."+p,null).on(r+"."+p,null),y(v&&mo.event.target===h),f({type:"dragend"})}var c,l=this,s=l.parentNode,f=u.of(l,arguments),h=mo.event.target,g=n(),p=null==g?"drag":"drag-"+g,d=t(s,g),v=0,m=mo.select(_o).on(e+"."+p,o).on(r+"."+p,a),y=L();i?(c=i.apply(l,arguments),c=[c.x-d[0],c.y-d[1]]):c=[0,0],f({type:"dragstart"})}}var u=g(n,"drag","dragstart","dragend"),i=null,o=r(c,mo.mouse,"mousemove","mouseup"),a=r(t,e,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},mo.rebind(n,u,"on")};var Bo=Math.PI,Wo=1e-6,Jo=Wo*Wo,Go=Bo/180,Ko=180/Bo,Qo=Math.SQRT2,na=2,ta=4;mo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Y(d),o=i/(na*h)*(e*I(Qo*t+d)-R(d));return[r+o*l,u+o*s,i*e/Y(Qo*t+d)]}return[r+n*l,u+n*s,i*Math.exp(Qo*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+ta*f)/(2*i*na*h),p=(c*c-i*i-ta*f)/(2*c*na*h),d=Math.log(Math.sqrt(g*g+1)-g),v=Math.log(Math.sqrt(p*p+1)-p),m=v-d,y=(m||Math.log(c/i))/Qo;return e.duration=1e3*y,e},mo.behavior.zoom=function(){function n(n){n.on(A,l).on(ua+".zoom",h).on(N,p).on("dblclick.zoom",d).on(q,s)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(k[0],Math.min(k[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){b&&b.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-S.y)/S.k}).map(_.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function l(){function n(){s=1,u(mo.mouse(r),h),a(i)}function e(){f.on(N,_o===r?p:null).on(T,null),g(s&&mo.event.target===l),c(i)}var r=this,i=C.of(r,arguments),l=mo.event.target,s=0,f=mo.select(_o).on(N,n).on(T,e),h=t(mo.mouse(r)),g=L();z.call(r),o(i)}function s(){function n(){var n=mo.touches(p);return g=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){for(var t=mo.event.changedTouches,e=0,i=t.length;i>e;++e)v[t[e].identifier]=null;var o=n(),c=Date.now();if(1===o.length){if(500>c-M){var l=o[0],s=v[l.identifier];r(2*S.k),u(l,s),f(),a(d)}M=c}else if(o.length>1){var l=o[0],h=o[1],g=l[0]-h[0],p=l[1]-h[1];m=g*g+p*p}}function i(){for(var n,t,e,i,o=mo.touches(p),c=0,l=o.length;l>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*g)}M=null,u(n,t),a(d)}function h(){if(mo.event.touches.length){for(var t=mo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}_.on(x,null).on(b,null),w.on(A,l).on(q,s),E(),c(d)}var g,p=this,d=C.of(p,arguments),v={},m=0,y=mo.event.changedTouches[0].identifier,x="touchmove.zoom-"+y,b="touchend.zoom-"+y,_=mo.select(_o).on(x,i).on(b,h),w=mo.select(p).on(A,null).on(q,e),E=L();z.call(p),e(),o(d)}function h(){var n=C.of(this,arguments);y?clearTimeout(y):(z.call(this),o(n)),y=setTimeout(function(){y=null,c(n)},50),f();var e=m||mo.mouse(this);v||(v=t(e)),r(Math.pow(2,.002*ea())*S.k),u(e,v),a(n)}function p(){v=null}function d(){var n=C.of(this,arguments),e=mo.mouse(this),i=t(e),l=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,mo.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1)),u(e,i),a(n),c(n)}var v,m,y,M,x,b,_,w,S={x:0,y:0,k:1},E=[960,500],k=ra,A="mousedown.zoom",N="mousemove.zoom",T="mouseup.zoom",q="touchstart.zoom",C=g(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=C.of(this,arguments),t=S;Pc?mo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=e/2,i=r/2,o=mo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(k=null==t?ra:[+t[0],+t[1]],n):k},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.x=function(t){return arguments.length?(b=t,x=t.copy(),S={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),S={x:0,y:0,k:1},n):w},mo.rebind(n,C,"on")};var ea,ra=[0,1/0],ua="onwheel"in xo?(ea=function(){return-mo.event.deltaY*(mo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in xo?(ea=function(){return mo.event.wheelDelta},"mousewheel"):(ea=function(){return-mo.event.detail},"MozMousePixelScroll");Z.prototype.toString=function(){return this.rgb()+""},mo.hsl=function(n,t,e){return 1===arguments.length?n instanceof X?V(n.h,n.s,n.l):lt(""+n,st,V):V(+n,+t,+e)};var ia=X.prototype=new Z;ia.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,this.l/n)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,n*this.l)},ia.rgb=function(){return $(this.h,this.s,this.l)},mo.hcl=function(n,t,e){return 1===arguments.length?n instanceof W?B(n.h,n.c,n.l):n instanceof K?nt(n.l,n.a,n.b):nt((n=ft((n=mo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):B(+n,+t,+e)};var oa=W.prototype=new Z;oa.brighter=function(n){return B(this.h,this.c,Math.min(100,this.l+aa*(arguments.length?n:1)))},oa.darker=function(n){return B(this.h,this.c,Math.max(0,this.l-aa*(arguments.length?n:1)))},oa.rgb=function(){return J(this.h,this.c,this.l).rgb()},mo.lab=function(n,t,e){return 1===arguments.length?n instanceof K?G(n.l,n.a,n.b):n instanceof W?J(n.l,n.c,n.h):ft((n=mo.rgb(n)).r,n.g,n.b):G(+n,+t,+e)};var aa=18,ca=.95047,la=1,sa=1.08883,fa=K.prototype=new Z;fa.brighter=function(n){return G(Math.min(100,this.l+aa*(arguments.length?n:1)),this.a,this.b)},fa.darker=function(n){return G(Math.max(0,this.l-aa*(arguments.length?n:1)),this.a,this.b)},fa.rgb=function(){return Q(this.l,this.a,this.b)},mo.rgb=function(n,t,e){return 1===arguments.length?n instanceof at?ot(n.r,n.g,n.b):lt(""+n,ot,$):ot(~~n,~~t,~~e)};var ha=at.prototype=new Z;ha.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),ot(Math.min(255,~~(t/n)),Math.min(255,~~(e/n)),Math.min(255,~~(r/n)))):ot(u,u,u)},ha.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),ot(~~(n*this.r),~~(n*this.g),~~(n*this.b))},ha.hsl=function(){return st(this.r,this.g,this.b)},ha.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var ga=mo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ga.forEach(function(n,t){ga.set(n,ut(t))}),mo.functor=pt,mo.xhr=vt(dt),mo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=mo.xhr(n,t,i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o.row(e)}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function o(t){return t.map(a).join(n)}function a(n){return c.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var c=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.substring(t+1,e).replace(/""/g,'"')}for(;c>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==l)continue;return n.substring(t,s-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],c=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new i,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(o).join("\n")},e},mo.csv=mo.dsv(",","text/csv"),mo.tsv=mo.dsv(" ","text/tab-separated-values");var pa,da,va,ma,ya,Ma=_o[a(_o,"requestAnimationFrame")]||function(n){setTimeout(n,17)};mo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={callback:n,time:u,next:null};da?da.next=i:pa=i,da=i,va||(ma=clearTimeout(ma),va=1,Ma(Mt))},mo.timer.flush=function(){bt(),_t()};var xa=".",ba=",",_a=[3,3],wa="$",Sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(wt);mo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=mo.round(n,St(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((0>=e?e+1:e-1)/3)))),Sa[8+e/3]},mo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)},mo.format=function(n){var t=Ea.exec(n),e=t[1]||" ",r=t[2]||">",u=t[3]||"",i=t[4]||"",o=t[5],a=+t[6],c=t[7],l=t[8],s=t[9],f=1,h="",g=!1;switch(l&&(l=+l.substring(1)),(o||"0"===e&&"="===r)&&(o=e="0",r="=",c&&(a-=Math.floor((a-1)/4))),s){case"n":c=!0,s="g";break;case"%":f=100,h="%",s="f";break;case"p":f=100,h="%",s="r";break;case"b":case"o":case"x":case"X":"#"===i&&(i="0"+s.toLowerCase());case"c":case"d":g=!0,l=0;break;case"s":f=-1,s="r"}"#"===i?i="":"$"===i&&(i=wa),"r"!=s||l||(s="g"),null!=l&&("g"==s?l=Math.max(1,Math.min(21,l)):("e"==s||"f"==s)&&(l=Math.max(0,Math.min(20,l)))),s=ka.get(s)||Et;var p=o&&c;return function(n){if(g&&n%1)return"";var t=0>n||0===n&&0>1/n?(n=-n,"-"):u;if(0>f){var d=mo.formatPrefix(n,l);n=d.scale(n),h=d.symbol}else n*=f;n=s(n,l);var v=n.lastIndexOf("."),m=0>v?n:n.substring(0,v),y=0>v?"":xa+n.substring(v+1);!o&&c&&(m=Aa(m));var M=i.length+m.length+y.length+(p?0:t.length),x=a>M?new Array(M=a-M+1).join(e):"";return p&&(m=Aa(x+m)),t+=i,n=m+y,("<"===r?t+n+x:">"===r?x+t+n:"^"===r?x.substring(0,M>>=1)+t+n+x.substring(M):t+(p?n:x+n))+h}};var Ea=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ka=mo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=mo.round(n,St(n,t))).toFixed(Math.max(0,Math.min(20,St(n*(1+1e-15),t))))}}),Aa=dt;if(_a){var Na=_a.length;Aa=function(n){for(var t=n.length,e=[],r=0,u=_a[0];t>0&&u>0;)e.push(n.substring(t-=u,t+u)),u=_a[r=(r+1)%Na];return e.reverse().join(ba)}}mo.geo={},kt.prototype={s:0,t:0,add:function(n){At(n,this.t,Ta),At(Ta.s,this.s,this),this.s?this.t+=Ta.t:this.s=Ta.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Ta=new kt;mo.geo.stream=function(n,t){n&&qa.hasOwnProperty(n.type)?qa[n.type](n,t):Nt(n,t)};var qa={Feature:function(n,t){Nt(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)Nt(e[r].geometry,t)}},za={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){Tt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)Tt(e[r],t,0)},Polygon:function(n,t){qt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)qt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)Nt(e[r],t)}};mo.geo.area=function(n){return Ca=0,mo.geo.stream(n,ja),Ca};var Ca,Da=new kt,ja={sphere:function(){Ca+=4*Bo},point:c,lineStart:c,lineEnd:c,polygonStart:function(){Da.reset(),ja.lineStart=zt},polygonEnd:function(){var n=2*Da;Ca+=0>n?4*Bo+n:n,ja.lineStart=ja.lineEnd=ja.point=c}};mo.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=Ct([t*Go,e*Go]);if(m){var u=jt(m,r),i=[u[1],-u[0],0],o=jt(i,u);Ft(o),o=Pt(o);var c=t-p,l=c>0?1:-1,d=o[0]*Ko*l,v=Math.abs(c)>180;if(v^(d>l*p&&l*t>d)){var y=o[1]*Ko;y>g&&(g=y)}else if(d=(d+360)%360-180,v^(d>l*p&&l*t>d)){var y=-o[1]*Ko;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);v?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Math.abs(r)>180?r+(r>0?360:-360):r}else d=n,v=e;ja.point(n,e),t(n,e)}function i(){ja.lineStart()}function o(){u(d,v),ja.lineEnd(),Math.abs(y)>Wo&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,d,v,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,ja.polygonStart()},polygonEnd:function(){ja.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>Da?(s=-(h=180),f=-(g=90)):y>Wo?g=90:-Wo>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],mo.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),mo.geo.centroid=function(n){La=Ha=Fa=Pa=Oa=Ra=Ya=Ia=Ua=Za=Va=0,mo.geo.stream(n,Xa);var t=Ua,e=Za,r=Va,u=t*t+e*e+r*r;return Jo>u&&(t=Ra,e=Ya,r=Ia,Wo>Ha&&(t=Fa,e=Pa,r=Oa),u=t*t+e*e+r*r,Jo>u)?[0/0,0/0]:[Math.atan2(e,t)*Ko,O(r/Math.sqrt(u))*Ko]};var La,Ha,Fa,Pa,Oa,Ra,Ya,Ia,Ua,Za,Va,Xa={sphere:c,point:Rt,lineStart:It,lineEnd:Ut,polygonStart:function(){Xa.lineStart=Zt},polygonEnd:function(){Xa.lineStart=It}},$a=Bt(Vt,Qt,te,ee),Ba=[-Bo,0],Wa=1e9;mo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=ue(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(mo.geo.conicEqualArea=function(){return ae(ce)}).raw=ce,mo.geo.albers=function(){return mo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},mo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=mo.geo.albers(),o=mo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=mo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Wo,f+.12*l+Wo],[s-.214*l-Wo,f+.234*l-Wo]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Wo,f+.166*l+Wo],[s-.115*l-Wo,f+.234*l-Wo]]).stream(c).point,n},n.scale(1070)};var Ja,Ga,Ka,Qa,nc,tc,ec={point:c,lineStart:c,lineEnd:c,polygonStart:function(){Ga=0,ec.lineStart=le},polygonEnd:function(){ec.lineStart=ec.lineEnd=ec.point=c,Ja+=Math.abs(Ga/2)}},rc={point:se,lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c},uc={point:ge,lineStart:pe,lineEnd:de,polygonStart:function(){uc.lineStart=ve},polygonEnd:function(){uc.point=ge,uc.lineStart=pe,uc.lineEnd=de}};mo.geo.transform=function(n){return{stream:function(t){var e=new Me(t);for(var r in n)e[r]=n[r];return e}}},Me.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},mo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),mo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ja=0,mo.geo.stream(n,u(ec)),Ja},n.centroid=function(n){return Fa=Pa=Oa=Ra=Ya=Ia=Ua=Za=Va=0,mo.geo.stream(n,u(uc)),Va?[Ua/Va,Za/Va]:Ia?[Ra/Ia,Ya/Ia]:Oa?[Fa/Oa,Pa/Oa]:[0/0,0/0]},n.bounds=function(n){return nc=tc=-(Ka=Qa=1/0),mo.geo.stream(n,u(rc)),[[Ka,Qa],[nc,tc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||xe(n):dt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new fe:new me(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(mo.geo.albersUsa()).context(null)},mo.geo.projection=be,mo.geo.projectionMutator=_e,(mo.geo.equirectangular=function(){return be(Se)}).raw=Se.invert=Se,mo.geo.rotation=function(n){function t(t){return t=n(t[0]*Go,t[1]*Go),t[0]*=Ko,t[1]*=Ko,t}return n=Ee(n[0]%360*Go,n[1]*Go,n.length>2?n[2]*Go:0),t.invert=function(t){return t=n.invert(t[0]*Go,t[1]*Go),t[0]*=Ko,t[1]*=Ko,t},t},mo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=Ee(-n[0]*Go,-n[1]*Go,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ko,n[1]*=Ko}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=Te((t=+r)*Go,u*Go),n):t},n.precision=function(r){return arguments.length?(e=Te(t*Go,(u=+r)*Go),n):u},n.angle(90)},mo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Go,u=n[1]*Go,i=t[1]*Go,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},mo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return mo.range(Math.ceil(i/v)*v,u,v).map(h).concat(mo.range(Math.ceil(l/m)*m,c,m).map(g)).concat(mo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Math.abs(n%v)>Wo +}).map(s)).concat(mo.range(Math.ceil(a/d)*d,o,d).filter(function(n){return Math.abs(n%m)>Wo}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,d=p,v=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(v=+t[0],m=+t[1],n):[v,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],n):[p,d]},n.precision=function(t){return arguments.length?(y=+t,s=ze(a,o,90),f=Ce(r,e,y),h=ze(l,c,90),g=Ce(i,u,y),n):y},n.majorExtent([[-180,-90+Wo],[180,90-Wo]]).minorExtent([[-180,-80-Wo],[180,80+Wo]])},mo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=De,u=je;return n.distance=function(){return mo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},mo.geo.interpolate=function(n,t){return Le(n[0]*Go,n[1]*Go,t[0]*Go,t[1]*Go)},mo.geo.length=function(n){return ic=0,mo.geo.stream(n,oc),ic};var ic,oc={sphere:c,point:c,lineStart:He,lineEnd:c,polygonStart:c,polygonEnd:c},ac=Fe(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(mo.geo.azimuthalEqualArea=function(){return be(ac)}).raw=ac;var cc=Fe(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},dt);(mo.geo.azimuthalEquidistant=function(){return be(cc)}).raw=cc,(mo.geo.conicConformal=function(){return ae(Pe)}).raw=Pe,(mo.geo.conicEquidistant=function(){return ae(Oe)}).raw=Oe;var lc=Fe(function(n){return 1/n},Math.atan);(mo.geo.gnomonic=function(){return be(lc)}).raw=lc,Re.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Bo/2]},(mo.geo.mercator=function(){return Ye(Re)}).raw=Re;var sc=Fe(function(){return 1},Math.asin);(mo.geo.orthographic=function(){return be(sc)}).raw=sc;var fc=Fe(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(mo.geo.stereographic=function(){return be(fc)}).raw=fc,Ie.invert=function(n,t){return[Math.atan2(R(n),Math.cos(t)),O(Math.sin(t)/Y(n))]},(mo.geo.transverseMercator=function(){return Ye(Ie)}).raw=Ie,mo.geom={},mo.svg={},mo.svg.line=function(){return Ue(dt)};var hc=mo.map({linear:Xe,"linear-closed":$e,step:Be,"step-before":We,"step-after":Je,basis:er,"basis-open":rr,"basis-closed":ur,bundle:ir,cardinal:Qe,"cardinal-open":Ge,"cardinal-closed":Ke,monotone:fr});hc.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var gc=[0,2/3,1/3,0],pc=[0,1/3,2/3,0],dc=[0,1/6,2/3,1/6];mo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u,i,o,a,c,l,s,f,h,g,p,d=pt(e),v=pt(r),m=n.length,y=m-1,M=[],x=[],b=0;if(d===Ze&&r===Ve)t=n;else for(i=0,t=[];m>i;++i)t.push([+d.call(this,u=n[i],i),+v.call(this,u,i)]);for(i=1;m>i;++i)(t[i][1]<t[b][1]||t[i][1]==t[b][1]&&t[i][0]<t[b][0])&&(b=i);for(i=0;m>i;++i)i!==b&&(c=t[i][1]-t[b][1],a=t[i][0]-t[b][0],M.push({angle:Math.atan2(c,a),index:i}));for(M.sort(function(n,t){return n.angle-t.angle}),g=M[0].angle,h=M[0].index,f=0,i=1;y>i;++i){if(o=M[i].index,g==M[i].angle){if(a=t[h][0]-t[b][0],c=t[h][1]-t[b][1],l=t[o][0]-t[b][0],s=t[o][1]-t[b][1],a*a+c*c>=l*l+s*s){M[i].index=-1;continue}M[f].index=-1}g=M[i].angle,f=i,h=o}for(x.push(b),i=0,o=0;2>i;++o)M[o].index>-1&&(x.push(M[o].index),i++);for(p=x.length;y>o;++o)if(!(M[o].index<0)){for(;!hr(x[p-2],x[p-1],M[o].index,t);)--p;x[p++]=M[o].index}var _=[];for(i=p-1;i>=0;--i)_.push(n[x[i]]);return _}var e=Ze,r=Ve;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},mo.geom.polygon=function(n){return Lo(n,vc),n};var vc=mo.geom.polygon.prototype=[];vc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},vc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},vc.clip=function(n){for(var t,e,r,u,i,o,a=dr(n),c=-1,l=this.length-dr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],gr(o,s,u)?(gr(i,s,u)||n.push(pr(i,o,s,u)),n.push(o)):gr(i,s,u)&&n.push(pr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n},mo.geom.delaunay=function(n){var t=n.map(function(){return[]}),e=[];return vr(n,function(e){t[e.region.l.index].push(n[e.region.r.index])}),t.forEach(function(t,r){var u=n[r],i=u[0],o=u[1];t.forEach(function(n){n.angle=Math.atan2(n[0]-i,n[1]-o)}),t.sort(function(n,t){return n.angle-t.angle});for(var a=0,c=t.length-1;c>a;a++)e.push([u,t[a],t[a+1]])}),e},mo.geom.voronoi=function(n){function t(n){var t,i,o,a=n.map(function(){return[]}),c=pt(e),l=pt(r),s=n.length,f=1e6;if(c===Ze&&l===Ve)t=n;else for(t=new Array(s),o=0;s>o;++o)t[o]=[+c.call(this,i=n[o],o),+l.call(this,i,o)];if(vr(t,function(n){var t,e,r,u,i,o;1===n.a&&n.b>=0?(t=n.ep.r,e=n.ep.l):(t=n.ep.l,e=n.ep.r),1===n.a?(i=t?t.y:-f,r=n.c-n.b*i,o=e?e.y:f,u=n.c-n.b*o):(r=t?t.x:-f,i=n.c-n.a*r,u=e?e.x:f,o=n.c-n.a*u);var c=[r,i],l=[u,o];a[n.region.l.index].push(c,l),a[n.region.r.index].push(c,l)}),a=a.map(function(n,e){var r=t[e][0],u=t[e][1],i=n.map(function(n){return Math.atan2(n[0]-r,n[1]-u)}),o=mo.range(n.length).sort(function(n,t){return i[n]-i[t]});return o.filter(function(n,t){return!t||i[n]-i[o[t-1]]>Wo}).map(function(t){return n[t]})}),a.forEach(function(n,e){var r=n.length;if(!r)return n.push([-f,-f],[-f,f],[f,f],[f,-f]);if(!(r>2)){var u=t[e],i=n[0],o=n[1],a=u[0],c=u[1],l=i[0],s=i[1],h=o[0],g=o[1],p=Math.abs(h-l),d=g-s;if(Math.abs(d)<Wo){var v=s>c?-f:f;n.push([-f,v],[f,v])}else if(Wo>p){var m=l>a?-f:f;n.push([m,-f],[m,f])}else{var v=(l-a)*(g-s)>(h-l)*(s-c)?f:-f,y=Math.abs(d)-p;Math.abs(y)<Wo?n.push([0>d?v:-v,v]):(y>0&&(v*=-1),n.push([-f,v],[f,v]))}}}),u)for(o=0;s>o;++o)u.clip(a[o]);for(o=0;s>o;++o)a[o].point=n[o];return a}var e=Ze,r=Ve,u=null;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.clipExtent=function(n){if(!arguments.length)return u&&[u[0],u[2]];if(null==n)u=null;else{var e=+n[0][0],r=+n[0][1],i=+n[1][0],o=+n[1][1];u=mo.geom.polygon([[e,r],[e,o],[i,o],[i,r]])}return t},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):u&&u[2]},t.links=function(n){var t,u,i,o=n.map(function(){return[]}),a=[],c=pt(e),l=pt(r),s=n.length;if(c===Ze&&l===Ve)t=n;else for(t=new Array(s),i=0;s>i;++i)t[i]=[+c.call(this,u=n[i],i),+l.call(this,u,i)];return vr(t,function(t){var e=t.region.l.index,r=t.region.r.index;o[e][r]||(o[e][r]=o[r][e]=!0,a.push({source:n[e],target:n[r]}))}),a},t.triangles=function(n){if(e===Ze&&r===Ve)return mo.geom.delaunay(n);for(var t,u=new Array(c),i=pt(e),o=pt(r),a=-1,c=n.length;++a<c;)(u[a]=[+i.call(this,t=n[a],a),+o.call(this,t,a)]).data=t;return mo.geom.delaunay(u).map(function(n){return n.map(function(n){return n.data})})},t)};var mc={l:"r",r:"l"};mo.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(Math.abs(c-e)+Math.abs(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=Mr()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,d,v,m,y,M=pt(a),x=pt(c);if(null!=t)d=t,v=e,m=r,y=u;else if(m=y=-(d=v=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<d&&(d=s.x),s.y<v&&(v=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);d>b&&(d=b),v>_&&(v=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-d,S=y-v;w>S?y=v+w:m=d+S;var E=Mr();if(E.add=function(n){i(E,n,+M(n,++g),+x(n,g),d,v,m,y)},E.visit=function(n){xr(n,E,d,v,m,y)},g=-1,null==t){for(;++g<p;)i(E,n[g],f[g],h[g],d,v,m,y);--g}else n.forEach(E.add);return f=h=n=s=null,E}var o,a=Ze,c=Ve;return(o=arguments.length)?(a=mr,c=yr,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},mo.interpolateRgb=br,mo.interpolateObject=_r,mo.interpolateNumber=wr,mo.interpolateString=Sr;var yc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;mo.interpolate=Er,mo.interpolators=[function(n,t){var e=typeof t;return("string"===e?ga.has(t)||/^(#|rgb\(|hsl\()/.test(t)?br:Sr:t instanceof Z?br:"object"===e?Array.isArray(t)?kr:_r:wr)(n,t)}],mo.interpolateArray=kr;var Mc=function(){return dt},xc=mo.map({linear:Mc,poly:Dr,quad:function(){return qr},cubic:function(){return zr},sin:function(){return jr},exp:function(){return Lr},circle:function(){return Hr},elastic:Fr,back:Pr,bounce:function(){return Or}}),bc=mo.map({"in":dt,out:Nr,"in-out":Tr,"out-in":function(n){return Tr(Nr(n))}});mo.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=xc.get(e)||Mc,r=bc.get(r)||dt,Ar(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},mo.interpolateHcl=Rr,mo.interpolateHsl=Yr,mo.interpolateLab=Ir,mo.interpolateRound=Ur,mo.transform=function(n){var t=xo.createElementNS(mo.ns.prefix.svg,"g");return(mo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Zr(e?e.matrix:_c)})(n)},Zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var _c={a:1,b:0,c:0,d:1,e:0,f:0};mo.interpolateTransform=Br,mo.layout={},mo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Gr(n[e]));return t}},mo.layout.chord=function(){function n(){var n,l,f,h,g,p={},d=[],v=mo.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];d.push(l),m.push(mo.range(i)),n+=l}for(o&&v.sort(function(n,t){return o(d[n],d[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(2*Bo-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=v[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},mo.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=1/Math.sqrt(i*i+o*o);if(d>(u-e)*a){var c=t.charge*a*a;return n.px-=i*c,n.py-=o*c,!0}if(t.point&&isFinite(a)){var c=t.pointCharge*a*a;n.px-=i*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=mo.event.x,n.py=mo.event.y,a.resume()}var e,r,u,i,o,a={},c=mo.dispatch("start","tick","end"),l=[1,1],s=.9,f=wc,h=Sc,g=-30,p=.1,d=.8,v=[],m=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,d,y,M,x,b=v.length,_=m.length;for(e=0;_>e;++e)a=m[e],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(d=M*M+x*x)&&(d=r*i[e]*((d=Math.sqrt(d))-u[e])/d,M*=d,x*=d,h.x-=M*(y=f.weight/(h.weight+f.weight)),h.y-=x*y,f.x+=M*(y=1-y),f.y+=x*y);if((y=r*p)&&(M=l[0]/2,x=l[1]/2,e=-1,y))for(;++e<b;)a=v[e],a.x+=(M-a.x)*y,a.y+=(x-a.y)*y;if(g)for(uu(t=mo.geom.quadtree(v),r,o),e=-1;++e<b;)(a=v[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=v[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(v=n,a):v},a.links=function(n){return arguments.length?(m=n,a):m},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.gravity=function(n){return arguments.length?(p=+n,a):p},a.theta=function(n){return arguments.length?(d=+n,a):d},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),mo.timer(a.tick)),a):r},a.start=function(){function n(n,r){for(var u,i=t(e),o=-1,a=i.length;++o<a;)if(!isNaN(u=i[o][n]))return u;return Math.random()*r}function t(){if(!c){for(c=[],r=0;p>r;++r)c[r]=[];for(r=0;d>r;++r){var n=m[r];c[n.source.index].push(n.target),c[n.target.index].push(n.source)}}return c[e]}var e,r,c,s,p=v.length,d=m.length,y=l[0],M=l[1];for(e=0;p>e;++e)(s=v[e]).index=e,s.weight=0;for(e=0;d>e;++e)s=m[e],"number"==typeof s.source&&(s.source=v[s.source]),"number"==typeof s.target&&(s.target=v[s.target]),++s.source.weight,++s.target.weight;for(e=0;p>e;++e)s=v[e],isNaN(s.x)&&(s.x=n("x",y)),isNaN(s.y)&&(s.y=n("y",M)),isNaN(s.px)&&(s.px=s.x),isNaN(s.py)&&(s.py=s.y);if(u=[],"function"==typeof f)for(e=0;d>e;++e)u[e]=+f.call(this,m[e],e);else for(e=0;d>e;++e)u[e]=f;if(i=[],"function"==typeof h)for(e=0;d>e;++e)i[e]=+h.call(this,m[e],e);else for(e=0;d>e;++e)i[e]=h;if(o=[],"function"==typeof g)for(e=0;p>e;++e)o[e]=+g.call(this,v[e],e);else for(e=0;p>e;++e)o[e]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=mo.behavior.drag().origin(dt).on("dragstart.force",nu).on("drag.force",t).on("dragend.force",tu)),arguments.length?(this.on("mouseover.force",eu).on("mouseout.force",ru).call(e),void 0):e},mo.rebind(a,c,"on")};var wc=20,Sc=1;mo.layout.hierarchy=function(){function n(t,o,a){var c=u.call(e,t,o);if(t.depth=o,a.push(t),c&&(l=c.length)){for(var l,s,f=-1,h=t.children=[],g=0,p=o+1;++f<l;)s=n(c[f],p,a),s.parent=t,h.push(s),g+=s.value;r&&h.sort(r),i&&(t.value=g)}else i&&(t.value=+i.call(e,t,o)||0);return t}function t(n,r){var u=n.children,o=0;if(u&&(a=u.length))for(var a,c=-1,l=r+1;++c<a;)o+=t(u[c],l);else i&&(o=+i.call(e,n,r)||0);return i&&(n.value=o),o}function e(t){var e=[];return n(t,0,e),e}var r=cu,u=ou,i=au;return e.sort=function(n){return arguments.length?(r=n,e):r},e.children=function(n){return arguments.length?(u=n,e):u},e.value=function(n){return arguments.length?(i=n,e):i},e.revalue=function(n){return t(n,0),n},e},mo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=mo.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},iu(e,r)},mo.layout.pie=function(){function n(i){var o=i.map(function(e,r){return+t.call(n,e,r)}),a=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/mo.sum(o),l=mo.range(i.length);null!=e&&l.sort(e===Ec?function(n,t){return o[t]-o[n]}:function(n,t){return e(i[n],i[t])});var s=[];return l.forEach(function(n){var t;s[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),s}var t=Number,e=Ec,r=0,u=2*Bo;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var Ec={};mo.layout.stack=function(){function n(a,c){var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=mo.permute(l,f),s=mo.permute(s,f);var h,g,p,d=r.call(n,s,c),v=l.length,m=l[0].length;for(g=0;m>g;++g)for(u.call(n,l[0][g],p=d[g],s[0][g][1]),h=1;v>h;++h)u.call(n,l[h][g],p+=s[h-1][g][1],s[h][g][1]);return a}var t=dt,e=gu,r=pu,u=hu,i=su,o=fu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:kc.get(t)||gu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:Ac.get(t)||pu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var kc=mo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(vu),o=mo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return mo.range(n.length).reverse()},"default":gu}),Ac=mo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:pu});mo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[mo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=xu,u=yu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=pt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return Mu(n,t)}:pt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},mo.layout.tree=function(){function n(n,i){function o(n,t){var r=n.children,u=n._tree;if(r&&(i=r.length)){for(var i,a,l,s=r[0],f=s,h=-1;++h<i;)l=r[h],o(l,a),f=c(l,a,f),a=l;Tu(n);var g=.5*(s._tree.prelim+l._tree.prelim);t?(u.prelim=t._tree.prelim+e(n,t),u.mod=u.prelim-g):u.prelim=g}else t&&(u.prelim=t._tree.prelim+e(n,t))}function a(n,t){n.x=n._tree.prelim+t;var e=n.children;if(e&&(r=e.length)){var r,u=-1;for(t+=n._tree.mod;++u<r;)a(e[u],t)}}function c(n,t,r){if(t){for(var u,i=n,o=n,a=t,c=n.parent.children[0],l=i._tree.mod,s=o._tree.mod,f=a._tree.mod,h=c._tree.mod;a=wu(a),i=_u(i),a&&i;)c=_u(c),o=wu(o),o._tree.ancestor=n,u=a._tree.prelim+f-i._tree.prelim-l+e(a,i),u>0&&(qu(zu(a,n,r),n,u),l+=u,s+=u),f+=a._tree.mod,l+=i._tree.mod,h+=c._tree.mod,s+=o._tree.mod;a&&!wu(o)&&(o._tree.thread=a,o._tree.mod+=f-s),i&&!_u(c)&&(c._tree.thread=i,c._tree.mod+=l-h,r=n)}return r}var l=t.call(this,n,i),s=l[0];Nu(s,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),o(s),a(s,-s._tree.prelim);var f=Su(s,ku),h=Su(s,Eu),g=Su(s,Au),p=f.x-e(f,h)/2,d=h.x+e(h,f)/2,v=g.depth||1;return Nu(s,u?function(n){n.x*=r[0],n.y=n.depth*r[1],delete n._tree}:function(n){n.x=(n.x-p)/(d-p)*r[0],n.y=n.depth/v*r[1],delete n._tree}),l}var t=mo.layout.hierarchy().sort(null).value(null),e=bu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},iu(n,t)},mo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Nu(a,function(n){n.r=+s(n.value)}),Nu(a,Hu),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Nu(a,function(n){n.r+=f}),Nu(a,Hu),Nu(a,function(n){n.r-=f})}return Ou(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=mo.layout.hierarchy().sort(Cu),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},iu(n,e)},mo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Nu(c,function(n){var t=n.children;t&&t.length?(n.x=Iu(t),n.y=Yu(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Uu(c),f=Zu(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Nu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=mo.layout.hierarchy().sort(null).value(null),e=bu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},iu(n,t)},mo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,d))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,d,l,!1),d=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,d,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=mo.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Vu,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Vu(t):Xu(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Xu(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Vu:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},iu(i,a)},mo.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=mo.random.normal.apply(mo,arguments);return function(){return Math.exp(n())}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t/n}}},mo.scale={};var Nc={floor:dt,ceil:dt};mo.scale.linear=function(){return Qu([0,1],[0,1],Er,!1)},mo.scale.log=function(){return ii(mo.scale.linear().domain([0,1]),10,!0,[1,10])};var Tc=mo.format(".0e"),qc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};mo.scale.pow=function(){return oi(mo.scale.linear(),1,[0,1])},mo.scale.sqrt=function(){return mo.scale.pow().exponent(.5)},mo.scale.ordinal=function(){return ci([],{t:"range",a:[[]]})},mo.scale.category10=function(){return mo.scale.ordinal().range(zc)},mo.scale.category20=function(){return mo.scale.ordinal().range(Cc)},mo.scale.category20b=function(){return mo.scale.ordinal().range(Dc)},mo.scale.category20c=function(){return mo.scale.ordinal().range(jc)};var zc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(it),Cc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(it),Dc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(it),jc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(it);mo.scale.quantile=function(){return li([],[])},mo.scale.quantize=function(){return si(0,1,[0,1])},mo.scale.threshold=function(){return fi([.5],[0,1])},mo.scale.identity=function(){return hi([0,1])},mo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+Lc,a=u.apply(this,arguments)+Lc,c=(o>a&&(c=o,o=a,a=c),a-o),l=Bo>c?"0":"1",s=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=Hc?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+l+",0 "+n*s+","+n*f+"Z":"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=gi,e=pi,r=di,u=vi;return n.innerRadius=function(e){return arguments.length?(t=pt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=pt(t),n):e},n.startAngle=function(t){return arguments.length?(r=pt(t),n):r},n.endAngle=function(t){return arguments.length?(u=pt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+Lc;return[Math.cos(i)*n,Math.sin(i)*n]},n};var Lc=-Bo/2,Hc=2*Bo-1e-6;mo.svg.line.radial=function(){var n=Ue(mi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},We.reverse=Je,Je.reverse=We,mo.svg.area=function(){return yi(dt)},mo.svg.area.radial=function(){var n=yi(mi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},mo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+Lc,s=l.call(n,u,r)+Lc;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Bo)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=De,o=je,a=Mi,c=di,l=vi;return n.radius=function(t){return arguments.length?(a=pt(t),n):a},n.source=function(t){return arguments.length?(i=pt(t),n):i},n.target=function(t){return arguments.length?(o=pt(t),n):o},n.startAngle=function(t){return arguments.length?(c=pt(t),n):c},n.endAngle=function(t){return arguments.length?(l=pt(t),n):l},n},mo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=De,e=je,r=xi;return n.source=function(e){return arguments.length?(t=pt(e),n):t},n.target=function(t){return arguments.length?(e=pt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},mo.svg.diagonal.radial=function(){var n=mo.svg.diagonal(),t=xi,e=n.projection;return n.projection=function(n){return arguments.length?e(bi(t=n)):t},n},mo.svg.symbol=function(){function n(n,r){return(Fc.get(t.call(this,n,r))||Si)(e.call(this,n,r))}var t=wi,e=_i;return n.type=function(e){return arguments.length?(t=pt(e),n):t},n.size=function(t){return arguments.length?(e=pt(t),n):e},n};var Fc=mo.map({circle:Si,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Yc)),e=t*Yc;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Rc),e=t*Rc/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Rc),e=t*Rc/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});mo.svg.symbolTypes=Fc.keys();var Pc,Oc,Rc=Math.sqrt(3),Yc=Math.tan(30*Go),Ic=[],Uc=0;Ic.call=Ro.call,Ic.empty=Ro.empty,Ic.node=Ro.node,Ic.size=Ro.size,mo.transition=function(n){return arguments.length?Pc?n.transition():n:Uo.transition()},mo.transition.prototype=Ic,Ic.select=function(n){var t,e,r,u=this.id,i=[];n=d(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],l=-1,s=c.length;++l<s;)(r=c[l])&&(e=n.call(r,r.__data__,l,o))?("__data__"in r&&(e.__data__=r.__data__),Ni(e,l,u,r.__transition__[u]),t.push(e)):t.push(null)}return Ei(i,u)},Ic.selectAll=function(n){var t,e,r,u,i,o=this.id,a=[];n=v(n);for(var c=-1,l=this.length;++c<l;)for(var s=this[c],f=-1,h=s.length;++f<h;)if(r=s[f]){i=r.__transition__[o],e=n.call(r,r.__data__,f,c),a.push(t=[]);for(var g=-1,p=e.length;++g<p;)(u=e[g])&&Ni(u,g,o,i),t.push(u)}return Ei(a,o)},Ic.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=k(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a)&&t.push(r)}return Ei(u,this.id)},Ic.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):N(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Ic.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n)) +})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Br:Er,a=mo.ns.qualify(n);return ki(this,"attr."+n,t,a.local?i:u)},Ic.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=mo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Ic.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=_o.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=Er(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return ki(this,"style."+n,t,u)},Ic.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,_o.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Ic.text=function(n){return ki(this,"text",n,Ai)},Ic.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Ic.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=mo.ease.apply(mo,arguments)),N(this,function(e){e.__transition__[t].ease=n}))},Ic.delay=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Ic.duration=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Ic.each=function(n,t){var e=this.id;if(arguments.length<2){var r=Oc,u=Pc;Pc=e,N(this,function(t,r,u){Oc=t.__transition__[e],n.call(t,t.__data__,r,u)}),Oc=r,Pc=u}else N(this,function(r){var u=r.__transition__[e];(u.event||(u.event=mo.dispatch("start","end"))).on(n,t)});return this},Ic.transition=function(){for(var n,t,e,r,u=this.id,i=++Uc,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],l=0,s=t.length;s>l;l++)(e=t[l])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Ni(e,l,i,r)),n.push(e)}return Ei(o,i)},mo.svg.axis=function(){function n(n){n.each(function(){var n,l=mo.select(this),s=null==c?e.ticks?e.ticks.apply(e,a):e.domain():c,f=null==t?e.tickFormat?e.tickFormat.apply(e,a):dt:t,h=l.selectAll(".tick").data(s,e),g=h.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),p=mo.transition(h.exit()).style("opacity",1e-6).remove(),d=mo.transition(h).style("opacity",1),v=Bu(e),m=l.selectAll(".domain").data([0]),y=(m.enter().append("path").attr("class","domain"),mo.transition(m)),M=e.copy(),x=this.__chart__||M;this.__chart__=M,g.append("line"),g.append("text");var b=g.select("line"),_=d.select("line"),w=h.select("text").text(f),S=g.select("text"),E=d.select("text");switch(r){case"bottom":n=Ti,b.attr("y2",u),S.attr("y",Math.max(u,0)+o),_.attr("x2",0).attr("y2",u),E.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+i+"V0H"+v[1]+"V"+i);break;case"top":n=Ti,b.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),_.attr("x2",0).attr("y2",-u),E.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+-i+"V0H"+v[1]+"V"+-i);break;case"left":n=qi,b.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),_.attr("x2",-u).attr("y2",0),E.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),y.attr("d","M"+-i+","+v[0]+"H0V"+v[1]+"H"+-i);break;case"right":n=qi,b.attr("x2",u),S.attr("x",Math.max(u,0)+o),_.attr("x2",u).attr("y2",0),E.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),y.attr("d","M"+i+","+v[0]+"H0V"+v[1]+"H"+i)}if(e.rangeBand){var k=M.rangeBand()/2,A=function(n){return M(n)+k};g.call(n,A),d.call(n,A)}else g.call(n,x),d.call(n,M),p.call(n,M)})}var t,e=mo.scale.linear(),r=Zc,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Vc?t+"":Zc,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Zc="bottom",Vc={top:1,right:1,bottom:1,left:1};mo.svg.brush=function(){function n(i){i.each(function(){var i=mo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(v,dt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Xc[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var s,f=mo.transition(i),h=mo.transition(o);c&&(s=Bu(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),e(f)),l&&(s=Bu(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function r(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==mo.event.keyCode&&(N||(M=null,q[0]-=s[1],q[1]-=h[1],N=2),f())}function g(){32==mo.event.keyCode&&2==N&&(q[0]+=s[1],q[1]+=h[1],N=0,f())}function v(){var n=mo.mouse(b),u=!1;x&&(n[0]+=x[0],n[1]+=x[1]),N||(mo.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),q[0]=s[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),k&&m(n,c,0)&&(e(S),u=!0),A&&m(n,l,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:N?"move":"resize"}))}function m(n,t,e){var r,u,a=Bu(t),c=a[0],l=a[1],f=q[e],g=e?h:s,v=g[1]-g[0];return N&&(c-=f,l-=v+f),r=(e?d:p)?Math.max(c,Math.min(l,n[e])):n[e],N?u=(r+=f)+v:(M&&(f=Math.max(c,Math.min(l,2*M[e]-r))),r>f?(u=r,r=f):u=f),g[0]!=r||g[1]!=u?(e?o=null:i=null,g[0]=r,g[1]=u,!0):void 0}function y(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),mo.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),w({type:"brushend"})}var M,x,b=this,_=mo.select(mo.event.target),w=a.of(b,arguments),S=mo.select(b),E=_.datum(),k=!/^(n|s)$/.test(E)&&c,A=!/^(e|w)$/.test(E)&&l,N=_.classed("extent"),T=L(),q=mo.mouse(b),z=mo.select(_o).on("keydown.brush",u).on("keyup.brush",g);if(mo.event.changedTouches?z.on("touchmove.brush",v).on("touchend.brush",y):z.on("mousemove.brush",v).on("mouseup.brush",y),S.interrupt().selectAll("*").interrupt(),N)q[0]=s[0]-q[0],q[1]=h[0]-q[1];else if(E){var C=+/w$/.test(E),D=+/^n/.test(E);x=[s[1-C]-q[0],h[1-D]-q[1]],q[0]=s[C],q[1]=h[D]}else mo.event.altKey&&(M=q.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),mo.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=g(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],h=[0,0],p=!0,d=!0,v=$c[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:h,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Pc?mo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=kr(s,t.x),r=kr(h,t.y);return i=o=null,function(u){s=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=$c[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,v=$c[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(p=!!t[0],d=!!t[1]):c?p=!!t:l&&(d=!!t),n):c&&l?[p,d]:c?p:l?d:null},n.extent=function(t){var e,r,u,a,f;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(f=e,e=r,r=f),(e!=s[0]||r!=s[1])&&(s=[e,r])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(f=u,u=a,a=f),(u!=h[0]||a!=h[1])&&(h=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(f=e,e=r,r=f))),l&&(o?(u=o[0],a=o[1]):(u=h[0],a=h[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(f=u,u=a,a=f))),c&&l?[[e,u],[r,a]]:c?[e,r]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&h[0]==h[1]},mo.rebind(n,a,"on")};var Xc={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$c=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bc=mo.time={},Wc=Date,Jc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];zi.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Gc.setUTCDate.apply(this._,arguments)},setDay:function(){Gc.setUTCDay.apply(this._,arguments)},setFullYear:function(){Gc.setUTCFullYear.apply(this._,arguments)},setHours:function(){Gc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Gc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Gc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Gc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Gc.setUTCSeconds.apply(this._,arguments)},setTime:function(){Gc.setTime.apply(this._,arguments)}};var Gc=Date.prototype,Kc="%a %b %e %X %Y",Qc="%m/%d/%Y",nl="%H:%M:%S",tl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],el=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],rl=["January","February","March","April","May","June","July","August","September","October","November","December"],ul=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Bc.year=Ci(function(n){return n=Bc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Bc.years=Bc.year.range,Bc.years.utc=Bc.year.utc.range,Bc.day=Ci(function(n){var t=new Wc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Bc.days=Bc.day.range,Bc.days.utc=Bc.day.utc.range,Bc.dayOfYear=function(n){var t=Bc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},Jc.forEach(function(n,t){n=n.toLowerCase(),t=7-t;var e=Bc[n]=Ci(function(n){return(n=Bc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Bc.year(n).getDay();return Math.floor((Bc.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Bc[n+"s"]=e.range,Bc[n+"s"].utc=e.utc.range,Bc[n+"OfYear"]=function(n){var e=Bc.year(n).getDay();return Math.floor((Bc.dayOfYear(n)+(e+t)%7)/7)}}),Bc.week=Bc.sunday,Bc.weeks=Bc.sunday.range,Bc.weeks.utc=Bc.sunday.utc.range,Bc.weekOfYear=Bc.sundayOfYear,Bc.format=ji;var il=Hi(tl),ol=Fi(tl),al=Hi(el),cl=Fi(el),ll=Hi(rl),sl=Fi(rl),fl=Hi(ul),hl=Fi(ul),gl=/^%/,pl={"-":"",_:" ",0:"0"},dl={a:function(n){return el[n.getDay()]},A:function(n){return tl[n.getDay()]},b:function(n){return ul[n.getMonth()]},B:function(n){return rl[n.getMonth()]},c:ji(Kc),d:function(n,t){return Pi(n.getDate(),t,2)},e:function(n,t){return Pi(n.getDate(),t,2)},H:function(n,t){return Pi(n.getHours(),t,2)},I:function(n,t){return Pi(n.getHours()%12||12,t,2)},j:function(n,t){return Pi(1+Bc.dayOfYear(n),t,3)},L:function(n,t){return Pi(n.getMilliseconds(),t,3)},m:function(n,t){return Pi(n.getMonth()+1,t,2)},M:function(n,t){return Pi(n.getMinutes(),t,2)},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n,t){return Pi(n.getSeconds(),t,2)},U:function(n,t){return Pi(Bc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Pi(Bc.mondayOfYear(n),t,2)},x:ji(Qc),X:ji(nl),y:function(n,t){return Pi(n.getFullYear()%100,t,2)},Y:function(n,t){return Pi(n.getFullYear()%1e4,t,4)},Z:ao,"%":function(){return"%"}},vl={a:Oi,A:Ri,b:Zi,B:Vi,c:Xi,d:no,e:no,H:eo,I:eo,j:to,L:io,m:Qi,M:ro,p:oo,S:uo,U:Ii,w:Yi,W:Ui,x:$i,X:Bi,y:Ji,Y:Wi,Z:Gi,"%":co},ml=/^\s*\d+/,yl=mo.map({am:0,pm:1});ji.utc=lo;var Ml=lo("%Y-%m-%dT%H:%M:%S.%LZ");ji.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?so:Ml,so.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},so.toString=Ml.toString,Bc.second=Ci(function(n){return new Wc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Bc.seconds=Bc.second.range,Bc.seconds.utc=Bc.second.utc.range,Bc.minute=Ci(function(n){return new Wc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Bc.minutes=Bc.minute.range,Bc.minutes.utc=Bc.minute.utc.range,Bc.hour=Ci(function(n){var t=n.getTimezoneOffset()/60;return new Wc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Bc.hours=Bc.hour.range,Bc.hours.utc=Bc.hour.utc.range,Bc.month=Ci(function(n){return n=Bc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Bc.months=Bc.month.range,Bc.months.utc=Bc.month.utc.range;var xl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],bl=[[Bc.second,1],[Bc.second,5],[Bc.second,15],[Bc.second,30],[Bc.minute,1],[Bc.minute,5],[Bc.minute,15],[Bc.minute,30],[Bc.hour,1],[Bc.hour,3],[Bc.hour,6],[Bc.hour,12],[Bc.day,1],[Bc.day,2],[Bc.week,1],[Bc.month,1],[Bc.month,3],[Bc.year,1]],_l=[[ji("%Y"),Vt],[ji("%B"),function(n){return n.getMonth()}],[ji("%b %d"),function(n){return 1!=n.getDate()}],[ji("%a %d"),function(n){return n.getDay()&&1!=n.getDate()}],[ji("%I %p"),function(n){return n.getHours()}],[ji("%I:%M"),function(n){return n.getMinutes()}],[ji(":%S"),function(n){return n.getSeconds()}],[ji(".%L"),function(n){return n.getMilliseconds()}]],wl=go(_l);bl.year=Bc.year,Bc.scale=function(){return fo(mo.scale.linear(),bl,wl)};var Sl={range:function(n,t,e){return mo.range(+n,+t,e).map(ho)}},El=bl.map(function(n){return[n[0].utc,n[1]]}),kl=[[lo("%Y"),Vt],[lo("%B"),function(n){return n.getUTCMonth()}],[lo("%b %d"),function(n){return 1!=n.getUTCDate()}],[lo("%a %d"),function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],[lo("%I %p"),function(n){return n.getUTCHours()}],[lo("%I:%M"),function(n){return n.getUTCMinutes()}],[lo(":%S"),function(n){return n.getUTCSeconds()}],[lo(".%L"),function(n){return n.getUTCMilliseconds()}]],Al=go(kl);return El.year=Bc.year.utc,Bc.scale.utc=function(){return fo(mo.scale.linear(),El,Al)},mo.text=vt(function(n){return n.responseText}),mo.json=function(n,t){return mt(n,"application/json",po,t)},mo.html=function(n,t){return mt(n,"text/html",vo,t)},mo.xml=vt(function(n){return n.responseXML}),mo}(); +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/html5shiv.js b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/html5shiv.js @@ -0,0 +1,8 @@ +/* + HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); +a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); +for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document); diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/jquery.min.js b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/jquery.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window); +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/nv.d3.min.js b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/nv.d3.min.js @@ -0,0 +1,6 @@ +(function(){function t(e,t){return(new Date(t,e+1,0)).getDate()}function n(e,t,n){return function(r,i,s){var o=e(r),u=[];o<r&&t(o);if(s>1)while(o<i){var a=new Date(+o);n(a)%s===0&&u.push(a),t(o)}else while(o<i)u.push(new Date(+o)),t(o);return u}}var e=window.nv||{};e.version="1.1.13b",e.dev=!0,window.nv=e,e.tooltip={},e.utils=e.utils||{},e.models={},e.charts={},e.graphs=[],e.logs={},e.dispatch=d3.dispatch("render_start","render_end"),e.dev&&(e.dispatch.on("render_start",function(t){e.logs.startTime=+(new Date)}),e.dispatch.on("render_end",function(t){e.logs.endTime=+(new Date),e.logs.totalTime=e.logs.endTime-e.logs.startTime,e.log("total",e.logs.totalTime)})),e.log=function(){if(e.dev&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(e.dev&&typeof console.log=="function"&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},e.render=function(n){n=n||1,e.render.active=!0,e.dispatch.render_start(),setTimeout(function(){var t,r;for(var i=0;i<n&&(r=e.render.queue[i]);i++)t=r.generate(),typeof r.callback==typeof Function&&r.callback(t),e.graphs.push(t);e.render.queue.splice(0,i),e.render.queue.length?setTimeout(arguments.callee,0):(e.render.active=!1,e.dispatch.render_end())},0)},e.render.active=!1,e.render.queue=[],e.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),e.render.queue.push(t),e.render.active||e.render()},e.identity=function(e){return e},e.strip=function(e){return e.replace(/(\s|&)/g,"")},d3.time.monthEnd=function(e){return new Date(e.getFullYear(),e.getMonth(),0)},d3.time.monthEnds=n(d3.time.monthEnd,function(e){e.setUTCDate(e.getUTCDate()+1),e.setDate(t(e.getMonth()+1,e.getFullYear()))},function(e){return e.getMonth()}),e.interactiveGuideline=function(){"use strict";function c(o){o.each(function(o){function g(){var e=d3.mouse(this),n=e[0],r=e[1],o=!0,a=!1;l&&(n=d3.event.offsetX,r=d3.event.offsetY,d3.event.target.tagName!=="svg"&&(o=!1),d3.event.target.className.baseVal.match("nv-legend")&&(a=!0)),o&&(n-=i.left,r-=i.top);if(n<0||r<0||n>p||r>d||d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined||a){if(l&&d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined&&d3.event.relatedTarget.className.match(t.nvPointerEventsClass))return;u.elementMouseout({mouseX:n,mouseY:r}),c.renderGuideLine(null);return}var f=s.invert(n);u.elementMousemove({mouseX:n,mouseY:r,pointXValue:f}),d3.event.type==="dblclick"&&u.elementDblclick({mouseX:n,mouseY:r,pointXValue:f})}var h=d3.select(this),p=n||960,d=r||400,v=h.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([o]),m=v.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");m.append("g").attr("class","nv-interactiveGuideLine");if(!f)return;f.on("mousemove",g,!0).on("mouseout",g,!0).on("dblclick",g),c.renderGuideLine=function(t){if(!a)return;var n=v.select(".nv-interactiveGuideLine").selectAll("line").data(t!=null?[e.utils.NaNtoZero(t)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",function(e){return e}).attr("x2",function(e){return e}).attr("y1",d).attr("y2",0),n.exit().remove()}})}var t=e.models.tooltip(),n=null,r=null,i={left:0,top:0},s=d3.scale.linear(),o=d3.scale.linear(),u=d3.dispatch("elementMousemove","elementMouseout","elementDblclick"),a=!0,f=null,l=navigator.userAgent.indexOf("MSIE")!==-1;return c.dispatch=u,c.tooltip=t,c.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.left=typeof e.left!="undefined"?e.left:i.left,c):i},c.width=function(e){return arguments.length?(n=e,c):n},c.height=function(e){return arguments.length?(r=e,c):r},c.xScale=function(e){return arguments.length?(s=e,c):s},c.showGuideLine=function(e){return arguments.length?(a=e,c):a},c.svgContainer=function(e){return arguments.length?(f=e,c):f},c},e.interactiveBisect=function(e,t,n){"use strict";if(!e instanceof Array)return null;typeof n!="function"&&(n=function(e,t){return e.x});var r=d3.bisector(n).left,i=d3.max([0,r(e,t)-1]),s=n(e[i],i);typeof s=="undefined"&&(s=i);if(s===t)return i;var o=d3.min([i+1,e.length-1]),u=n(e[o],o);return typeof u=="undefined"&&(u=o),Math.abs(u-t)>=Math.abs(s-t)?i:o},e.nearestValueIndex=function(e,t,n){"use strict";var r=Infinity,i=null;return e.forEach(function(e,s){var o=Math.abs(t-e);o<=r&&o<n&&(r=o,i=s)}),i},function(){"use strict";window.nv.tooltip={},window.nv.models.tooltip=function(){function y(){if(a){var e=d3.select(a);e.node().tagName!=="svg"&&(e=e.select("svg"));var t=e.node()?e.attr("viewBox"):null;if(t){t=t.split(" ");var n=parseInt(e.style("width"))/t[2];l.left=l.left*n,l.top=l.top*n}}}function b(e){var t;a?t=d3.select(a):t=d3.select("body");var n=t.select(".nvtooltip");return n.node()===null&&(n=t.append("div").attr("class","nvtooltip "+(u?u:"xy-tooltip")).attr("id",h)),n.node().innerHTML=e,n.style("top",0).style("left",0).style("opacity",0),n.selectAll("div, table, td, tr").classed(p,!0),n.classed(p,!0),n.node()}function w(){if(!c)return;if(!g(n))return;y();var t=l.left,u=o!=null?o:l.top,h=b(m(n));f=h;if(a){var p=a.getElementsByTagName("svg")[0],d=p?p.getBoundingClientRect():a.getBoundingClientRect(),v={left:0,top:0};if(p){var E=p.getBoundingClientRect(),S=a.getBoundingClientRect(),x=E.top;if(x<0){var T=a.getBoundingClientRect();x=Math.abs(x)>T.height?0:x}v.top=Math.abs(x-S.top),v.left=Math.abs(E.left-S.left)}t+=a.offsetLeft+v.left-2*a.scrollLeft,u+=a.offsetTop+v.top-2*a.scrollTop}return s&&s>0&&(u=Math.floor(u/s)*s),e.tooltip.calcTooltipPosition([t,u],r,i,h),w}var t=null,n=null,r="w",i=50,s=25,o=null,u=null,a=null,f=null,l={left:null,top:null},c=!0,h="nvtooltip-"+Math.floor(Math.random()*1e5),p="nv-pointer-events-none",d=function(e,t){return e},v=function(e){return e},m=function(e){if(t!=null)return t;if(e==null)return"";var n=d3.select(document.createElement("table")),r=n.selectAll("thead").data([e]).enter().append("thead");r.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(v(e.value));var i=n.selectAll("tbody").data([e]).enter().append("tbody"),s=i.selectAll("tr").data(function(e){return e.series}).enter().append("tr").classed("highlight",function(e){return e.highlight});s.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(e){return e.color}),s.append("td").classed("key",!0).html(function(e){return e.key}),s.append("td").classed("value",!0).html(function(e,t){return d(e.value,t)}),s.selectAll("td").each(function(e){if(e.highlight){var t=d3.scale.linear().domain([0,1]).range(["#fff",e.color]),n=.6;d3.select(this).style("border-bottom-color",t(n)).style("border-top-color",t(n))}});var o=n.node().outerHTML;return e.footer!==undefined&&(o+="<div class='footer'>"+e.footer+"</div>"),o},g=function(e){return e&&e.series&&e.series.length>0?!0:!1};return w.nvPointerEventsClass=p,w.content=function(e){return arguments.length?(t=e,w):t},w.tooltipElem=function(){return f},w.contentGenerator=function(e){return arguments.length?(typeof e=="function"&&(m=e),w):m},w.data=function(e){return arguments.length?(n=e,w):n},w.gravity=function(e){return arguments.length?(r=e,w):r},w.distance=function(e){return arguments.length?(i=e,w):i},w.snapDistance=function(e){return arguments.length?(s=e,w):s},w.classes=function(e){return arguments.length?(u=e,w):u},w.chartContainer=function(e){return arguments.length?(a=e,w):a},w.position=function(e){return arguments.length?(l.left=typeof e.left!="undefined"?e.left:l.left,l.top=typeof e.top!="undefined"?e.top:l.top,w):l},w.fixedTop=function(e){return arguments.length?(o=e,w):o},w.enabled=function(e){return arguments.length?(c=e,w):c},w.valueFormatter=function(e){return arguments.length?(typeof e=="function"&&(d=e),w):d},w.headerFormatter=function(e){return arguments.length?(typeof e=="function"&&(v=e),w):v},w.id=function(){return h},w},e.tooltip.show=function(t,n,r,i,s,o){var u=document.createElement("div");u.className="nvtooltip "+(o?o:"xy-tooltip");var a=s;if(!s||s.tagName.match(/g|svg/i))a=document.getElementsByTagName("body")[0];u.style.left=0,u.style.top=0,u.style.opacity=0,u.innerHTML=n,a.appendChild(u),s&&(t[0]=t[0]-s.scrollLeft,t[1]=t[1]-s.scrollTop),e.tooltip.calcTooltipPosition(t,r,i,u)},e.tooltip.findFirstNonSVGParent=function(e){while(e.tagName.match(/^g|svg$/i)!==null)e=e.parentNode;return e},e.tooltip.findTotalOffsetTop=function(e,t){var n=t;do isNaN(e.offsetTop)||(n+=e.offsetTop);while(e=e.offsetParent);return n},e.tooltip.findTotalOffsetLeft=function(e,t){var n=t;do isNaN(e.offsetLeft)||(n+=e.offsetLeft);while(e=e.offsetParent);return n},e.tooltip.calcTooltipPosition=function(t,n,r,i){var s=parseInt(i.offsetHeight),o=parseInt(i.offsetWidth),u=e.utils.windowSize().width,a=e.utils.windowSize().height,f=window.pageYOffset,l=window.pageXOffset,c,h;a=window.innerWidth>=document.body.scrollWidth?a:a-16,u=window.innerHeight>=document.body.scrollHeight?u:u-16,n=n||"s",r=r||20;var p=function(t){return e.tooltip.findTotalOffsetTop(t,h)},d=function(t){return e.tooltip.findTotalOffsetLeft(t,c)};switch(n){case"e":c=t[0]-o-r,h=t[1]-s/2;var v=d(i),m=p(i);v<l&&(c=t[0]+r>l?t[0]+r:l-v+c),m<f&&(h=f-m+h),m+s>f+a&&(h=f+a-m+h-s);break;case"w":c=t[0]+r,h=t[1]-s/2;var v=d(i),m=p(i);v+o>u&&(c=t[0]-o-r),m<f&&(h=f+5),m+s>f+a&&(h=f+a-m+h-s);break;case"n":c=t[0]-o/2-5,h=t[1]+r;var v=d(i),m=p(i);v<l&&(c=l+5),v+o>u&&(c=c-o/2+5),m+s>f+a&&(h=f+a-m+h-s);break;case"s":c=t[0]-o/2,h=t[1]-s-r;var v=d(i),m=p(i);v<l&&(c=l+5),v+o>u&&(c=c-o/2+5),f>m&&(h=f);break;case"none":c=t[0],h=t[1]-r;var v=d(i),m=p(i)}return i.style.left=c+"px",i.style.top=h+"px",i.style.opacity=1,i.style.position="absolute",i},e.tooltip.cleanup=function(){var e=document.getElementsByClassName("nvtooltip"),t=[];while(e.length)t.push(e[0]),e[0].style.transitionDelay="0 !important",e[0].style.opacity=0,e[0].className="nvtooltip-pending-removal";setTimeout(function(){while(t.length){var e=t.pop();e.parentNode.removeChild(e)}},500)}}(),e.utils.windowSize=function(){var e={width:640,height:480};return document.body&&document.body.offsetWidth&&(e.width=document.body.offsetWidth,e.height=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(e.width=document.documentElement.offsetWidth,e.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(e.width=window.innerWidth,e.height=window.innerHeight),e},e.utils.windowResize=function(e){if(e===undefined)return;var t=window.onresize;window.onresize=function(n){typeof t=="function"&&t(n),e(n)}},e.utils.getColor=function(t){return arguments.length?Object.prototype.toString.call(t)==="[object Array]"?function(e,n){return e.color||t[n%t.length]}:t:e.utils.defaultColor()},e.utils.defaultColor=function(){var e=d3.scale.category20().range();return function(t,n){return t.color||e[n%e.length]}},e.utils.customTheme=function(e,t,n){t=t||function(e){return e.key},n=n||d3.scale.category20().range();var r=n.length;return function(i,s){var o=t(i);return r||(r=n.length),typeof e[o]!="undefined"?typeof e[o]=="function"?e[o]():e[o]:n[--r]}},e.utils.pjax=function(t,n){function r(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),e.utils.pjax(t,n)})}d3.selectAll(t).on("click",function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})},e.utils.calcApproxTextWidth=function(e){if(e instanceof d3.selection){var t=parseInt(e.style("font-size").replace("px","")),n=e.text().length;return n*t*.5}return 0},e.utils.NaNtoZero=function(e){return typeof e!="number"||isNaN(e)||e===null||e===Infinity?0:e},e.utils.optionsFunc=function(e){return e&&d3.map(e).forEach(function(e,t){typeof this[e]=="function"&&this[e](t)}.bind(this)),this},e.models.axis=function(){"use strict";function m(e){return e.each(function(e){var i=d3.select(this),m=i.selectAll("g.nv-wrap.nv-axis").data([e]),g=m.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),y=g.append("g"),b=m.select("g");p!==null?t.ticks(p):(t.orient()=="top"||t.orient()=="bottom")&&t.ticks(Math.abs(s.range()[1]-s.range()[0])/100),b.transition().call(t),v=v||t.scale();var w=t.tickFormat();w==null&&(w=v.tickFormat());var E=b.selectAll("text.nv-axislabel").data([o||null]);E.exit().remove();switch(t.orient()){case"top":E.enter().append("text").attr("class","nv-axislabel");var S=s.range().length==2?s.range()[1]:s.range()[s.range().length-1]+(s.range()[1]-s.range()[0]);E.attr("text-anchor","middle").attr("y",0).attr("x",S/2);if(u){var x=m.selectAll("g.nv-axisMaxMin").data(s.domain());x.enter().append("g").attr("class","nv-axisMaxMin").append("text"),x.exit().remove(),x.attr("transform",function(e,t){return"translate("+s(e)+",0)"}).select("text").attr("dy","0em").attr("y",-t.tickPadding()).attr("text-anchor","middle").text(function(e,t){var n=w(e);return(""+n).match("NaN")?"":n}),x.transition().attr("transform",function(e,t){return"translate("+s.range()[t]+",0)"})}break;case"bottom":var T=36,N=30,C=b.selectAll("g").select("text");if(f%360){C.each(function(e,t){var n=this.getBBox().width;n>N&&(N=n)});var k=Math.abs(Math.sin(f*Math.PI/180)),T=(k?k*N:N)+30;C.attr("transform",function(e,t,n){return"rotate("+f+" 0,0)"}).style("text-anchor",f%360>0?"start":"end")}E.enter().append("text").attr("class","nv-axislabel");var S=s.range().length==2?s.range()[1]:s.range()[s.range().length-1]+(s.range()[1]-s.range()[0]);E.attr("text-anchor","middle").attr("y",T).attr("x",S/2);if(u){var x=m.selectAll("g.nv-axisMaxMin").data([s.domain()[0],s.domain()[s.domain().length-1]]);x.enter().append("g").attr("class","nv-axisMaxMin").append("text"),x.exit().remove(),x.attr("transform",function(e,t){return"translate("+(s(e)+(h?s.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",t.tickPadding()).attr("transform",function(e,t,n){return"rotate("+f+" 0,0)"}).style("text-anchor",f?f%360>0?"start":"end":"middle").text(function(e,t){var n=w(e);return(""+n).match("NaN")?"":n}),x.transition().attr("transform",function(e,t){return"translate("+(s(e)+(h?s.rangeBand()/2:0))+",0)"})}c&&C.attr("transform",function(e,t){return"translate(0,"+(t%2==0?"0":"12")+")"});break;case"right":E.enter().append("text").attr("class","nv-axislabel"),E.style("text-anchor",l?"middle":"begin").attr("transform",l?"rotate(90)":"").attr("y",l?-Math.max(n.right,r)+12:-10).attr("x",l?s.range()[0]/2:t.tickPadding());if(u){var x=m.selectAll("g.nv-axisMaxMin").data(s.domain());x.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(e,t){return"translate(0,"+s(e)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",t.tickPadding()).style("text-anchor","start").text(function(e,t){var n=w(e);return(""+n).match("NaN")?"":n}),x.transition().attr("transform",function(e,t){return"translate(0,"+s.range()[t]+")"}).select("text").style("opacity",1)}break;case"left":E.enter().append("text").attr("class","nv-axislabel"),E.style("text-anchor",l?"middle":"end").attr("transform",l?"rotate(-90)":"").attr("y",l?-Math.max(n.left,r)+d:-10).attr("x",l?-s.range()[0]/2:-t.tickPadding());if(u){var x=m.selectAll("g.nv-axisMaxMin").data(s.domain());x.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),x.exit().remove(),x.attr("transform",function(e,t){return"translate(0,"+v(e)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-t.tickPadding()).attr("text-anchor","end").text(function(e,t){var n=w(e);return(""+n).match("NaN")?"":n}),x.transition().attr("transform",function(e,t){return"translate(0,"+s.range()[t]+")"}).select("text").style("opacity",1)}}E.text(function(e){return e}),u&&(t.orient()==="left"||t.orient()==="right")&&(b.selectAll("g").each(function(e,t){d3.select(this).select("text").attr("opacity",1);if(s(e)<s.range()[1]+10||s(e)>s.range()[0]-10)(e>1e-10||e<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0)}),s.domain()[0]==s.domain()[1]&&s.domain()[0]==0&&m.selectAll("g.nv-axisMaxMin").style("opacity",function(e,t){return t?0:1}));if(u&&(t.orient()==="top"||t.orient()==="bottom")){var L=[];m.selectAll("g.nv-axisMaxMin").each(function(e,t){try{t?L.push(s(e)-this.getBBox().width-4):L.push(s(e)+this.getBBox().width+4)}catch(n){t?L.push(s(e)-4):L.push(s(e)+4)}}),b.selectAll("g").each(function(e,t){if(s(e)<L[0]||s(e)>L[1])e>1e-10||e<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove()})}a&&b.selectAll(".tick").filter(function(e){return!parseFloat(Math.round(e.__data__*1e5)/1e6)&&e.__data__!==undefined}).classed("zero",!0),v=s.copy()}),m}var t=d3.svg.axis(),n={top:0,right:0,bottom:0,left:0},r=75,i=60,s=d3.scale.linear(),o=null,u=!0,a=!0,f=0,l=!0,c=!1,h=!1,p=null,d=12;t.scale(s).orient("bottom").tickFormat(function(e){return e});var v;return m.axis=t,d3.rebind(m,t,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(m,s,"domain","range","rangeBand","rangeBands"),m.options=e.utils.optionsFunc.bind(m),m.margin=function(e){return arguments.length?(n.top=typeof e.top!="undefined"?e.top:n.top,n.right=typeof e.right!="undefined"?e.right:n.right,n.bottom=typeof e.bottom!="undefined"?e.bottom:n.bottom,n.left=typeof e.left!="undefined"?e.left:n.left,m):n},m.width=function(e){return arguments.length?(r=e,m):r},m.ticks=function(e){return arguments.length?(p=e,m):p},m.height=function(e){return arguments.length?(i=e,m):i},m.axisLabel=function(e){return arguments.length?(o=e,m):o},m.showMaxMin=function(e){return arguments.length?(u=e,m):u},m.highlightZero=function(e){return arguments.length?(a=e,m):a},m.scale=function(e){return arguments.length?(s=e,t.scale(s),h=typeof s.rangeBands=="function",d3.rebind(m,s,"domain","range","rangeBand","rangeBands"),m):s},m.rotateYLabel=function(e){return arguments.length?(l=e,m):l},m.rotateLabels=function(e){return arguments.length?(f=e,m):f},m.staggerLabels=function(e){return arguments.length?(c=e,m):c},m.axisLabelDistance=function(e){return arguments.length?(d=e,m):d},m},e.models.bullet=function(){"use strict";function m(e){return e.each(function(e,n){var p=c-t.left-t.right,m=h-t.top-t.bottom,g=d3.select(this),y=i.call(this,e,n).slice().sort(d3.descending),b=s.call(this,e,n).slice().sort(d3.descending),w=o.call(this,e,n).slice().sort(d3.descending),E=u.call(this,e,n).slice(),S=a.call(this,e,n).slice(),x=f.call(this,e,n).slice(),T=d3.scale.linear().domain(d3.extent(d3.merge([l,y]))).range(r?[p,0]:[0,p]),N=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(T.range());this.__chart__=T;var C=d3.min(y),k=d3.max(y),L=y[1],A=g.selectAll("g.nv-wrap.nv-bullet").data([e]),O=A.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),M=O.append("g"),_=A.select("g");M.append("rect").attr("class","nv-range nv-rangeMax"),M.append("rect").attr("class","nv-range nv-rangeAvg"),M.append("rect").attr("class","nv-range nv-rangeMin"),M.append("rect").attr("class","nv-measure"),M.append("path").attr("class","nv-markerTriangle"),A.attr("transform","translate("+t.left+","+t.top+")");var D=function(e){return Math.abs(N(e)-N(0))},P=function(e){return Math.abs(T(e)-T(0))},H=function(e){return e<0?N(e):N(0)},B=function(e){return e<0?T(e):T(0)};_.select("rect.nv-rangeMax").attr("height",m).attr("width",P(k>0?k:C)).attr("x",B(k>0?k:C)).datum(k>0?k:C),_.select("rect.nv-rangeAvg").attr("height",m).attr("width",P(L)).attr("x",B(L)).datum(L),_.select("rect.nv-rangeMin").attr("height",m).attr("width",P(k)).attr("x",B(k)).attr("width",P(k>0?C:k)).attr("x",B(k>0?C:k)).datum(k>0?C:k),_.select("rect.nv-measure").style("fill",d).attr("height",m/3).attr("y",m/3).attr("width",w<0?T(0)-T(w[0]):T(w[0])-T(0)).attr("x",B(w)).on("mouseover",function(){v.elementMouseover({value:w[0],label:x[0]||"Current",pos:[T(w[0]),m/2]})}).on("mouseout",function(){v.elementMouseout({value:w[0],label:x[0]||"Current"})});var j=m/6;b[0]?_.selectAll("path.nv-markerTriangle").attr("transform",function(e){return"translate("+T(b[0])+","+m/2+")"}).attr("d","M0,"+j+"L"+j+","+ -j+" "+ -j+","+ -j+"Z").on("mouseover",function(){v.elementMouseover({value:b[0],label:S[0]||"Previous",pos:[T(b[0]),m/2]})}).on("mouseout",function(){v.elementMouseout({value:b[0],label:S[0]||"Previous"})}):_.selectAll("path.nv-markerTriangle").remove(),A.selectAll(".nv-range").on("mouseover",function(e,t){var n=E[t]||(t?t==1?"Mean":"Minimum":"Maximum");v.elementMouseover({value:e,label:n,pos:[T(e),m/2]})}).on("mouseout",function(e,t){var n=E[t]||(t?t==1?"Mean":"Minimum":"Maximum");v.elementMouseout({value:e,label:n})})}),m}var t={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(e){return e.ranges},s=function(e){return e.markers},o=function(e){return e.measures},u=function(e){return e.rangeLabels?e.rangeLabels:[]},a=function(e){return e.markerLabels?e.markerLabels:[]},f=function(e){return e.measureLabels?e.measureLabels:[]},l=[0],c=380,h=30,p=null,d=e.utils.getColor(["#1f77b4"]),v=d3.dispatch("elementMouseover","elementMouseout");return m.dispatch=v,m.options=e.utils.optionsFunc.bind(m),m.orient=function(e){return arguments.length?(n=e,r=n=="right"||n=="bottom",m):n},m.ranges=function(e){return arguments.length?(i=e,m):i},m.markers=function(e){return arguments.length?(s=e,m):s},m.measures=function(e){return arguments.length?(o=e,m):o},m.forceX=function(e){return arguments.length?(l=e,m):l},m.width=function(e){return arguments.length?(c=e,m):c},m.height=function(e){return arguments.length?(h=e,m):h},m.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,m):t},m.tickFormat=function(e){return arguments.length?(p=e,m):p},m.color=function(t){return arguments.length?(d=e.utils.getColor(t),m):d},m},e.models.bulletChart=function(){"use strict";function m(e){return e.each(function(n,h){var g=d3.select(this),y=(a||parseInt(g.style("width"))||960)-i.left-i.right,b=f-i.top-i.bottom,w=this;m.update=function(){m(e)},m.container=this;if(!n||!s.call(this,n,h)){var E=g.selectAll(".nv-noData").data([p]);return E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),E.attr("x",i.left+y/2).attr("y",18+i.top+b/2).text(function(e){return e}),m}g.selectAll(".nv-noData").remove();var S=s.call(this,n,h).slice().sort(d3.descending),x=o.call(this,n,h).slice().sort(d3.descending),T=u.call(this,n,h).slice().sort(d3.descending),N=g.selectAll("g.nv-wrap.nv-bulletChart").data([n]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),k=C.append("g"),L=N.select("g");k.append("g").attr("class","nv-bulletWrap"),k.append("g").attr("class","nv-titles"),N.attr("transform","translate("+i.left+","+i.top+")");var A=d3.scale.linear().domain([0,Math.max(S[0],x[0],T[0])]).range(r?[y,0]:[0,y]),O=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(A.range());this.__chart__=A;var M=function(e){return Math.abs(O(e)-O(0))},_=function(e){return Math.abs(A(e)-A(0))},D=k.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(f-i.top-i.bottom)/2+")");D.append("text").attr("class","nv-title").text(function(e){return e.title}),D.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(e){return e.subtitle}),t.width(y).height(b);var P=L.select(".nv-bulletWrap");d3.transition(P).call(t);var H=l||A.tickFormat(y/100),B=L.selectAll("g.nv-tick").data(A.ticks(y/50),function(e){return this.textContent||H(e)}),j=B.enter().append("g").attr("class","nv-tick").attr("transform",function(e){return"translate("+O(e)+",0)"}).style("opacity",1e-6);j.append("line").attr("y1",b).attr("y2",b*7/6),j.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",b*7/6).text(H);var F=d3.transition(B).attr("transform",function(e){return"translate("+A(e)+",0)"}).style("opacity",1);F.select("line").attr("y1",b).attr("y2",b*7/6),F.select("text").attr("y",b*7/6),d3.transition(B.exit()).attr("transform",function(e){return"translate("+A(e)+",0)"}).style("opacity",1e-6).remove(),d.on("tooltipShow",function(e){e.key=n.title,c&&v(e,w.parentNode)})}),d3.timer.flush(),m}var t=e.models.bullet(),n="left",r=!1,i={top:5,right:40,bottom:20,left:120},s=function(e){return e.ranges},o=function(e){return e.markers},u=function(e){return e.measures},a=null,f=55,l=null,c=!0,h=function(e,t,n,r,i){return"<h3>"+t+"</h3>"+"<p>"+n+"</p>"},p="No Data Available.",d=d3.dispatch("tooltipShow","tooltipHide"),v=function(t,n){var r=t.pos[0]+(n.offsetLeft||0)+i.left,s=t.pos[1]+(n.offsetTop||0)+i.top,o=h(t.key,t.label,t.value,t,m);e.tooltip.show([r,s],o,t.value<0?"e":"w",null,n)};return t.dispatch.on("elementMouseover.tooltip",function(e){d.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){d.tooltipHide(e)}),d.on("tooltipHide",function(){c&&e.tooltip.cleanup()}),m.dispatch=d,m.bullet=t,d3.rebind(m,t,"color"),m.options=e.utils.optionsFunc.bind(m),m.orient=function(e){return arguments.length?(n=e,r=n=="right"||n=="bottom",m):n},m.ranges=function(e){return arguments.length?(s=e,m):s},m.markers=function(e){return arguments.length?(o=e,m):o},m.measures=function(e){return arguments.length?(u=e,m):u},m.width=function(e){return arguments.length?(a=e,m):a},m.height=function(e){return arguments.length?(f=e,m):f},m.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.right=typeof e.right!="undefined"?e.right:i.right,i.bottom=typeof e.bottom!="undefined"?e.bottom:i.bottom,i.left=typeof e.left!="undefined"?e.left:i.left,m):i},m.tickFormat=function(e){return arguments.length?(l=e,m):l},m.tooltips=function(e){return arguments.length?(c=e,m):c},m.tooltipContent=function(e){return arguments.length?(h=e,m):h},m.noData=function(e){return arguments.length?(p=e,m):p},m},e.models.cumulativeLineChart=function(){"use strict";function _(b){return b.each(function(b){function q(e,t){d3.select(_.container).style("cursor","ew-resize")}function R(e,t){O.x=d3.event.x,O.i=Math.round(A.invert(O.x)),rt()}function U(e,t){d3.select(_.container).style("cursor","auto"),x.index=O.i,k.stateChange(x)}function rt(){nt.data([O]);var e=_.transitionDuration();_.transitionDuration(0),_.update(),_.transitionDuration(e)}var P=d3.select(this).classed("nv-chart-"+S,!0),H=this,B=(f||parseInt(P.style("width"))||960)-u.left-u.right,j=(l||parseInt(P.style("height"))||400)-u.top-u.bottom;_.update=function(){P.transition().duration(L).call(_)},_.container=this,x.disabled=b.map(function(e){return!!e.disabled});if(!T){var F;T={};for(F in x)x[F]instanceof Array?T[F]=x[F].slice(0):T[F]=x[F]}var I=d3.behavior.drag().on("dragstart",q).on("drag",R).on("dragend",U);if(!b||!b.length||!b.filter(function(e){return e.values.length}).length){var z=P.selectAll(".nv-noData").data([N]);return z.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),z.attr("x",u.left+B/2).attr("y",u.top+j/2).text(function(e){return e}),_}P.selectAll(".nv-noData").remove(),w=t.xScale(),E=t.yScale();if(!y){var W=b.filter(function(e){return!e.disabled}).map(function(e,n){var r=d3.extent(e.values,t.y());return r[0]<-0.95&&(r[0]=-0.95),[(r[0]-r[1])/(1+r[1]),(r[1]-r[0])/(1+r[0])]}),X=[d3.min(W,function(e){return e[0]}),d3.max(W,function(e){return e[1]})];t.yDomain(X)}else t.yDomain(null);A.domain([0,b[0].values.length-1]).range([0,B]).clamp(!0);var b=D(O.i,b),V=g?"none":"all",$=P.selectAll("g.nv-wrap.nv-cumulativeLine").data([b]),J=$.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),K=$.select("g");J.append("g").attr("class","nv-interactive"),J.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),J.append("g").attr("class","nv-y nv-axis"),J.append("g").attr("class","nv-background"),J.append("g").attr("class","nv-linesWrap").style("pointer-events",V),J.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),J.append("g").attr("class","nv-legendWrap"),J.append("g").attr("class","nv-controlsWrap"),c&&(i.width(B),K.select(".nv-legendWrap").datum(b).call(i),u.top!=i.height()&&(u.top=i.height(),j=(l||parseInt(P.style("height"))||400)-u.top-u.bottom),K.select(".nv-legendWrap").attr("transform","translate(0,"+ -u.top+")"));if(m){var Q=[{key:"Re-scale y-axis",disabled:!y}];s.width(140).color(["#444","#444","#444"]),K.select(".nv-controlsWrap").datum(Q).attr("transform","translate(0,"+ -u.top+")").call(s)}$.attr("transform","translate("+u.left+","+u.top+")"),d&&K.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)");var G=b.filter(function(e){return e.tempDisabled});$.select(".tempDisabled").remove(),G.length&&$.append("text").attr("class","tempDisabled").attr("x",B/2).attr("y","-.71em").style("text-anchor","end").text(G.map(function(e){return e.key}).join(", ")+" values cannot be calculated for this time period."),g&&(o.width(B).height(j).margin({left:u.left,top:u.top}).svgContainer(P).xScale(w),$.select(".nv-interactive").call(o)),J.select(".nv-background").append("rect"),K.select(".nv-background rect").attr("width",B).attr("height",j),t.y(function(e){return e.display.y}).width(B).height(j).color(b.map(function(e,t){return e.color||a(e,t)}).filter(function(e,t){return!b[t].disabled&&!b[t].tempDisabled}));var Y=K.select(".nv-linesWrap").datum(b.filter(function(e){return!e.disabled&&!e.tempDisabled}));Y.call(t),b.forEach(function(e,t){e.seriesIndex=t});var Z=b.filter(function(e){return!e.disabled&&!!C(e)}),et=K.select(".nv-avgLinesWrap").selectAll("line").data(Z,function(e){return e.key}),tt=function(e){var t=E(C(e));return t<0?0:t>j?j:t};et.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(e,n){return t.color()(e,e.seriesIndex)}).attr("x1",0).attr("x2",B).attr("y1",tt).attr("y2",tt),et.style("stroke-opacity",function(e){var t=E(C(e));return t<0||t>j?0:1}).attr("x1",0).attr("x2",B).attr("y1",tt).attr("y2",tt),et.exit().remove();var nt=Y.selectAll(".nv-indexLine").data([O]);nt.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(I),nt.attr("transform",function(e){return"translate("+A(e.i)+",0)"}).attr("height",j),h&&(n.scale(w).ticks(Math.min(b[0].values.length,B/70)).tickSize(-j,0),K.select(".nv-x.nv-axis").attr("transform","translate(0,"+E.range()[0]+")"),d3.transition(K.select(".nv-x.nv-axis")).call(n)),p&&(r.scale(E).ticks(j/36).tickSize(-B,0),d3.transition(K.select(".nv-y.nv-axis")).call(r)),K.select(".nv-background rect").on("click",function(){O.x=d3.mouse(this)[0],O.i=Math.round(A.invert(O.x)),x.index=O.i,k.stateChange(x),rt()}),t.dispatch.on("elementClick",function(e){O.i=e.pointIndex,O.x=A(O.i),x.index=O.i,k.stateChange(x),rt()}),s.dispatch.on("legendClick",function(e,t){e.disabled=!e.disabled,y=!e.disabled,x.rescaleY=y,k.stateChange(x),_.update()}),i.dispatch.on("stateChange",function(e){x.disabled=e.disabled,k.stateChange(x),_.update()}),o.dispatch.on("elementMousemove",function(i){t.clearHighlights();var s,f,l,c=[];b.filter(function(e,t){return e.seriesIndex=t,!e.disabled}).forEach(function(n,r){f=e.interactiveBisect(n.values,i.pointXValue,_.x()),t.highlightPoint(r,f,!0);var o=n.values[f];if(typeof o=="undefined")return;typeof s=="undefined"&&(s=o),typeof l=="undefined"&&(l=_.xScale()(_.x()(o,f))),c.push({key:n.key,value:_.y()(o,f),color:a(n,n.seriesIndex)})});if(c.length>2){var h=_.yScale().invert(i.mouseY),p=Math.abs(_.yScale().domain()[0]-_.yScale().domain()[1]),d=.03*p,m=e.nearestValueIndex(c.map(function(e){return e.value}),h,d);m!==null&&(c[m].highlight=!0)}var g=n.tickFormat()(_.x()(s,f),f);o.tooltip.position({left:l+u.left,top:i.mouseY+u.top}).chartContainer(H.parentNode).enabled(v).valueFormatter(function(e,t){return r.tickFormat()(e)}).data({value:g,series:c})(),o.renderGuideLine(l)}),o.dispatch.on("elementMouseout",function(e){k.tooltipHide(),t.clearHighlights()}),k.on("tooltipShow",function(e){v&&M(e,H.parentNode)}),k.on("changeState",function(e){typeof e.disabled!="undefined"&&(b.forEach(function(t,n){t.disabled=e.disabled[n]}),x.disabled=e.disabled),typeof e.index!="undefined"&&(O.i=e.index,O.x=A(O.i),x.index=e.index,nt.data([O])),typeof e.rescaleY!="undefined"&&(y=e.rescaleY),_.update()})}),_}function D(e,n){return n.map(function(n,r){if(!n.values)return n;var i=t.y()(n.values[e],e);return i<-0.95?(n.tempDisabled=!0,n):(n.tempDisabled=!1,n.values=n.values.map(function(e,n){return e.display={y:(t.y()(e,n)-i)/(1+i)},e}),n)})}var t=e.models.line(),n=e.models +.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o=e.interactiveGuideline(),u={top:30,right:30,bottom:50,left:60},a=e.utils.defaultColor(),f=null,l=null,c=!0,h=!0,p=!0,d=!1,v=!0,m=!0,g=!1,y=!0,b=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},w,E,S=t.id(),x={index:0,rescaleY:y},T=null,N="No Data Available.",C=function(e){return e.average},k=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),L=250;n.orient("bottom").tickPadding(7),r.orient(d?"right":"left"),s.updateState(!1);var A=d3.scale.linear(),O={i:0,x:0},M=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=b(i.series.key,a,f,i,_);e.tooltip.show([o,u],l,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+u.left,e.pos[1]+u.top],k.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){k.tooltipHide(e)}),k.on("tooltipHide",function(){v&&e.tooltip.cleanup()}),_.dispatch=k,_.lines=t,_.legend=i,_.xAxis=n,_.yAxis=r,_.interactiveLayer=o,d3.rebind(_,t,"defined","isArea","x","y","xScale","yScale","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id"),_.options=e.utils.optionsFunc.bind(_),_.margin=function(e){return arguments.length?(u.top=typeof e.top!="undefined"?e.top:u.top,u.right=typeof e.right!="undefined"?e.right:u.right,u.bottom=typeof e.bottom!="undefined"?e.bottom:u.bottom,u.left=typeof e.left!="undefined"?e.left:u.left,_):u},_.width=function(e){return arguments.length?(f=e,_):f},_.height=function(e){return arguments.length?(l=e,_):l},_.color=function(t){return arguments.length?(a=e.utils.getColor(t),i.color(a),_):a},_.rescaleY=function(e){return arguments.length?(y=e,_):y},_.showControls=function(e){return arguments.length?(m=e,_):m},_.useInteractiveGuideline=function(e){return arguments.length?(g=e,e===!0&&(_.interactive(!1),_.useVoronoi(!1)),_):g},_.showLegend=function(e){return arguments.length?(c=e,_):c},_.showXAxis=function(e){return arguments.length?(h=e,_):h},_.showYAxis=function(e){return arguments.length?(p=e,_):p},_.rightAlignYAxis=function(e){return arguments.length?(d=e,r.orient(e?"right":"left"),_):d},_.tooltips=function(e){return arguments.length?(v=e,_):v},_.tooltipContent=function(e){return arguments.length?(b=e,_):b},_.state=function(e){return arguments.length?(x=e,_):x},_.defaultState=function(e){return arguments.length?(T=e,_):T},_.noData=function(e){return arguments.length?(N=e,_):N},_.average=function(e){return arguments.length?(C=e,_):C},_.transitionDuration=function(e){return arguments.length?(L=e,_):L},_},e.models.discreteBar=function(){"use strict";function E(e){return e.each(function(e){var i=n-t.left-t.right,E=r-t.top-t.bottom,S=d3.select(this);e=e.map(function(e,t){return e.values=e.values.map(function(e){return e.series=t,e}),e});var T=p&&d?[]:e.map(function(e){return e.values.map(function(e,t){return{x:u(e,t),y:a(e,t),y0:e.y0}})});s.domain(p||d3.merge(T).map(function(e){return e.x})).rangeBands(v||[0,i],.1),o.domain(d||d3.extent(d3.merge(T).map(function(e){return e.y}).concat(f))),c?o.range(m||[E-(o.domain()[0]<0?12:0),o.domain()[1]>0?12:0]):o.range(m||[E,0]),b=b||s,w=w||o.copy().range([o(0),o(0)]);var N=S.selectAll("g.nv-wrap.nv-discretebar").data([e]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),k=C.append("g"),L=N.select("g");k.append("g").attr("class","nv-groups"),N.attr("transform","translate("+t.left+","+t.top+")");var A=N.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e){return e.key});A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),A.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),A.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}),A.transition().style("stroke-opacity",1).style("fill-opacity",.75);var O=A.selectAll("g.nv-bar").data(function(e){return e.values});O.exit().remove();var M=O.enter().append("g").attr("transform",function(e,t,n){return"translate("+(s(u(e,t))+s.rangeBand()*.05)+", "+o(0)+")"}).on("mouseover",function(t,n){d3.select(this).classed("hover",!0),g.elementMouseover({value:a(t,n),point:t,series:e[t.series],pos:[s(u(t,n))+s.rangeBand()*(t.series+.5)/e.length,o(a(t,n))],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),g.elementMouseout({value:a(t,n),point:t,series:e[t.series],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("click",function(t,n){g.elementClick({value:a(t,n),point:t,series:e[t.series],pos:[s(u(t,n))+s.rangeBand()*(t.series+.5)/e.length,o(a(t,n))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(t,n){g.elementDblClick({value:a(t,n),point:t,series:e[t.series],pos:[s(u(t,n))+s.rangeBand()*(t.series+.5)/e.length,o(a(t,n))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()});M.append("rect").attr("height",0).attr("width",s.rangeBand()*.9/e.length),c?(M.append("text").attr("text-anchor","middle"),O.select("text").text(function(e,t){return h(a(e,t))}).transition().attr("x",s.rangeBand()*.9/2).attr("y",function(e,t){return a(e,t)<0?o(a(e,t))-o(0)+12:-4})):O.selectAll("text").remove(),O.attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(e,t){return e.color||l(e,t)}).style("stroke",function(e,t){return e.color||l(e,t)}).select("rect").attr("class",y).transition().attr("width",s.rangeBand()*.9/e.length),O.transition().attr("transform",function(e,t){var n=s(u(e,t))+s.rangeBand()*.05,r=a(e,t)<0?o(0):o(0)-o(a(e,t))<1?o(0)-1:o(a(e,t));return"translate("+n+", "+r+")"}).select("rect").attr("height",function(e,t){return Math.max(Math.abs(o(a(e,t))-o(d&&d[0]||0))||1)}),b=s.copy(),w=o.copy()}),E}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.ordinal(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=[0],l=e.utils.defaultColor(),c=!1,h=d3.format(",.2f"),p,d,v,m,g=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),y="discreteBar",b,w;return E.dispatch=g,E.options=e.utils.optionsFunc.bind(E),E.x=function(e){return arguments.length?(u=e,E):u},E.y=function(e){return arguments.length?(a=e,E):a},E.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,E):t},E.width=function(e){return arguments.length?(n=e,E):n},E.height=function(e){return arguments.length?(r=e,E):r},E.xScale=function(e){return arguments.length?(s=e,E):s},E.yScale=function(e){return arguments.length?(o=e,E):o},E.xDomain=function(e){return arguments.length?(p=e,E):p},E.yDomain=function(e){return arguments.length?(d=e,E):d},E.xRange=function(e){return arguments.length?(v=e,E):v},E.yRange=function(e){return arguments.length?(m=e,E):m},E.forceY=function(e){return arguments.length?(f=e,E):f},E.color=function(t){return arguments.length?(l=e.utils.getColor(t),E):l},E.id=function(e){return arguments.length?(i=e,E):i},E.showValues=function(e){return arguments.length?(c=e,E):c},E.valueFormat=function(e){return arguments.length?(h=e,E):h},E.rectClass=function(e){return arguments.length?(y=e,E):y},E},e.models.discreteBarChart=function(){"use strict";function w(e){return e.each(function(e){var u=d3.select(this),p=this,E=(s||parseInt(u.style("width"))||960)-i.left-i.right,S=(o||parseInt(u.style("height"))||400)-i.top-i.bottom;w.update=function(){g.beforeUpdate(),u.transition().duration(y).call(w)},w.container=this;if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var T=u.selectAll(".nv-noData").data([m]);return T.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),T.attr("x",i.left+E/2).attr("y",i.top+S/2).text(function(e){return e}),w}u.selectAll(".nv-noData").remove(),d=t.xScale(),v=t.yScale().clamp(!0);var N=u.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([e]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),k=C.append("defs"),L=N.select("g");C.append("g").attr("class","nv-x nv-axis"),C.append("g").attr("class","nv-y nv-axis"),C.append("g").attr("class","nv-barsWrap"),L.attr("transform","translate("+i.left+","+i.top+")"),l&&L.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),t.width(E).height(S);var A=L.select(".nv-barsWrap").datum(e.filter(function(e){return!e.disabled}));A.transition().call(t),k.append("clipPath").attr("id","nv-x-label-clip-"+t.id()).append("rect"),L.select("#nv-x-label-clip-"+t.id()+" rect").attr("width",d.rangeBand()*(c?2:1)).attr("height",16).attr("x",-d.rangeBand()/(c?1:2));if(a){n.scale(d).ticks(E/100).tickSize(-S,0),L.select(".nv-x.nv-axis").attr("transform","translate(0,"+(v.range()[0]+(t.showValues()&&v.domain()[0]<0?16:0))+")"),L.select(".nv-x.nv-axis").transition().call(n);var O=L.select(".nv-x.nv-axis").selectAll("g");c&&O.selectAll("text").attr("transform",function(e,t,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}f&&(r.scale(v).ticks(S/36).tickSize(-E,0),L.select(".nv-y.nv-axis").transition().call(r)),g.on("tooltipShow",function(e){h&&b(e,p.parentNode)})}),w}var t=e.models.discreteBar(),n=e.models.axis(),r=e.models.axis(),i={top:15,right:10,bottom:50,left:60},s=null,o=null,u=e.utils.getColor(),a=!0,f=!0,l=!1,c=!1,h=!0,p=function(e,t,n,r,i){return"<h3>"+t+"</h3>"+"<p>"+n+"</p>"},d,v,m="No Data Available.",g=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate"),y=250;n.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(e){return e}),r.orient(l?"right":"left").tickFormat(d3.format(",.1f"));var b=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=p(i.series.key,a,f,i,w);e.tooltip.show([o,u],l,i.value<0?"n":"s",null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+i.left,e.pos[1]+i.top],g.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){g.tooltipHide(e)}),g.on("tooltipHide",function(){h&&e.tooltip.cleanup()}),w.dispatch=g,w.discretebar=t,w.xAxis=n,w.yAxis=r,d3.rebind(w,t,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat"),w.options=e.utils.optionsFunc.bind(w),w.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.right=typeof e.right!="undefined"?e.right:i.right,i.bottom=typeof e.bottom!="undefined"?e.bottom:i.bottom,i.left=typeof e.left!="undefined"?e.left:i.left,w):i},w.width=function(e){return arguments.length?(s=e,w):s},w.height=function(e){return arguments.length?(o=e,w):o},w.color=function(n){return arguments.length?(u=e.utils.getColor(n),t.color(u),w):u},w.showXAxis=function(e){return arguments.length?(a=e,w):a},w.showYAxis=function(e){return arguments.length?(f=e,w):f},w.rightAlignYAxis=function(e){return arguments.length?(l=e,r.orient(e?"right":"left"),w):l},w.staggerLabels=function(e){return arguments.length?(c=e,w):c},w.tooltips=function(e){return arguments.length?(h=e,w):h},w.tooltipContent=function(e){return arguments.length?(p=e,w):p},w.noData=function(e){return arguments.length?(m=e,w):m},w.transitionDuration=function(e){return arguments.length?(y=e,w):y},w},e.models.distribution=function(){"use strict";function l(e){return e.each(function(e){var a=n-(i==="x"?t.left+t.right:t.top+t.bottom),l=i=="x"?"y":"x",c=d3.select(this);f=f||u;var h=c.selectAll("g.nv-distribution").data([e]),p=h.enter().append("g").attr("class","nvd3 nv-distribution"),d=p.append("g"),v=h.select("g");h.attr("transform","translate("+t.left+","+t.top+")");var m=v.selectAll("g.nv-dist").data(function(e){return e},function(e){return e.key});m.enter().append("g"),m.attr("class",function(e,t){return"nv-dist nv-series-"+t}).style("stroke",function(e,t){return o(e,t)});var g=m.selectAll("line.nv-dist"+i).data(function(e){return e.values});g.enter().append("line").attr(i+"1",function(e,t){return f(s(e,t))}).attr(i+"2",function(e,t){return f(s(e,t))}),m.exit().selectAll("line.nv-dist"+i).transition().attr(i+"1",function(e,t){return u(s(e,t))}).attr(i+"2",function(e,t){return u(s(e,t))}).style("stroke-opacity",0).remove(),g.attr("class",function(e,t){return"nv-dist"+i+" nv-dist"+i+"-"+t}).attr(l+"1",0).attr(l+"2",r),g.transition().attr(i+"1",function(e,t){return u(s(e,t))}).attr(i+"2",function(e,t){return u(s(e,t))}),f=u.copy()}),l}var t={top:0,right:0,bottom:0,left:0},n=400,r=8,i="x",s=function(e){return e[i]},o=e.utils.defaultColor(),u=d3.scale.linear(),a,f;return l.options=e.utils.optionsFunc.bind(l),l.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,l):t},l.width=function(e){return arguments.length?(n=e,l):n},l.axis=function(e){return arguments.length?(i=e,l):i},l.size=function(e){return arguments.length?(r=e,l):r},l.getData=function(e){return arguments.length?(s=d3.functor(e),l):s},l.scale=function(e){return arguments.length?(u=e,l):u},l.color=function(t){return arguments.length?(o=e.utils.getColor(t),l):o},l},e.models.historicalBar=function(){"use strict";function w(E){return E.each(function(w){var E=n-t.left-t.right,S=r-t.top-t.bottom,T=d3.select(this);s.domain(d||d3.extent(w[0].values.map(u).concat(f))),c?s.range(m||[E*.5/w[0].values.length,E*(w[0].values.length-.5)/w[0].values.length]):s.range(m||[0,E]),o.domain(v||d3.extent(w[0].values.map(a).concat(l))).range(g||[S,0]),s.domain()[0]===s.domain()[1]&&(s.domain()[0]?s.domain([s.domain()[0]-s.domain()[0]*.01,s.domain()[1]+s.domain()[1]*.01]):s.domain([-1,1])),o.domain()[0]===o.domain()[1]&&(o.domain()[0]?o.domain([o.domain()[0]+o.domain()[0]*.01,o.domain()[1]-o.domain()[1]*.01]):o.domain([-1,1]));var N=T.selectAll("g.nv-wrap.nv-historicalBar-"+i).data([w[0].values]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+i),k=C.append("defs"),L=C.append("g"),A=N.select("g");L.append("g").attr("class","nv-bars"),N.attr("transform","translate("+t.left+","+t.top+")"),T.on("click",function(e,t){y.chartClick({data:e,index:t,pos:d3.event,id:i})}),k.append("clipPath").attr("id","nv-chart-clip-path-"+i).append("rect"),N.select("#nv-chart-clip-path-"+i+" rect").attr("width",E).attr("height",S),A.attr("clip-path",h?"url(#nv-chart-clip-path-"+i+")":"");var O=N.select(".nv-bars").selectAll(".nv-bar").data(function(e){return e},function(e,t){return u(e,t)});O.exit().remove();var M=O.enter().append("rect").attr("x",0).attr("y",function(t,n){return e.utils.NaNtoZero(o(Math.max(0,a(t,n))))}).attr("height",function(t,n){return e.utils.NaNtoZero(Math.abs(o(a(t,n))-o(0)))}).attr("transform",function(e,t){return"translate("+(s(u(e,t))-E/w[0].values.length*.45)+",0)"}).on("mouseover",function(e,t){if(!b)return;d3.select(this).classed("hover",!0),y.elementMouseover({point:e,series:w[0],pos:[s(u(e,t)),o(a(e,t))],pointIndex:t,seriesIndex:0,e:d3.event})}).on("mouseout",function(e,t){if(!b)return;d3.select(this).classed("hover",!1),y.elementMouseout({point:e,series:w[0],pointIndex:t,seriesIndex:0,e:d3.event})}).on("click",function(e,t){if(!b)return;y.elementClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()}).on("dblclick",function(e,t){if(!b)return;y.elementDblClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()});O.attr("fill",function(e,t){return p(e,t)}).attr("class",function(e,t,n){return(a(e,t)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+t}).transition().attr("transform",function(e,t){return"translate("+(s(u(e,t))-E/w[0].values.length*.45)+",0)"}).attr("width",E/w[0].values.length*.9),O.transition().attr("y",function(t,n){var r=a(t,n)<0?o(0):o(0)-o(a(t,n))<1?o(0)-1:o(a(t,n));return e.utils.NaNtoZero(r)}).attr("height",function(t,n){return e.utils.NaNtoZero(Math.max(Math.abs(o(a(t,n))-o(0)),1))})}),w}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=[],l=[0],c=!1,h=!0,p=e.utils.defaultColor(),d,v,m,g,y=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),b=!0;return w.highlightPoint=function(e,t){d3.select(".nv-historicalBar-"+i).select(".nv-bars .nv-bar-0-"+e).classed("hover",t)},w.clearHighlights=function(){d3.select(".nv-historicalBar-"+i).select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=y,w.options=e.utils.optionsFunc.bind(w),w.x=function(e){return arguments.length?(u=e,w):u},w.y=function(e){return arguments.length?(a=e,w):a},w.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,w):t},w.width=function(e){return arguments.length?(n=e,w):n},w.height=function(e){return arguments.length?(r=e,w):r},w.xScale=function(e){return arguments.length?(s=e,w):s},w.yScale=function(e){return arguments.length?(o=e,w):o},w.xDomain=function(e){return arguments.length?(d=e,w):d},w.yDomain=function(e){return arguments.length?(v=e,w):v},w.xRange=function(e){return arguments.length?(m=e,w):m},w.yRange=function(e){return arguments.length?(g=e,w):g},w.forceX=function(e){return arguments.length?(f=e,w):f},w.forceY=function(e){return arguments.length?(l=e,w):l},w.padData=function(e){return arguments.length?(c=e,w):c},w.clipEdge=function(e){return arguments.length?(h=e,w):h},w.color=function(t){return arguments.length?(p=e.utils.getColor(t),w):p},w.id=function(e){return arguments.length?(i=e,w):i},w.interactive=function(e){return arguments.length?(b=!1,w):b},w},e.models.historicalBarChart=function(){"use strict";function x(e){return e.each(function(d){var T=d3.select(this),N=this,C=(u||parseInt(T.style("width"))||960)-s.left-s.right,k=(a||parseInt(T.style("height"))||400)-s.top-s.bottom;x.update=function(){T.transition().duration(E).call(x)},x.container=this,g.disabled=d.map(function(e){return!!e.disabled});if(!y){var L;y={};for(L in g)g[L]instanceof Array?y[L]=g[L].slice(0):y[L]=g[L]}if(!d||!d.length||!d.filter(function(e){return e.values.length}).length){var A=T.selectAll(".nv-noData").data([b]);return A.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),A.attr("x",s.left+C/2).attr("y",s.top+k/2).text(function(e){return e}),x}T.selectAll(".nv-noData").remove(),v=t.xScale(),m=t.yScale();var O=T.selectAll("g.nv-wrap.nv-historicalBarChart").data([d]),M=O.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),_=O.select("g");M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis"),M.append("g").attr("class","nv-barsWrap"),M.append("g").attr("class","nv-legendWrap"),f&&(i.width(C),_.select(".nv-legendWrap").datum(d).call(i),s.top!=i.height()&&(s.top=i.height(),k=(a||parseInt(T.style("height"))||400)-s.top-s.bottom),O.select(".nv-legendWrap").attr("transform","translate(0,"+ -s.top+")")),O.attr("transform","translate("+s.left+","+s.top+")"),h&&_.select(".nv-y.nv-axis").attr("transform","translate("+C+",0)"),t.width(C).height(k).color(d.map(function(e,t){return e.color||o(e,t)}).filter(function(e,t){return!d[t].disabled}));var D=_.select(".nv-barsWrap").datum(d.filter(function(e){return!e.disabled}));D.transition().call(t),l&&(n.scale(v).tickSize(-k,0),_.select(".nv-x.nv-axis").attr("transform","translate(0,"+m.range()[0]+")"),_.select(".nv-x.nv-axis").transition().call(n)),c&&(r.scale(m).ticks(k/36).tickSize(-C,0),_.select(".nv-y.nv-axis").transition().call(r)),i.dispatch.on("legendClick",function(t,n){t.disabled=!t.disabled,d.filter(function(e){return!e.disabled}).length||d.map(function(e){return e.disabled=!1,O.selectAll(".nv-series").classed("disabled",!1),e}),g.disabled=d.map(function(e){return!!e.disabled}),w.stateChange(g),e.transition().call(x)}),i.dispatch.on("legendDblclick",function(e){d.forEach(function(e){e.disabled=!0}),e.disabled=!1,g.disabled=d.map(function(e){return!!e.disabled}),w.stateChange(g),x.update()}),w.on("tooltipShow",function(e){p&&S(e,N.parentNode)}),w.on("changeState",function(t){typeof t.disabled!="undefined"&&(d.forEach(function(e,n){e.disabled=t.disabled[n]}),g.disabled=t.disabled),e.call(x)})}),x}var t=e.models.historicalBar(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s={top:30,right:90,bottom:50,left:90},o=e.utils.defaultColor(),u=null,a=null,f=!1,l=!0,c=!0,h=!1,p=!0,d=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},v,m,g={},y=null,b="No Data Available.",w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),E=250;n.orient("bottom").tickPadding(7),r.orient(h?"right":"left");var S=function(i,s){if(s){var o=d3.select(s).select("svg"),u=o.node()?o.attr("viewBox"):null;if(u){u=u.split(" ");var a=parseInt(o.style("width"))/u[2];i.pos[0]=i.pos[0]*a,i.pos[1]=i.pos[1]*a}}var f=i.pos[0]+(s.offsetLeft||0),l=i.pos[1]+(s.offsetTop||0),c=n.tickFormat()(t.x()(i.point,i.pointIndex)),h=r.tickFormat()(t.y()(i.point,i.pointIndex)),p=d(i.series.key,c,h,i,x);e.tooltip.show([f,l],p,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+s.left,e.pos[1]+s.top],w.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){w.tooltipHide(e)}),w.on("tooltipHide",function(){p&&e.tooltip.cleanup()}),x.dispatch=w,x.bars=t,x.legend=i,x.xAxis=n,x.yAxis=r,d3.rebind(x,t,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate","highlightPoint","clearHighlights","interactive"),x.options=e.utils.optionsFunc.bind(x),x.margin=function(e){return arguments.length?(s.top=typeof e.top!="undefined"?e.top:s.top,s.right=typeof e.right!="undefined"?e.right:s.right,s.bottom=typeof e.bottom!="undefined"?e.bottom:s.bottom,s.left=typeof e.left!="undefined"?e.left:s.left,x):s},x.width=function(e){return arguments.length?(u=e,x):u},x.height=function(e){return arguments.length?(a=e,x):a},x.color=function(t){return arguments.length?(o=e.utils.getColor(t),i.color(o),x):o},x.showLegend=function(e){return arguments.length?(f=e,x):f},x.showXAxis=function(e){return arguments.length?(l=e,x):l},x.showYAxis=function(e){return arguments.length?(c=e,x):c},x.rightAlignYAxis=function(e){return arguments.length?(h=e,r.orient(e?"right":"left"),x):h},x.tooltips=function(e){return arguments.length?(p=e,x):p},x.tooltipContent=function(e){return arguments.length?(d=e,x):d},x.state=function(e){return arguments.length?(g=e,x):g},x.defaultState=function(e){return arguments.length?(y=e,x):y},x.noData=function(e){return arguments.length?(b=e,x):b},x.transitionDuration=function(e){return arguments.length?(E=e,x):E},x},e.models.indentedTree=function(){"use strict";function g(e){return e.each(function(e){function k(e,t,n){d3.event.stopPropagation();if(d3.event.shiftKey&&!n)return d3.event.shiftKey=!1,e.values&&e.values.forEach(function(e){(e.values||e._values)&&k(e,0,!0)}),!0;if(!O(e))return!0;e.values?(e._values=e.values,e.values=null):(e.values=e._values,e._values=null),g.update()}function L(e){return e._values&&e._values.length?h:e.values&&e.values.length?p:""}function A(e){return e._values&&e._values.length}function O(e){var t=e.values||e._values;return t&&t.length}var t=1,n=d3.select(this),i=d3.layout.tree().children(function(e){return e.values}).size([r,f]);g.update=function(){n.transition().duration(600).call(g)},e[0]||(e[0]={key:a});var s=i.nodes(e[0]),y=d3.select(this).selectAll("div").data([[s]]),b=y.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree"),w=b.append("table"),E=y.select("table").attr("width","100%").attr("class",c);if(o){var S=w.append("thead"),x=S.append("tr");l.forEach(function(e){x.append("th").attr("width",e.width?e.width:"10%").style("text-align",e.type=="numeric"?"right":"left").append("span").text(e.label)})}var T=E.selectAll("tbody").data(function(e){return e});T.enter().append("tbody"),t=d3.max(s,function(e){return e.depth}),i.size([r,t*f]);var N=T.selectAll("tr").data(function(e){return e.filter(function(e){return u&&!e.children?u(e):!0})},function(e,t){return e.id||e.id||++m});N.exit().remove(),N.select("img.nv-treeicon").attr("src",L).classed("folded",A);var C=N.enter().append("tr");l.forEach(function(e,t){var n=C.append("td").style("padding-left",function(e){return(t?0:e.depth*f+12+(L(e)?0:16))+"px"},"important").style("text-align",e.type=="numeric"?"right":"left");t==0&&n.append("img").classed("nv-treeicon",!0).classed("nv-folded",A).attr("src",L).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(e){return L(e)?"inline-block":"none"}).on("click",k),n.each(function(n){!t&&v(n)?d3.select(this).append("a").attr("href",v).attr("class",d3.functor(e.classes)).append("span"):d3.select(this).append("span"),d3.select(this).select("span").attr("class",d3.functor(e.classes)).text(function(t){return e.format?e.format(t):t[e.key]||"-"})}),e.showCount&&(n.append("span").attr("class","nv-childrenCount"),N.selectAll("span.nv-childrenCount").text(function(e){return e.values&&e.values.length||e._values&&e._values.length?"("+(e.values&&e.values.filter(function(e){return u?u(e):!0}).length||e._values&&e._values.filter(function(e){return u?u(e):!0}).length||0)+")":""}))}),N.order().on("click",function(e){d.elementClick({row:this,data:e,pos:[e.x,e.y]})}).on("dblclick",function(e){d.elementDblclick({row:this,data:e,pos:[e.x,e.y]})}).on("mouseover",function(e){d.elementMouseover({row:this,data:e,pos:[e.x,e.y]})}).on("mouseout",function(e){d.elementMouseout({row:this,data:e,pos:[e.x,e.y]})})}),g}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=e.utils.defaultColor(),s=Math.floor(Math.random()*1e4),o=!0,u=!1,a="No Data Available.",f=20,l=[{key:"key",label:"Name",type:"text"}],c=null,h="images/grey-plus.png",p="images/grey-minus.png",d=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout"),v=function(e){return e.url},m=0;return g.options=e.utils.optionsFunc.bind(g),g.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,g):t},g.width=function(e){return arguments.length?(n=e,g):n},g.height=function(e){return arguments.length?(r=e,g):r},g.color=function(t){return arguments.length?(i=e.utils.getColor(t),scatter.color(i),g):i},g.id=function(e){return arguments.length?(s=e,g):s},g.header=function(e){return arguments.length?(o=e,g):o},g.noData=function(e){return arguments.length?(a=e,g):a},g.filterZero=function(e){return arguments.length?(u=e,g):u},g.columns=function(e){return arguments.length?(l=e,g):l},g.tableClass=function(e){return arguments.length?(c=e,g):c},g.iconOpen=function(e){return arguments.length?(h=e,g):h},g.iconClose=function(e){return arguments.length?(p=e,g):p},g.getUrl=function(e){return arguments.length?(v=e,g):v},g},e.models.legend=function(){"use strict";function c(h){return h.each(function(c){var h=n-t.left-t.right,p=d3.select(this),d=p.selectAll("g.nv-legend").data([c]),v=d.enter().append("g").attr("class","nvd3 nv-legend").append("g"),m=d.select("g");d.attr("transform","translate("+t.left+","+t.top+")");var g=m.selectAll(".nv-series").data(function(e){return e}),y=g.enter().append("g").attr("class","nv-series").on("mouseover",function(e,t){l.legendMouseover(e,t)}).on("mouseout",function(e,t){l.legendMouseout(e,t)}).on("click",function(e,t){l.legendClick(e,t),a&&(f?(c.forEach(function(e){e.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,c.every(function(e){return e.disabled})&&c.forEach(function(e){e.disabled=!1})),l.stateChange({disabled:c.map(function(e){return!!e.disabled})}))}).on("dblclick",function(e,t){l.legendDblclick(e,t),a&&(c.forEach(function(e){e.disabled=!0}),e.disabled=!1,l.stateChange({disabled:c.map(function(e){return!!e.disabled})}))});y.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),y.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8"),g.classed("disabled",function(e){return e.disabled}),g.exit().remove(),g.select("circle").style("fill",function(e,t){return e.color||s(e,t)}).style("stroke",function(e,t){return e.color||s(e,t)}),g.select("text").text(i);if(o){var b=[];g.each(function(t,n){var r=d3.select(this).select("text"),i;try{i=r.node().getComputedTextLength()}catch(s){i=e.utils.calcApproxTextWidth(r)}b.push(i+28)});var w=0,E=0,S=[];while(E<h&&w<b.length)S[w]=b[w],E+=b[w++];w===0&&(w=1);while(E>h&&w>1){S=[],w--;for(var x=0;x<b.length;x++)b[x]>(S[x%w]||0)&&(S[x%w]=b[x]);E=S.reduce(function(e,t,n,r){return e+t})}var T=[];for(var N=0,C=0;N<w;N++)T[N]=C,C+=S[N];g.attr("transform",function(e,t){return"translate("+T[t%w]+","+(5+Math.floor(t/w)*20)+")"}),u?m.attr("transform","translate("+(n-t.right-E)+","+t.top+")"):m.attr("transform","translate(0,"+t.top+")"),r=t.top+t.bottom+Math.ceil(b.length/w)*20}else{var k=5,L=5,A=0,O;g.attr("transform",function(e,r){var i=d3.select(this).select("text").node().getComputedTextLength()+28;return O=L,n<t.left+t.right+O+i&&(L=O=5,k+=20),L+=i,L>A&&(A=L),"translate("+O+","+k+")"}),m.attr("transform","translate("+(n-t.right-A)+","+t.top+")"),r=t.top+t.bottom+k+15}}),c}var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(e){return e.key},s=e.utils.defaultColor(),o=!0,u=!0,a=!0,f=!1,l=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange");return c.dispatch=l,c.options=e.utils.optionsFunc.bind(c),c.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,c):t},c.width=function(e){return arguments.length?(n=e,c):n},c.height=function(e){return arguments.length?(r=e,c):r},c.key=function(e){return arguments.length?(i=e,c):i},c.color=function(t){return arguments.length?(s=e.utils.getColor(t),c):s},c.align=function(e){return arguments.length?(o=e,c):o},c.rightAlign=function(e){return arguments.length?(u=e,c):u},c.updateState=function(e){return arguments.length?(a=e,c):a},c.radioButtonMode=function(e){return arguments.length?(f=e,c):f},c},e.models.line=function(){"use strict";function m(g){return g.each(function(m){var g=r-n.left-n.right,b=i-n.top-n.bottom,w=d3.select(this);c=t.xScale(),h=t.yScale(),d=d||c,v=v||h;var E=w.selectAll("g.nv-wrap.nv-line").data([m]),S=E.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),T=S.append("defs"),N=S.append("g"),C=E.select("g");N.append("g").attr("class","nv-groups"),N.append("g").attr("class","nv-scatterWrap"),E.attr("transform","translate("+n.left+","+n.top+")"),t.width(g).height(b);var k=E.select(".nv-scatterWrap");k.transition().call(t),T.append("clipPath").attr("id","nv-edge-clip-"+t.id()).append("rect"),E.select("#nv-edge-clip-"+t.id()+" rect").attr("width",g).attr("height",b),C.attr("clip-path",l?"url(#nv-edge-clip-"+t.id()+")":""),k.attr("clip-path",l?"url(#nv-edge-clip-"+t.id()+")":"");var L=E.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e){return e.key});L.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),L.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),L.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}).style("fill",function(e,t){return s(e,t)}).style("stroke",function(e,t){return s(e,t)}),L.transition().style("stroke-opacity",1).style("fill-opacity",.5);var A=L.selectAll("path.nv-area").data(function(e){return f(e)?[e]:[]});A.enter().append("path").attr("class","nv-area").attr("d",function(t){return d3.svg.area().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(d(o(t,n)))}).y0(function(t,n){return e.utils.NaNtoZero(v(u(t,n)))}).y1(function(e,t){return v(h.domain()[0]<=0?h.domain()[1]>=0?0:h.domain()[1]:h.domain()[0])}).apply(this,[t.values])}),L.exit().selectAll("path.nv-area").remove(), +A.transition().attr("d",function(t){return d3.svg.area().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y0(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))}).y1(function(e,t){return h(h.domain()[0]<=0?h.domain()[1]>=0?0:h.domain()[1]:h.domain()[0])}).apply(this,[t.values])});var O=L.selectAll("path.nv-line").data(function(e){return[e.values]});O.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(d(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(v(u(t,n)))})),L.exit().selectAll("path.nv-line").transition().attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))})),O.transition().attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))})),d=c.copy(),v=h.copy()}),m}var t=e.models.scatter(),n={top:0,right:0,bottom:0,left:0},r=960,i=500,s=e.utils.defaultColor(),o=function(e){return e.x},u=function(e){return e.y},a=function(e,t){return!isNaN(u(e,t))&&u(e,t)!==null},f=function(e){return e.area},l=!1,c,h,p="linear";t.size(16).sizeDomain([16,256]);var d,v;return m.dispatch=t.dispatch,m.scatter=t,d3.rebind(m,t,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","padData","highlightPoint","clearHighlights"),m.options=e.utils.optionsFunc.bind(m),m.margin=function(e){return arguments.length?(n.top=typeof e.top!="undefined"?e.top:n.top,n.right=typeof e.right!="undefined"?e.right:n.right,n.bottom=typeof e.bottom!="undefined"?e.bottom:n.bottom,n.left=typeof e.left!="undefined"?e.left:n.left,m):n},m.width=function(e){return arguments.length?(r=e,m):r},m.height=function(e){return arguments.length?(i=e,m):i},m.x=function(e){return arguments.length?(o=e,t.x(e),m):o},m.y=function(e){return arguments.length?(u=e,t.y(e),m):u},m.clipEdge=function(e){return arguments.length?(l=e,m):l},m.color=function(n){return arguments.length?(s=e.utils.getColor(n),t.color(s),m):s},m.interpolate=function(e){return arguments.length?(p=e,m):p},m.defined=function(e){return arguments.length?(a=e,m):a},m.isArea=function(e){return arguments.length?(f=d3.functor(e),m):f},m},e.models.lineChart=function(){"use strict";function N(m){return m.each(function(m){var C=d3.select(this),k=this,L=(a||parseInt(C.style("width"))||960)-o.left-o.right,A=(f||parseInt(C.style("height"))||400)-o.top-o.bottom;N.update=function(){C.transition().duration(x).call(N)},N.container=this,b.disabled=m.map(function(e){return!!e.disabled});if(!w){var O;w={};for(O in b)b[O]instanceof Array?w[O]=b[O].slice(0):w[O]=b[O]}if(!m||!m.length||!m.filter(function(e){return e.values.length}).length){var M=C.selectAll(".nv-noData").data([E]);return M.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),M.attr("x",o.left+L/2).attr("y",o.top+A/2).text(function(e){return e}),N}C.selectAll(".nv-noData").remove(),g=t.xScale(),y=t.yScale();var _=C.selectAll("g.nv-wrap.nv-lineChart").data([m]),D=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),P=_.select("g");D.append("rect").style("opacity",0),D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-linesWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-interactive"),P.select("rect").attr("width",L).attr("height",A),l&&(i.width(L),P.select(".nv-legendWrap").datum(m).call(i),o.top!=i.height()&&(o.top=i.height(),A=(f||parseInt(C.style("height"))||400)-o.top-o.bottom),_.select(".nv-legendWrap").attr("transform","translate(0,"+ -o.top+")")),_.attr("transform","translate("+o.left+","+o.top+")"),p&&P.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),d&&(s.width(L).height(A).margin({left:o.left,top:o.top}).svgContainer(C).xScale(g),_.select(".nv-interactive").call(s)),t.width(L).height(A).color(m.map(function(e,t){return e.color||u(e,t)}).filter(function(e,t){return!m[t].disabled}));var H=P.select(".nv-linesWrap").datum(m.filter(function(e){return!e.disabled}));H.transition().call(t),c&&(n.scale(g).ticks(L/100).tickSize(-A,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+y.range()[0]+")"),P.select(".nv-x.nv-axis").transition().call(n)),h&&(r.scale(y).ticks(A/36).tickSize(-L,0),P.select(".nv-y.nv-axis").transition().call(r)),i.dispatch.on("stateChange",function(e){b=e,S.stateChange(b),N.update()}),s.dispatch.on("elementMousemove",function(i){t.clearHighlights();var a,f,l,c=[];m.filter(function(e,t){return e.seriesIndex=t,!e.disabled}).forEach(function(n,r){f=e.interactiveBisect(n.values,i.pointXValue,N.x()),t.highlightPoint(r,f,!0);var s=n.values[f];if(typeof s=="undefined")return;typeof a=="undefined"&&(a=s),typeof l=="undefined"&&(l=N.xScale()(N.x()(s,f))),c.push({key:n.key,value:N.y()(s,f),color:u(n,n.seriesIndex)})});if(c.length>2){var h=N.yScale().invert(i.mouseY),p=Math.abs(N.yScale().domain()[0]-N.yScale().domain()[1]),d=.03*p,g=e.nearestValueIndex(c.map(function(e){return e.value}),h,d);g!==null&&(c[g].highlight=!0)}var y=n.tickFormat()(N.x()(a,f));s.tooltip.position({left:l+o.left,top:i.mouseY+o.top}).chartContainer(k.parentNode).enabled(v).valueFormatter(function(e,t){return r.tickFormat()(e)}).data({value:y,series:c})(),s.renderGuideLine(l)}),s.dispatch.on("elementMouseout",function(e){S.tooltipHide(),t.clearHighlights()}),S.on("tooltipShow",function(e){v&&T(e,k.parentNode)}),S.on("changeState",function(e){typeof e.disabled!="undefined"&&(m.forEach(function(t,n){t.disabled=e.disabled[n]}),b.disabled=e.disabled),N.update()})}),N}var t=e.models.line(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.interactiveGuideline(),o={top:30,right:20,bottom:50,left:60},u=e.utils.defaultColor(),a=null,f=null,l=!0,c=!0,h=!0,p=!1,d=!1,v=!0,m=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},g,y,b={},w=null,E="No Data Available.",S=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),x=250;n.orient("bottom").tickPadding(7),r.orient(p?"right":"left");var T=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=m(i.series.key,a,f,i,N);e.tooltip.show([o,u],l,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+o.left,e.pos[1]+o.top],S.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){S.tooltipHide(e)}),S.on("tooltipHide",function(){v&&e.tooltip.cleanup()}),N.dispatch=S,N.lines=t,N.legend=i,N.xAxis=n,N.yAxis=r,N.interactiveLayer=s,d3.rebind(N,t,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id","interpolate"),N.options=e.utils.optionsFunc.bind(N),N.margin=function(e){return arguments.length?(o.top=typeof e.top!="undefined"?e.top:o.top,o.right=typeof e.right!="undefined"?e.right:o.right,o.bottom=typeof e.bottom!="undefined"?e.bottom:o.bottom,o.left=typeof e.left!="undefined"?e.left:o.left,N):o},N.width=function(e){return arguments.length?(a=e,N):a},N.height=function(e){return arguments.length?(f=e,N):f},N.color=function(t){return arguments.length?(u=e.utils.getColor(t),i.color(u),N):u},N.showLegend=function(e){return arguments.length?(l=e,N):l},N.showXAxis=function(e){return arguments.length?(c=e,N):c},N.showYAxis=function(e){return arguments.length?(h=e,N):h},N.rightAlignYAxis=function(e){return arguments.length?(p=e,r.orient(e?"right":"left"),N):p},N.useInteractiveGuideline=function(e){return arguments.length?(d=e,e===!0&&(N.interactive(!1),N.useVoronoi(!1)),N):d},N.tooltips=function(e){return arguments.length?(v=e,N):v},N.tooltipContent=function(e){return arguments.length?(m=e,N):m},N.state=function(e){return arguments.length?(b=e,N):b},N.defaultState=function(e){return arguments.length?(w=e,N):w},N.noData=function(e){return arguments.length?(E=e,N):E},N.transitionDuration=function(e){return arguments.length?(x=e,N):x},N},e.models.linePlusBarChart=function(){"use strict";function T(e){return e.each(function(e){var l=d3.select(this),c=this,v=(a||parseInt(l.style("width"))||960)-u.left-u.right,N=(f||parseInt(l.style("height"))||400)-u.top-u.bottom;T.update=function(){l.transition().call(T)},b.disabled=e.map(function(e){return!!e.disabled});if(!w){var C;w={};for(C in b)b[C]instanceof Array?w[C]=b[C].slice(0):w[C]=b[C]}if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var k=l.selectAll(".nv-noData").data([E]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",u.left+v/2).attr("y",u.top+N/2).text(function(e){return e}),T}l.selectAll(".nv-noData").remove();var L=e.filter(function(e){return!e.disabled&&e.bar}),A=e.filter(function(e){return!e.bar});m=A.filter(function(e){return!e.disabled}).length&&A.filter(function(e){return!e.disabled})[0].values.length?t.xScale():n.xScale(),g=n.yScale(),y=t.yScale();var O=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([e]),M=O.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),_=O.select("g");M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y1 nv-axis"),M.append("g").attr("class","nv-y2 nv-axis"),M.append("g").attr("class","nv-barsWrap"),M.append("g").attr("class","nv-linesWrap"),M.append("g").attr("class","nv-legendWrap"),p&&(o.width(v/2),_.select(".nv-legendWrap").datum(e.map(function(e){return e.originalKey=e.originalKey===undefined?e.key:e.originalKey,e.key=e.originalKey+(e.bar?" (left axis)":" (right axis)"),e})).call(o),u.top!=o.height()&&(u.top=o.height(),N=(f||parseInt(l.style("height"))||400)-u.top-u.bottom),_.select(".nv-legendWrap").attr("transform","translate("+v/2+","+ -u.top+")")),O.attr("transform","translate("+u.left+","+u.top+")"),t.width(v).height(N).color(e.map(function(e,t){return e.color||h(e,t)}).filter(function(t,n){return!e[n].disabled&&!e[n].bar})),n.width(v).height(N).color(e.map(function(e,t){return e.color||h(e,t)}).filter(function(t,n){return!e[n].disabled&&e[n].bar}));var D=_.select(".nv-barsWrap").datum(L.length?L:[{values:[]}]),P=_.select(".nv-linesWrap").datum(A[0]&&!A[0].disabled?A:[{values:[]}]);d3.transition(D).call(n),d3.transition(P).call(t),r.scale(m).ticks(v/100).tickSize(-N,0),_.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")"),d3.transition(_.select(".nv-x.nv-axis")).call(r),i.scale(g).ticks(N/36).tickSize(-v,0),d3.transition(_.select(".nv-y1.nv-axis")).style("opacity",L.length?1:0).call(i),s.scale(y).ticks(N/36).tickSize(L.length?0:-v,0),_.select(".nv-y2.nv-axis").style("opacity",A.length?1:0).attr("transform","translate("+v+",0)"),d3.transition(_.select(".nv-y2.nv-axis")).call(s),o.dispatch.on("stateChange",function(e){b=e,S.stateChange(b),T.update()}),S.on("tooltipShow",function(e){d&&x(e,c.parentNode)}),S.on("changeState",function(t){typeof t.disabled!="undefined"&&(e.forEach(function(e,n){e.disabled=t.disabled[n]}),b.disabled=t.disabled),T.update()})}),T}var t=e.models.line(),n=e.models.historicalBar(),r=e.models.axis(),i=e.models.axis(),s=e.models.axis(),o=e.models.legend(),u={top:30,right:60,bottom:50,left:60},a=null,f=null,l=function(e){return e.x},c=function(e){return e.y},h=e.utils.defaultColor(),p=!0,d=!0,v=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},m,g,y,b={},w=null,E="No Data Available.",S=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");n.padData(!0),t.clipEdge(!1).padData(!0),r.orient("bottom").tickPadding(7).highlightZero(!1),i.orient("left"),s.orient("right");var x=function(n,o){var u=n.pos[0]+(o.offsetLeft||0),a=n.pos[1]+(o.offsetTop||0),f=r.tickFormat()(t.x()(n.point,n.pointIndex)),l=(n.series.bar?i:s).tickFormat()(t.y()(n.point,n.pointIndex)),c=v(n.series.key,f,l,n,T);e.tooltip.show([u,a],c,n.value<0?"n":"s",null,o)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+u.left,e.pos[1]+u.top],S.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){S.tooltipHide(e)}),n.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+u.left,e.pos[1]+u.top],S.tooltipShow(e)}),n.dispatch.on("elementMouseout.tooltip",function(e){S.tooltipHide(e)}),S.on("tooltipHide",function(){d&&e.tooltip.cleanup()}),T.dispatch=S,T.legend=o,T.lines=t,T.bars=n,T.xAxis=r,T.y1Axis=i,T.y2Axis=s,d3.rebind(T,t,"defined","size","clipVoronoi","interpolate"),T.options=e.utils.optionsFunc.bind(T),T.x=function(e){return arguments.length?(l=e,t.x(e),n.x(e),T):l},T.y=function(e){return arguments.length?(c=e,t.y(e),n.y(e),T):c},T.margin=function(e){return arguments.length?(u.top=typeof e.top!="undefined"?e.top:u.top,u.right=typeof e.right!="undefined"?e.right:u.right,u.bottom=typeof e.bottom!="undefined"?e.bottom:u.bottom,u.left=typeof e.left!="undefined"?e.left:u.left,T):u},T.width=function(e){return arguments.length?(a=e,T):a},T.height=function(e){return arguments.length?(f=e,T):f},T.color=function(t){return arguments.length?(h=e.utils.getColor(t),o.color(h),T):h},T.showLegend=function(e){return arguments.length?(p=e,T):p},T.tooltips=function(e){return arguments.length?(d=e,T):d},T.tooltipContent=function(e){return arguments.length?(v=e,T):v},T.state=function(e){return arguments.length?(b=e,T):b},T.defaultState=function(e){return arguments.length?(w=e,T):w},T.noData=function(e){return arguments.length?(E=e,T):E},T},e.models.lineWithFocusChart=function(){"use strict";function k(e){return e.each(function(e){function U(e){var t=+(e=="e"),n=t?1:-1,r=M/3;return"M"+.5*n+","+r+"A6,6 0 0 "+t+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+t+" "+.5*n+","+2*r+"Z"+"M"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}function z(){a.empty()||a.extent(w),I.data([a.empty()?g.domain():w]).each(function(e,t){var n=g(e[0])-v.range()[0],r=v.range()[1]-g(e[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",g(e[1])).attr("width",r<0?0:r)})}function W(){w=a.empty()?null:a.extent();var n=a.empty()?g.domain():a.extent();if(Math.abs(n[0]-n[1])<=1)return;T.brush({extent:n,brush:a}),z();var s=H.select(".nv-focus .nv-linesWrap").datum(e.filter(function(e){return!e.disabled}).map(function(e,r){return{key:e.key,values:e.values.filter(function(e,r){return t.x()(e,r)>=n[0]&&t.x()(e,r)<=n[1]})}}));s.transition().duration(N).call(t),H.select(".nv-focus .nv-x.nv-axis").transition().duration(N).call(r),H.select(".nv-focus .nv-y.nv-axis").transition().duration(N).call(i)}var S=d3.select(this),L=this,A=(h||parseInt(S.style("width"))||960)-f.left-f.right,O=(p||parseInt(S.style("height"))||400)-f.top-f.bottom-d,M=d-l.top-l.bottom;k.update=function(){S.transition().duration(N).call(k)},k.container=this;if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var _=S.selectAll(".nv-noData").data([x]);return _.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),_.attr("x",f.left+A/2).attr("y",f.top+O/2).text(function(e){return e}),k}S.selectAll(".nv-noData").remove(),v=t.xScale(),m=t.yScale(),g=n.xScale(),y=n.yScale();var D=S.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([e]),P=D.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),H=D.select("g");P.append("g").attr("class","nv-legendWrap");var B=P.append("g").attr("class","nv-focus");B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis"),B.append("g").attr("class","nv-linesWrap");var j=P.append("g").attr("class","nv-context");j.append("g").attr("class","nv-x nv-axis"),j.append("g").attr("class","nv-y nv-axis"),j.append("g").attr("class","nv-linesWrap"),j.append("g").attr("class","nv-brushBackground"),j.append("g").attr("class","nv-x nv-brush"),b&&(u.width(A),H.select(".nv-legendWrap").datum(e).call(u),f.top!=u.height()&&(f.top=u.height(),O=(p||parseInt(S.style("height"))||400)-f.top-f.bottom-d),H.select(".nv-legendWrap").attr("transform","translate(0,"+ -f.top+")")),D.attr("transform","translate("+f.left+","+f.top+")"),t.width(A).height(O).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),n.defined(t.defined()).width(A).height(M).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),H.select(".nv-context").attr("transform","translate(0,"+(O+f.bottom+l.top)+")");var F=H.select(".nv-context .nv-linesWrap").datum(e.filter(function(e){return!e.disabled}));d3.transition(F).call(n),r.scale(v).ticks(A/100).tickSize(-O,0),i.scale(m).ticks(O/36).tickSize(-A,0),H.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+O+")"),a.x(g).on("brush",function(){var e=k.transitionDuration();k.transitionDuration(0),W(),k.transitionDuration(e)}),w&&a.extent(w);var I=H.select(".nv-brushBackground").selectAll("g").data([w||a.extent()]),q=I.enter().append("g");q.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",M),q.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",M);var R=H.select(".nv-x.nv-brush").call(a);R.selectAll("rect").attr("height",M),R.selectAll(".resize").append("path").attr("d",U),W(),s.scale(g).ticks(A/100).tickSize(-M,0),H.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+y.range()[0]+")"),d3.transition(H.select(".nv-context .nv-x.nv-axis")).call(s),o.scale(y).ticks(M/36).tickSize(-A,0),d3.transition(H.select(".nv-context .nv-y.nv-axis")).call(o),H.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+y.range()[0]+")"),u.dispatch.on("stateChange",function(e){k.update()}),T.on("tooltipShow",function(e){E&&C(e,L.parentNode)})}),k}var t=e.models.line(),n=e.models.line(),r=e.models.axis(),i=e.models.axis(),s=e.models.axis(),o=e.models.axis(),u=e.models.legend(),a=d3.svg.brush(),f={top:30,right:30,bottom:30,left:60},l={top:0,right:30,bottom:20,left:60},c=e.utils.defaultColor(),h=null,p=null,d=100,v,m,g,y,b=!0,w=null,E=!0,S=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},x="No Data Available.",T=d3.dispatch("tooltipShow","tooltipHide","brush"),N=250;t.clipEdge(!0),n.interactive(!1),r.orient("bottom").tickPadding(5),i.orient("left"),s.orient("bottom").tickPadding(5),o.orient("left");var C=function(n,s){var o=n.pos[0]+(s.offsetLeft||0),u=n.pos[1]+(s.offsetTop||0),a=r.tickFormat()(t.x()(n.point,n.pointIndex)),f=i.tickFormat()(t.y()(n.point,n.pointIndex)),l=S(n.series.key,a,f,n,k);e.tooltip.show([o,u],l,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+f.left,e.pos[1]+f.top],T.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),T.on("tooltipHide",function(){E&&e.tooltip.cleanup()}),k.dispatch=T,k.legend=u,k.lines=t,k.lines2=n,k.xAxis=r,k.yAxis=i,k.x2Axis=s,k.y2Axis=o,d3.rebind(k,t,"defined","isArea","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),k.options=e.utils.optionsFunc.bind(k),k.x=function(e){return arguments.length?(t.x(e),n.x(e),k):t.x},k.y=function(e){return arguments.length?(t.y(e),n.y(e),k):t.y},k.margin=function(e){return arguments.length?(f.top=typeof e.top!="undefined"?e.top:f.top,f.right=typeof e.right!="undefined"?e.right:f.right,f.bottom=typeof e.bottom!="undefined"?e.bottom:f.bottom,f.left=typeof e.left!="undefined"?e.left:f.left,k):f},k.margin2=function(e){return arguments.length?(l=e,k):l},k.width=function(e){return arguments.length?(h=e,k):h},k.height=function(e){return arguments.length?(p=e,k):p},k.height2=function(e){return arguments.length?(d=e,k):d},k.color=function(t){return arguments.length?(c=e.utils.getColor(t),u.color(c),k):c},k.showLegend=function(e){return arguments.length?(b=e,k):b},k.tooltips=function(e){return arguments.length?(E=e,k):E},k.tooltipContent=function(e){return arguments.length?(S=e,k):S},k.interpolate=function(e){return arguments.length?(t.interpolate(e),n.interpolate(e),k):t.interpolate()},k.noData=function(e){return arguments.length?(x=e,k):x},k.xTickFormat=function(e){return arguments.length?(r.tickFormat(e),s.tickFormat(e),k):r.tickFormat()},k.yTickFormat=function(e){return arguments.length?(i.tickFormat(e),o.tickFormat(e),k):i.tickFormat()},k.brushExtent=function(e){return arguments.length?(w=e,k):w},k.transitionDuration=function(e){return arguments.length?(N=e,k):N},k},e.models.linePlusBarWithFocusChart=function(){"use strict";function B(e){return e.each(function(e){function nt(e){var t=+(e=="e"),n=t?1:-1,r=q/3;return"M"+.5*n+","+r+"A6,6 0 0 "+t+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+t+" "+.5*n+","+2*r+"Z"+"M"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}function rt(){h.empty()||h.extent(x),Z.data([h.empty()?k.domain():x]).each(function(e,t){var n=k(e[0])-k.range()[0],r=k.range()[1]-k(e[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",k(e[1])).attr("width",r<0?0:r)})}function it(){x=h.empty()?null:h.extent(),S=h.empty()?k.domain():h.extent(),D.brush({extent:S,brush:h}),rt(),r.width(F).height(I).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&e[n].bar})),t.width(F).height(I).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&!e[n].bar}));var n=J.select(".nv-focus .nv-barsWrap").datum(U.length?U.map(function(e,t){return{key:e.key,values:e.values.filter(function(e,t){return r.x()(e,t)>=S[0]&&r.x()(e,t)<=S[1]})}}):[{values:[]}]),i=J.select(".nv-focus .nv-linesWrap").datum(z[0].disabled?[{values:[]}]:z.map(function(e,n){return{key:e.key,values:e.values.filter(function(e,n){return t.x()(e,n)>=S[0]&&t.x()(e,n)<=S[1]})}}));U.length?C=r.xScale():C=t.xScale(),s.scale(C).ticks(F/100).tickSize(-I,0),s.domain([Math.ceil(S[0]),Math.floor(S[1])]),J.select(".nv-x.nv-axis").transition().duration(P).call(s),n.transition().duration(P).call(r),i.transition().duration(P).call(t),J.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+L.range()[0]+")"),u.scale(L).ticks(I/36).tickSize(-F,0),J.select(".nv-focus .nv-y1.nv-axis").style("opacity",U.length?1:0),a.scale(A).ticks(I/36).tickSize(U.length?0:-F,0),J.select(".nv-focus .nv-y2.nv-axis").style("opacity",z.length?1:0).attr("transform","translate("+C.range()[1]+",0)"),J.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(u),J.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(a)}var N=d3.select(this),j=this,F=(v||parseInt(N.style("width"))||960)-p.left-p.right,I=(m||parseInt(N.style("height"))||400)-p.top-p.bottom-g,q=g-d.top-d.bottom;B.update=function(){N.transition().duration(P).call(B)},B.container=this;if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var R=N.selectAll(".nv-noData").data([_]);return R.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),R.attr("x",p.left+F/2).attr("y",p.top+I/2).text(function(e){return e}),B}N.selectAll(".nv-noData").remove();var U=e.filter(function(e){return!e.disabled&&e.bar}),z=e.filter(function(e){return!e.bar});C=r.xScale(),k=o.scale(),L=r.yScale(),A=t.yScale(),O=i.yScale(),M=n.yScale();var W=e.filter(function(e){return!e.disabled&&e.bar}).map(function(e){return e.values.map(function(e,t){return{x:y(e,t),y:b(e,t)}})}),X=e.filter(function(e){return!e.disabled&&!e.bar}).map(function(e){return e.values.map(function(e,t){return{x:y(e,t),y:b(e,t)}})});C.range([0,F]),k.domain(d3.extent(d3.merge(W.concat(X)),function(e){return e.x})).range([0,F]);var V=N.selectAll("g.nv-wrap.nv-linePlusBar").data([e]),$=V.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),J=V.select("g");$.append("g").attr("class","nv-legendWrap");var K=$.append("g").attr("class","nv-focus");K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y1 nv-axis"),K.append("g").attr("class","nv-y2 nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-linesWrap");var Q=$.append("g").attr("class","nv-context");Q.append("g").attr("class","nv-x nv-axis"),Q.append("g").attr("class","nv-y1 nv-axis"),Q.append("g").attr("class","nv-y2 nv-axis"),Q.append("g").attr("class","nv-barsWrap"),Q.append("g").attr("class","nv-linesWrap"),Q.append("g").attr("class","nv-brushBackground"),Q.append("g").attr("class","nv-x nv-brush"),E&&(c.width(F/2),J.select(".nv-legendWrap").datum(e.map(function(e){return e.originalKey=e.originalKey===undefined?e.key:e.originalKey,e.key=e.originalKey+(e.bar?" (left axis)":" (right axis)"),e})).call(c),p.top!=c.height()&&(p.top=c.height(),I=(m||parseInt(N.style("height"))||400)-p.top-p.bottom-g),J.select(".nv-legendWrap").attr("transform","translate("+F/2+","+ -p.top+")")),V.attr("transform","translate("+p.left+","+p.top+")"),i.width(F).height(q).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&e[n].bar})),n.width(F).height(q).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&!e[n].bar}));var G=J.select(".nv-context .nv-barsWrap").datum(U.length?U:[{values:[]}]),Y=J.select(".nv-context .nv-linesWrap").datum(z[0].disabled?[{values:[]}]:z);J.select(".nv-context").attr("transform","translate(0,"+(I+p.bottom+d.top)+")"),G.transition().call(i),Y.transition().call(n),h.x(k).on("brush",it),x&&h.extent(x);var Z=J.select(".nv-brushBackground").selectAll("g").data([x||h.extent()]),et=Z.enter().append("g");et.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",q),et.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",q);var tt=J.select(".nv-x.nv-brush").call(h);tt.selectAll("rect").attr("height",q),tt.selectAll(".resize").append("path").attr("d",nt),o.ticks(F/100).tickSize(-q,0),J.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+O.range()[0]+")"),J.select(".nv-context .nv-x.nv-axis").transition().call(o),f.scale(O).ticks(q/36).tickSize(-F,0),J.select(".nv-context .nv-y1.nv-axis").style("opacity",U.length?1:0).attr("transform","translate(0,"+k.range()[0]+")"),J.select(".nv-context .nv-y1.nv-axis").transition().call(f),l.scale(M).ticks(q/36).tickSize(U.length?0:-F,0),J.select(".nv-context .nv-y2.nv-axis").style("opacity",z.length?1:0).attr("transform","translate("+k.range()[1]+",0)"),J.select(".nv-context .nv-y2.nv-axis").transition().call(l),c.dispatch.on("stateChange",function(e){B.update()}),D.on("tooltipShow",function(e){T&&H(e,j.parentNode)}),it()}),B}var t=e.models.line(),n=e.models.line(),r=e.models.historicalBar(),i=e.models.historicalBar(),s=e.models.axis(),o=e.models.axis(),u=e.models.axis(),a=e.models.axis(),f=e.models.axis(),l=e.models.axis(),c=e.models.legend(),h=d3.svg.brush(),p={top:30,right:30,bottom:30,left:60},d={top:0,right:30,bottom:20,left:60},v=null,m=null,g=100,y=function(e){return e.x},b=function(e){return e.y},w=e.utils.defaultColor(),E=!0,S,x=null,T=!0,N=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},C,k,L,A,O,M,_="No Data Available.",D=d3.dispatch("tooltipShow","tooltipHide","brush"),P=0;t.clipEdge(!0),n.interactive(!1),s.orient("bottom").tickPadding(5),u.orient("left"),a.orient("right"),o.orient("bottom").tickPadding(5),f.orient("left"),l.orient("right");var H=function(n,r){S&&(n.pointIndex+=Math.ceil(S[0]));var i=n.pos[0]+(r.offsetLeft||0),o=n.pos[1]+(r.offsetTop||0),f=s.tickFormat()(t.x()(n.point,n.pointIndex)),l=(n.series.bar?u:a).tickFormat()(t.y()(n.point,n.pointIndex)),c=N(n.series.key,f,l,n,B);e.tooltip.show([i,o],c,n.value<0?"n":"s",null,r)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+p.left,e.pos[1]+p.top],D.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){D.tooltipHide(e)}),r.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+p.left,e.pos[1]+p.top],D.tooltipShow(e)}),r.dispatch.on("elementMouseout.tooltip",function(e){D.tooltipHide(e)}),D.on("tooltipHide",function(){T&&e.tooltip.cleanup()}),B.dispatch=D,B.legend=c,B.lines=t,B.lines2=n,B.bars=r,B.bars2=i,B.xAxis=s,B.x2Axis=o,B.y1Axis=u,B.y2Axis=a,B.y3Axis=f,B.y4Axis=l,d3.rebind(B,t,"defined","size","clipVoronoi","interpolate"),B.options=e.utils.optionsFunc.bind(B),B.x=function(e){return arguments.length?(y=e,t.x(e),r.x(e),B):y},B.y=function(e){return arguments.length?(b=e,t.y(e),r.y(e),B):b},B.margin=function(e){return arguments.length?(p.top=typeof e.top!="undefined"?e.top:p.top,p.right=typeof e.right!="undefined"?e.right:p.right,p.bottom=typeof e.bottom!="undefined"?e.bottom:p.bottom,p.left=typeof e.left!="undefined"?e.left:p.left,B):p},B.width=function(e){return arguments.length?(v=e,B):v},B.height=function(e){return arguments.length?(m=e,B):m},B.color=function(t){return arguments.length?(w=e.utils.getColor(t),c.color(w),B):w},B.showLegend=function(e){return arguments.length?(E=e,B):E},B.tooltips=function(e){return arguments.length?(T=e,B):T},B.tooltipContent=function(e){return arguments.length?(N=e,B):N},B.noData=function(e){return arguments.length?(_=e,B):_},B.brushExtent=function(e){return arguments.length?(x=e,B):x},B},e.models.multiBar=function(){"use strict";function C(e){return e.each(function(e){var C=n-t.left-t.right,k=r-t.top-t.bottom,L=d3.select(this);d&&e.length&&(d=[{values:e[0].values.map(function(e){return{x:e.x,y:0,series:e.series,size:.01}})}]),c&&(e=d3.layout.stack().offset(h).values(function(e){return e.values}).y(a)(!e.length&&d?d:e)),e=e.map(function(e,t){return e.values=e.values.map(function(e){return e.series=t,e}),e}),c&&e[0].values.map(function(t,n){var r=0,i=0;e.map(function(e){var t=e.values[n];t.size=Math.abs(t.y),t.y<0?(t.y1=i,i-=t.size):(t.y1=t.size+r,r+=t.size)})});var A=y&&b?[]:e.map(function(e){return e.values.map(function(e,t){return{x:u(e,t),y:a(e,t),y0:e.y0,y1:e.y1}})});i.domain(y||d3.merge(A).map(function(e){return e.x})).rangeBands(w||[0,C],S),s.domain(b||d3.extent(d3.merge(A).map(function(e){return c?e.y>0?e.y1:e.y1+e.y:e.y}).concat(f))).range(E||[k,0]),i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]-i.domain()[0]*.01,i.domain()[1]+i.domain()[1]*.01]):i.domain([-1,1])),s.domain()[0]===s.domain()[1]&&(s.domain()[0]?s.domain([s.domain()[0]+s.domain()[0]*.01,s.domain()[1]-s.domain()[1]*.01]):s.domain([-1,1])),T=T||i,N=N||s;var O=L.selectAll("g.nv-wrap.nv-multibar").data([e]),M=O.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),_=M.append("defs"),D=M.append("g"),P=O.select("g");D.append("g").attr("class","nv-groups"),O.attr("transform","translate("+t.left+","+t.top+")"),_.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),O.select("#nv-edge-clip-"+o+" rect").attr("width",C).attr("height",k),P.attr("clip-path",l?"url(#nv-edge-clip-"+o+")":"");var H=O.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e,t){return t});H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),H.exit().transition().selectAll("rect.nv-bar").delay(function(t,n){return n*g/e[0].values.length}).attr("y",function(e){return c?N(e.y0):N(0)}).attr("height",0).remove(),H.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}).style("fill",function(e,t){return p(e,t)}).style("stroke",function(e,t){return p(e,t)}),H.transition().style("stroke-opacity",1).style("fill-opacity",.75);var B=H.selectAll("rect.nv-bar").data(function(t){return d&&!e.length?d.values:t.values});B.exit().remove();var j=B.enter().append("rect").attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,n,r){return c?0:r*i.rangeBand()/e.length}).attr("y",function(e){return N(c?e.y0:0)}).attr("height",0).attr("width",i.rangeBand()/(c?1:e.length)).attr("transform",function(e,t){return"translate("+i(u(e,t))+",0)"});B.style("fill",function(e,t,n){return p(e,n,t)}).style("stroke",function(e,t,n){return p(e,n,t)}).on("mouseover",function(t,n){d3.select(this).classed("hover",!0),x.elementMouseover({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),x.elementMouseout({value:a(t,n),point:t,series:e[t.series],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("click",function(t,n){x.elementClick({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series +,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(t,n){x.elementDblClick({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}),B.attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}).transition().attr("transform",function(e,t){return"translate("+i(u(e,t))+",0)"}),v&&(m||(m=e.map(function(){return!0})),B.style("fill",function(e,t,n){return d3.rgb(v(e,t)).darker(m.map(function(e,t){return t}).filter(function(e,t){return!m[t]})[n]).toString()}).style("stroke",function(e,t,n){return d3.rgb(v(e,t)).darker(m.map(function(e,t){return t}).filter(function(e,t){return!m[t]})[n]).toString()})),c?B.transition().delay(function(t,n){return n*g/e[0].values.length}).attr("y",function(e,t){return s(c?e.y1:0)}).attr("height",function(e,t){return Math.max(Math.abs(s(e.y+(c?e.y0:0))-s(c?e.y0:0)),1)}).attr("x",function(t,n){return c?0:t.series*i.rangeBand()/e.length}).attr("width",i.rangeBand()/(c?1:e.length)):B.transition().delay(function(t,n){return n*g/e[0].values.length}).attr("x",function(t,n){return t.series*i.rangeBand()/e.length}).attr("width",i.rangeBand()/e.length).attr("y",function(e,t){return a(e,t)<0?s(0):s(0)-s(a(e,t))<1?s(0)-1:s(a(e,t))||0}).attr("height",function(e,t){return Math.max(Math.abs(s(a(e,t))-s(0)),1)||0}),T=i.copy(),N=s.copy()}),C}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=d3.scale.ordinal(),s=d3.scale.linear(),o=Math.floor(Math.random()*1e4),u=function(e){return e.x},a=function(e){return e.y},f=[0],l=!0,c=!1,h="zero",p=e.utils.defaultColor(),d=!1,v=null,m,g=1200,y,b,w,E,S=.1,x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),T,N;return C.dispatch=x,C.options=e.utils.optionsFunc.bind(C),C.x=function(e){return arguments.length?(u=e,C):u},C.y=function(e){return arguments.length?(a=e,C):a},C.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,C):t},C.width=function(e){return arguments.length?(n=e,C):n},C.height=function(e){return arguments.length?(r=e,C):r},C.xScale=function(e){return arguments.length?(i=e,C):i},C.yScale=function(e){return arguments.length?(s=e,C):s},C.xDomain=function(e){return arguments.length?(y=e,C):y},C.yDomain=function(e){return arguments.length?(b=e,C):b},C.xRange=function(e){return arguments.length?(w=e,C):w},C.yRange=function(e){return arguments.length?(E=e,C):E},C.forceY=function(e){return arguments.length?(f=e,C):f},C.stacked=function(e){return arguments.length?(c=e,C):c},C.stackOffset=function(e){return arguments.length?(h=e,C):h},C.clipEdge=function(e){return arguments.length?(l=e,C):l},C.color=function(t){return arguments.length?(p=e.utils.getColor(t),C):p},C.barColor=function(t){return arguments.length?(v=e.utils.getColor(t),C):v},C.disabled=function(e){return arguments.length?(m=e,C):m},C.id=function(e){return arguments.length?(o=e,C):o},C.hideable=function(e){return arguments.length?(d=e,C):d},C.delay=function(e){return arguments.length?(g=e,C):g},C.groupSpacing=function(e){return arguments.length?(S=e,C):S},C},e.models.multiBarChart=function(){"use strict";function A(e){return e.each(function(e){var b=d3.select(this),O=this,M=(u||parseInt(b.style("width"))||960)-o.left-o.right,_=(a||parseInt(b.style("height"))||400)-o.top-o.bottom;A.update=function(){b.transition().duration(k).call(A)},A.container=this,S.disabled=e.map(function(e){return!!e.disabled});if(!x){var D;x={};for(D in S)S[D]instanceof Array?x[D]=S[D].slice(0):x[D]=S[D]}if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var P=b.selectAll(".nv-noData").data([T]);return P.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),P.attr("x",o.left+M/2).attr("y",o.top+_/2).text(function(e){return e}),A}b.selectAll(".nv-noData").remove(),w=t.xScale(),E=t.yScale();var H=b.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([e]),B=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),j=H.select("g");B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis"),B.append("g").attr("class","nv-barsWrap"),B.append("g").attr("class","nv-legendWrap"),B.append("g").attr("class","nv-controlsWrap"),c&&(i.width(M-C()),t.barColor()&&e.forEach(function(e,t){e.color=d3.rgb("#ccc").darker(t*1.5).toString()}),j.select(".nv-legendWrap").datum(e).call(i),o.top!=i.height()&&(o.top=i.height(),_=(a||parseInt(b.style("height"))||400)-o.top-o.bottom),j.select(".nv-legendWrap").attr("transform","translate("+C()+","+ -o.top+")"));if(l){var F=[{key:"Grouped",disabled:t.stacked()},{key:"Stacked",disabled:!t.stacked()}];s.width(C()).color(["#444","#444","#444"]),j.select(".nv-controlsWrap").datum(F).attr("transform","translate(0,"+ -o.top+")").call(s)}H.attr("transform","translate("+o.left+","+o.top+")"),d&&j.select(".nv-y.nv-axis").attr("transform","translate("+M+",0)"),t.disabled(e.map(function(e){return e.disabled})).width(M).height(_).color(e.map(function(e,t){return e.color||f(e,t)}).filter(function(t,n){return!e[n].disabled}));var I=j.select(".nv-barsWrap").datum(e.filter(function(e){return!e.disabled}));I.transition().call(t);if(h){n.scale(w).ticks(M/100).tickSize(-_,0),j.select(".nv-x.nv-axis").attr("transform","translate(0,"+E.range()[0]+")"),j.select(".nv-x.nv-axis").transition().call(n);var q=j.select(".nv-x.nv-axis > g").selectAll("g");q.selectAll("line, text").style("opacity",1);if(m){var R=function(e,t){return"translate("+e+","+t+")"},U=5,z=17;q.selectAll("text").attr("transform",function(e,t,n){return R(0,n%2==0?U:z)});var W=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;j.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(e,t){return R(0,t===0||W%2!==0?z:U)})}v&&q.filter(function(t,n){return n%Math.ceil(e[0].values.length/(M/100))!==0}).selectAll("text, line").style("opacity",0),g&&q.selectAll(".tick text").attr("transform","rotate("+g+" 0,0)").style("text-anchor",g>0?"start":"end"),j.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}p&&(r.scale(E).ticks(_/36).tickSize(-M,0),j.select(".nv-y.nv-axis").transition().call(r)),i.dispatch.on("stateChange",function(e){S=e,N.stateChange(S),A.update()}),s.dispatch.on("legendClick",function(e,n){if(!e.disabled)return;F=F.map(function(e){return e.disabled=!0,e}),e.disabled=!1;switch(e.key){case"Grouped":t.stacked(!1);break;case"Stacked":t.stacked(!0)}S.stacked=t.stacked(),N.stateChange(S),A.update()}),N.on("tooltipShow",function(e){y&&L(e,O.parentNode)}),N.on("changeState",function(n){typeof n.disabled!="undefined"&&(e.forEach(function(e,t){e.disabled=n.disabled[t]}),S.disabled=n.disabled),typeof n.stacked!="undefined"&&(t.stacked(n.stacked),S.stacked=n.stacked),A.update()})}),A}var t=e.models.multiBar(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o={top:30,right:20,bottom:50,left:60},u=null,a=null,f=e.utils.defaultColor(),l=!0,c=!0,h=!0,p=!0,d=!1,v=!0,m=!1,g=0,y=!0,b=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" on "+t+"</p>"},w,E,S={stacked:!1},x=null,T="No Data Available.",N=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),C=function(){return l?180:0},k=250;t.stacked(!1),n.orient("bottom").tickPadding(7).highlightZero(!0).showMaxMin(!1).tickFormat(function(e){return e}),r.orient(d?"right":"left").tickFormat(d3.format(",.1f")),s.updateState(!1);var L=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=b(i.series.key,a,f,i,A);e.tooltip.show([o,u],l,i.value<0?"n":"s",null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+o.left,e.pos[1]+o.top],N.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){N.tooltipHide(e)}),N.on("tooltipHide",function(){y&&e.tooltip.cleanup()}),A.dispatch=N,A.multibar=t,A.legend=i,A.xAxis=n,A.yAxis=r,d3.rebind(A,t,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","stacked","stackOffset","delay","barColor","groupSpacing"),A.options=e.utils.optionsFunc.bind(A),A.margin=function(e){return arguments.length?(o.top=typeof e.top!="undefined"?e.top:o.top,o.right=typeof e.right!="undefined"?e.right:o.right,o.bottom=typeof e.bottom!="undefined"?e.bottom:o.bottom,o.left=typeof e.left!="undefined"?e.left:o.left,A):o},A.width=function(e){return arguments.length?(u=e,A):u},A.height=function(e){return arguments.length?(a=e,A):a},A.color=function(t){return arguments.length?(f=e.utils.getColor(t),i.color(f),A):f},A.showControls=function(e){return arguments.length?(l=e,A):l},A.showLegend=function(e){return arguments.length?(c=e,A):c},A.showXAxis=function(e){return arguments.length?(h=e,A):h},A.showYAxis=function(e){return arguments.length?(p=e,A):p},A.rightAlignYAxis=function(e){return arguments.length?(d=e,r.orient(e?"right":"left"),A):d},A.reduceXTicks=function(e){return arguments.length?(v=e,A):v},A.rotateLabels=function(e){return arguments.length?(g=e,A):g},A.staggerLabels=function(e){return arguments.length?(m=e,A):m},A.tooltip=function(e){return arguments.length?(b=e,A):b},A.tooltips=function(e){return arguments.length?(y=e,A):y},A.tooltipContent=function(e){return arguments.length?(b=e,A):b},A.state=function(e){return arguments.length?(S=e,A):S},A.defaultState=function(e){return arguments.length?(x=e,A):x},A.noData=function(e){return arguments.length?(T=e,A):T},A.transitionDuration=function(e){return arguments.length?(k=e,A):k},A},e.models.multiBarHorizontal=function(){"use strict";function N(e){return e.each(function(e){var i=n-t.left-t.right,g=r-t.top-t.bottom,N=d3.select(this);p&&(e=d3.layout.stack().offset("zero").values(function(e){return e.values}).y(a)(e)),e=e.map(function(e,t){return e.values=e.values.map(function(e){return e.series=t,e}),e}),p&&e[0].values.map(function(t,n){var r=0,i=0;e.map(function(e){var t=e.values[n];t.size=Math.abs(t.y),t.y<0?(t.y1=i-t.size,i-=t.size):(t.y1=r,r+=t.size)})});var C=y&&b?[]:e.map(function(e){return e.values.map(function(e,t){return{x:u(e,t),y:a(e,t),y0:e.y0,y1:e.y1}})});s.domain(y||d3.merge(C).map(function(e){return e.x})).rangeBands(w||[0,g],.1),o.domain(b||d3.extent(d3.merge(C).map(function(e){return p?e.y>0?e.y1+e.y:e.y1:e.y}).concat(f))),d&&!p?o.range(E||[o.domain()[0]<0?v:0,i-(o.domain()[1]>0?v:0)]):o.range(E||[0,i]),x=x||s,T=T||d3.scale.linear().domain(o.domain()).range([o(0),o(0)]);var k=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([e]),L=k.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),A=L.append("defs"),O=L.append("g"),M=k.select("g");O.append("g").attr("class","nv-groups"),k.attr("transform","translate("+t.left+","+t.top+")");var _=k.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e,t){return t});_.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),_.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),_.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}).style("fill",function(e,t){return l(e,t)}).style("stroke",function(e,t){return l(e,t)}),_.transition().style("stroke-opacity",1).style("fill-opacity",.75);var D=_.selectAll("g.nv-bar").data(function(e){return e.values});D.exit().remove();var P=D.enter().append("g").attr("transform",function(t,n,r){return"translate("+T(p?t.y0:0)+","+(p?0:r*s.rangeBand()/e.length+s(u(t,n)))+")"});P.append("rect").attr("width",0).attr("height",s.rangeBand()/(p?1:e.length)),D.on("mouseover",function(t,n){d3.select(this).classed("hover",!0),S.elementMouseover({value:a(t,n),point:t,series:e[t.series],pos:[o(a(t,n)+(p?t.y0:0)),s(u(t,n))+s.rangeBand()*(p?e.length/2:t.series+.5)/e.length],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),S.elementMouseout({value:a(t,n),point:t,series:e[t.series],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("click",function(t,n){S.elementClick({value:a(t,n),point:t,series:e[t.series],pos:[s(u(t,n))+s.rangeBand()*(p?e.length/2:t.series+.5)/e.length,o(a(t,n)+(p?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(t,n){S.elementDblClick({value:a(t,n),point:t,series:e[t.series],pos:[s(u(t,n))+s.rangeBand()*(p?e.length/2:t.series+.5)/e.length,o(a(t,n)+(p?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}),P.append("text"),d&&!p?(D.select("text").attr("text-anchor",function(e,t){return a(e,t)<0?"end":"start"}).attr("y",s.rangeBand()/(e.length*2)).attr("dy",".32em").text(function(e,t){return m(a(e,t))}),D.transition().select("text").attr("x",function(e,t){return a(e,t)<0?-4:o(a(e,t))-o(0)+4})):D.selectAll("text").text(""),D.attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}),c&&(h||(h=e.map(function(){return!0})),D.style("fill",function(e,t,n){return d3.rgb(c(e,t)).darker(h.map(function(e,t){return t}).filter(function(e,t){return!h[t]})[n]).toString()}).style("stroke",function(e,t,n){return d3.rgb(c(e,t)).darker(h.map(function(e,t){return t}).filter(function(e,t){return!h[t]})[n]).toString()})),p?D.transition().attr("transform",function(e,t){return"translate("+o(e.y1)+","+s(u(e,t))+")"}).select("rect").attr("width",function(e,t){return Math.abs(o(a(e,t)+e.y0)-o(e.y0))}).attr("height",s.rangeBand()):D.transition().attr("transform",function(t,n){return"translate("+(a(t,n)<0?o(a(t,n)):o(0))+","+(t.series*s.rangeBand()/e.length+s(u(t,n)))+")"}).select("rect").attr("height",s.rangeBand()/e.length).attr("width",function(e,t){return Math.max(Math.abs(o(a(e,t))-o(0)),1)}),x=s.copy(),T=o.copy()}),N}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.ordinal(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=[0],l=e.utils.defaultColor(),c=null,h,p=!1,d=!1,v=60,m=d3.format(",.2f"),g=1200,y,b,w,E,S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),x,T;return N.dispatch=S,N.options=e.utils.optionsFunc.bind(N),N.x=function(e){return arguments.length?(u=e,N):u},N.y=function(e){return arguments.length?(a=e,N):a},N.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,N):t},N.width=function(e){return arguments.length?(n=e,N):n},N.height=function(e){return arguments.length?(r=e,N):r},N.xScale=function(e){return arguments.length?(s=e,N):s},N.yScale=function(e){return arguments.length?(o=e,N):o},N.xDomain=function(e){return arguments.length?(y=e,N):y},N.yDomain=function(e){return arguments.length?(b=e,N):b},N.xRange=function(e){return arguments.length?(w=e,N):w},N.yRange=function(e){return arguments.length?(E=e,N):E},N.forceY=function(e){return arguments.length?(f=e,N):f},N.stacked=function(e){return arguments.length?(p=e,N):p},N.color=function(t){return arguments.length?(l=e.utils.getColor(t),N):l},N.barColor=function(t){return arguments.length?(c=e.utils.getColor(t),N):c},N.disabled=function(e){return arguments.length?(h=e,N):h},N.id=function(e){return arguments.length?(i=e,N):i},N.delay=function(e){return arguments.length?(g=e,N):g},N.showValues=function(e){return arguments.length?(d=e,N):d},N.valueFormat=function(e){return arguments.length?(m=e,N):m},N.valuePadding=function(e){return arguments.length?(v=e,N):v},N},e.models.multiBarHorizontalChart=function(){"use strict";function T(e){return e.each(function(h){var d=d3.select(this),N=this,C=(u||parseInt(d.style("width"))||960)-o.left-o.right,k=(a||parseInt(d.style("height"))||400)-o.top-o.bottom;T.update=function(){d.transition().duration(S).call(T)},T.container=this,g.disabled=h.map(function(e){return!!e.disabled});if(!y){var L;y={};for(L in g)g[L]instanceof Array?y[L]=g[L].slice(0):y[L]=g[L]}if(!h||!h.length||!h.filter(function(e){return e.values.length}).length){var A=d.selectAll(".nv-noData").data([b]);return A.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),A.attr("x",o.left+C/2).attr("y",o.top+k/2).text(function(e){return e}),T}d.selectAll(".nv-noData").remove(),v=t.xScale(),m=t.yScale();var O=d.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([h]),M=O.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),_=O.select("g");M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis"),M.append("g").attr("class","nv-barsWrap"),M.append("g").attr("class","nv-legendWrap"),M.append("g").attr("class","nv-controlsWrap"),c&&(i.width(C-E()),t.barColor()&&h.forEach(function(e,t){e.color=d3.rgb("#ccc").darker(t*1.5).toString()}),_.select(".nv-legendWrap").datum(h).call(i),o.top!=i.height()&&(o.top=i.height(),k=(a||parseInt(d.style("height"))||400)-o.top-o.bottom),_.select(".nv-legendWrap").attr("transform","translate("+E()+","+ -o.top+")"));if(l){var D=[{key:"Grouped",disabled:t.stacked()},{key:"Stacked",disabled:!t.stacked()}];s.width(E()).color(["#444","#444","#444"]),_.select(".nv-controlsWrap").datum(D).attr("transform","translate(0,"+ -o.top+")").call(s)}O.attr("transform","translate("+o.left+","+o.top+")"),t.disabled(h.map(function(e){return e.disabled})).width(C).height(k).color(h.map(function(e,t){return e.color||f(e,t)}).filter(function(e,t){return!h[t].disabled}));var P=_.select(".nv-barsWrap").datum(h.filter(function(e){return!e.disabled}));P.transition().call(t),n.scale(v).ticks(k/24).tickSize(-C,0),_.select(".nv-x.nv-axis").transition().call(n);var H=_.select(".nv-x.nv-axis").selectAll("g");H.selectAll("line, text").style("opacity",1),r.scale(m).ticks(C/100).tickSize(-k,0),_.select(".nv-y.nv-axis").attr("transform","translate(0,"+k+")"),_.select(".nv-y.nv-axis").transition().call(r),i.dispatch.on("stateChange",function(e){g=e,w.stateChange(g),T.update()}),s.dispatch.on("legendClick",function(e,n){if(!e.disabled)return;D=D.map(function(e){return e.disabled=!0,e}),e.disabled=!1;switch(e.key){case"Grouped":t.stacked(!1);break;case"Stacked":t.stacked(!0)}g.stacked=t.stacked(),w.stateChange(g),T.update()}),w.on("tooltipShow",function(e){p&&x(e,N.parentNode)}),w.on("changeState",function(n){typeof n.disabled!="undefined"&&(h.forEach(function(e,t){e.disabled=n.disabled[t]}),g.disabled=n.disabled),typeof n.stacked!="undefined"&&(t.stacked(n.stacked),g.stacked=n.stacked),e.call(T)})}),T}var t=e.models.multiBarHorizontal(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend().height(30),s=e.models.legend().height(30),o={top:30,right:20,bottom:50,left:60},u=null,a=null,f=e.utils.defaultColor(),l=!0,c=!0,h=!1,p=!0,d=function(e,t,n,r,i){return"<h3>"+e+" - "+t+"</h3>"+"<p>"+n+"</p>"},v,m,g={stacked:h},y=null,b="No Data Available.",w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),E=function(){return l?180:0},S=250;t.stacked(h),n.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(e){return e}),r.orient("bottom").tickFormat(d3.format(",.1f")),s.updateState(!1);var x=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=d(i.series.key,a,f,i,T);e.tooltip.show([o,u],l,i.value<0?"e":"w",null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+o.left,e.pos[1]+o.top],w.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){w.tooltipHide(e)}),w.on("tooltipHide",function(){p&&e.tooltip.cleanup()}),T.dispatch=w,T.multibar=t,T.legend=i,T.xAxis=n,T.yAxis=r,d3.rebind(T,t,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","delay","showValues","valueFormat","stacked","barColor"),T.options=e.utils.optionsFunc.bind(T),T.margin=function(e){return arguments.length?(o.top=typeof e.top!="undefined"?e.top:o.top,o.right=typeof e.right!="undefined"?e.right:o.right,o.bottom=typeof e.bottom!="undefined"?e.bottom:o.bottom,o.left=typeof e.left!="undefined"?e.left:o.left,T):o},T.width=function(e){return arguments.length?(u=e,T):u},T.height=function(e){return arguments.length?(a=e,T):a},T.color=function(t){return arguments.length?(f=e.utils.getColor(t),i.color(f),T):f},T.showControls=function(e){return arguments.length?(l=e,T):l},T.showLegend=function(e){return arguments.length?(c=e,T):c},T.tooltip=function(e){return arguments.length?(d=e,T):d},T.tooltips=function(e){return arguments.length?(p=e,T):p},T.tooltipContent=function(e){return arguments.length?(d=e,T):d},T.state=function(e){return arguments.length?(g=e,T):g},T.defaultState=function(e){return arguments.length?(y=e,T):y},T.noData=function(e){return arguments.length?(b=e,T):b},T.transitionDuration=function(e){return arguments.length?(S=e,T):S},T},e.models.multiChart=function(){"use strict";function C(e){return e.each(function(e){var u=d3.select(this),f=this;C.update=function(){u.transition().call(C)},C.container=this;var k=(r||parseInt(u.style("width"))||960)-t.left-t.right,L=(i||parseInt(u.style("height"))||400)-t.top-t.bottom,A=e.filter(function(e){return!e.disabled&&e.type=="line"&&e.yAxis==1}),O=e.filter(function(e){return!e.disabled&&e.type=="line"&&e.yAxis==2}),M=e.filter(function(e){return!e.disabled&&e.type=="bar"&&e.yAxis==1}),_=e.filter(function(e){return!e.disabled&&e.type=="bar"&&e.yAxis==2}),D=e.filter(function(e){return!e.disabled&&e.type=="area"&&e.yAxis==1}),P=e.filter(function(e){return!e.disabled&&e.type=="area"&&e.yAxis==2}),H=e.filter(function(e){return!e.disabled&&e.yAxis==1}).map(function(e){return e.values.map(function(e,t){return{x:e.x,y:e.y}})}),B=e.filter(function(e){return!e.disabled&&e.yAxis==2}).map(function(e){return e.values.map(function(e,t){return{x:e.x,y:e.y}})});a.domain(d3.extent(d3.merge(H.concat(B)),function(e){return e.x})).range([0,k]);var j=u.selectAll("g.wrap.multiChart").data([e]),F=j.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");F.append("g").attr("class","x axis"),F.append("g").attr("class","y1 axis"),F.append("g").attr("class","y2 axis"),F.append("g").attr("class","lines1Wrap"),F.append("g").attr("class","lines2Wrap"),F.append("g").attr("class","bars1Wrap"),F.append("g").attr("class","bars2Wrap"),F.append("g").attr("class","stack1Wrap"),F.append("g").attr("class","stack2Wrap"),F.append("g").attr("class","legendWrap");var I=j.select("g");s&&(x.width(k/2),I.select(".legendWrap").datum(e.map(function(e){return e.originalKey=e.originalKey===undefined?e.key:e.originalKey,e.key=e.originalKey+(e.yAxis==1?"":" (right axis)"),e})).call(x),t.top!=x.height()&&(t.top=x.height(),L=(i||parseInt(u.style("height"))||400)-t.top-t.bottom),I.select(".legendWrap").attr("transform","translate("+k/2+","+ -t.top+")")),d.width(k).height(L).interpolate("monotone").color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==1&&e[n].type=="line"})),v.width(k).height(L).interpolate("monotone").color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==2&&e[n].type=="line"})),m.width(k).height(L).color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==1&&e[n].type=="bar"})),g.width(k).height(L).color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==2&&e[n].type=="bar"})),y.width(k).height(L).color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==1&&e[n].type=="area"})),b.width(k).height(L).color(e.map(function(e,t){return e.color||n[t%n.length]}).filter(function(t,n){return!e[n].disabled&&e[n].yAxis==2&&e[n].type=="area"})),I.attr("transform","translate("+t.left+","+t.top+")");var q=I.select(".lines1Wrap").datum(A),R=I.select(".bars1Wrap").datum(M),U=I.select(".stack1Wrap").datum(D),z=I.select(".lines2Wrap").datum(O),W=I.select(".bars2Wrap").datum(_),X=I.select(".stack2Wrap").datum(P),V=D.length?D.map(function(e){return e.values}).reduce(function(e,t){return e.map(function(e,n){return{x:e.x,y:e.y+t[n].y}})}).concat([{x:0,y:0}]):[],$=P.length?P.map(function(e){return e.values}).reduce(function(e,t){return e.map(function(e,n){return{x:e.x,y:e.y+t[n].y}})}).concat([{x:0,y:0}]):[];h.domain(l||d3.extent(d3.merge(H).concat(V),function(e){return e.y})).range([0,L]),p.domain(c||d3.extent(d3.merge(B).concat($),function(e){return e.y})).range([0,L]),d.yDomain(h.domain()),m.yDomain(h.domain()),y.yDomain(h.domain()),v.yDomain(p.domain()),g.yDomain(p.domain()),b.yDomain(p.domain()),D.length&&d3.transition(U).call(y),P.length&&d3.transition(X).call(b),M.length&&d3.transition(R).call(m),_.length&&d3.transition(W).call(g),A.length&&d3.transition(q).call(d),O.length&&d3.transition(z).call(v),w.ticks(k/100).tickSize(-L,0),I.select(".x.axis").attr("transform","translate(0,"+L+")"),d3.transition(I.select(".x.axis")).call(w),E.ticks(L/36).tickSize(-k,0),d3.transition(I.select(".y1.axis")).call(E),S.ticks(L/36).tickSize(-k,0),d3.transition(I.select(".y2.axis")).call(S),I.select(".y2.axis").style("opacity",B.length?1:0).attr("transform","translate("+a.range()[1]+",0)"),x.dispatch.on("stateChange",function(e){C.update()}),T.on("tooltipShow",function(e){o&&N(e,f.parentNode)})}),C}var t={top:30,right:20,bottom:50,left:60},n=d3.scale.category20().range(),r=null,i=null,s=!0,o=!0,u=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" at "+t+"</p>"},a,f,l,c,a=d3.scale.linear(),h=d3.scale.linear(),p=d3.scale.linear(),d=e.models.line().yScale(h),v=e.models.line().yScale(p),m=e.models.multiBar().stacked(!1).yScale(h),g=e.models.multiBar().stacked(!1).yScale(p),y=e.models.stackedArea().yScale(h),b=e.models.stackedArea().yScale(p),w=e.models.axis().scale(a).orient("bottom").tickPadding(5),E=e.models.axis().scale(h).orient("left"),S=e.models.axis().scale(p).orient("right"),x=e.models.legend().height(30),T=d3.dispatch("tooltipShow","tooltipHide"),N=function(t,n){var r=t.pos[0]+(n.offsetLeft||0),i=t.pos[1]+(n.offsetTop||0),s=w.tickFormat()(d.x()(t.point,t.pointIndex)),o=(t.series.yAxis==2?S:E).tickFormat()(d.y()(t.point,t.pointIndex)),a=u(t.series.key,s,o,t,C);e.tooltip.show([r,i],a,undefined,undefined,n.offsetParent)};return d.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),d.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),v.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),v.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),m.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),m.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),g.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),g.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),y.dispatch.on("tooltipShow",function(e){if(!Math.round(y.y()(e.point)*100))return setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1;e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),y.dispatch.on("tooltipHide",function(e){T.tooltipHide(e)}),b.dispatch.on("tooltipShow",function(e){if(!Math.round(b.y()(e.point)*100))return setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1;e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),b.dispatch.on("tooltipHide",function(e){T.tooltipHide(e)}),d.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),d.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),v.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],T.tooltipShow(e)}),v.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),T.on("tooltipHide",function(){o&&e.tooltip.cleanup()}),C.dispatch=T,C.lines1=d,C.lines2=v,C.bars1=m,C.bars2=g,C.stack1=y,C.stack2=b,C.xAxis=w,C.yAxis1=E,C.yAxis2=S,C.options=e.utils.optionsFunc.bind(C),C.x=function(e){return arguments.length?(getX=e,d.x(e),m.x(e),C):getX},C.y=function(e){return arguments.length?(getY=e,d.y(e),m.y(e),C):getY},C.yDomain1=function(e){return arguments.length?(l=e,C):l},C.yDomain2=function(e){return arguments.length?(c=e,C):c},C.margin=function(e){return arguments.length?(t=e,C):t},C.width=function(e){return arguments.length?(r=e,C):r},C.height=function(e){return arguments.length?(i=e,C):i},C.color=function(e){return arguments.length?(n=e,x.color(e),C):n},C.showLegend=function(e){return arguments.length?(s=e,C):s},C.tooltips=function(e){return arguments.length?(o=e,C):o},C.tooltipContent=function(e){return arguments.length?(u=e,C):u},C},e.models.ohlcBar=function(){"use strict";function x(e){return e.each(function(e){var g=n-t.left-t.right,x=r-t.top-t.bottom,T=d3.select(this);s.domain(y||d3.extent(e[0].values.map(u).concat(p))),v?s.range(w||[g*.5/e[0].values.length,g*(e[0].values.length-.5)/e[0].values.length]):s.range(w||[0,g]),o.domain(b||[d3.min(e[0].values.map(h).concat(d)),d3.max(e[0].values.map(c).concat(d))]).range(E||[x,0]),s.domain()[0]===s.domain()[1]&&(s.domain()[0]?s.domain([s.domain()[0]-s.domain()[0]*.01,s.domain()[1]+s.domain()[1]*.01]):s.domain([-1,1])),o.domain()[0]===o.domain()[1]&&(o.domain()[0]?o.domain([o.domain()[0]+o.domain()[0]*.01,o.domain()[1]-o.domain()[1]*.01]):o.domain([-1,1]));var N=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([e[0].values]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),k=C.append("defs"),L=C.append("g"),A=N.select("g");L.append("g").attr("class","nv-ticks"),N.attr("transform","translate("+t.left+","+t.top+")"),T.on("click",function(e,t){S.chartClick({data:e,index:t,pos:d3.event,id:i})}),k.append("clipPath").attr("id","nv-chart-clip-path-"+i).append("rect"),N.select("#nv-chart-clip-path-"+i+" rect").attr("width",g).attr("height",x),A.attr("clip-path",m?"url(#nv-chart-clip-path-"+i+")":"");var O=N.select(".nv-ticks").selectAll(".nv-tick").data(function(e){return e});O.exit().remove();var M=O.enter().append("path").attr("class",function(e,t,n){return(f(e,t)>l(e,t)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+t}).attr("d",function(t,n){var r=g/e[0].values.length*.9;return"m0,0l0,"+(o(f(t,n))-o(c(t,n)))+"l"+ -r/2+",0l"+r/2+",0l0,"+(o(h(t,n))-o(f(t,n)))+"l0,"+(o(l(t,n))-o(h(t,n)))+"l"+r/2+",0l"+ -r/2+",0z"}).attr("transform",function(e,t){return"translate("+s(u(e,t))+","+o(c(e,t))+")"}).on("mouseover",function(t,n){d3.select(this).classed("hover",!0),S.elementMouseover({point:t,series:e[0],pos:[s(u(t,n)),o(a(t,n))],pointIndex:n,seriesIndex:0,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),S.elementMouseout({point:t,series:e[0],pointIndex:n,seriesIndex:0,e:d3.event})}).on("click",function(e,t){S.elementClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()}).on("dblclick",function(e,t){S.elementDblClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()});O.attr("class",function(e,t,n){return(f(e,t)>l(e,t)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+t}),d3.transition(O).attr("transform",function(e,t){return"translate("+s(u(e,t))+","+o(c(e,t))+")"}).attr("d",function(t,n){var r=g/e[0].values.length*.9;return"m0,0l0,"+(o(f(t,n))-o(c(t,n)))+"l"+ -r/2+",0l"+r/2+",0l0,"+(o(h(t,n))-o(f(t,n)))+"l0,"+(o(l(t,n))-o(h(t,n)))+"l"+r/2+",0l"+ -r/2+",0z"})}),x}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=function(e){return e.open},l=function(e){return e.close},c=function(e){return e.high},h=function(e){return e.low},p=[],d=[],v=!1,m=!0,g=e.utils.defaultColor(),y,b,w,E,S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return x.dispatch=S,x.options=e.utils.optionsFunc.bind(x),x.x=function(e){return arguments.length?(u=e,x):u},x.y=function(e){return arguments.length?(a=e,x):a},x.open=function(e){return arguments.length?(f=e,x):f},x.close=function(e){return arguments.length?(l=e,x):l},x.high=function(e){return arguments.length?(c=e,x):c},x.low=function( +e){return arguments.length?(h=e,x):h},x.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,x):t},x.width=function(e){return arguments.length?(n=e,x):n},x.height=function(e){return arguments.length?(r=e,x):r},x.xScale=function(e){return arguments.length?(s=e,x):s},x.yScale=function(e){return arguments.length?(o=e,x):o},x.xDomain=function(e){return arguments.length?(y=e,x):y},x.yDomain=function(e){return arguments.length?(b=e,x):b},x.xRange=function(e){return arguments.length?(w=e,x):w},x.yRange=function(e){return arguments.length?(E=e,x):E},x.forceX=function(e){return arguments.length?(p=e,x):p},x.forceY=function(e){return arguments.length?(d=e,x):d},x.padData=function(e){return arguments.length?(v=e,x):v},x.clipEdge=function(e){return arguments.length?(m=e,x):m},x.color=function(t){return arguments.length?(g=e.utils.getColor(t),x):g},x.id=function(e){return arguments.length?(i=e,x):i},x},e.models.pie=function(){"use strict";function E(e){return e.each(function(e){function P(e){var t=(e.startAngle+e.endAngle)*90/Math.PI-90;return t>90?t-180:t}function H(e){e.endAngle=isNaN(e.endAngle)?0:e.endAngle,e.startAngle=isNaN(e.startAngle)?0:e.startAngle,v||(e.innerRadius=0);var t=d3.interpolate(this._current,e);return this._current=t(0),function(e){return L(t(e))}}function B(e){e.innerRadius=0;var t=d3.interpolate({startAngle:0,endAngle:0},e);return function(e){return L(t(e))}}var o=n-t.left-t.right,f=r-t.top-t.bottom,E=Math.min(o,f)/2,S=E-E/5,x=d3.select(this),T=x.selectAll(".nv-wrap.nv-pie").data(e),N=T.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+u),C=N.append("g"),k=T.select("g");C.append("g").attr("class","nv-pie"),T.attr("transform","translate("+t.left+","+t.top+")"),k.select(".nv-pie").attr("transform","translate("+o/2+","+f/2+")"),x.on("click",function(e,t){w.chartClick({data:e,index:t,pos:d3.event,id:u})});var L=d3.svg.arc().outerRadius(S);g&&L.startAngle(g),y&&L.endAngle(y),v&&L.innerRadius(E*b);var A=d3.layout.pie().sort(null).value(function(e){return e.disabled?0:s(e)}),O=T.select(".nv-pie").selectAll(".nv-slice").data(A);O.exit().remove();var M=O.enter().append("g").attr("class","nv-slice").on("mouseover",function(e,t){d3.select(this).classed("hover",!0),w.elementMouseover({label:i(e.data),value:s(e.data),point:e.data,pointIndex:t,pos:[d3.event.pageX,d3.event.pageY],id:u})}).on("mouseout",function(e,t){d3.select(this).classed("hover",!1),w.elementMouseout({label:i(e.data),value:s(e.data),point:e.data,index:t,id:u})}).on("click",function(e,t){w.elementClick({label:i(e.data),value:s(e.data),point:e.data,index:t,pos:d3.event,id:u}),d3.event.stopPropagation()}).on("dblclick",function(e,t){w.elementDblClick({label:i(e.data),value:s(e.data),point:e.data,index:t,pos:d3.event,id:u}),d3.event.stopPropagation()});O.attr("fill",function(e,t){return a(e,t)}).attr("stroke",function(e,t){return a(e,t)});var _=M.append("path").each(function(e){this._current=e});d3.transition(O.select("path")).attr("d",L).attrTween("d",H);if(l){var D=d3.svg.arc().innerRadius(0);c&&(D=L),h&&(D=d3.svg.arc().outerRadius(L.outerRadius())),M.append("g").classed("nv-label",!0).each(function(e,t){var n=d3.select(this);n.attr("transform",function(e){if(m){e.outerRadius=S+10,e.innerRadius=S+15;var t=(e.startAngle+e.endAngle)/2*(180/Math.PI);return(e.startAngle+e.endAngle)/2<Math.PI?t-=90:t+=90,"translate("+D.centroid(e)+") rotate("+t+")"}return e.outerRadius=E+10,e.innerRadius=E+15,"translate("+D.centroid(e)+")"}),n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text").style("text-anchor",m?(e.startAngle+e.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}),O.select(".nv-label").transition().attr("transform",function(e){if(m){e.outerRadius=S+10,e.innerRadius=S+15;var t=(e.startAngle+e.endAngle)/2*(180/Math.PI);return(e.startAngle+e.endAngle)/2<Math.PI?t-=90:t+=90,"translate("+D.centroid(e)+") rotate("+t+")"}return e.outerRadius=E+10,e.innerRadius=E+15,"translate("+D.centroid(e)+")"}),O.each(function(e,t){var n=d3.select(this);n.select(".nv-label text").style("text-anchor",m?(e.startAngle+e.endAngle)/2<Math.PI?"start":"end":"middle").text(function(e,t){var n=(e.endAngle-e.startAngle)/(2*Math.PI),r={key:i(e.data),value:s(e.data),percent:d3.format("%")(n)};return e.value&&n>d?r[p]:""});var r=n.select("text").node().getBBox();n.select(".nv-label rect").attr("width",r.width+10).attr("height",r.height+10).attr("transform",function(){return"translate("+[r.x-5,r.y-5]+")"})})}}),E}var t={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(e){return e.x},s=function(e){return e.y},o=function(e){return e.description},u=Math.floor(Math.random()*1e4),a=e.utils.defaultColor(),f=d3.format(",.2f"),l=!0,c=!0,h=!1,p="key",d=.02,v=!1,m=!1,g=!1,y=!1,b=.5,w=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return E.dispatch=w,E.options=e.utils.optionsFunc.bind(E),E.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,E):t},E.width=function(e){return arguments.length?(n=e,E):n},E.height=function(e){return arguments.length?(r=e,E):r},E.values=function(t){return e.log("pie.values() is no longer supported."),E},E.x=function(e){return arguments.length?(i=e,E):i},E.y=function(e){return arguments.length?(s=d3.functor(e),E):s},E.description=function(e){return arguments.length?(o=e,E):o},E.showLabels=function(e){return arguments.length?(l=e,E):l},E.labelSunbeamLayout=function(e){return arguments.length?(m=e,E):m},E.donutLabelsOutside=function(e){return arguments.length?(h=e,E):h},E.pieLabelsOutside=function(e){return arguments.length?(c=e,E):c},E.labelType=function(e){return arguments.length?(p=e,p=p||"key",E):p},E.donut=function(e){return arguments.length?(v=e,E):v},E.donutRatio=function(e){return arguments.length?(b=e,E):b},E.startAngle=function(e){return arguments.length?(g=e,E):g},E.endAngle=function(e){return arguments.length?(y=e,E):y},E.id=function(e){return arguments.length?(u=e,E):u},E.color=function(t){return arguments.length?(a=e.utils.getColor(t),E):a},E.valueFormat=function(e){return arguments.length?(f=e,E):f},E.labelThreshold=function(e){return arguments.length?(d=e,E):d},E},e.models.pieChart=function(){"use strict";function v(e){return e.each(function(e){var u=d3.select(this),a=this,f=(i||parseInt(u.style("width"))||960)-r.left-r.right,d=(s||parseInt(u.style("height"))||400)-r.top-r.bottom;v.update=function(){u.transition().call(v)},v.container=this,l.disabled=e.map(function(e){return!!e.disabled});if(!c){var m;c={};for(m in l)l[m]instanceof Array?c[m]=l[m].slice(0):c[m]=l[m]}if(!e||!e.length){var g=u.selectAll(".nv-noData").data([h]);return g.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),g.attr("x",r.left+f/2).attr("y",r.top+d/2).text(function(e){return e}),v}u.selectAll(".nv-noData").remove();var y=u.selectAll("g.nv-wrap.nv-pieChart").data([e]),b=y.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),w=y.select("g");b.append("g").attr("class","nv-pieWrap"),b.append("g").attr("class","nv-legendWrap"),o&&(n.width(f).key(t.x()),y.select(".nv-legendWrap").datum(e).call(n),r.top!=n.height()&&(r.top=n.height(),d=(s||parseInt(u.style("height"))||400)-r.top-r.bottom),y.select(".nv-legendWrap").attr("transform","translate(0,"+ -r.top+")")),y.attr("transform","translate("+r.left+","+r.top+")"),t.width(f).height(d);var E=w.select(".nv-pieWrap").datum([e]);d3.transition(E).call(t),n.dispatch.on("stateChange",function(e){l=e,p.stateChange(l),v.update()}),t.dispatch.on("elementMouseout.tooltip",function(e){p.tooltipHide(e)}),p.on("changeState",function(t){typeof t.disabled!="undefined"&&(e.forEach(function(e,n){e.disabled=t.disabled[n]}),l.disabled=t.disabled),v.update()})}),v}var t=e.models.pie(),n=e.models.legend(),r={top:30,right:20,bottom:20,left:20},i=null,s=null,o=!0,u=e.utils.defaultColor(),a=!0,f=function(e,t,n,r){return"<h3>"+e+"</h3>"+"<p>"+t+"</p>"},l={},c=null,h="No Data Available.",p=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),d=function(n,r){var i=t.description()(n.point)||t.x()(n.point),s=n.pos[0]+(r&&r.offsetLeft||0),o=n.pos[1]+(r&&r.offsetTop||0),u=t.valueFormat()(t.y()(n.point)),a=f(i,u,n,v);e.tooltip.show([s,o],a,n.value<0?"n":"s",null,r)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+r.left,e.pos[1]+r.top],p.tooltipShow(e)}),p.on("tooltipShow",function(e){a&&d(e)}),p.on("tooltipHide",function(){a&&e.tooltip.cleanup()}),v.legend=n,v.dispatch=p,v.pie=t,d3.rebind(v,t,"valueFormat","values","x","y","description","id","showLabels","donutLabelsOutside","pieLabelsOutside","labelType","donut","donutRatio","labelThreshold"),v.options=e.utils.optionsFunc.bind(v),v.margin=function(e){return arguments.length?(r.top=typeof e.top!="undefined"?e.top:r.top,r.right=typeof e.right!="undefined"?e.right:r.right,r.bottom=typeof e.bottom!="undefined"?e.bottom:r.bottom,r.left=typeof e.left!="undefined"?e.left:r.left,v):r},v.width=function(e){return arguments.length?(i=e,v):i},v.height=function(e){return arguments.length?(s=e,v):s},v.color=function(r){return arguments.length?(u=e.utils.getColor(r),n.color(u),t.color(u),v):u},v.showLegend=function(e){return arguments.length?(o=e,v):o},v.tooltips=function(e){return arguments.length?(a=e,v):a},v.tooltipContent=function(e){return arguments.length?(f=e,v):f},v.state=function(e){return arguments.length?(l=e,v):l},v.defaultState=function(e){return arguments.length?(c=e,v):c},v.noData=function(e){return arguments.length?(h=e,v):h},v},e.models.scatter=function(){"use strict";function I(q){return q.each(function(I){function Q(){if(!g)return!1;var e,i=d3.merge(I.map(function(e,t){return e.values.map(function(e,n){var r=f(e,n),i=l(e,n);return[o(r)+Math.random()*1e-7,u(i)+Math.random()*1e-7,t,n,e]}).filter(function(e,t){return b(e[4],t)})}));if(D===!0){if(x){var a=X.select("defs").selectAll(".nv-point-clips").data([s]).enter();a.append("clipPath").attr("class","nv-point-clips").attr("id","nv-points-clip-"+s);var c=X.select("#nv-points-clip-"+s).selectAll("circle").data(i);c.enter().append("circle").attr("r",T),c.exit().remove(),c.attr("cx",function(e){return e[0]}).attr("cy",function(e){return e[1]}),X.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+s+")")}i.length&&(i.push([o.range()[0]-20,u.range()[0]-20,null,null]),i.push([o.range()[1]+20,u.range()[1]+20,null,null]),i.push([o.range()[0]-20,u.range()[0]+20,null,null]),i.push([o.range()[1]+20,u.range()[1]-20,null,null]));var h=d3.geom.polygon([[-10,-10],[-10,r+10],[n+10,r+10],[n+10,-10]]),p=d3.geom.voronoi(i).map(function(e,t){return{data:h.clip(e),series:i[t][2],point:i[t][3]}}),d=X.select(".nv-point-paths").selectAll("path").data(p);d.enter().append("path").attr("class",function(e,t){return"nv-path-"+t}),d.exit().remove(),d.attr("d",function(e){return e.data.length===0?"M 0 0":"M"+e.data.join("L")+"Z"});var v=function(e,n){if(F)return 0;var r=I[e.series];if(typeof r=="undefined")return;var i=r.values[e.point];n({point:i,series:r,pos:[o(f(i,e.point))+t.left,u(l(i,e.point))+t.top],seriesIndex:e.series,pointIndex:e.point})};d.on("click",function(e){v(e,_.elementClick)}).on("mouseover",function(e){v(e,_.elementMouseover)}).on("mouseout",function(e,t){v(e,_.elementMouseout)})}else X.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(e,n){if(F||!I[e.series])return 0;var r=I[e.series],i=r.values[n];_.elementClick({point:i,series:r,pos:[o(f(i,n))+t.left,u(l(i,n))+t.top],seriesIndex:e.series,pointIndex:n})}).on("mouseover",function(e,n){if(F||!I[e.series])return 0;var r=I[e.series],i=r.values[n];_.elementMouseover({point:i,series:r,pos:[o(f(i,n))+t.left,u(l(i,n))+t.top],seriesIndex:e.series,pointIndex:n})}).on("mouseout",function(e,t){if(F||!I[e.series])return 0;var n=I[e.series],r=n.values[t];_.elementMouseout({point:r,series:n,seriesIndex:e.series,pointIndex:t})});F=!1}var q=n-t.left-t.right,R=r-t.top-t.bottom,U=d3.select(this);I.forEach(function(e,t){e.values.forEach(function(e){e.series=t})});var W=N&&C&&A?[]:d3.merge(I.map(function(e){return e.values.map(function(e,t){return{x:f(e,t),y:l(e,t),size:c(e,t)}})}));o.domain(N||d3.extent(W.map(function(e){return e.x}).concat(d))),w&&I[0]?o.range(k||[(q*E+q)/(2*I[0].values.length),q-q*(1+E)/(2*I[0].values.length)]):o.range(k||[0,q]),u.domain(C||d3.extent(W.map(function(e){return e.y}).concat(v))).range(L||[R,0]),a.domain(A||d3.extent(W.map(function(e){return e.size}).concat(m))).range(O||[16,256]);if(o.domain()[0]===o.domain()[1]||u.domain()[0]===u.domain()[1])M=!0;o.domain()[0]===o.domain()[1]&&(o.domain()[0]?o.domain([o.domain()[0]-o.domain()[0]*.01,o.domain()[1]+o.domain()[1]*.01]):o.domain([-1,1])),u.domain()[0]===u.domain()[1]&&(u.domain()[0]?u.domain([u.domain()[0]-u.domain()[0]*.01,u.domain()[1]+u.domain()[1]*.01]):u.domain([-1,1])),isNaN(o.domain()[0])&&o.domain([-1,1]),isNaN(u.domain()[0])&&u.domain([-1,1]),P=P||o,H=H||u,B=B||a;var X=U.selectAll("g.nv-wrap.nv-scatter").data([I]),V=X.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+s+(M?" nv-single-point":"")),$=V.append("defs"),J=V.append("g"),K=X.select("g");J.append("g").attr("class","nv-groups"),J.append("g").attr("class","nv-point-paths"),X.attr("transform","translate("+t.left+","+t.top+")"),$.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),X.select("#nv-edge-clip-"+s+" rect").attr("width",q).attr("height",R),K.attr("clip-path",S?"url(#nv-edge-clip-"+s+")":""),F=!0;var G=X.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e){return e.key});G.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),G.exit().remove(),G.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}),G.transition().style("fill",function(e,t){return i(e,t)}).style("stroke",function(e,t){return i(e,t)}).style("stroke-opacity",1).style("fill-opacity",.5);if(p){var Y=G.selectAll("circle.nv-point").data(function(e){return e.values},y);Y.enter().append("circle").style("fill",function(e,t){return e.color}).style("stroke",function(e,t){return e.color}).attr("cx",function(t,n){return e.utils.NaNtoZero(P(f(t,n)))}).attr("cy",function(t,n){return e.utils.NaNtoZero(H(l(t,n)))}).attr("r",function(e,t){return Math.sqrt(a(c(e,t))/Math.PI)}),Y.exit().remove(),G.exit().selectAll("path.nv-point").transition().attr("cx",function(t,n){return e.utils.NaNtoZero(o(f(t,n)))}).attr("cy",function(t,n){return e.utils.NaNtoZero(u(l(t,n)))}).remove(),Y.each(function(e,t){d3.select(this).classed("nv-point",!0).classed("nv-point-"+t,!0).classed("hover",!1)}),Y.transition().attr("cx",function(t,n){return e.utils.NaNtoZero(o(f(t,n)))}).attr("cy",function(t,n){return e.utils.NaNtoZero(u(l(t,n)))}).attr("r",function(e,t){return Math.sqrt(a(c(e,t))/Math.PI)})}else{var Y=G.selectAll("path.nv-point").data(function(e){return e.values});Y.enter().append("path").style("fill",function(e,t){return e.color}).style("stroke",function(e,t){return e.color}).attr("transform",function(e,t){return"translate("+P(f(e,t))+","+H(l(e,t))+")"}).attr("d",d3.svg.symbol().type(h).size(function(e,t){return a(c(e,t))})),Y.exit().remove(),G.exit().selectAll("path.nv-point").transition().attr("transform",function(e,t){return"translate("+o(f(e,t))+","+u(l(e,t))+")"}).remove(),Y.each(function(e,t){d3.select(this).classed("nv-point",!0).classed("nv-point-"+t,!0).classed("hover",!1)}),Y.transition().attr("transform",function(e,t){return"translate("+o(f(e,t))+","+u(l(e,t))+")"}).attr("d",d3.svg.symbol().type(h).size(function(e,t){return a(c(e,t))}))}clearTimeout(j),j=setTimeout(Q,300),P=o.copy(),H=u.copy(),B=a.copy()}),I}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=e.utils.defaultColor(),s=Math.floor(Math.random()*1e5),o=d3.scale.linear(),u=d3.scale.linear(),a=d3.scale.linear(),f=function(e){return e.x},l=function(e){return e.y},c=function(e){return e.size||1},h=function(e){return e.shape||"circle"},p=!0,d=[],v=[],m=[],g=!0,y=null,b=function(e){return!e.notActive},w=!1,E=.1,S=!1,x=!0,T=function(){return 25},N=null,C=null,k=null,L=null,A=null,O=null,M=!1,_=d3.dispatch("elementClick","elementMouseover","elementMouseout"),D=!0,P,H,B,j,F=!1;return I.clearHighlights=function(){d3.selectAll(".nv-chart-"+s+" .nv-point.hover").classed("hover",!1)},I.highlightPoint=function(e,t,n){d3.select(".nv-chart-"+s+" .nv-series-"+e+" .nv-point-"+t).classed("hover",n)},_.on("elementMouseover.point",function(e){g&&I.highlightPoint(e.seriesIndex,e.pointIndex,!0)}),_.on("elementMouseout.point",function(e){g&&I.highlightPoint(e.seriesIndex,e.pointIndex,!1)}),I.dispatch=_,I.options=e.utils.optionsFunc.bind(I),I.x=function(e){return arguments.length?(f=d3.functor(e),I):f},I.y=function(e){return arguments.length?(l=d3.functor(e),I):l},I.size=function(e){return arguments.length?(c=d3.functor(e),I):c},I.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,I):t},I.width=function(e){return arguments.length?(n=e,I):n},I.height=function(e){return arguments.length?(r=e,I):r},I.xScale=function(e){return arguments.length?(o=e,I):o},I.yScale=function(e){return arguments.length?(u=e,I):u},I.zScale=function(e){return arguments.length?(a=e,I):a},I.xDomain=function(e){return arguments.length?(N=e,I):N},I.yDomain=function(e){return arguments.length?(C=e,I):C},I.sizeDomain=function(e){return arguments.length?(A=e,I):A},I.xRange=function(e){return arguments.length?(k=e,I):k},I.yRange=function(e){return arguments.length?(L=e,I):L},I.sizeRange=function(e){return arguments.length?(O=e,I):O},I.forceX=function(e){return arguments.length?(d=e,I):d},I.forceY=function(e){return arguments.length?(v=e,I):v},I.forceSize=function(e){return arguments.length?(m=e,I):m},I.interactive=function(e){return arguments.length?(g=e,I):g},I.pointKey=function(e){return arguments.length?(y=e,I):y},I.pointActive=function(e){return arguments.length?(b=e,I):b},I.padData=function(e){return arguments.length?(w=e,I):w},I.padDataOuter=function(e){return arguments.length?(E=e,I):E},I.clipEdge=function(e){return arguments.length?(S=e,I):S},I.clipVoronoi=function(e){return arguments.length?(x=e,I):x},I.useVoronoi=function(e){return arguments.length?(D=e,D===!1&&(x=!1),I):D},I.clipRadius=function(e){return arguments.length?(T=e,I):T},I.color=function(t){return arguments.length?(i=e.utils.getColor(t),I):i},I.shape=function(e){return arguments.length?(h=e,I):h},I.onlyCircles=function(e){return arguments.length?(p=e,I):p},I.id=function(e){return arguments.length?(s=e,I):s},I.singlePoint=function(e){return arguments.length?(M=e,I):M},I},e.models.scatterChart=function(){"use strict";function F(e){return e.each(function(e){function K(){if(T)return X.select(".nv-point-paths").style("pointer-events","all"),!1;X.select(".nv-point-paths").style("pointer-events","none");var i=d3.mouse(this);h.distortion(x).focus(i[0]),p.distortion(x).focus(i[1]),X.select(".nv-scatterWrap").call(t),b&&X.select(".nv-x.nv-axis").call(n),w&&X.select(".nv-y.nv-axis").call(r),X.select(".nv-distributionX").datum(e.filter(function(e){return!e.disabled})).call(o),X.select(".nv-distributionY").datum(e.filter(function(e){return!e.disabled})).call(u)}var C=d3.select(this),k=this,L=(f||parseInt(C.style("width"))||960)-a.left-a.right,I=(l||parseInt(C.style("height"))||400)-a.top-a.bottom;F.update=function(){C.transition().duration(D).call(F)},F.container=this,A.disabled=e.map(function(e){return!!e.disabled});if(!O){var q;O={};for(q in A)A[q]instanceof Array?O[q]=A[q].slice(0):O[q]=A[q]}if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var R=C.selectAll(".nv-noData").data([_]);return R.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),R.attr("x",a.left+L/2).attr("y",a.top+I/2).text(function(e){return e}),F}C.selectAll(".nv-noData").remove(),P=P||h,H=H||p;var U=C.selectAll("g.nv-wrap.nv-scatterChart").data([e]),z=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()),W=z.append("g"),X=U.select("g");W.append("rect").attr("class","nvd3 nv-background"),W.append("g").attr("class","nv-x nv-axis"),W.append("g").attr("class","nv-y nv-axis"),W.append("g").attr("class","nv-scatterWrap"),W.append("g").attr("class","nv-distWrap"),W.append("g").attr("class","nv-legendWrap"),W.append("g").attr("class","nv-controlsWrap");if(y){var V=S?L/2:L;i.width(V),U.select(".nv-legendWrap").datum(e).call(i),a.top!=i.height()&&(a.top=i.height(),I=(l||parseInt(C.style("height"))||400)-a.top-a.bottom),U.select(".nv-legendWrap").attr("transform","translate("+(L-V)+","+ -a.top+")")}S&&(s.width(180).color(["#444"]),X.select(".nv-controlsWrap").datum(j).attr("transform","translate(0,"+ -a.top+")").call(s)),U.attr("transform","translate("+a.left+","+a.top+")"),E&&X.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),t.width(L).height(I).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),d!==0&&t.xDomain(null),v!==0&&t.yDomain(null),U.select(".nv-scatterWrap").datum(e.filter(function(e){return!e.disabled})).call(t);if(d!==0){var $=h.domain()[1]-h.domain()[0];t.xDomain([h.domain()[0]-d*$,h.domain()[1]+d*$])}if(v!==0){var J=p.domain()[1]-p.domain()[0];t.yDomain([p.domain()[0]-v*J,p.domain()[1]+v*J])}(v!==0||d!==0)&&U.select(".nv-scatterWrap").datum(e.filter(function(e){return!e.disabled})).call(t),b&&(n.scale(h).ticks(n.ticks()&&n.ticks().length?n.ticks():L/100).tickSize(-I,0),X.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(n)),w&&(r.scale(p).ticks(r.ticks()&&r.ticks().length?r.ticks():I/36).tickSize(-L,0),X.select(".nv-y.nv-axis").call(r)),m&&(o.getData(t.x()).scale(h).width(L).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),W.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),X.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(e.filter(function(e){return!e.disabled})).call(o)),g&&(u.getData(t.y()).scale(p).width(I).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),W.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),X.select(".nv-distributionY").attr("transform","translate("+(E?L:-u.size())+",0)").datum(e.filter(function(e){return!e.disabled})).call(u)),d3.fisheye&&(X.select(".nv-background").attr("width",L).attr("height",I),X.select(".nv-background").on("mousemove",K),X.select(".nv-background").on("click",function(){T=!T}),t.dispatch.on("elementClick.freezeFisheye",function(){T=!T})),s.dispatch.on("legendClick",function(e,i){e.disabled=!e.disabled,x=e.disabled?0:2.5,X.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),X.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(h.distortion(x).focus(0),p.distortion(x).focus(0),X.select(".nv-scatterWrap").call(t),X.select(".nv-x.nv-axis").call(n),X.select(".nv-y.nv-axis").call(r)):T=!1,F.update()}),i.dispatch.on("stateChange",function(e){A.disabled=e.disabled,M.stateChange(A),F.update()}),t.dispatch.on("elementMouseover.tooltip",function(e){d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",function(t,n){return e.pos[1]-I}),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",e.pos[0]+o.size()),e.pos=[e.pos[0]+a.left,e.pos[1]+a.top],M.tooltipShow(e)}),M.on("tooltipShow",function(e){N&&B(e,k.parentNode)}),M.on("changeState",function(t){typeof t.disabled!="undefined"&&(e.forEach(function(e,n){e.disabled=t.disabled[n]}),A.disabled=t.disabled),F.update()}),P=h.copy(),H=p.copy()}),F}var t=e.models.scatter(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o=e.models.distribution(),u=e.models.distribution(),a={top:30,right:20,bottom:50,left:75},f=null,l=null,c=e.utils.defaultColor(),h=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):t.xScale(),p=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):t.yScale(),d=0,v=0,m=!1,g=!1,y=!0,b=!0,w=!0,E=!1,S=!!d3.fisheye,x=0,T=!1,N=!0,C=function(e,t,n){return"<strong>"+t+"</strong>"},k=function(e,t,n){return"<strong>"+n+"</strong>"},L=null,A={},O=null,M=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),_="No Data Available.",D=250;t.xScale(h).yScale(p),n.orient("bottom").tickPadding(10),r.orient(E?"right":"left").tickPadding(10),o.axis("x"),u.axis("y"),s.updateState(!1);var P,H,B=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),f=i.pos[0]+(s.offsetLeft||0),l=p.range()[0]+a.top+(s.offsetTop||0),c=h.range()[0]+a.left+(s.offsetLeft||0),d=i.pos[1]+(s.offsetTop||0),v=n.tickFormat()(t.x()(i.point,i.pointIndex)),m=r.tickFormat()(t.y()(i.point,i.pointIndex));C!=null&&e.tooltip.show([f,l],C(i.series.key,v,m,i,F),"n",1,s,"x-nvtooltip"),k!=null&&e.tooltip.show([c,d],k(i.series.key,v,m,i,F),"e",1,s,"y-nvtooltip"),L!=null&&e.tooltip.show([o,u],L(i.series.key,v,m,i,F),i.value<0?"n":"s",null,s)},j=[{key:"Magnify",disabled:!0}];return t.dispatch.on("elementMouseout.tooltip",function(e){M.tooltipHide(e),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",u.size())}),M.on("tooltipHide",function(){N&&e.tooltip.cleanup()}),F.dispatch=M,F.scatter=t,F.legend=i,F.controls=s,F.xAxis=n,F.yAxis=r,F.distX=o,F.distY=u,d3.rebind(F,t,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),F.options=e.utils.optionsFunc.bind(F),F.margin=function(e){return arguments.length?(a.top=typeof e.top!="undefined"?e.top:a.top,a.right=typeof e.right!="undefined"?e.right:a.right,a.bottom=typeof e.bottom!="undefined"?e.bottom:a.bottom,a.left=typeof e.left!="undefined"?e.left:a.left,F):a},F.width=function(e){return arguments.length?(f=e,F):f},F.height=function(e){return arguments.length?(l=e,F):l},F.color=function(t){return arguments.length?(c=e.utils.getColor(t),i.color(c),o.color(c),u.color(c),F):c},F.showDistX=function(e){return arguments.length?(m=e,F):m},F.showDistY=function(e){return arguments.length?(g=e,F):g},F.showControls=function(e){return arguments.length?(S=e,F):S},F.showLegend=function(e){return arguments.length?(y=e,F):y},F.showXAxis=function(e){return arguments.length?(b=e,F):b},F.showYAxis=function(e){return arguments.length?(w=e,F):w},F.rightAlignYAxis=function(e){return arguments.length?(E=e,r.orient(e?"right":"left"),F):E},F.fisheye=function(e){return arguments.length?(x=e,F):x},F.xPadding=function(e){return arguments.length?(d=e,F):d},F.yPadding=function(e){return arguments.length?(v=e,F):v},F.tooltips=function(e){return arguments.length?(N=e,F):N},F.tooltipContent=function(e){return arguments.length?(L=e,F):L},F.tooltipXContent=function(e){return arguments.length?(C=e,F):C},F.tooltipYContent=function(e){return arguments.length?(k=e,F):k},F.state=function(e){return arguments.length?(A=e,F):A},F.defaultState=function(e){return arguments.length?(O=e,F):O},F.noData=function(e){return arguments.length?(_=e,F):_},F.transitionDuration=function(e){return arguments.length?(D=e,F):D},F},e.models.scatterPlusLineChart=function(){"use strict";function B(e){return e.each(function(e){function $(){if(S)return z.select(".nv-point-paths").style("pointer-events","all"),!1;z.select(".nv-point-paths").style("pointer-events","none");var i=d3.mouse(this);h.distortion(E).focus(i[0]),p.distortion(E).focus(i[1]),z.select(".nv-scatterWrap").datum(e.filter(function(e){return!e.disabled})).call(t),g&&z.select(".nv-x.nv-axis").call(n),y&&z.select(".nv-y.nv-axis").call(r),z.select(".nv-distributionX").datum(e.filter(function(e){return!e.disabled})).call(o),z.select(".nv-distributionY").datum(e.filter(function(e){return!e.disabled})).call(u)}var T=d3.select(this),N=this,C=(f||parseInt(T.style("width"))||960)-a.left-a.right,j=(l||parseInt(T.style("height"))||400)-a.top-a.bottom;B.update=function(){T.transition().duration(M).call(B)},B.container=this,k.disabled=e.map(function(e){return!!e.disabled});if(!L){var F;L={};for(F in k)k[F]instanceof Array?L[F]=k[F].slice(0):L[F]=k[F]}if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var I=T.selectAll(".nv-noData").data([O]);return I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",a.left+C/2).attr("y",a.top+j/2).text(function(e){return e}),B}T.selectAll(".nv-noData").remove(),h=t.xScale(),p=t.yScale(),_=_||h,D=D||p;var q=T.selectAll("g.nv-wrap.nv-scatterChart").data([e]),R=q.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()),U=R.append("g"),z=q.select("g");U.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),U.append("g").attr("class","nv-x nv-axis"),U.append("g").attr("class","nv-y nv-axis"),U.append("g").attr("class","nv-scatterWrap"),U.append("g").attr("class","nv-regressionLinesWrap"),U.append("g").attr("class","nv-distWrap"),U.append("g").attr("class","nv-legendWrap"),U.append("g").attr("class","nv-controlsWrap"),q.attr("transform","translate("+a.left+","+a.top+")"),b&&z.select(".nv-y.nv-axis").attr("transform","translate("+C+",0)"),m&&(i.width(C/2),q.select(".nv-legendWrap").datum(e).call(i),a.top!=i.height()&&(a.top=i.height(),j=(l||parseInt(T.style("height"))||400)-a.top-a.bottom),q.select(".nv-legendWrap").attr("transform","translate("+C/2+","+ -a.top+")")),w&&(s.width(180).color(["#444"]),z.select(".nv-controlsWrap").datum(H).attr("transform","translate(0,"+ -a.top+")").call(s)),t.width(C).height(j).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),q.select(".nv-scatterWrap").datum(e.filter(function(e){return!e.disabled})).call(t),q.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+t.id()+")");var W=q.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(e){return e});W.enter().append("g").attr("class","nv-regLines");var X=W.selectAll(".nv-regLine").data(function(e){return[e]}),V=X.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0);X.transition().attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",function(e,t){return p(h.domain()[0]*e.slope+e.intercept)}).attr("y2",function(e,t){return p(h.domain()[1]*e.slope+e.intercept)}).style("stroke",function(e,t,n){return c(e,n)}).style("stroke-opacity",function(e,t){return e.disabled||typeof e.slope=="undefined"||typeof e.intercept=="undefined"?0:1}),g&&(n.scale(h).ticks(n.ticks()?n.ticks():C/100).tickSize(-j,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")").call(n)),y&&(r.scale(p).ticks(r.ticks()?r.ticks():j/36).tickSize(-C,0),z.select(".nv-y.nv-axis").call(r)),d&&(o.getData(t.x()).scale(h).width(C).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),U.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),z.select(".nv-distributionX").attr("transform","translate(0,"+p.range()[0]+")").datum(e.filter(function(e){return!e.disabled})).call(o)),v&&(u.getData(t.y()).scale(p).width(j).color(e.map(function(e,t){return e.color||c(e,t)}).filter(function(t,n){return!e[n].disabled})),U.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),z.select(".nv-distributionY").attr("transform","translate("+(b?C:-u.size())+",0)").datum(e.filter(function(e){return!e.disabled})).call(u)),d3.fisheye&&(z.select(".nv-background").attr("width",C).attr("height",j),z.select(".nv-background").on("mousemove",$),z.select(".nv-background").on("click",function(){S=!S}),t.dispatch.on("elementClick.freezeFisheye",function(){S=!S})),s.dispatch.on("legendClick",function(e,i){e.disabled=!e.disabled,E=e.disabled?0:2.5,z.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),z.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(h.distortion(E).focus(0),p.distortion(E).focus(0),z.select(".nv-scatterWrap" +).call(t),z.select(".nv-x.nv-axis").call(n),z.select(".nv-y.nv-axis").call(r)):S=!1,B.update()}),i.dispatch.on("stateChange",function(e){k=e,A.stateChange(k),B.update()}),t.dispatch.on("elementMouseover.tooltip",function(e){d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",e.pos[1]-j),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",e.pos[0]+o.size()),e.pos=[e.pos[0]+a.left,e.pos[1]+a.top],A.tooltipShow(e)}),A.on("tooltipShow",function(e){x&&P(e,N.parentNode)}),A.on("changeState",function(t){typeof t.disabled!="undefined"&&(e.forEach(function(e,n){e.disabled=t.disabled[n]}),k.disabled=t.disabled),B.update()}),_=h.copy(),D=p.copy()}),B}var t=e.models.scatter(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o=e.models.distribution(),u=e.models.distribution(),a={top:30,right:20,bottom:50,left:75},f=null,l=null,c=e.utils.defaultColor(),h=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):t.xScale(),p=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):t.yScale(),d=!1,v=!1,m=!0,g=!0,y=!0,b=!1,w=!!d3.fisheye,E=0,S=!1,x=!0,T=function(e,t,n){return"<strong>"+t+"</strong>"},N=function(e,t,n){return"<strong>"+n+"</strong>"},C=function(e,t,n,r){return"<h3>"+e+"</h3>"+"<p>"+r+"</p>"},k={},L=null,A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),O="No Data Available.",M=250;t.xScale(h).yScale(p),n.orient("bottom").tickPadding(10),r.orient(b?"right":"left").tickPadding(10),o.axis("x"),u.axis("y"),s.updateState(!1);var _,D,P=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),f=i.pos[0]+(s.offsetLeft||0),l=p.range()[0]+a.top+(s.offsetTop||0),c=h.range()[0]+a.left+(s.offsetLeft||0),d=i.pos[1]+(s.offsetTop||0),v=n.tickFormat()(t.x()(i.point,i.pointIndex)),m=r.tickFormat()(t.y()(i.point,i.pointIndex));T!=null&&e.tooltip.show([f,l],T(i.series.key,v,m,i,B),"n",1,s,"x-nvtooltip"),N!=null&&e.tooltip.show([c,d],N(i.series.key,v,m,i,B),"e",1,s,"y-nvtooltip"),C!=null&&e.tooltip.show([o,u],C(i.series.key,v,m,i.point.tooltip,i,B),i.value<0?"n":"s",null,s)},H=[{key:"Magnify",disabled:!0}];return t.dispatch.on("elementMouseout.tooltip",function(e){A.tooltipHide(e),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",u.size())}),A.on("tooltipHide",function(){x&&e.tooltip.cleanup()}),B.dispatch=A,B.scatter=t,B.legend=i,B.controls=s,B.xAxis=n,B.yAxis=r,B.distX=o,B.distY=u,d3.rebind(B,t,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),B.options=e.utils.optionsFunc.bind(B),B.margin=function(e){return arguments.length?(a.top=typeof e.top!="undefined"?e.top:a.top,a.right=typeof e.right!="undefined"?e.right:a.right,a.bottom=typeof e.bottom!="undefined"?e.bottom:a.bottom,a.left=typeof e.left!="undefined"?e.left:a.left,B):a},B.width=function(e){return arguments.length?(f=e,B):f},B.height=function(e){return arguments.length?(l=e,B):l},B.color=function(t){return arguments.length?(c=e.utils.getColor(t),i.color(c),o.color(c),u.color(c),B):c},B.showDistX=function(e){return arguments.length?(d=e,B):d},B.showDistY=function(e){return arguments.length?(v=e,B):v},B.showControls=function(e){return arguments.length?(w=e,B):w},B.showLegend=function(e){return arguments.length?(m=e,B):m},B.showXAxis=function(e){return arguments.length?(g=e,B):g},B.showYAxis=function(e){return arguments.length?(y=e,B):y},B.rightAlignYAxis=function(e){return arguments.length?(b=e,r.orient(e?"right":"left"),B):b},B.fisheye=function(e){return arguments.length?(E=e,B):E},B.tooltips=function(e){return arguments.length?(x=e,B):x},B.tooltipContent=function(e){return arguments.length?(C=e,B):C},B.tooltipXContent=function(e){return arguments.length?(T=e,B):T},B.tooltipYContent=function(e){return arguments.length?(N=e,B):N},B.state=function(e){return arguments.length?(k=e,B):k},B.defaultState=function(e){return arguments.length?(L=e,B):L},B.noData=function(e){return arguments.length?(O=e,B):O},B.transitionDuration=function(e){return arguments.length?(M=e,B):M},B},e.models.sparkline=function(){"use strict";function d(e){return e.each(function(e){var i=n-t.left-t.right,d=r-t.top-t.bottom,v=d3.select(this);s.domain(l||d3.extent(e,u)).range(h||[0,i]),o.domain(c||d3.extent(e,a)).range(p||[d,0]);var m=v.selectAll("g.nv-wrap.nv-sparkline").data([e]),g=m.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),b=g.append("g"),w=m.select("g");m.attr("transform","translate("+t.left+","+t.top+")");var E=m.selectAll("path").data(function(e){return[e]});E.enter().append("path"),E.exit().remove(),E.style("stroke",function(e,t){return e.color||f(e,t)}).attr("d",d3.svg.line().x(function(e,t){return s(u(e,t))}).y(function(e,t){return o(a(e,t))}));var S=m.selectAll("circle.nv-point").data(function(e){function n(t){if(t!=-1){var n=e[t];return n.pointIndex=t,n}return null}var t=e.map(function(e,t){return a(e,t)}),r=n(t.lastIndexOf(o.domain()[1])),i=n(t.indexOf(o.domain()[0])),s=n(t.length-1);return[i,r,s].filter(function(e){return e!=null})});S.enter().append("circle"),S.exit().remove(),S.attr("cx",function(e,t){return s(u(e,e.pointIndex))}).attr("cy",function(e,t){return o(a(e,e.pointIndex))}).attr("r",2).attr("class",function(e,t){return u(e,e.pointIndex)==s.domain()[1]?"nv-point nv-currentValue":a(e,e.pointIndex)==o.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),d}var t={top:2,right:0,bottom:2,left:0},n=400,r=32,i=!0,s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=e.utils.getColor(["#000"]),l,c,h,p;return d.options=e.utils.optionsFunc.bind(d),d.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,d):t},d.width=function(e){return arguments.length?(n=e,d):n},d.height=function(e){return arguments.length?(r=e,d):r},d.x=function(e){return arguments.length?(u=d3.functor(e),d):u},d.y=function(e){return arguments.length?(a=d3.functor(e),d):a},d.xScale=function(e){return arguments.length?(s=e,d):s},d.yScale=function(e){return arguments.length?(o=e,d):o},d.xDomain=function(e){return arguments.length?(l=e,d):l},d.yDomain=function(e){return arguments.length?(c=e,d):c},d.xRange=function(e){return arguments.length?(h=e,d):h},d.yRange=function(e){return arguments.length?(p=e,d):p},d.animate=function(e){return arguments.length?(i=e,d):i},d.color=function(t){return arguments.length?(f=e.utils.getColor(t),d):f},d},e.models.sparklinePlus=function(){"use strict";function v(e){return e.each(function(c){function O(){if(a)return;var e=C.selectAll(".nv-hoverValue").data(u),r=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",function(e){return"translate("+s(t.x()(c[e],e))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1);if(!u.length)return;r.append("line").attr("x1",0).attr("y1",-n.top).attr("x2",0).attr("y2",b),r.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-n.top).attr("text-anchor","end").attr("dy",".9em"),C.select(".nv-hoverValue .nv-xValue").text(f(t.x()(c[u[0]],u[0]))),r.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-n.top).attr("text-anchor","start").attr("dy",".9em"),C.select(".nv-hoverValue .nv-yValue").text(l(t.y()(c[u[0]],u[0])))}function M(){function r(e,n){var r=Math.abs(t.x()(e[0],0)-n),i=0;for(var s=0;s<e.length;s++)Math.abs(t.x()(e[s],s)-n)<r&&(r=Math.abs(t.x()(e[s],s)-n),i=s);return i}if(a)return;var e=d3.mouse(this)[0]-n.left;u=[r(c,Math.round(s.invert(e)))],O()}var m=d3.select(this),g=(r||parseInt(m.style("width"))||960)-n.left-n.right,b=(i||parseInt(m.style("height"))||400)-n.top-n.bottom;v.update=function(){v(e)},v.container=this;if(!c||!c.length){var w=m.selectAll(".nv-noData").data([d]);return w.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),w.attr("x",n.left+g/2).attr("y",n.top+b/2).text(function(e){return e}),v}m.selectAll(".nv-noData").remove();var E=t.y()(c[c.length-1],c.length-1);s=t.xScale(),o=t.yScale();var S=m.selectAll("g.nv-wrap.nv-sparklineplus").data([c]),T=S.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),N=T.append("g"),C=S.select("g");N.append("g").attr("class","nv-sparklineWrap"),N.append("g").attr("class","nv-valueWrap"),N.append("g").attr("class","nv-hoverArea"),S.attr("transform","translate("+n.left+","+n.top+")");var k=C.select(".nv-sparklineWrap");t.width(g).height(b),k.call(t);var L=C.select(".nv-valueWrap"),A=L.selectAll(".nv-currentValue").data([E]);A.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),A.attr("x",g+(p?n.right:0)).attr("y",h?function(e){return o(e)}:0).style("fill",t.color()(c[c.length-1],c.length-1)).text(l(E)),N.select(".nv-hoverArea").append("rect").on("mousemove",M).on("click",function(){a=!a}).on("mouseout",function(){u=[],O()}),C.select(".nv-hoverArea rect").attr("transform",function(e){return"translate("+ -n.left+","+ -n.top+")"}).attr("width",g+n.left+n.right).attr("height",b+n.top)}),v}var t=e.models.sparkline(),n={top:15,right:100,bottom:10,left:50},r=null,i=null,s,o,u=[],a=!1,f=d3.format(",r"),l=d3.format(",.2f"),c=!0,h=!0,p=!1,d="No Data Available.";return v.sparkline=t,d3.rebind(v,t,"x","y","xScale","yScale","color"),v.options=e.utils.optionsFunc.bind(v),v.margin=function(e){return arguments.length?(n.top=typeof e.top!="undefined"?e.top:n.top,n.right=typeof e.right!="undefined"?e.right:n.right,n.bottom=typeof e.bottom!="undefined"?e.bottom:n.bottom,n.left=typeof e.left!="undefined"?e.left:n.left,v):n},v.width=function(e){return arguments.length?(r=e,v):r},v.height=function(e){return arguments.length?(i=e,v):i},v.xTickFormat=function(e){return arguments.length?(f=e,v):f},v.yTickFormat=function(e){return arguments.length?(l=e,v):l},v.showValue=function(e){return arguments.length?(c=e,v):c},v.alignValue=function(e){return arguments.length?(h=e,v):h},v.rightAlignValue=function(e){return arguments.length?(p=e,v):p},v.noData=function(e){return arguments.length?(d=e,v):d},v},e.models.stackedArea=function(){"use strict";function g(e){return e.each(function(e){var a=n-t.left-t.right,b=r-t.top-t.bottom,w=d3.select(this);p=v.xScale(),d=v.yScale();var E=e;e=e.map(function(e,t){return e.seriesIndex=t,e.values=e.values.map(function(e,n){return e.index=n,e.seriesIndex=t,e}),e});var S=e.filter(function(e){return!e.disabled});e=d3.layout.stack().order(l).offset(f).values(function(e){return e.values}).x(o).y(u).out(function(e,t,n){var r=u(e)===0?0:n;e.display={y:r,y0:t}})(S);var T=w.selectAll("g.nv-wrap.nv-stackedarea").data([e]),N=T.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),C=N.append("defs"),k=N.append("g"),L=T.select("g");k.append("g").attr("class","nv-areaWrap"),k.append("g").attr("class","nv-scatterWrap"),T.attr("transform","translate("+t.left+","+t.top+")"),v.width(a).height(b).x(o).y(function(e){return e.display.y+e.display.y0}).forceY([0]).color(e.map(function(e,t){return e.color||i(e,e.seriesIndex)}));var A=L.select(".nv-scatterWrap").datum(e);A.call(v),C.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),T.select("#nv-edge-clip-"+s+" rect").attr("width",a).attr("height",b),L.attr("clip-path",h?"url(#nv-edge-clip-"+s+")":"");var O=d3.svg.area().x(function(e,t){return p(o(e,t))}).y0(function(e){return d(e.display.y0)}).y1(function(e){return d(e.display.y+e.display.y0)}).interpolate(c),M=d3.svg.area().x(function(e,t){return p(o(e,t))}).y0(function(e){return d(e.display.y0)}).y1(function(e){return d(e.display.y0)}),_=L.select(".nv-areaWrap").selectAll("path.nv-area").data(function(e){return e});_.enter().append("path").attr("class",function(e,t){return"nv-area nv-area-"+t}).attr("d",function(e,t){return M(e.values,e.seriesIndex)}).on("mouseover",function(e,t){d3.select(this).classed("hover",!0),m.areaMouseover({point:e,series:e.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})}).on("mouseout",function(e,t){d3.select(this).classed("hover",!1),m.areaMouseout({point:e,series:e.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})}).on("click",function(e,t){d3.select(this).classed("hover",!1),m.areaClick({point:e,series:e.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})}),_.exit().transition().attr("d",function(e,t){return M(e.values,t)}).remove(),_.style("fill",function(e,t){return e.color||i(e,e.seriesIndex)}).style("stroke",function(e,t){return e.color||i(e,e.seriesIndex)}),_.transition().attr("d",function(e,t){return O(e.values,t)}),v.dispatch.on("elementMouseover.area",function(e){L.select(".nv-chart-"+s+" .nv-area-"+e.seriesIndex).classed("hover",!0)}),v.dispatch.on("elementMouseout.area",function(e){L.select(".nv-chart-"+s+" .nv-area-"+e.seriesIndex).classed("hover",!1)}),g.d3_stackedOffset_stackPercent=function(e){var t=e.length,n=e[0].length,r=1/t,i,s,o,a=[];for(s=0;s<n;++s){for(i=0,o=0;i<E.length;i++)o+=u(E[i].values[s]);if(o)for(i=0;i<t;i++)e[i][s][1]/=o;else for(i=0;i<t;i++)e[i][s][1]=r}for(s=0;s<n;++s)a[s]=0;return a}}),g}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=e.utils.defaultColor(),s=Math.floor(Math.random()*1e5),o=function(e){return e.x},u=function(e){return e.y},a="stack",f="zero",l="default",c="linear",h=!1,p,d,v=e.models.scatter(),m=d3.dispatch("tooltipShow","tooltipHide","areaClick","areaMouseover","areaMouseout");return v.size(2.2).sizeDomain([2.2,2.2]),v.dispatch.on("elementClick.area",function(e){m.areaClick(e)}),v.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+t.left,e.pos[1]+t.top],m.tooltipShow(e)}),v.dispatch.on("elementMouseout.tooltip",function(e){m.tooltipHide(e)}),g.dispatch=m,g.scatter=v,d3.rebind(g,v,"interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","highlightPoint","clearHighlights"),g.options=e.utils.optionsFunc.bind(g),g.x=function(e){return arguments.length?(o=d3.functor(e),g):o},g.y=function(e){return arguments.length?(u=d3.functor(e),g):u},g.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,g):t},g.width=function(e){return arguments.length?(n=e,g):n},g.height=function(e){return arguments.length?(r=e,g):r},g.clipEdge=function(e){return arguments.length?(h=e,g):h},g.color=function(t){return arguments.length?(i=e.utils.getColor(t),g):i},g.offset=function(e){return arguments.length?(f=e,g):f},g.order=function(e){return arguments.length?(l=e,g):l},g.style=function(e){if(!arguments.length)return a;a=e;switch(a){case"stack":g.offset("zero"),g.order("default");break;case"stream":g.offset("wiggle"),g.order("inside-out");break;case"stream-center":g.offset("silhouette"),g.order("inside-out");break;case"expand":g.offset("expand"),g.order("default");break;case"stack_percent":g.offset(g.d3_stackedOffset_stackPercent),g.order("default")}return g},g.interpolate=function(e){return arguments.length?(c=e,g):c},g},e.models.stackedAreaChart=function(){"use strict";function M(y){return y.each(function(y){var _=d3.select(this),D=this,P=(a||parseInt(_.style("width"))||960)-u.left-u.right,H=(f||parseInt(_.style("height"))||400)-u.top-u.bottom;M.update=function(){_.transition().duration(A).call(M)},M.container=this,S.disabled=y.map(function(e){return!!e.disabled});if(!x){var B;x={};for(B in S)S[B]instanceof Array?x[B]=S[B].slice(0):x[B]=S[B]}if(!y||!y.length||!y.filter(function(e){return e.values.length}).length){var j=_.selectAll(".nv-noData").data([T]);return j.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),j.attr("x",u.left+P/2).attr("y",u.top+H/2).text(function(e){return e}),M}_.selectAll(".nv-noData").remove(),b=t.xScale(),w=t.yScale();var F=_.selectAll("g.nv-wrap.nv-stackedAreaChart").data([y]),I=F.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),q=F.select("g");I.append("rect").style("opacity",0),I.append("g").attr("class","nv-x nv-axis"),I.append("g").attr("class","nv-y nv-axis"),I.append("g").attr("class","nv-stackedWrap"),I.append("g").attr("class","nv-legendWrap"),I.append("g").attr("class","nv-controlsWrap"),I.append("g").attr("class","nv-interactive"),q.select("rect").attr("width",P).attr("height",H);if(h){var R=c?P-C:P;i.width(R),q.select(".nv-legendWrap").datum(y).call(i),u.top!=i.height()&&(u.top=i.height(),H=(f||parseInt(_.style("height"))||400)-u.top-u.bottom),q.select(".nv-legendWrap").attr("transform","translate("+(P-R)+","+ -u.top+")")}if(c){var U=[{key:L.stacked||"Stacked",metaKey:"Stacked",disabled:t.style()!="stack",style:"stack"},{key:L.stream||"Stream",metaKey:"Stream",disabled:t.style()!="stream",style:"stream"},{key:L.expanded||"Expanded",metaKey:"Expanded",disabled:t.style()!="expand",style:"expand"},{key:L.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:t.style()!="stack_percent",style:"stack_percent"}];C=k.length/3*260,U=U.filter(function(e){return k.indexOf(e.metaKey)!==-1}),s.width(C).color(["#444","#444","#444"]),q.select(".nv-controlsWrap").datum(U).call(s),u.top!=Math.max(s.height(),i.height())&&(u.top=Math.max(s.height(),i.height()),H=(f||parseInt(_.style("height"))||400)-u.top-u.bottom),q.select(".nv-controlsWrap").attr("transform","translate(0,"+ -u.top+")")}F.attr("transform","translate("+u.left+","+u.top+")"),v&&q.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),m&&(o.width(P).height(H).margin({left:u.left,top:u.top}).svgContainer(_).xScale(b),F.select(".nv-interactive").call(o)),t.width(P).height(H);var z=q.select(".nv-stackedWrap").datum(y);z.transition().call(t),p&&(n.scale(b).ticks(P/100).tickSize(-H,0),q.select(".nv-x.nv-axis").attr("transform","translate(0,"+H+")"),q.select(".nv-x.nv-axis").transition().duration(0).call(n)),d&&(r.scale(w).ticks(t.offset()=="wiggle"?0:H/36).tickSize(-P,0).setTickFormat(t.style()=="expand"||t.style()=="stack_percent"?d3.format("%"):E),q.select(".nv-y.nv-axis").transition().duration(0).call(r)),t.dispatch.on("areaClick.toggle",function(e){y.filter(function(e){return!e.disabled}).length===1?y=y.map(function(e){return e.disabled=!1,e}):y=y.map(function(t,n){return t.disabled=n!=e.seriesIndex,t}),S.disabled=y.map(function(e){return!!e.disabled}),N.stateChange(S),M.update()}),i.dispatch.on("stateChange",function(e){S.disabled=e.disabled,N.stateChange(S),M.update()}),s.dispatch.on("legendClick",function(e,n){if(!e.disabled)return;U=U.map(function(e){return e.disabled=!0,e}),e.disabled=!1,t.style(e.style),S.style=t.style(),N.stateChange(S),M.update()}),o.dispatch.on("elementMousemove",function(i){t.clearHighlights();var s,a,f,c=[];y.filter(function(e,t){return e.seriesIndex=t,!e.disabled}).forEach(function(n,r){a=e.interactiveBisect(n.values,i.pointXValue,M.x()),t.highlightPoint(r,a,!0);var o=n.values[a];if(typeof o=="undefined")return;typeof s=="undefined"&&(s=o),typeof f=="undefined"&&(f=M.xScale()(M.x()(o,a)));var u=t.style()=="expand"?o.display.y:M.y()(o,a);c.push({key:n.key,value:u,color:l(n,n.seriesIndex),stackedValue:o.display})}),c.reverse();if(c.length>2){var h=M.yScale().invert(i.mouseY),p=Infinity,d=null;c.forEach(function(e,t){if(h>=e.stackedValue.y0&&h<=e.stackedValue.y0+e.stackedValue.y){d=t;return}}),d!=null&&(c[d].highlight=!0)}var v=n.tickFormat()(M.x()(s,a)),m=t.style()=="expand"?function(e,t){return d3.format(".1%")(e)}:function(e,t){return r.tickFormat()(e)};o.tooltip.position({left:f+u.left,top:i.mouseY+u.top}).chartContainer(D.parentNode).enabled(g).valueFormatter(m).data({value:v,series:c})(),o.renderGuideLine(f)}),o.dispatch.on("elementMouseout",function(e){N.tooltipHide(),t.clearHighlights()}),N.on("tooltipShow",function(e){g&&O(e,D.parentNode)}),N.on("changeState",function(e){typeof e.disabled!="undefined"&&(y.forEach(function(t,n){t.disabled=e.disabled[n]}),S.disabled=e.disabled),typeof e.style!="undefined"&&t.style(e.style),M.update()})}),M}var t=e.models.stackedArea(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o=e.interactiveGuideline(),u={top:30,right:25,bottom:50,left:60},a=null,f=null,l=e.utils.defaultColor(),c=!0,h=!0,p=!0,d=!0,v=!1,m=!1,g=!0,y=function(e,t,n,r,i){return"<h3>"+e+"</h3>"+"<p>"+n+" on "+t+"</p>"},b,w,E=d3.format(",.2f"),S={style:t.style()},x=null,T="No Data Available.",N=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),C=250,k=["Stacked","Stream","Expanded"],L={},A=250;n.orient("bottom").tickPadding(7),r.orient(v?"right":"left"),s.updateState(!1);var O=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=y(i.series.key,a,f,i,M);e.tooltip.show([o,u],l,i.value<0?"n":"s",null,s)};return t.dispatch.on("tooltipShow",function(e){e.pos=[e.pos[0]+u.left,e.pos[1]+u.top],N.tooltipShow(e)}),t.dispatch.on("tooltipHide",function(e){N.tooltipHide(e)}),N.on("tooltipHide",function(){g&&e.tooltip.cleanup()}),M.dispatch=N,M.stacked=t,M.legend=i,M.controls=s,M.xAxis=n,M.yAxis=r,M.interactiveLayer=o,d3.rebind(M,t,"x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","sizeDomain","interactive","useVoronoi","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),M.options=e.utils.optionsFunc.bind(M),M.margin=function(e){return arguments.length?(u.top=typeof e.top!="undefined"?e.top:u.top,u.right=typeof e.right!="undefined"?e.right:u.right,u.bottom=typeof e.bottom!="undefined"?e.bottom:u.bottom,u.left=typeof e.left!="undefined"?e.left:u.left,M):u},M.width=function(e){return arguments.length?(a=e,M):a},M.height=function(e){return arguments.length?(f=e,M):f},M.color=function(n){return arguments.length?(l=e.utils.getColor(n),i.color(l),t.color(l),M):l},M.showControls=function(e){return arguments.length?(c=e,M):c},M.showLegend=function(e){return arguments.length?(h=e,M):h},M.showXAxis=function(e){return arguments.length?(p=e,M):p},M.showYAxis=function(e){return arguments.length?(d=e,M):d},M.rightAlignYAxis=function(e){return arguments.length?(v=e,r.orient(e?"right":"left"),M):v},M.useInteractiveGuideline=function(e){return arguments.length?(m=e,e===!0&&(M.interactive(!1),M.useVoronoi(!1)),M):m},M.tooltip=function(e){return arguments.length?(y=e,M):y},M.tooltips=function(e){return arguments.length?(g=e,M):g},M.tooltipContent=function(e){return arguments.length?(y=e,M):y},M.state=function(e){return arguments.length?(S=e,M):S},M.defaultState=function(e){return arguments.length?(x=e,M):x},M.noData=function(e){return arguments.length?(T=e,M):T},M.transitionDuration=function(e){return arguments.length?(A=e,M):A},M.controlsData=function(e){return arguments.length?(k=e,M):k},M.controlLabels=function(e){return arguments.length?typeof e!="object"?L:(L=e,M):L},r.setTickFormat=r.tickFormat,r.tickFormat=function(e){return arguments.length?(E=e,r):E},M}})(); +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/method_item.html.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/method_item.html.dist @@ -0,0 +1,11 @@ + <tr> + <td class="{{methods_level}}" colspan="4">{{name}}</td> + <td class="{{methods_level}} big">{{methods_bar}}</td> + <td class="{{methods_level}} small"><div align="right">{{methods_tested_percent}}</div></td> + <td class="{{methods_level}} small"><div align="right">{{methods_number}}</div></td> + <td class="{{methods_level}} small">{{crap}}</td> + <td class="{{lines_level}} big">{{lines_bar}}</td> + <td class="{{lines_level}} small"><div align="right">{{lines_executed_percent}}</div></td> + <td class="{{lines_level}} small"><div align="right">{{lines_number}}</div></td> + </tr> + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node.php @@ -0,0 +1,380 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Base class for nodes in the code coverage information tree. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +abstract class PHP_CodeCoverage_Report_Node implements Countable +{ + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $path; + + /** + * @var array + */ + protected $pathArray; + + /** + * @var PHP_CodeCoverage_Report_Node + */ + protected $parent; + + /** + * @var string + */ + protected $id; + + /** + * Constructor. + * + * @param string $name + * @param PHP_CodeCoverage_Report_Node $parent + */ + public function __construct($name, PHP_CodeCoverage_Report_Node $parent = NULL) + { + if (substr($name, -1) == '/') { + $name = substr($name, 0, -1); + } + + $this->name = $name; + $this->parent = $parent; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getId() + { + if ($this->id === NULL) { + $parent = $this->getParent(); + + if ($parent === NULL) { + $this->id = 'index'; + } else { + $parentId = $parent->getId(); + + if ($parentId == 'index') { + $this->id = str_replace(':', '_', $this->name); + } else { + $this->id = $parentId . '_' . $this->name; + } + } + } + + return $this->id; + } + + /** + * @return string + */ + public function getPath() + { + if ($this->path === NULL) { + if ($this->parent === NULL || $this->parent->getPath() === NULL) { + $this->path = $this->name; + } else { + $this->path = $this->parent->getPath() . '/' . $this->name; + } + } + + return $this->path; + } + + /** + * @return array + */ + public function getPathAsArray() + { + if ($this->pathArray === NULL) { + if ($this->parent === NULL) { + $this->pathArray = array(); + } else { + $this->pathArray = $this->parent->getPathAsArray(); + } + + $this->pathArray[] = $this; + } + + return $this->pathArray; + } + + /** + * @return PHP_CodeCoverage_Report_Node + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns the percentage of classes that has been tested. + * + * @param boolean $asString + * @return integer + */ + public function getTestedClassesPercent($asString = TRUE) + { + return PHP_CodeCoverage_Util::percent( + $this->getNumTestedClasses(), + $this->getNumClasses(), + $asString + ); + } + + /** + * Returns the percentage of traits that has been tested. + * + * @param boolean $asString + * @return integer + */ + public function getTestedTraitsPercent($asString = TRUE) + { + return PHP_CodeCoverage_Util::percent( + $this->getNumTestedTraits(), + $this->getNumTraits(), + $asString + ); + } + + /** + * Returns the percentage of traits that has been tested. + * + * @param boolean $asString + * @return integer + * @since Method available since Release 1.2.0 + */ + public function getTestedClassesAndTraitsPercent($asString = TRUE) + { + return PHP_CodeCoverage_Util::percent( + $this->getNumTestedClassesAndTraits(), + $this->getNumClassesAndTraits(), + $asString + ); + } + + /** + * Returns the percentage of methods that has been tested. + * + * @param boolean $asString + * @return integer + */ + public function getTestedMethodsPercent($asString = TRUE) + { + return PHP_CodeCoverage_Util::percent( + $this->getNumTestedMethods(), + $this->getNumMethods(), + $asString + ); + } + + /** + * Returns the percentage of executed lines. + * + * @param boolean $asString + * @return integer + */ + public function getLineExecutedPercent($asString = TRUE) + { + return PHP_CodeCoverage_Util::percent( + $this->getNumExecutedLines(), + $this->getNumExecutableLines(), + $asString + ); + } + + /** + * Returns the number of classes and traits. + * + * @return integer + * @since Method available since Release 1.2.0 + */ + public function getNumClassesAndTraits() + { + return $this->getNumClasses() + $this->getNumTraits(); + } + + /** + * Returns the number of tested classes and traits. + * + * @return integer + * @since Method available since Release 1.2.0 + */ + public function getNumTestedClassesAndTraits() + { + return $this->getNumTestedClasses() + $this->getNumTestedTraits(); + } + + /** + * Returns the classes and traits of this node. + * + * @return array + * @since Method available since Release 1.2.0 + */ + public function getClassesAndTraits() + { + return array_merge($this->getClasses(), $this->getTraits()); + } + + /** + * Returns the classes of this node. + * + * @return array + */ + abstract public function getClasses(); + + /** + * Returns the traits of this node. + * + * @return array + */ + abstract public function getTraits(); + + /** + * Returns the functions of this node. + * + * @return array + */ + abstract public function getFunctions(); + + /** + * Returns the LOC/CLOC/NCLOC of this node. + * + * @return array + */ + abstract public function getLinesOfCode(); + + /** + * Returns the number of executable lines. + * + * @return integer + */ + abstract public function getNumExecutableLines(); + + /** + * Returns the number of executed lines. + * + * @return integer + */ + abstract public function getNumExecutedLines(); + + /** + * Returns the number of classes. + * + * @return integer + */ + abstract public function getNumClasses(); + + /** + * Returns the number of tested classes. + * + * @return integer + */ + abstract public function getNumTestedClasses(); + + /** + * Returns the number of traits. + * + * @return integer + */ + abstract public function getNumTraits(); + + /** + * Returns the number of tested traits. + * + * @return integer + */ + abstract public function getNumTestedTraits(); + + /** + * Returns the number of methods. + * + * @return integer + */ + abstract public function getNumMethods(); + + /** + * Returns the number of tested methods. + * + * @return integer + */ + abstract public function getNumTestedMethods(); + + /** + * Returns the number of functions. + * + * @return integer + */ + abstract public function getNumFunctions(); + + /** + * Returns the number of tested functions. + * + * @return integer + */ + abstract public function getNumTestedFunctions(); +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Directory.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Directory.php @@ -0,0 +1,512 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Represents a directory in the code coverage information tree. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_Node_Directory extends PHP_CodeCoverage_Report_Node implements IteratorAggregate +{ + /** + * @var PHP_CodeCoverage_Report_Node[] + */ + protected $children = array(); + + /** + * @var PHP_CodeCoverage_Report_Node_Directory[] + */ + protected $directories = array(); + + /** + * @var PHP_CodeCoverage_Report_Node_File[] + */ + protected $files = array(); + + /** + * @var array + */ + protected $classes; + + /** + * @var array + */ + protected $traits; + + /** + * @var array + */ + protected $functions; + + /** + * @var array + */ + protected $linesOfCode = NULL; + + /** + * @var integer + */ + protected $numFiles = -1; + + /** + * @var integer + */ + protected $numExecutableLines = -1; + + /** + * @var integer + */ + protected $numExecutedLines = -1; + + /** + * @var integer + */ + protected $numClasses = -1; + + /** + * @var integer + */ + protected $numTestedClasses = -1; + + /** + * @var integer + */ + protected $numTraits = -1; + + /** + * @var integer + */ + protected $numTestedTraits = -1; + + /** + * @var integer + */ + protected $numMethods = -1; + + /** + * @var integer + */ + protected $numTestedMethods = -1; + + /** + * @var integer + */ + protected $numFunctions = -1; + + /** + * @var integer + */ + protected $numTestedFunctions = -1; + + /** + * Returns the number of files in/under this node. + * + * @return integer + */ + public function count() + { + if ($this->numFiles == -1) { + $this->numFiles = 0; + + foreach ($this->children as $child) { + $this->numFiles += count($child); + } + } + + return $this->numFiles; + } + + /** + * Returns an iterator for this node. + * + * @return RecursiveIteratorIterator + */ + public function getIterator() + { + return new RecursiveIteratorIterator( + new PHP_CodeCoverage_Report_Node_Iterator($this), + RecursiveIteratorIterator::SELF_FIRST + ); + } + + /** + * Adds a new directory. + * + * @param string $name + * @return PHP_CodeCoverage_Report_Node_Directory + */ + public function addDirectory($name) + { + $directory = new PHP_CodeCoverage_Report_Node_Directory($name, $this); + + $this->children[] = $directory; + $this->directories[] = &$this->children[count($this->children) - 1]; + + return $directory; + } + + /** + * Adds a new file. + * + * @param string $name + * @param array $coverageData + * @param array $testData + * @param boolean $cacheTokens + * @return PHP_CodeCoverage_Report_Node_File + * @throws PHP_CodeCoverage_Exception + */ + public function addFile($name, array $coverageData, array $testData, $cacheTokens) + { + $file = new PHP_CodeCoverage_Report_Node_File( + $name, $this, $coverageData, $testData, $cacheTokens + ); + + $this->children[] = $file; + $this->files[] = &$this->children[count($this->children) - 1]; + + $this->numExecutableLines = -1; + $this->numExecutedLines = -1; + + return $file; + } + + /** + * Returns the directories in this directory. + * + * @return array + */ + public function getDirectories() + { + return $this->directories; + } + + /** + * Returns the files in this directory. + * + * @return array + */ + public function getFiles() + { + return $this->files; + } + + /** + * Returns the child nodes of this node. + * + * @return array + */ + public function getChildNodes() + { + return $this->children; + } + + /** + * Returns the classes of this node. + * + * @return array + */ + public function getClasses() + { + if ($this->classes === NULL) { + $this->classes = array(); + + foreach ($this->children as $child) { + $this->classes = array_merge( + $this->classes, $child->getClasses() + ); + } + } + + return $this->classes; + } + + /** + * Returns the traits of this node. + * + * @return array + */ + public function getTraits() + { + if ($this->traits === NULL) { + $this->traits = array(); + + foreach ($this->children as $child) { + $this->traits = array_merge( + $this->traits, $child->getTraits() + ); + } + } + + return $this->traits; + } + + /** + * Returns the functions of this node. + * + * @return array + */ + public function getFunctions() + { + if ($this->functions === NULL) { + $this->functions = array(); + + foreach ($this->children as $child) { + $this->functions = array_merge( + $this->functions, $child->getFunctions() + ); + } + } + + return $this->functions; + } + + /** + * Returns the LOC/CLOC/NCLOC of this node. + * + * @return array + */ + public function getLinesOfCode() + { + if ($this->linesOfCode === NULL) { + $this->linesOfCode = array('loc' => 0, 'cloc' => 0, 'ncloc' => 0); + + foreach ($this->children as $child) { + $linesOfCode = $child->getLinesOfCode(); + + $this->linesOfCode['loc'] += $linesOfCode['loc']; + $this->linesOfCode['cloc'] += $linesOfCode['cloc']; + $this->linesOfCode['ncloc'] += $linesOfCode['ncloc']; + } + } + + return $this->linesOfCode; + } + + /** + * Returns the number of executable lines. + * + * @return integer + */ + public function getNumExecutableLines() + { + if ($this->numExecutableLines == -1) { + $this->numExecutableLines = 0; + + foreach ($this->children as $child) { + $this->numExecutableLines += $child->getNumExecutableLines(); + } + } + + return $this->numExecutableLines; + } + + /** + * Returns the number of executed lines. + * + * @return integer + */ + public function getNumExecutedLines() + { + if ($this->numExecutedLines == -1) { + $this->numExecutedLines = 0; + + foreach ($this->children as $child) { + $this->numExecutedLines += $child->getNumExecutedLines(); + } + } + + return $this->numExecutedLines; + } + + /** + * Returns the number of classes. + * + * @return integer + */ + public function getNumClasses() + { + if ($this->numClasses == -1) { + $this->numClasses = 0; + + foreach ($this->children as $child) { + $this->numClasses += $child->getNumClasses(); + } + } + + return $this->numClasses; + } + + /** + * Returns the number of tested classes. + * + * @return integer + */ + public function getNumTestedClasses() + { + if ($this->numTestedClasses == -1) { + $this->numTestedClasses = 0; + + foreach ($this->children as $child) { + $this->numTestedClasses += $child->getNumTestedClasses(); + } + } + + return $this->numTestedClasses; + } + + /** + * Returns the number of traits. + * + * @return integer + */ + public function getNumTraits() + { + if ($this->numTraits == -1) { + $this->numTraits = 0; + + foreach ($this->children as $child) { + $this->numTraits += $child->getNumTraits(); + } + } + + return $this->numTraits; + } + + /** + * Returns the number of tested traits. + * + * @return integer + */ + public function getNumTestedTraits() + { + if ($this->numTestedTraits == -1) { + $this->numTestedTraits = 0; + + foreach ($this->children as $child) { + $this->numTestedTraits += $child->getNumTestedTraits(); + } + } + + return $this->numTestedTraits; + } + + /** + * Returns the number of methods. + * + * @return integer + */ + public function getNumMethods() + { + if ($this->numMethods == -1) { + $this->numMethods = 0; + + foreach ($this->children as $child) { + $this->numMethods += $child->getNumMethods(); + } + } + + return $this->numMethods; + } + + /** + * Returns the number of tested methods. + * + * @return integer + */ + public function getNumTestedMethods() + { + if ($this->numTestedMethods == -1) { + $this->numTestedMethods = 0; + + foreach ($this->children as $child) { + $this->numTestedMethods += $child->getNumTestedMethods(); + } + } + + return $this->numTestedMethods; + } + + /** + * Returns the number of functions. + * + * @return integer + */ + public function getNumFunctions() + { + if ($this->numFunctions == -1) { + $this->numFunctions = 0; + + foreach ($this->children as $child) { + $this->numFunctions += $child->getNumFunctions(); + } + } + + return $this->numFunctions; + } + + /** + * Returns the number of tested functions. + * + * @return integer + */ + public function getNumTestedFunctions() + { + if ($this->numTestedFunctions == -1) { + $this->numTestedFunctions = 0; + + foreach ($this->children as $child) { + $this->numTestedFunctions += $child->getNumTestedFunctions(); + } + } + + return $this->numTestedFunctions; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/File.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/File.php @@ -0,0 +1,721 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Represents a file in the code coverage information tree. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_Node_File extends PHP_CodeCoverage_Report_Node +{ + /** + * @var array + */ + protected $coverageData; + + /** + * @var array + */ + protected $testData; + + /** + * @var array + */ + protected $ignoredLines; + + /** + * @var integer + */ + protected $numExecutableLines = 0; + + /** + * @var integer + */ + protected $numExecutedLines = 0; + + /** + * @var array + */ + protected $classes = array(); + + /** + * @var array + */ + protected $traits = array(); + + /** + * @var array + */ + protected $functions = array(); + + /** + * @var array + */ + protected $linesOfCode = array(); + + /** + * @var integer + */ + protected $numTestedTraits = 0; + + /** + * @var integer + */ + protected $numTestedClasses = 0; + + /** + * @var integer + */ + protected $numMethods = NULL; + + /** + * @var integer + */ + protected $numTestedMethods = NULL; + + /** + * @var integer + */ + protected $numTestedFunctions = NULL; + + /** + * @var array + */ + protected $startLines = array(); + + /** + * @var array + */ + protected $endLines = array(); + + /** + * @var boolean + */ + protected $cacheTokens; + + /** + * Constructor. + * + * @param string $name + * @param PHP_CodeCoverage_Report_Node $parent + * @param array $coverageData + * @param array $testData + * @param boolean $cacheTokens + * @throws PHP_CodeCoverage_Exception + */ + public function __construct($name, PHP_CodeCoverage_Report_Node $parent, array $coverageData, array $testData, $cacheTokens) + { + if (!is_bool($cacheTokens)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'boolean' + ); + } + + parent::__construct($name, $parent); + + $this->coverageData = $coverageData; + $this->testData = $testData; + $this->ignoredLines = PHP_CodeCoverage_Util::getLinesToBeIgnored( + $this->getPath(), $cacheTokens + ); + $this->cacheTokens = $cacheTokens; + + $this->calculateStatistics(); + } + + /** + * Returns the number of files in/under this node. + * + * @return integer + */ + public function count() + { + return 1; + } + + /** + * Returns the code coverage data of this node. + * + * @return array + */ + public function getCoverageData() + { + return $this->coverageData; + } + + /** + * Returns the test data of this node. + * + * @return array + */ + public function getTestData() + { + return $this->testData; + } + + /** + * @return array + */ + public function getIgnoredLines() + { + return $this->ignoredLines; + } + + /** + * Returns the classes of this node. + * + * @return array + */ + public function getClasses() + { + return $this->classes; + } + + /** + * Returns the traits of this node. + * + * @return array + */ + public function getTraits() + { + return $this->traits; + } + + /** + * Returns the functions of this node. + * + * @return array + */ + public function getFunctions() + { + return $this->functions; + } + + /** + * Returns the LOC/CLOC/NCLOC of this node. + * + * @return array + */ + public function getLinesOfCode() + { + return $this->linesOfCode; + } + + /** + * Returns the number of executable lines. + * + * @return integer + */ + public function getNumExecutableLines() + { + return $this->numExecutableLines; + } + + /** + * Returns the number of executed lines. + * + * @return integer + */ + public function getNumExecutedLines() + { + return $this->numExecutedLines; + } + + /** + * Returns the number of classes. + * + * @return integer + */ + public function getNumClasses() + { + return count($this->classes); + } + + /** + * Returns the number of tested classes. + * + * @return integer + */ + public function getNumTestedClasses() + { + return $this->numTestedClasses; + } + + /** + * Returns the number of traits. + * + * @return integer + */ + public function getNumTraits() + { + return count($this->traits); + } + + /** + * Returns the number of tested traits. + * + * @return integer + */ + public function getNumTestedTraits() + { + return $this->numTestedTraits; + } + + /** + * Returns the number of methods. + * + * @return integer + */ + public function getNumMethods() + { + if ($this->numMethods === NULL) { + $this->numMethods = 0; + + foreach ($this->classes as $class) { + foreach ($class['methods'] as $method) { + if ($method['executableLines'] > 0) { + $this->numMethods++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait['methods'] as $method) { + if ($method['executableLines'] > 0) { + $this->numMethods++; + } + } + } + } + + return $this->numMethods; + } + + /** + * Returns the number of tested methods. + * + * @return integer + */ + public function getNumTestedMethods() + { + if ($this->numTestedMethods === NULL) { + $this->numTestedMethods = 0; + + foreach ($this->classes as $class) { + foreach ($class['methods'] as $method) { + if ($method['executableLines'] > 0 && + $method['coverage'] == 100) { + $this->numTestedMethods++; + } + } + } + + foreach ($this->traits as $trait) { + foreach ($trait['methods'] as $method) { + if ($method['executableLines'] > 0 && + $method['coverage'] == 100) { + $this->numTestedMethods++; + } + } + } + } + + return $this->numTestedMethods; + } + + /** + * Returns the number of functions. + * + * @return integer + */ + public function getNumFunctions() + { + return count($this->functions); + } + + /** + * Returns the number of tested functions. + * + * @return integer + */ + public function getNumTestedFunctions() + { + if ($this->numTestedFunctions === NULL) { + $this->numTestedFunctions = 0; + + foreach ($this->functions as $function) { + if ($function['executableLines'] > 0 && + $function['coverage'] == 100) { + $this->numTestedFunctions++; + } + } + } + + return $this->numTestedFunctions; + } + + /** + * Calculates coverage statistics for the file. + */ + protected function calculateStatistics() + { + if ($this->cacheTokens) { + $tokens = PHP_Token_Stream_CachingFactory::get($this->getPath()); + } else { + $tokens = new PHP_Token_Stream($this->getPath()); + } + + $this->processClasses($tokens); + $this->processTraits($tokens); + $this->processFunctions($tokens); + $this->linesOfCode = $tokens->getLinesOfCode(); + unset($tokens); + + for ($lineNumber = 1; $lineNumber <= $this->linesOfCode['loc']; $lineNumber++) { + if (isset($this->startLines[$lineNumber])) { + // Start line of a class. + if (isset($this->startLines[$lineNumber]['className'])) { + $currentClass = &$this->startLines[$lineNumber]; + } + + // Start line of a trait. + else if (isset($this->startLines[$lineNumber]['traitName'])) { + $currentTrait = &$this->startLines[$lineNumber]; + } + + // Start line of a method. + else if (isset($this->startLines[$lineNumber]['methodName'])) { + $currentMethod = &$this->startLines[$lineNumber]; + } + + // Start line of a function. + else if (isset($this->startLines[$lineNumber]['functionName'])) { + $currentFunction = &$this->startLines[$lineNumber]; + } + } + + if (!isset($this->ignoredLines[$lineNumber]) && + isset($this->coverageData[$lineNumber]) && + $this->coverageData[$lineNumber] !== NULL) { + if (isset($currentClass)) { + $currentClass['executableLines']++; + } + + if (isset($currentTrait)) { + $currentTrait['executableLines']++; + } + + if (isset($currentMethod)) { + $currentMethod['executableLines']++; + } + + if (isset($currentFunction)) { + $currentFunction['executableLines']++; + } + + $this->numExecutableLines++; + + if (count($this->coverageData[$lineNumber]) > 0 || + isset($this->ignoredLines[$lineNumber])) { + if (isset($currentClass)) { + $currentClass['executedLines']++; + } + + if (isset($currentTrait)) { + $currentTrait['executedLines']++; + } + + if (isset($currentMethod)) { + $currentMethod['executedLines']++; + } + + if (isset($currentFunction)) { + $currentFunction['executedLines']++; + } + + $this->numExecutedLines++; + } + } + + if (isset($this->endLines[$lineNumber])) { + // End line of a class. + if (isset($this->endLines[$lineNumber]['className'])) { + unset($currentClass); + } + + // End line of a trait. + else if (isset($this->endLines[$lineNumber]['traitName'])) { + unset($currentTrait); + } + + // End line of a method. + else if (isset($this->endLines[$lineNumber]['methodName'])) { + unset($currentMethod); + } + + // End line of a function. + else if (isset($this->endLines[$lineNumber]['functionName'])) { + unset($currentFunction); + } + } + } + + foreach ($this->traits as &$trait) { + foreach ($trait['methods'] as &$method) { + if ($method['executableLines'] > 0) { + $method['coverage'] = ($method['executedLines'] / + $method['executableLines']) * 100; + } else { + $method['coverage'] = 100; + } + + $method['crap'] = $this->crap( + $method['ccn'], $method['coverage'] + ); + + $trait['ccn'] += $method['ccn']; + } + + if ($trait['executableLines'] > 0) { + $trait['coverage'] = ($trait['executedLines'] / + $trait['executableLines']) * 100; + } else { + $trait['coverage'] = 100; + } + + if ($trait['coverage'] == 100) { + $this->numTestedClasses++; + } + + $trait['crap'] = $this->crap( + $trait['ccn'], $trait['coverage'] + ); + } + + foreach ($this->classes as &$class) { + foreach ($class['methods'] as &$method) { + if ($method['executableLines'] > 0) { + $method['coverage'] = ($method['executedLines'] / + $method['executableLines']) * 100; + } else { + $method['coverage'] = 100; + } + + $method['crap'] = $this->crap( + $method['ccn'], $method['coverage'] + ); + + $class['ccn'] += $method['ccn']; + } + + if ($class['executableLines'] > 0) { + $class['coverage'] = ($class['executedLines'] / + $class['executableLines']) * 100; + } else { + $class['coverage'] = 100; + } + + if ($class['coverage'] == 100) { + $this->numTestedClasses++; + } + + $class['crap'] = $this->crap( + $class['ccn'], $class['coverage'] + ); + } + } + + /** + * @param PHP_Token_Stream $tokens + */ + protected function processClasses(PHP_Token_Stream $tokens) + { + $classes = $tokens->getClasses(); + unset($tokens); + + $link = $this->getId() . '.html#'; + + foreach ($classes as $className => $class) { + $this->classes[$className] = array( + 'className' => $className, + 'methods' => array(), + 'startLine' => $class['startLine'], + 'executableLines' => 0, + 'executedLines' => 0, + 'ccn' => 0, + 'coverage' => 0, + 'crap' => 0, + 'package' => $class['package'], + 'link' => $link . $class['startLine'] + ); + + $this->startLines[$class['startLine']] = &$this->classes[$className]; + $this->endLines[$class['endLine']] = &$this->classes[$className]; + + foreach ($class['methods'] as $methodName => $method) { + $this->classes[$className]['methods'][$methodName] = array( + 'methodName' => $methodName, + 'signature' => $method['signature'], + 'startLine' => $method['startLine'], + 'endLine' => $method['endLine'], + 'executableLines' => 0, + 'executedLines' => 0, + 'ccn' => $method['ccn'], + 'coverage' => 0, + 'crap' => 0, + 'link' => $link . $method['startLine'] + ); + + $this->startLines[$method['startLine']] = &$this->classes[$className]['methods'][$methodName]; + $this->endLines[$method['endLine']] = &$this->classes[$className]['methods'][$methodName]; + } + } + } + + /** + * @param PHP_Token_Stream $tokens + */ + protected function processTraits(PHP_Token_Stream $tokens) + { + $traits = $tokens->getTraits(); + unset($tokens); + + $link = $this->getId() . '.html#'; + + foreach ($traits as $traitName => $trait) { + $this->traits[$traitName] = array( + 'traitName' => $traitName, + 'methods' => array(), + 'startLine' => $trait['startLine'], + 'executableLines' => 0, + 'executedLines' => 0, + 'ccn' => 0, + 'coverage' => 0, + 'crap' => 0, + 'package' => $trait['package'], + 'link' => $link . $trait['startLine'] + ); + + $this->startLines[$trait['startLine']] = &$this->traits[$traitName]; + $this->endLines[$trait['endLine']] = &$this->traits[$traitName]; + + foreach ($trait['methods'] as $methodName => $method) { + $this->traits[$traitName]['methods'][$methodName] = array( + 'methodName' => $methodName, + 'signature' => $method['signature'], + 'startLine' => $method['startLine'], + 'endLine' => $method['endLine'], + 'executableLines' => 0, + 'executedLines' => 0, + 'ccn' => $method['ccn'], + 'coverage' => 0, + 'crap' => 0, + 'link' => $link . $method['startLine'] + ); + + $this->startLines[$method['startLine']] = &$this->traits[$traitName]['methods'][$methodName]; + $this->endLines[$method['endLine']] = &$this->traits[$traitName]['methods'][$methodName]; + } + } + } + + /** + * @param PHP_Token_Stream $tokens + */ + protected function processFunctions(PHP_Token_Stream $tokens) + { + $functions = $tokens->getFunctions(); + unset($tokens); + + $link = $this->getId() . '.html#'; + + foreach ($functions as $functionName => $function) { + $this->functions[$functionName] = array( + 'functionName' => $functionName, + 'signature' => $function['signature'], + 'startLine' => $function['startLine'], + 'executableLines' => 0, + 'executedLines' => 0, + 'ccn' => $function['ccn'], + 'coverage' => 0, + 'crap' => 0, + 'link' => $link . $function['startLine'] + ); + + $this->startLines[$function['startLine']] = &$this->functions[$functionName]; + $this->endLines[$function['endLine']] = &$this->functions[$functionName]; + } + } + + /** + * Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code + * based on its cyclomatic complexity and percentage of code coverage. + * + * @param integer $ccn + * @param float $coverage + * @return string + * @since Method available since Release 1.2.0 + */ + protected function crap($ccn, $coverage) + { + if ($coverage == 0) { + return (string)pow($ccn, 2) + $ccn; + } + + if ($coverage >= 95) { + return (string)$ccn; + } + + return sprintf( + '%01.2F', pow($ccn, 2) * pow(1 - $coverage/100, 3) + $ccn + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Iterator.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Node/Iterator.php @@ -0,0 +1,148 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Recursive iterator for PHP_CodeCoverage_Report_Node object graphs. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_Node_Iterator implements RecursiveIterator +{ + /** + * @var integer + */ + protected $position; + + /** + * @var PHP_CodeCoverage_Report_Node[] + */ + protected $nodes; + + /** + * Constructor. + * + * @param PHP_CodeCoverage_Report_Node_Directory $node + */ + public function __construct(PHP_CodeCoverage_Report_Node_Directory $node) + { + $this->nodes = $node->getChildNodes(); + } + + /** + * Rewinds the Iterator to the first element. + * + */ + public function rewind() + { + $this->position = 0; + } + + /** + * Checks if there is a current element after calls to rewind() or next(). + * + * @return boolean + */ + public function valid() + { + return $this->position < count($this->nodes); + } + + /** + * Returns the key of the current element. + * + * @return integer + */ + public function key() + { + return $this->position; + } + + /** + * Returns the current element. + * + * @return PHPUnit_Framework_Test + */ + public function current() + { + return $this->valid() ? $this->nodes[$this->position] : NULL; + } + + /** + * Moves forward to next element. + * + */ + public function next() + { + $this->position++; + } + + /** + * Returns the sub iterator for the current element. + * + * @return PHP_CodeCoverage_Report_Node_Iterator + */ + public function getChildren() + { + return new PHP_CodeCoverage_Report_Node_Iterator( + $this->nodes[$this->position] + ); + } + + /** + * Checks whether the current element has children. + * + * @return boolean + */ + public function hasChildren() + { + return $this->nodes[$this->position] instanceof PHP_CodeCoverage_Report_Node_Directory; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/PHP.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/PHP.php @@ -0,0 +1,74 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Uses serialize() to write a PHP_CodeCoverage object to a file. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_PHP +{ + /** + * @param PHP_CodeCoverage $coverage + * @param string $target + * @return string + */ + public function process(PHP_CodeCoverage $coverage, $target = NULL) + { + $coverage = serialize($coverage); + + if ($target !== NULL) { + return file_put_contents($target, $coverage); + } else { + return $coverage; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Text.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Text.php @@ -0,0 +1,278 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +/** + * Generates human readable output from an PHP_CodeCoverage object. + * + * The output gets put into a text file our written to the CLI. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_Text +{ + protected $outputStream; + protected $lowUpperBound; + protected $highLowerBound; + protected $showUncoveredFiles; + + protected $colors = array( + 'green' => "\x1b[30;42m", + 'yellow' => "\x1b[30;43m", + 'red' => "\x1b[37;41m", + 'header' => "\x1b[47;40m", + 'reset' => "\x1b[0m", + 'eol' => "\x1b[2K", + ); + + public function __construct(PHPUnit_Util_Printer $outputStream, $lowUpperBound, $highLowerBound, $showUncoveredFiles) + { + $this->outputStream = $outputStream; + $this->lowUpperBound = $lowUpperBound; + $this->highLowerBound = $highLowerBound; + $this->showUncoveredFiles = $showUncoveredFiles; + } + + /** + * @param PHP_CodeCoverage $coverage + * @param string $target + * @param string $name + * @return string + */ + public function process(PHP_CodeCoverage $coverage, $showColors = FALSE) + { + $output = ''; + $report = $coverage->getReport(); + unset($coverage); + + $colors = array( + 'header' => '', + 'classes' => '', + 'methods' => '', + 'lines' => '', + 'reset' => '', + 'eol' => '' + ); + + if ($showColors) { + $colors['classes'] = $this->getCoverageColor( + $report->getNumTestedClassesAndTraits(), + $report->getNumClassesAndTraits() + ); + $colors['methods'] = $this->getCoverageColor( + $report->getNumTestedMethods(), + $report->getNumMethods() + ); + $colors['lines'] = $this->getCoverageColor( + $report->getNumExecutedLines(), + $report->getNumExecutableLines() + ); + $colors['reset'] = $this->colors['reset']; + $colors['header'] = $this->colors['header']; + $colors['eol'] = $this->colors['eol']; + } + + $output .= PHP_EOL . PHP_EOL . + $colors['header'] . 'Code Coverage Report '; + + $output .= PHP_EOL . + date(' Y-m-d H:i:s', $_SERVER['REQUEST_TIME']) . + PHP_EOL; + + $output .= PHP_EOL . ' Summary: ' . PHP_EOL . $colors['reset'] + . $colors['classes'] . $colors['eol'] . ' Classes: ' . PHP_CodeCoverage_Util::percent($report->getNumTestedClassesAndTraits(), $report->getNumClassesAndTraits(), TRUE) + . ' (' . $report->getNumTestedClassesAndTraits() . '/' . $report->getNumClassesAndTraits() . ')' . PHP_EOL . $colors ['eol'] + . $colors['methods'] . $colors['eol'] . ' Methods: ' . PHP_CodeCoverage_Util::percent($report->getNumTestedMethods(), $report->getNumMethods(), TRUE) + . ' (' . $report->getNumTestedMethods() . '/' . $report->getNumMethods() . ')' . PHP_EOL . $colors ['eol'] + . $colors['lines'] . $colors['eol'] . ' Lines: ' . PHP_CodeCoverage_Util::percent($report->getNumExecutedLines(), $report->getNumExecutableLines(), TRUE) + . ' (' . $report->getNumExecutedLines() . '/' . $report->getNumExecutableLines() . ')' . PHP_EOL . $colors['reset'] . $colors ['eol']; + + $classCoverage = array(); + + foreach ($report as $item) { + if (!$item instanceof PHP_CodeCoverage_Report_Node_File) { + continue; + } + + $classes = $item->getClassesAndTraits(); + $coverage = $item->getCoverageData(); + $lines = array(); + $ignoredLines = $item->getIgnoredLines(); + + foreach ($classes as $className => $class) { + $classStatements = 0; + $coveredClassStatements = 0; + $coveredMethods = 0; + + foreach ($class['methods'] as $method) { + $methodCount = 0; + $methodLines = 0; + $methodLinesCovered = 0; + + for ($i = $method['startLine']; + $i <= $method['endLine']; + $i++) { + if (isset($ignoredLines[$i])) { + continue; + } + + $add = TRUE; + $count = 0; + + if (isset($coverage[$i])) { + if ($coverage[$i] !== NULL) { + $classStatements++; + $methodLines++; + } else { + $add = FALSE; + } + + $count = count($coverage[$i]); + + if ($count > 0) { + $coveredClassStatements++; + $methodLinesCovered++; + } + } else { + $add = FALSE; + } + + $methodCount = max($methodCount, $count); + + if ($add) { + $lines[$i] = array( + 'count' => $count, 'type' => 'stmt' + ); + } + } + + if ($methodCount > 0) { + $coveredMethods++; + } + + } + + if (!empty($class['package']['namespace'])) { + $namespace = '\\' . $class['package']['namespace'] . '::'; + } + + else if (!empty($class['package']['fullPackage'])) { + $namespace = '@' . $class['package']['fullPackage'] . '::'; + } + + else { + $namespace = ''; + } + + $classCoverage[$namespace . $className] = array( + 'namespace' => $namespace, + 'className ' => $className, + 'methodsCovered' => $coveredMethods, + 'methodCount' => count($class['methods']), + 'statementsCovered' => $coveredClassStatements, + 'statementCount' => $classStatements, + ); + } + } + + ksort($classCoverage); + + $methodColor = ''; + $linesColor = ''; + $resetColor = ''; + + foreach ($classCoverage as $fullQualifiedPath => $classInfo) { + if ($classInfo['statementsCovered'] != 0 || + $this->showUncoveredFiles) { + + if ($showColors) { + $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); + $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); + $resetColor = $colors['reset']; + } + + $output .= PHP_EOL . $fullQualifiedPath . PHP_EOL + . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ' + . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor + ; + } + } + + $this->outputStream->write($output . PHP_EOL); + } + + protected function getCoverageColor($numberOfCoveredElements, $totalNumberOfElements) + { + $coverage = PHP_CodeCoverage_Util::percent( + $numberOfCoveredElements, $totalNumberOfElements + ); + + if ($coverage > $this->highLowerBound) { + return $this->colors['green']; + } + + else if ($coverage > $this->lowUpperBound) { + return $this->colors['yellow']; + } + + return $this->colors['red']; + } + + protected function printCoverageCounts($numberOfCoveredElements, $totalNumberOfElements, $presicion) + { + $format = '%' . $presicion . 's'; + + return PHP_CodeCoverage_Util::percent( + $numberOfCoveredElements, $totalNumberOfElements, TRUE, TRUE + ) . + ' (' . sprintf($format, $numberOfCoveredElements) . '/' . + sprintf($format, $totalNumberOfElements) . ')'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util.php @@ -0,0 +1,265 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Utility methods. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_Util +{ + /** + * @var array + */ + protected static $ignoredLines = array(); + + /** + * @var array + */ + protected static $ids = array(); + + + /** + * Returns the lines of a source file that should be ignored. + * + * @param string $filename + * @param boolean $cacheTokens + * @return array + * @throws PHP_CodeCoverage_Exception + */ + public static function getLinesToBeIgnored($filename, $cacheTokens = TRUE) + { + if (!is_string($filename)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 1, 'string' + ); + } + + if (!is_bool($cacheTokens)) { + throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( + 2, 'boolean' + ); + } + + if (!isset(self::$ignoredLines[$filename])) { + self::$ignoredLines[$filename] = array(); + $ignore = FALSE; + $stop = FALSE; + $lines = file($filename); + + foreach ($lines as $index => $line) { + if (!trim($line)) { + self::$ignoredLines[$filename][$index+1] = TRUE; + } + } + + if ($cacheTokens) { + $tokens = PHP_Token_Stream_CachingFactory::get($filename); + } else { + $tokens = new PHP_Token_Stream($filename); + } + + $classes = array_merge($tokens->getClasses(), $tokens->getTraits()); + $tokens = $tokens->tokens(); + + foreach ($tokens as $token) { + switch (get_class($token)) { + case 'PHP_Token_COMMENT': + case 'PHP_Token_DOC_COMMENT': { + + $_token = trim($token); + $_line = trim($lines[$token->getLine() - 1]); + + if ($_token == '// @codeCoverageIgnore' || + $_token == '//@codeCoverageIgnore') { + $ignore = TRUE; + $stop = TRUE; + } + + else if ($_token == '// @codeCoverageIgnoreStart' || + $_token == '//@codeCoverageIgnoreStart') { + $ignore = TRUE; + } + + else if ($_token == '// @codeCoverageIgnoreEnd' || + $_token == '//@codeCoverageIgnoreEnd') { + $stop = TRUE; + } + + // be sure the comment doesn't have some token BEFORE it on the same line... + // it would not be safe to ignore the whole line in those cases. + if (0 === strpos($_token, $_line)) { + $count = substr_count($token, "\n"); + $line = $token->getLine(); + + for ($i = $line; $i < $line + $count; $i++) { + self::$ignoredLines[$filename][$i] = TRUE; + } + + if ($token instanceof PHP_Token_DOC_COMMENT) { + // Workaround for the fact the DOC_COMMENT token + // does not include the final \n character in its + // text. + if (substr(trim($lines[$i-1]), -2) == '*/') { + self::$ignoredLines[$filename][$i] = TRUE; + } + } + } + } + break; + + case 'PHP_Token_INTERFACE': + case 'PHP_Token_TRAIT': + case 'PHP_Token_CLASS': + case 'PHP_Token_FUNCTION': { + $docblock = $token->getDocblock(); + + if (strpos($docblock, '@codeCoverageIgnore')) { + $endLine = $token->getEndLine(); + + for ($i = $token->getLine(); $i <= $endLine; $i++) { + self::$ignoredLines[$filename][$i] = TRUE; + } + } + + else if ($token instanceof PHP_Token_INTERFACE || + $token instanceof PHP_Token_TRAIT || + $token instanceof PHP_Token_CLASS) { + if (empty($classes[$token->getName()]['methods'])) { + for ($i = $token->getLine(); + $i <= $token->getEndLine(); + $i++) { + self::$ignoredLines[$filename][$i] = TRUE; + } + } else { + $firstMethod = array_shift( + $classes[$token->getName()]['methods'] + ); + + do { + $lastMethod = array_pop( + $classes[$token->getName()]['methods'] + ); + } while ($lastMethod !== NULL && substr($lastMethod['signature'], 0, 18) == 'anonymous function'); + + if ($lastMethod === NULL) { + $lastMethod = $firstMethod; + } + + for ($i = $token->getLine(); + $i < $firstMethod['startLine']; + $i++) { + self::$ignoredLines[$filename][$i] = TRUE; + } + + for ($i = $token->getEndLine(); + $i > $lastMethod['endLine']; + $i--) { + self::$ignoredLines[$filename][$i] = TRUE; + } + } + } + } + break; + + case 'PHP_Token_NAMESPACE': { + self::$ignoredLines[$filename][$token->getEndLine()] = TRUE; + } // Intentional fallthrough + case 'PHP_Token_OPEN_TAG': + case 'PHP_Token_CLOSE_TAG': + case 'PHP_Token_USE': { + self::$ignoredLines[$filename][$token->getLine()] = TRUE; + } + break; + } + + if ($ignore) { + self::$ignoredLines[$filename][$token->getLine()] = TRUE; + + if ($stop) { + $ignore = FALSE; + $stop = FALSE; + } + } + } + } + + return self::$ignoredLines[$filename]; + } + + /** + * @param float $a + * @param float $b + * @return float ($a / $b) * 100 + */ + public static function percent($a, $b, $asString = FALSE, $fixedWidth = FALSE) + { + if ($asString && $b == 0) { + return ''; + } + + if ($b > 0) { + $percent = ($a / $b) * 100; + } else { + $percent = 100; + } + + if ($asString) { + if ($fixedWidth) { + return sprintf('%6.2F%%', $percent); + } + + return sprintf('%01.2F%%', $percent); + } else { + return $percent; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util/InvalidArgumentHelper.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Util/InvalidArgumentHelper.php @@ -0,0 +1,80 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.2.0 + */ + +/** + * Factory for PHP_CodeCoverage_Exception objects that are used to describe + * invalid arguments passed to a function or method. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.2.0 + */ +class PHP_CodeCoverage_Util_InvalidArgumentHelper +{ + /** + * @param integer $argument + * @param string $type + * @param mixed $value + */ + public static function factory($argument, $type, $value = NULL) + { + $stack = debug_backtrace(FALSE); + + return new PHP_CodeCoverage_Exception( + sprintf( + 'Argument #%d%sof %s::%s() must be a %s', + $argument, + $value !== NULL ? ' (' . $value . ')' : ' ', + $stack[1]['class'], + $stack[1]['function'], + $type + ) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Version.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Version.php @@ -0,0 +1,92 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.2.1 + */ + +/** + * + * + * @category PHP + * @package CodeCoverage + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.2.1 + */ +class PHP_CodeCoverage_Version +{ + const VERSION = '1.2.18'; + protected static $version; + + /** + * Returns the version of PHP_CodeCoverage. + * + * @return string + */ + public static function id() + { + if (self::$version === NULL) { + self::$version = self::VERSION; + + if (is_dir(dirname(dirname(__DIR__)) . '/.git')) { + $dir = getcwd(); + chdir(__DIR__); + $version = @exec('git describe --tags'); + chdir($dir); + + if ($version) { + if (count(explode('.', self::VERSION)) == 3) { + self::$version = $version; + } else { + $version = explode('-', $version); + + self::$version = self::VERSION . '-' . $version[2]; + } + } + } + } + + return self::$version; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/README.md b/libs/php-ssh/vendor/phpunit/php-code-coverage/README.md @@ -0,0 +1,40 @@ +[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage) +[![Build Status](https://travis-ci.org/sebastianbergmann/php-code-coverage.png?branch=1.2)](https://travis-ci.org/sebastianbergmann/php-code-coverage) + +# PHP_CodeCoverage + +**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information. + +## Requirements + +* PHP 5.3.3 is required but using the latest version of PHP is highly recommended +* [Xdebug](http://xdebug.org/) 2.1.3 is required but using the latest version of Xdebug is highly recommended + +## Installation + +To add PHP_CodeCoverage as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-code-coverage` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_CodeCoverage 1.2: + + { + "require": { + "phpunit/php-code-coverage": "1.2.*" + } + } + +## Using the PHP_CodeCoverage API + +```php +<?php +$coverage = new PHP_CodeCoverage; +$coverage->start('<name of test>'); + +// ... + +$coverage->stop(); + +$writer = new PHP_CodeCoverage_Report_Clover; +$writer->process($coverage, '/tmp/clover.xml'); + +$writer = new PHP_CodeCoverage_Report_HTML; +$writer->process($coverage, '/tmp/code-coverage-report'); +``` + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/FilterTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/FilterTest.php @@ -0,0 +1,305 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +/** + * Tests for the PHP_CodeCoverage_Filter class. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_FilterTest extends PHPUnit_Framework_TestCase +{ + protected $filter; + protected $files; + + protected function setUp() + { + $this->filter = unserialize('O:23:"PHP_CodeCoverage_Filter":0:{}'); + + $this->files = array( + TEST_FILES_PATH . 'BankAccount.php', + TEST_FILES_PATH . 'BankAccountTest.php', + TEST_FILES_PATH . 'CoverageClassExtendedTest.php', + TEST_FILES_PATH . 'CoverageClassTest.php', + TEST_FILES_PATH . 'CoverageFunctionParenthesesTest.php', + TEST_FILES_PATH . 'CoverageFunctionParenthesesWhitespaceTest.php', + TEST_FILES_PATH . 'CoverageFunctionTest.php', + TEST_FILES_PATH . 'CoverageMethodOneLineAnnotationTest.php', + TEST_FILES_PATH . 'CoverageMethodParenthesesTest.php', + TEST_FILES_PATH . 'CoverageMethodParenthesesWhitespaceTest.php', + TEST_FILES_PATH . 'CoverageMethodTest.php', + TEST_FILES_PATH . 'CoverageNoneTest.php', + TEST_FILES_PATH . 'CoverageNotPrivateTest.php', + TEST_FILES_PATH . 'CoverageNotProtectedTest.php', + TEST_FILES_PATH . 'CoverageNotPublicTest.php', + TEST_FILES_PATH . 'CoverageNothingTest.php', + TEST_FILES_PATH . 'CoveragePrivateTest.php', + TEST_FILES_PATH . 'CoverageProtectedTest.php', + TEST_FILES_PATH . 'CoveragePublicTest.php', + TEST_FILES_PATH . 'CoverageTwoDefaultClassAnnotations.php', + TEST_FILES_PATH . 'CoveredClass.php', + TEST_FILES_PATH . 'CoveredFunction.php', + TEST_FILES_PATH . 'NamespaceCoverageClassExtendedTest.php', + TEST_FILES_PATH . 'NamespaceCoverageClassTest.php', + TEST_FILES_PATH . 'NamespaceCoverageCoversClassPublicTest.php', + TEST_FILES_PATH . 'NamespaceCoverageCoversClassTest.php', + TEST_FILES_PATH . 'NamespaceCoverageMethodTest.php', + TEST_FILES_PATH . 'NamespaceCoverageNotPrivateTest.php', + TEST_FILES_PATH . 'NamespaceCoverageNotProtectedTest.php', + TEST_FILES_PATH . 'NamespaceCoverageNotPublicTest.php', + TEST_FILES_PATH . 'NamespaceCoveragePrivateTest.php', + TEST_FILES_PATH . 'NamespaceCoverageProtectedTest.php', + TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php', + TEST_FILES_PATH . 'NamespaceCoveredClass.php', + TEST_FILES_PATH . 'NotExistingCoveredElementTest.php', + TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php', + TEST_FILES_PATH . 'source_with_ignore.php', + TEST_FILES_PATH . 'source_with_namespace.php', + TEST_FILES_PATH . 'source_with_oneline_annotations.php', + TEST_FILES_PATH . 'source_without_ignore.php', + TEST_FILES_PATH . 'source_without_namespace.php' + ); + } + + /** + * @covers PHP_CodeCoverage_Filter::addFileToBlacklist + * @covers PHP_CodeCoverage_Filter::getBlacklist + */ + public function testAddingAFileToTheBlacklistWorks() + { + $this->filter->addFileToBlacklist($this->files[0]); + + $this->assertEquals( + array($this->files[0]), $this->filter->getBlacklist() + ); + } + + /** + * @covers PHP_CodeCoverage_Filter::removeFileFromBlacklist + * @covers PHP_CodeCoverage_Filter::getBlacklist + */ + public function testRemovingAFileFromTheBlacklistWorks() + { + $this->filter->addFileToBlacklist($this->files[0]); + $this->filter->removeFileFromBlacklist($this->files[0]); + + $this->assertEquals(array(), $this->filter->getBlacklist()); + } + + /** + * @covers PHP_CodeCoverage_Filter::addDirectoryToBlacklist + * @covers PHP_CodeCoverage_Filter::getBlacklist + * @depends testAddingAFileToTheBlacklistWorks + */ + public function testAddingADirectoryToTheBlacklistWorks() + { + $this->filter->addDirectoryToBlacklist(TEST_FILES_PATH); + + $blacklist = $this->filter->getBlacklist(); + sort($blacklist); + + $this->assertEquals($this->files, $blacklist); + } + + /** + * @covers PHP_CodeCoverage_Filter::addFilesToBlacklist + * @covers PHP_CodeCoverage_Filter::getBlacklist + */ + public function testAddingFilesToTheBlacklistWorks() + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + TEST_FILES_PATH, $suffixes = '.php' + ); + + $this->filter->addFilesToBlacklist($files); + + $blacklist = $this->filter->getBlacklist(); + sort($blacklist); + + $this->assertEquals($this->files, $blacklist); + } + + /** + * @covers PHP_CodeCoverage_Filter::removeDirectoryFromBlacklist + * @covers PHP_CodeCoverage_Filter::getBlacklist + * @depends testAddingADirectoryToTheBlacklistWorks + */ + public function testRemovingADirectoryFromTheBlacklistWorks() + { + $this->filter->addDirectoryToBlacklist(TEST_FILES_PATH); + $this->filter->removeDirectoryFromBlacklist(TEST_FILES_PATH); + + $this->assertEquals(array(), $this->filter->getBlacklist()); + } + + /** + * @covers PHP_CodeCoverage_Filter::addFileToWhitelist + * @covers PHP_CodeCoverage_Filter::getWhitelist + */ + public function testAddingAFileToTheWhitelistWorks() + { + $this->filter->addFileToWhitelist($this->files[0]); + + $this->assertEquals( + array($this->files[0]), $this->filter->getWhitelist() + ); + } + + /** + * @covers PHP_CodeCoverage_Filter::removeFileFromWhitelist + * @covers PHP_CodeCoverage_Filter::getWhitelist + */ + public function testRemovingAFileFromTheWhitelistWorks() + { + $this->filter->addFileToWhitelist($this->files[0]); + $this->filter->removeFileFromWhitelist($this->files[0]); + + $this->assertEquals(array(), $this->filter->getWhitelist()); + } + + /** + * @covers PHP_CodeCoverage_Filter::addDirectoryToWhitelist + * @covers PHP_CodeCoverage_Filter::getWhitelist + * @depends testAddingAFileToTheWhitelistWorks + */ + public function testAddingADirectoryToTheWhitelistWorks() + { + $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); + + $whitelist = $this->filter->getWhitelist(); + sort($whitelist); + + $this->assertEquals($this->files, $whitelist); + } + + /** + * @covers PHP_CodeCoverage_Filter::addFilesToWhitelist + * @covers PHP_CodeCoverage_Filter::getBlacklist + */ + public function testAddingFilesToTheWhitelistWorks() + { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + TEST_FILES_PATH, $suffixes = '.php' + ); + + $this->filter->addFilesToWhitelist($files); + + $whitelist = $this->filter->getWhitelist(); + sort($whitelist); + + $this->assertEquals($this->files, $whitelist); + } + + /** + * @covers PHP_CodeCoverage_Filter::removeDirectoryFromWhitelist + * @covers PHP_CodeCoverage_Filter::getWhitelist + * @depends testAddingADirectoryToTheWhitelistWorks + */ + public function testRemovingADirectoryFromTheWhitelistWorks() + { + $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH); + $this->filter->removeDirectoryFromWhitelist(TEST_FILES_PATH); + + $this->assertEquals(array(), $this->filter->getWhitelist()); + } + + /** + * @covers PHP_CodeCoverage_Filter::isFile + */ + public function testIsFile() + { + $this->assertFalse($this->filter->isFile('vfs://root/a/path')); + $this->assertFalse($this->filter->isFile('xdebug://debug-eval')); + $this->assertFalse($this->filter->isFile('eval()\'d code')); + $this->assertFalse($this->filter->isFile('runtime-created function')); + $this->assertFalse($this->filter->isFile('assert code')); + $this->assertFalse($this->filter->isFile('regexp code')); + $this->assertTrue($this->filter->isFile('filename')); + } + + /** + * @covers PHP_CodeCoverage_Filter::isFiltered + */ + public function testBlacklistedFileIsFiltered() + { + $this->filter->addFileToBlacklist($this->files[0]); + $this->assertTrue($this->filter->isFiltered($this->files[0])); + } + + /** + * @covers PHP_CodeCoverage_Filter::isFiltered + */ + public function testWhitelistedFileIsNotFiltered() + { + $this->filter->addFileToWhitelist($this->files[0]); + $this->assertFalse($this->filter->isFiltered($this->files[0])); + } + + /** + * @covers PHP_CodeCoverage_Filter::isFiltered + */ + public function testNotWhitelistedFileIsFiltered() + { + $this->filter->addFileToWhitelist($this->files[0]); + $this->assertTrue($this->filter->isFiltered($this->files[1])); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/CloverTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/CloverTest.php @@ -0,0 +1,109 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once TEST_FILES_PATH . '../TestCase.php'; + +/** + * Tests for the PHP_CodeCoverage_Report_Clover class. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_Report_CloverTest extends PHP_CodeCoverage_TestCase +{ + /** + * @covers PHP_CodeCoverage_Report_Clover + */ + public function testCloverForBankAccountTest() + { + $clover = new PHP_CodeCoverage_Report_Clover; + + $this->assertStringMatchesFormatFile( + TEST_FILES_PATH . 'BankAccount-clover.xml', + $clover->process($this->getCoverageForBankAccount(), NULL, 'BankAccount') + ); + } + + /** + * @covers PHP_CodeCoverage_Report_Clover + */ + public function testCloverForFileWithIgnoredLines() + { + $clover = new PHP_CodeCoverage_Report_Clover; + + $this->assertStringMatchesFormatFile( + TEST_FILES_PATH . 'ignored-lines-clover.xml', + $clover->process($this->getCoverageForFileWithIgnoredLines()) + ); + } + + /** + * @covers PHP_CodeCoverage_Report_Clover + */ + public function testCloverForClassWithAnonymousFunction() + { + $clover = new PHP_CodeCoverage_Report_Clover; + + $this->assertStringMatchesFormatFile( + TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml', + $clover->process($this->getCoverageForClassWithAnonymousFunction()) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/FactoryTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/FactoryTest.php @@ -0,0 +1,263 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.1.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once TEST_FILES_PATH . '../TestCase.php'; + +/** + * Tests for the PHP_CodeCoverage_Report_Factory class. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.1.0 + */ +class PHP_CodeCoverage_Report_FactoryTest extends PHP_CodeCoverage_TestCase +{ + protected $factory; + + protected function setUp() + { + $this->factory = new PHP_CodeCoverage_Report_Factory; + } + + public function testSomething() + { + $root = $this->getCoverageForBankAccount()->getReport(); + + $expectedPath = rtrim(TEST_FILES_PATH, DIRECTORY_SEPARATOR); + $this->assertEquals($expectedPath, $root->getName()); + $this->assertEquals($expectedPath, $root->getPath()); + $this->assertEquals(10, $root->getNumExecutableLines()); + $this->assertEquals(5, $root->getNumExecutedLines()); + $this->assertEquals(1, $root->getNumClasses()); + $this->assertEquals(0, $root->getNumTestedClasses()); + $this->assertEquals(4, $root->getNumMethods()); + $this->assertEquals(3, $root->getNumTestedMethods()); + $this->assertEquals('0.00%', $root->getTestedClassesPercent()); + $this->assertEquals('75.00%', $root->getTestedMethodsPercent()); + $this->assertEquals('50.00%', $root->getLineExecutedPercent()); + $this->assertEquals(0, $root->getNumFunctions()); + $this->assertEquals(0, $root->getNumTestedFunctions()); + $this->assertNull($root->getParent()); + $this->assertEquals(array(), $root->getDirectories()); + #$this->assertEquals(array(), $root->getFiles()); + #$this->assertEquals(array(), $root->getChildNodes()); + + $this->assertEquals( + array( + 'BankAccount' => array( + 'methods' => array( + 'getBalance' => array( + 'signature' => 'getBalance()', + 'startLine' => 6, + 'endLine' => 9, + 'executableLines' => 1, + 'executedLines' => 1, + 'ccn' => 1, + 'coverage' => 100, + 'crap' => '1', + 'link' => 'BankAccount.php.html#6', + 'methodName' => 'getBalance' + ), + 'setBalance' => array( + 'signature' => 'setBalance($balance)', + 'startLine' => 11, + 'endLine' => 18, + 'executableLines' => 5, + 'executedLines' => 0, + 'ccn' => 2, + 'coverage' => 0, + 'crap' => 6, + 'link' => 'BankAccount.php.html#11', + 'methodName' => 'setBalance' + ), + 'depositMoney' => array( + 'signature' => 'depositMoney($balance)', + 'startLine' => 20, + 'endLine' => 25, + 'executableLines' => 2, + 'executedLines' => 2, + 'ccn' => 1, + 'coverage' => 100, + 'crap' => '1', + 'link' => 'BankAccount.php.html#20', + 'methodName' => 'depositMoney' + ), + 'withdrawMoney' => array( + 'signature' => 'withdrawMoney($balance)', + 'startLine' => 27, + 'endLine' => 32, + 'executableLines' => 2, + 'executedLines' => 2, + 'ccn' => 1, + 'coverage' => 100, + 'crap' => '1', + 'link' => 'BankAccount.php.html#27', + 'methodName' => 'withdrawMoney' + ), + ), + 'startLine' => 2, + 'executableLines' => 10, + 'executedLines' => 5, + 'ccn' => 5, + 'coverage' => 50, + 'crap' => '8.12', + 'package' => array( + 'namespace' => '', + 'fullPackage' => '', + 'category' => '', + 'package' => '', + 'subpackage' => '' + ), + 'link' => 'BankAccount.php.html#2', + 'className' => 'BankAccount' + ) + ), + $root->getClasses() + ); + + $this->assertEquals(array(), $root->getFunctions()); + } + + /** + * @covers PHP_CodeCoverage_Report_Factory::buildDirectoryStructure + */ + public function testBuildDirectoryStructure() + { + $method = new ReflectionMethod( + 'PHP_CodeCoverage_Report_Factory', 'buildDirectoryStructure' + ); + + $method->setAccessible(TRUE); + + $this->assertEquals( + array( + 'src' => array( + 'Money.php/f' => array(), + 'MoneyBag.php/f' => array() + ) + ), + $method->invoke( + $this->factory, + array('src/Money.php' => array(), 'src/MoneyBag.php' => array()) + ) + ); + } + + /** + * @covers PHP_CodeCoverage_Report_Factory::reducePaths + * @dataProvider reducePathsProvider + */ + public function testReducePaths($reducedPaths, $commonPath, $paths) + { + $method = new ReflectionMethod( + 'PHP_CodeCoverage_Report_Factory', 'reducePaths' + ); + + $method->setAccessible(TRUE); + + $_commonPath = $method->invokeArgs($this->factory, array(&$paths)); + + $this->assertEquals($reducedPaths, $paths); + $this->assertEquals($commonPath, $_commonPath); + } + + public function reducePathsProvider() + { + return array( + array( + array( + 'Money.php' => array(), + 'MoneyBag.php' => array() + ), + '/home/sb/Money', + array( + '/home/sb/Money/Money.php' => array(), + '/home/sb/Money/MoneyBag.php' => array() + ) + ), + array( + array( + 'Money.php' => array() + ), + '/home/sb/Money/', + array( + '/home/sb/Money/Money.php' => array() + ) + ), + array( + array(), + '.', + array() + ), + array( + array( + 'Money.php' => array(), + 'MoneyBag.php' => array(), + 'Cash.phar/Cash.php' => array(), + ), + '/home/sb/Money', + array( + '/home/sb/Money/Money.php' => array(), + '/home/sb/Money/MoneyBag.php' => array(), + 'phar:///home/sb/Money/Cash.phar/Cash.php' => array(), + ), + ), + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/UtilTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/UtilTest.php @@ -0,0 +1,232 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once TEST_FILES_PATH . 'CoverageClassExtendedTest.php'; +require_once TEST_FILES_PATH . 'CoverageClassTest.php'; +require_once TEST_FILES_PATH . 'CoverageFunctionTest.php'; +require_once TEST_FILES_PATH . 'CoverageFunctionParenthesesTest.php'; +require_once TEST_FILES_PATH . 'CoverageFunctionParenthesesWhitespaceTest.php'; +require_once TEST_FILES_PATH . 'CoverageMethodTest.php'; +require_once TEST_FILES_PATH . 'CoverageMethodOneLineAnnotationTest.php'; +require_once TEST_FILES_PATH . 'CoverageMethodParenthesesTest.php'; +require_once TEST_FILES_PATH . 'CoverageMethodParenthesesWhitespaceTest.php'; +require_once TEST_FILES_PATH . 'CoverageNoneTest.php'; +require_once TEST_FILES_PATH . 'CoverageNotPrivateTest.php'; +require_once TEST_FILES_PATH . 'CoverageNotProtectedTest.php'; +require_once TEST_FILES_PATH . 'CoverageNotPublicTest.php'; +require_once TEST_FILES_PATH . 'CoveragePrivateTest.php'; +require_once TEST_FILES_PATH . 'CoverageProtectedTest.php'; +require_once TEST_FILES_PATH . 'CoveragePublicTest.php'; +require_once TEST_FILES_PATH . 'CoverageTwoDefaultClassAnnotations.php'; +require_once TEST_FILES_PATH . 'CoveredClass.php'; +require_once TEST_FILES_PATH . 'CoveredFunction.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageClassExtendedTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageClassTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageCoversClassTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageCoversClassPublicTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageMethodTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageNotPrivateTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageNotProtectedTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageNotPublicTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoveragePrivateTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoverageProtectedTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php'; +require_once TEST_FILES_PATH . 'NamespaceCoveredClass.php'; +require_once TEST_FILES_PATH . 'NotExistingCoveredElementTest.php'; +require_once TEST_FILES_PATH . 'CoverageNothingTest.php'; +/** + * Tests for the PHP_CodeCoverage_Util class. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverage_UtilTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHP_CodeCoverage_Util::getLinesToBeIgnored + */ + public function testGetLinesToBeIgnored() + { + $this->assertEquals( + array( + 1 => TRUE, + 3 => TRUE, + 4 => TRUE, + 5 => TRUE, + 7 => TRUE, + 8 => TRUE, + 9 => TRUE, + 10 => TRUE, + 11 => TRUE, + 12 => TRUE, + 13 => TRUE, + 14 => TRUE, + 15 => TRUE, + 16 => TRUE, + 17 => TRUE, + 18 => TRUE, + 19 => TRUE, + 20 => TRUE, + 21 => TRUE, + 22 => TRUE, + 23 => TRUE, + 24 => TRUE, + 25 => TRUE, + 26 => TRUE, + 27 => TRUE, + 30 => TRUE, + 32 => TRUE, + 33 => TRUE, + 34 => TRUE, + 35 => TRUE, + 36 => TRUE, + 37 => TRUE, + 38 => TRUE, + ), + PHP_CodeCoverage_Util::getLinesToBeIgnored( + TEST_FILES_PATH . 'source_with_ignore.php' + ) + ); + } + + /** + * @covers PHP_CodeCoverage_Util::getLinesToBeIgnored + */ + public function testGetLinesToBeIgnored2() + { + $this->assertEquals( + array(1 => TRUE), + PHP_CodeCoverage_Util::getLinesToBeIgnored( + TEST_FILES_PATH . 'source_without_ignore.php' + ) + ); + } + + public function testGetLinesToBeIgnored3() + { + $this->assertEquals( + array( + 1 => TRUE, + 2 => TRUE, + 8 => TRUE, + 15 => TRUE, + 3 => TRUE, + 4 => TRUE, + 19 => TRUE, + 16 => TRUE + ), + PHP_CodeCoverage_Util::getLinesToBeIgnored( + TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' + ) + ); + } + + /** + * @covers PHP_CodeCoverage_Util::getLinesToBeIgnored + */ + public function testGetLinesToBeIgnoredOneLineAnnotations() + { + $this->assertEquals( + array( + 1 => TRUE, + 2 => TRUE, + 3 => TRUE, + 4 => TRUE, + 5 => TRUE, + 6 => TRUE, + 7 => TRUE, + 8 => TRUE, + 9 => TRUE, + 10 => TRUE, + 11 => TRUE, + 12 => TRUE, + 13 => TRUE, + 14 => TRUE, + 17 => TRUE, + 19 => TRUE, + 22 => TRUE, + 23 => TRUE, + 27 => TRUE, + 28 => TRUE, + 29 => TRUE, + 30 => TRUE, + 31 => TRUE, + 32 => TRUE, + 33 => TRUE, + ), + PHP_CodeCoverage_Util::getLinesToBeIgnored( + TEST_FILES_PATH . 'source_with_oneline_annotations.php' + ) + ); + } + + + /** + * @covers PHP_CodeCoverage_Util::percent + */ + public function testPercent() + { + $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 0)); + $this->assertEquals(100, PHP_CodeCoverage_Util::percent(100, 100)); + $this->assertEquals( + '100.00%', PHP_CodeCoverage_Util::percent(100, 100, TRUE) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverageTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverageTest.php @@ -0,0 +1,560 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once TEST_FILES_PATH . '../TestCase.php'; + +require_once TEST_FILES_PATH . 'BankAccount.php'; +require_once TEST_FILES_PATH . 'BankAccountTest.php'; + +/** + * Tests for the PHP_CodeCoverage class. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +class PHP_CodeCoverageTest extends PHP_CodeCoverage_TestCase +{ + protected $coverage; + protected $getLinesToBeCovered; + + protected function setUp() + { + $this->coverage = new PHP_CodeCoverage; + + $this->getLinesToBeCovered = new ReflectionMethod( + 'PHP_CodeCoverage', 'getLinesToBeCovered' + ); + + $this->getLinesToBeCovered->setAccessible(TRUE); + } + + /** + * @covers PHP_CodeCoverage::__construct + * @covers PHP_CodeCoverage::filter + */ + public function testConstructor() + { + $this->assertAttributeInstanceOf( + 'PHP_CodeCoverage_Driver_Xdebug', 'driver', $this->coverage + ); + + $this->assertAttributeInstanceOf( + 'PHP_CodeCoverage_Filter', 'filter', $this->coverage + ); + } + + /** + * @covers PHP_CodeCoverage::__construct + * @covers PHP_CodeCoverage::filter + */ + public function testConstructor2() + { + $filter = new PHP_CodeCoverage_Filter; + $coverage = new PHP_CodeCoverage(NULL, $filter); + + $this->assertAttributeInstanceOf( + 'PHP_CodeCoverage_Driver_Xdebug', 'driver', $coverage + ); + + $this->assertSame($filter, $coverage->filter()); + } + + /** + * @covers PHP_CodeCoverage::start + * @expectedException PHP_CodeCoverage_Exception + */ + public function testStartThrowsExceptionForInvalidArgument() + { + $this->coverage->start(NULL, array(), NULL); + } + + /** + * @covers PHP_CodeCoverage::stop + * @expectedException PHP_CodeCoverage_Exception + */ + public function testStopThrowsExceptionForInvalidArgument() + { + $this->coverage->stop(NULL); + } + + /** + * @covers PHP_CodeCoverage::append + * @expectedException PHP_CodeCoverage_Exception + */ + public function testAppendThrowsExceptionForInvalidArgument() + { + $this->coverage->append(array(), NULL); + } + + /** + * @covers PHP_CodeCoverage::setCacheTokens + * @expectedException PHP_CodeCoverage_Exception + */ + public function testSetCacheTokensThrowsExceptionForInvalidArgument() + { + $this->coverage->setCacheTokens(NULL); + } + + /** + * @covers PHP_CodeCoverage::setCacheTokens + */ + public function testSetCacheTokens() + { + $this->coverage->setCacheTokens(TRUE); + $this->assertAttributeEquals(TRUE, 'cacheTokens', $this->coverage); + } + + /** + * @covers PHP_CodeCoverage::setForceCoversAnnotation + * @expectedException PHP_CodeCoverage_Exception + */ + public function testSetForceCoversAnnotationThrowsExceptionForInvalidArgument() + { + $this->coverage->setForceCoversAnnotation(NULL); + } + + /** + * @covers PHP_CodeCoverage::setForceCoversAnnotation + */ + public function testSetForceCoversAnnotation() + { + $this->coverage->setForceCoversAnnotation(TRUE); + $this->assertAttributeEquals( + TRUE, 'forceCoversAnnotation', $this->coverage + ); + } + + /** + * @covers PHP_CodeCoverage::setProcessUncoveredFilesFromWhitelist + * @expectedException PHP_CodeCoverage_Exception + */ + public function testSetProcessUncoveredFilesFromWhitelistThrowsExceptionForInvalidArgument() + { + $this->coverage->setProcessUncoveredFilesFromWhitelist(NULL); + } + + /** + * @covers PHP_CodeCoverage::setProcessUncoveredFilesFromWhitelist + */ + public function testSetProcessUncoveredFilesFromWhitelist() + { + $this->coverage->setProcessUncoveredFilesFromWhitelist(TRUE); + $this->assertAttributeEquals( + TRUE, 'processUncoveredFilesFromWhitelist', $this->coverage + ); + } + + /** + * @covers PHP_CodeCoverage::setMapTestClassNameToCoveredClassName + */ + public function testSetMapTestClassNameToCoveredClassName() + { + $this->coverage->setMapTestClassNameToCoveredClassName(TRUE); + $this->assertAttributeEquals( + TRUE, 'mapTestClassNameToCoveredClassName', $this->coverage + ); + } + + /** + * @covers PHP_CodeCoverage::setMapTestClassNameToCoveredClassName + * @expectedException PHP_CodeCoverage_Exception + */ + public function testSetMapTestClassNameToCoveredClassNameThrowsExceptionForInvalidArgument() + { + $this->coverage->setMapTestClassNameToCoveredClassName(NULL); + } + + /** + * @covers PHP_CodeCoverage::clear + */ + public function testClear() + { + $this->coverage->clear(); + + $this->assertAttributeEquals(NULL, 'currentId', $this->coverage); + $this->assertAttributeEquals(array(), 'data', $this->coverage); + $this->assertAttributeEquals(array(), 'tests', $this->coverage); + } + + /** + * @covers PHP_CodeCoverage::start + * @covers PHP_CodeCoverage::stop + * @covers PHP_CodeCoverage::append + * @covers PHP_CodeCoverage::applyListsFilter + * @covers PHP_CodeCoverage::initializeFilesThatAreSeenTheFirstTime + * @covers PHP_CodeCoverage::applyCoversAnnotationFilter + * @covers PHP_CodeCoverage::getTests + */ + public function testCollect() + { + $coverage = $this->getCoverageForBankAccount(); + + $this->assertEquals( + $this->getExpectedDataArrayForBankAccount(), $coverage->getData() + ); + + $this->assertEquals( + array( + 'BankAccountTest::testBalanceIsInitiallyZero' => NULL, + 'BankAccountTest::testBalanceCannotBecomeNegative' => NULL, + 'BankAccountTest::testBalanceCannotBecomeNegative2' => NULL, + 'BankAccountTest::testDepositWithdrawMoney' => NULL + ), + $coverage->getTests() + ); + } + + /** + * @covers PHP_CodeCoverage::getData + * @covers PHP_CodeCoverage::merge + */ + public function testMerge() + { + $coverage = $this->getCoverageForBankAccountForFirstTwoTests(); + $coverage->merge($this->getCoverageForBankAccountForLastTwoTests()); + + $this->assertEquals( + $this->getExpectedDataArrayForBankAccount(), $coverage->getData() + ); + } + + /** + * @covers PHP_CodeCoverage::getData + * @covers PHP_CodeCoverage::merge + */ + public function testMerge2() + { + $coverage = new PHP_CodeCoverage( + $this->getMock('PHP_CodeCoverage_Driver_Xdebug'), + new PHP_CodeCoverage_Filter + ); + + $coverage->merge($this->getCoverageForBankAccount()); + + $this->assertEquals( + $this->getExpectedDataArrayForBankAccount(), $coverage->getData() + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + * @covers PHP_CodeCoverage::resolveCoversToReflectionObjects + * @dataProvider getLinesToBeCoveredProvider + */ + public function testGetLinesToBeCovered($test, $lines) + { + if (strpos($test, 'Namespace') === 0) { + $expected = array( + TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines + ); + } + + else if ($test === 'CoverageNoneTest') { + $expected = array(); + } + + else if ($test === 'CoverageNothingTest') { + $expected = false; + } + + else if ($test === 'CoverageFunctionTest') { + $expected = array( + TEST_FILES_PATH . 'CoveredFunction.php' => $lines + ); + } + + else { + $expected = array(TEST_FILES_PATH . 'CoveredClass.php' => $lines); + } + + $this->assertEquals( + $expected, + $this->getLinesToBeCovered->invoke( + $this->coverage, $test, 'testSomething' + ) + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + * @covers PHP_CodeCoverage::resolveCoversToReflectionObjects + * @expectedException PHP_CodeCoverage_Exception + */ + public function testGetLinesToBeCovered2() + { + $this->getLinesToBeCovered->invoke( + $this->coverage, 'NotExistingCoveredElementTest', 'testOne' + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + * @covers PHP_CodeCoverage::resolveCoversToReflectionObjects + * @expectedException PHP_CodeCoverage_Exception + */ + public function testGetLinesToBeCovered3() + { + $this->getLinesToBeCovered->invoke( + $this->coverage, 'NotExistingCoveredElementTest', 'testTwo' + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + * @covers PHP_CodeCoverage::resolveCoversToReflectionObjects + * @expectedException PHP_CodeCoverage_Exception + */ + public function testGetLinesToBeCovered4() + { + $this->getLinesToBeCovered->invoke( + $this->coverage, 'NotExistingCoveredElementTest', 'testThree' + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + */ + public function testGetLinesToBeCoveredSkipsNonExistantMethods() + { + $this->assertSame( + array(), + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'NotExistingCoveredElementTest', + 'methodDoesNotExist' + ) + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + * @expectedException PHP_CodeCoverage_Exception + */ + public function testTwoCoversDefaultClassAnnoationsAreNotAllowed() + { + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'CoverageTwoDefaultClassAnnotations', + 'testSomething' + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + */ + public function testFunctionParenthesesAreAllowed() + { + $this->assertSame( + array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)), + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'CoverageFunctionParenthesesTest', + 'testSomething' + ) + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + */ + public function testFunctionParenthesesAreAllowedWithWhitespace() + { + $this->assertSame( + array(TEST_FILES_PATH . 'CoveredFunction.php' => range(2, 4)), + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'CoverageFunctionParenthesesWhitespaceTest', + 'testSomething' + ) + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + */ + public function testMethodParenthesesAreAllowed() + { + $this->assertSame( + array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)), + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'CoverageMethodParenthesesTest', + 'testSomething' + ) + ); + } + + /** + * @covers PHP_CodeCoverage::getLinesToBeCovered + */ + public function testMethodParenthesesAreAllowedWithWhitespace() + { + $this->assertSame( + array(TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35)), + $this->getLinesToBeCovered->invoke( + $this->coverage, + 'CoverageMethodParenthesesWhitespaceTest', + 'testSomething' + ) + ); + } + + public function getLinesToBeCoveredProvider() + { + return array( + array( + 'CoverageNoneTest', + array() + ), + array( + 'CoverageClassExtendedTest', + array_merge(range(19, 36), range(2, 17)) + ), + array( + 'CoverageClassTest', + range(19, 36) + ), + array( + 'CoverageMethodTest', + range(31, 35) + ), + array( + 'CoverageMethodOneLineAnnotationTest', + range(31, 35) + ), + array( + 'CoverageNotPrivateTest', + array_merge(range(25, 29), range(31, 35)) + ), + array( + 'CoverageNotProtectedTest', + array_merge(range(21, 23), range(31, 35)) + ), + array( + 'CoverageNotPublicTest', + array_merge(range(21, 23), range(25, 29)) + ), + array( + 'CoveragePrivateTest', + range(21, 23) + ), + array( + 'CoverageProtectedTest', + range(25, 29) + ), + array( + 'CoveragePublicTest', + range(31, 35) + ), + array( + 'CoverageFunctionTest', + range(2, 4) + ), + array( + 'NamespaceCoverageClassExtendedTest', + array_merge(range(21, 38), range(4, 19)) + ), + array( + 'NamespaceCoverageClassTest', + range(21, 38) + ), + array( + 'NamespaceCoverageMethodTest', + range(33, 37) + ), + array( + 'NamespaceCoverageNotPrivateTest', + array_merge(range(27, 31), range(33, 37)) + ), + array( + 'NamespaceCoverageNotProtectedTest', + array_merge(range(23, 25), range(33, 37)) + ), + array( + 'NamespaceCoverageNotPublicTest', + array_merge(range(23, 25), range(27, 31)) + ), + array( + 'NamespaceCoveragePrivateTest', + range(23, 25) + ), + array( + 'NamespaceCoverageProtectedTest', + range(27, 31) + ), + array( + 'NamespaceCoveragePublicTest', + range(33, 37) + ), + array( + 'NamespaceCoverageCoversClassTest', + array_merge(range(23, 25), range(27, 31), range(33, 37), range(6, 8), range(10, 13), range(15, 18)) + ), + array( + 'NamespaceCoverageCoversClassPublicTest', + range(33, 37) + ), + array( + 'CoverageNothingTest', + false + ) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/TestCase.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/TestCase.php @@ -0,0 +1,303 @@ +<?php +/** + * PHP_CodeCoverage + * + * Copyright (c) 2009-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since File available since Release 1.0.0 + */ + +/** + * Abstract base class for test case classes. + * + * @category PHP + * @package CodeCoverage + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-code-coverage + * @since Class available since Release 1.0.0 + */ +abstract class PHP_CodeCoverage_TestCase extends PHPUnit_Framework_TestCase +{ + protected function getXdebugDataForBankAccount() + { + return array( + array( + TEST_FILES_PATH . 'BankAccount.php' => array( + 8 => 1, + 9 => -2, + 13 => -1, + 14 => -1, + 15 => -1, + 16 => -1, + 18 => -1, + 22 => -1, + 24 => -1, + 25 => -2, + 29 => -1, + 31 => -1, + 32 => -2 + ) + ), + array( + TEST_FILES_PATH . 'BankAccount.php' => array( + 8 => 1, + 13 => 1, + 16 => 1, + 29 => 1, + ) + ), + array( + TEST_FILES_PATH . 'BankAccount.php' => array( + 8 => 1, + 13 => 1, + 16 => 1, + 22 => 1, + ) + ), + array( + TEST_FILES_PATH . 'BankAccount.php' => array( + 8 => 1, + 13 => 1, + 14 => 1, + 15 => 1, + 18 => 1, + 22 => 1, + 24 => 1, + 29 => 1, + 31 => 1, + ) + ) + ); + } + + protected function getCoverageForBankAccount() + { + $data = $this->getXdebugDataForBankAccount(); + + $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); + $stub->expects($this->any()) + ->method('stop') + ->will($this->onConsecutiveCalls( + $data[0], $data[1], $data[2], $data[3] + )); + + $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); + + $coverage->start( + new BankAccountTest('testBalanceIsInitiallyZero'), TRUE + ); + $coverage->stop(); + + $coverage->start( + new BankAccountTest('testBalanceCannotBecomeNegative') + ); + $coverage->stop(); + + $coverage->start( + new BankAccountTest('testBalanceCannotBecomeNegative2') + ); + $coverage->stop(); + + $coverage->start( + new BankAccountTest('testDepositWithdrawMoney') + ); + $coverage->stop(); + + return $coverage; + } + + protected function getCoverageForBankAccountForFirstTwoTests() + { + $data = $this->getXdebugDataForBankAccount(); + + $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); + $stub->expects($this->any()) + ->method('stop') + ->will($this->onConsecutiveCalls( + $data[0], $data[1] + )); + + $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); + + $coverage->start( + new BankAccountTest('testBalanceIsInitiallyZero'), TRUE + ); + $coverage->stop(); + + $coverage->start( + new BankAccountTest('testBalanceCannotBecomeNegative') + ); + $coverage->stop(); + + return $coverage; + } + + protected function getCoverageForBankAccountForLastTwoTests() + { + $data = $this->getXdebugDataForBankAccount(); + + $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); + $stub->expects($this->any()) + ->method('stop') + ->will($this->onConsecutiveCalls( + $data[2], $data[3] + )); + + $coverage = new PHP_CodeCoverage($stub, new PHP_CodeCoverage_Filter); + + $coverage->start( + new BankAccountTest('testBalanceCannotBecomeNegative2'), TRUE + ); + $coverage->stop(); + + $coverage->start( + new BankAccountTest('testDepositWithdrawMoney') + ); + $coverage->stop(); + + return $coverage; + } + + protected function getExpectedDataArrayForBankAccount() + { + return array( + TEST_FILES_PATH . 'BankAccount.php' => array( + 8 => array( + 0 => 'BankAccountTest::testBalanceIsInitiallyZero', + 1 => 'BankAccountTest::testDepositWithdrawMoney' + ), + 9 => NULL, + 13 => array(), + 14 => array(), + 15 => array(), + 16 => array(), + 18 => array(), + 22 => array( + 0 => 'BankAccountTest::testBalanceCannotBecomeNegative2', + 1 => 'BankAccountTest::testDepositWithdrawMoney' + ), + 24 => array( + 0 => 'BankAccountTest::testDepositWithdrawMoney', + ), + 25 => NULL, + 29 => array( + 0 => 'BankAccountTest::testBalanceCannotBecomeNegative', + 1 => 'BankAccountTest::testDepositWithdrawMoney' + ), + 31 => array( + 0 => 'BankAccountTest::testDepositWithdrawMoney' + ), + 32 => NULL + ) + ); + } + + protected function getCoverageForFileWithIgnoredLines() + { + $coverage = new PHP_CodeCoverage( + $this->setUpXdebugStubForFileWithIgnoredLines(), + new PHP_CodeCoverage_Filter + ); + + $coverage->start('FileWithIgnoredLines', TRUE); + $coverage->stop(); + + return $coverage; + } + + protected function setUpXdebugStubForFileWithIgnoredLines() + { + $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); + $stub->expects($this->any()) + ->method('stop') + ->will($this->returnValue( + array( + TEST_FILES_PATH . 'source_with_ignore.php' => array( + 2 => 1, + 4 => -1, + 6 => -1, + 7 => 1 + ) + ) + )); + + return $stub; + } + + protected function getCoverageForClassWithAnonymousFunction() + { + $coverage = new PHP_CodeCoverage( + $this->setUpXdebugStubForClassWithAnonymousFunction(), + new PHP_CodeCoverage_Filter + ); + + $coverage->start('ClassWithAnonymousFunction', TRUE); + $coverage->stop(); + + return $coverage; + } + + protected function setUpXdebugStubForClassWithAnonymousFunction() + { + $stub = $this->getMock('PHP_CodeCoverage_Driver_Xdebug'); + $stub->expects($this->any()) + ->method('stop') + ->will($this->returnValue( + array( + TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' => array( + 7 => 1, + 9 => 1, + 10 => -1, + 11 => 1, + 12 => 1, + 13 => 1, + 14 => 1, + 17 => 1, + 18 => 1 + ) + ) + )); + + return $stub; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount-clover.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount-clover.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<coverage generated="%i"> + <project timestamp="%i" name="BankAccount"> + <file name="%s/BankAccount.php"> + <class name="BankAccount" namespace="global"> + <metrics methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/> + </class> + <line num="6" type="method" name="getBalance" crap="1" count="2"/> + <line num="8" type="stmt" count="2"/> + <line num="11" type="method" name="setBalance" crap="6" count="0"/> + <line num="13" type="stmt" count="0"/> + <line num="14" type="stmt" count="0"/> + <line num="15" type="stmt" count="0"/> + <line num="16" type="stmt" count="0"/> + <line num="18" type="stmt" count="0"/> + <line num="20" type="method" name="depositMoney" crap="1" count="2"/> + <line num="22" type="stmt" count="2"/> + <line num="24" type="stmt" count="1"/> + <line num="27" type="method" name="withdrawMoney" crap="1" count="2"/> + <line num="29" type="stmt" count="2"/> + <line num="31" type="stmt" count="1"/> + <metrics loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/> + </file> + <metrics files="1" loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/> + </project> +</coverage> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount.php @@ -0,0 +1,33 @@ +<?php +class BankAccount +{ + protected $balance = 0; + + public function getBalance() + { + return $this->balance; + } + + protected function setBalance($balance) + { + if ($balance >= 0) { + $this->balance = $balance; + } else { + throw new RuntimeException; + } + } + + public function depositMoney($balance) + { + $this->setBalance($this->getBalance() + $balance); + + return $this->getBalance(); + } + + public function withdrawMoney($balance) + { + $this->setBalance($this->getBalance() - $balance); + + return $this->getBalance(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccountTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/BankAccountTest.php @@ -0,0 +1,70 @@ +<?php +require_once 'BankAccount.php'; + +class BankAccountTest extends PHPUnit_Framework_TestCase +{ + protected $ba; + + protected function setUp() + { + $this->ba = new BankAccount; + } + + /** + * @covers BankAccount::getBalance + */ + public function testBalanceIsInitiallyZero() + { + $this->assertEquals(0, $this->ba->getBalance()); + } + + /** + * @covers BankAccount::withdrawMoney + */ + public function testBalanceCannotBecomeNegative() + { + try { + $this->ba->withdrawMoney(1); + } + + catch (RuntimeException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::depositMoney + */ + public function testBalanceCannotBecomeNegative2() + { + try { + $this->ba->depositMoney(-1); + } + + catch (RuntimeException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::getBalance + * @covers BankAccount::depositMoney + * @covers BankAccount::withdrawMoney + */ + public function testDepositWithdrawMoney() + { + $this->assertEquals(0, $this->ba->getBalance()); + $this->ba->depositMoney(1); + $this->assertEquals(1, $this->ba->getBalance()); + $this->ba->withdrawMoney(1); + $this->assertEquals(0, $this->ba->getBalance()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassExtendedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassExtendedTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageClassExtendedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass<extended> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageClassTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageClassTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesTest.php @@ -0,0 +1,11 @@ +<?php +class CoverageFunctionParenthesesTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers ::globalFunction() + */ + public function testSomething() + { + globalFunction(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesWhitespaceTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionParenthesesWhitespaceTest.php @@ -0,0 +1,11 @@ +<?php +class CoverageFunctionParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers ::globalFunction ( ) + */ + public function testSomething() + { + globalFunction(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionTest.php @@ -0,0 +1,11 @@ +<?php +class CoverageFunctionTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers ::globalFunction + */ + public function testSomething() + { + globalFunction(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodOneLineAnnotationTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodOneLineAnnotationTest.php @@ -0,0 +1,12 @@ +<?php + +class CoverageMethodOneLineAnnotationTest extends PHPUnit_Framework_TestCase +{ + /** @covers CoveredClass::publicMethod */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageMethodParenthesesTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::publicMethod() + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesWhitespaceTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodParenthesesWhitespaceTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageMethodParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::publicMethod ( ) + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageMethodTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageMethodTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::publicMethod + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNoneTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNoneTest.php @@ -0,0 +1,9 @@ +<?php +class CoverageNoneTest extends PHPUnit_Framework_TestCase +{ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPrivateTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPrivateTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageNotPrivateTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<!private> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotProtectedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotProtectedTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageNotProtectedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<!protected> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPublicTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNotPublicTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageNotPublicTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<!public> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNothingTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNothingTest.php @@ -0,0 +1,13 @@ +<?php +class CoverageNothingTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::publicMethod + * @coversNothing + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePrivateTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePrivateTest.php @@ -0,0 +1,12 @@ +<?php +class CoveragePrivateTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<private> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageProtectedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageProtectedTest.php @@ -0,0 +1,12 @@ +<?php +class CoverageProtectedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<protected> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePublicTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveragePublicTest.php @@ -0,0 +1,12 @@ +<?php +class CoveragePublicTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers CoveredClass::<public> + */ + public function testSomething() + { + $o = new CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageTwoDefaultClassAnnotations.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoverageTwoDefaultClassAnnotations.php @@ -0,0 +1,19 @@ +<?php + +/** + * @coversDefaultClass \NamespaceOne + * @coversDefaultClass \AnotherDefault\Name\Space\Does\Not\Work + */ +class CoverageTwoDefaultClassAnnotations +{ + + /** + * @covers Foo\CoveredClass::<public> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredClass.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredClass.php @@ -0,0 +1,36 @@ +<?php +class CoveredParentClass +{ + private function privateMethod() + { + } + + protected function protectedMethod() + { + $this->privateMethod(); + } + + public function publicMethod() + { + $this->protectedMethod(); + } +} + +class CoveredClass extends CoveredParentClass +{ + private function privateMethod() + { + } + + protected function protectedMethod() + { + parent::protectedMethod(); + $this->privateMethod(); + } + + public function publicMethod() + { + parent::publicMethod(); + $this->protectedMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredFunction.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/CoveredFunction.php @@ -0,0 +1,4 @@ +<?php +function globalFunction() +{ +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassExtendedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassExtendedTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageClassExtendedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass<extended> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageClassTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassPublicTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassPublicTest.php @@ -0,0 +1,16 @@ +<?php +/** + * @coversDefaultClass \Foo\CoveredClass + */ +class NamespaceCoverageCoversClassPublicTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers ::publicMethod + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageCoversClassTest.php @@ -0,0 +1,21 @@ +<?php +/** + * @coversDefaultClass \Foo\CoveredClass + */ +class NamespaceCoverageCoversClassTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers ::privateMethod + * @covers ::protectedMethod + * @covers ::publicMethod + * @covers \Foo\CoveredParentClass::privateMethod + * @covers \Foo\CoveredParentClass::protectedMethod + * @covers \Foo\CoveredParentClass::publicMethod + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageMethodTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageMethodTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageMethodTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::publicMethod + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPrivateTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPrivateTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageNotPrivateTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<!private> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotProtectedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotProtectedTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageNotProtectedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<!protected> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPublicTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageNotPublicTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageNotPublicTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<!public> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePrivateTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePrivateTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoveragePrivateTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<private> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageProtectedTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageProtectedTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoverageProtectedTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<protected> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePublicTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveragePublicTest.php @@ -0,0 +1,12 @@ +<?php +class NamespaceCoveragePublicTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers Foo\CoveredClass::<public> + */ + public function testSomething() + { + $o = new Foo\CoveredClass; + $o->publicMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveredClass.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoveredClass.php @@ -0,0 +1,38 @@ +<?php +namespace Foo; + +class CoveredParentClass +{ + private function privateMethod() + { + } + + protected function protectedMethod() + { + $this->privateMethod(); + } + + public function publicMethod() + { + $this->protectedMethod(); + } +} + +class CoveredClass extends CoveredParentClass +{ + private function privateMethod() + { + } + + protected function protectedMethod() + { + parent::protectedMethod(); + $this->privateMethod(); + } + + public function publicMethod() + { + parent::publicMethod(); + $this->protectedMethod(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NotExistingCoveredElementTest.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/NotExistingCoveredElementTest.php @@ -0,0 +1,24 @@ +<?php +class NotExistingCoveredElementTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers NotExistingClass + */ + public function testOne() + { + } + + /** + * @covers NotExistingClass::notExistingMethod + */ + public function testTwo() + { + } + + /** + * @covers NotExistingClass::<public> + */ + public function testThree() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/class-with-anonymous-function-clover.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/class-with-anonymous-function-clover.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<coverage generated="%i"> + <project timestamp="%i"> + <file name="%s/source_with_class_and_anonymous_function.php"> + <class name="CoveredClassWithAnonymousFunctionInStaticMethod" namespace="global"> + <metrics methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="12" coveredstatements="11" elements="14" coveredelements="13"/> + </class> + <line num="5" type="method" name="runAnonymous" crap="1.04" count="1"/> + <line num="7" type="stmt" count="1"/> + <line num="9" type="stmt" count="1"/> + <line num="10" type="stmt" count="0"/> + <line num="11" type="method" name="anonymous function" crap="1" count="1"/> + <line num="12" type="stmt" count="1"/> + <line num="13" type="stmt" count="1"/> + <line num="14" type="stmt" count="1"/> + <line num="17" type="stmt" count="1"/> + <line num="18" type="stmt" count="1"/> + <metrics loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="9" coveredstatements="8" elements="11" coveredelements="9"/> + </file> + <metrics files="1" loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="9" coveredstatements="8" elements="11" coveredelements="9"/> + </project> +</coverage> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/ignored-lines-clover.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/ignored-lines-clover.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<coverage generated="%i"> + <project timestamp="%i"> + <file name="%s/source_with_ignore.php"> + <class name="Foo" namespace="global"> + <metrics methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="1" coveredelements="0"/> + </class> + <class name="Bar" namespace="global"> + <metrics methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="1" coveredelements="0"/> + </class> + <line num="2" type="stmt" count="1"/> + <line num="6" type="stmt" count="0"/> + <metrics loc="38" ncloc="26" classes="2" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/> + </file> + <metrics files="1" loc="38" ncloc="26" classes="2" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/> + </project> +</coverage> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_class_and_anonymous_function.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_class_and_anonymous_function.php @@ -0,0 +1,19 @@ +<?php + +class CoveredClassWithAnonymousFunctionInStaticMethod +{ + public static function runAnonymous() + { + $filter = array('abc124', 'abc123', '123'); + + array_walk( + $filter, + function (&$val, $key) { + $val = preg_replace('|[^0-9]|', '', $val); + } + ); + + // Should be covered + $extravar = true; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_ignore.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_ignore.php @@ -0,0 +1,38 @@ +<?php +if ($neverHappens) { + // @codeCoverageIgnoreStart + print '*'; + // @codeCoverageIgnoreEnd +} + +/** + * @codeCoverageIgnore + */ +class Foo +{ + public function bar() + { + } +} + +class Bar +{ + /** + * @codeCoverageIgnore + */ + public function foo() + { + } +} + +function baz() +{ + print '*'; // @codeCoverageIgnore +} + +interface Bor { + + public function foo(); + +} + diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_namespace.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_namespace.php @@ -0,0 +1,20 @@ +<?php +namespace bar\baz; + +/** + * Represents foo. + */ +class Foo +{ +} + +/** + * @param mixed $bar + */ +function &foo($bar) +{ + $baz = function() {}; + $a = TRUE ? TRUE : FALSE; + $b = "{$a}"; + $c = "${b}"; +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_oneline_annotations.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_with_oneline_annotations.php @@ -0,0 +1,35 @@ +<?php + +/** Docblock */ +interface Foo { + public function bar(); +} + +class Foo +{ + public function bar() + { + } +} + +function baz() +{ + // a one-line comment + print '*'; // a one-line comment + + /* a one-line comment */ + print '*'; /* a one-line comment */ + + /* a one-line comment + */ + print '*'; /* a one-line comment + */ + + print '*'; // @codeCoverageIgnore + + print '*'; // @codeCoverageIgnoreStart + print '*'; + print '*'; // @codeCoverageIgnoreEnd + + print '*'; +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_ignore.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_ignore.php @@ -0,0 +1,4 @@ +<?php +if ($neverHappens) { + print '*'; +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_namespace.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/Tests/_files/source_without_namespace.php @@ -0,0 +1,18 @@ +<?php +/** + * Represents foo. + */ +class Foo +{ +} + +/** + * @param mixed $bar + */ +function &foo($bar) +{ + $baz = function() {}; + $a = TRUE ? TRUE : FALSE; + $b = "{$a}"; + $c = "${b}"; +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/build.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="PHP_CodeCoverage" default="build"> + <property name="php" value="php"/> + <property name="phpunit" value="phpunit"/> + + <target name="build" + depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/> + + <target name="build-parallel" + depends="prepare,lint,tools-parallel,phpunit,phpcb"/> + + <target name="tools-parallel" + description="Run tools in parallel"> + <parallel threadCount="2"> + <sequential> + <antcall target="pdepend"/> + <antcall target="phpmd-ci"/> + </sequential> + <antcall target="phpcpd"/> + <antcall target="phpcs-ci"/> + <antcall target="phploc"/> + </parallel> + </target> + + <target name="clean" description="Cleanup build artifacts"> + <delete dir="${basedir}/build/api"/> + <delete dir="${basedir}/build/code-browser"/> + <delete dir="${basedir}/build/coverage"/> + <delete dir="${basedir}/build/logs"/> + <delete dir="${basedir}/build/pdepend"/> + </target> + + <target name="prepare" depends="clean,phpab" + description="Prepare for build"> + <mkdir dir="${basedir}/build/api"/> + <mkdir dir="${basedir}/build/code-browser"/> + <mkdir dir="${basedir}/build/coverage"/> + <mkdir dir="${basedir}/build/logs"/> + <mkdir dir="${basedir}/build/pdepend"/> + </target> + + <target name="phpab" description="Generate autoloader scripts"> + <exec executable="phpab"> + <arg value="--output" /> + <arg path="PHP/CodeCoverage/Autoload.php" /> + <arg value="--template" /> + <arg path="PHP/CodeCoverage/Autoload.php.in" /> + <arg value="--indent" /> + <arg value=" " /> + <arg path="PHP" /> + </exec> + </target> + + <target name="lint"> + <apply executable="${php}" failonerror="true"> + <arg value="-l" /> + + <fileset dir="${basedir}/PHP"> + <include name="**/*.php" /> + <modified /> + </fileset> + + <fileset dir="${basedir}/Tests"> + <include name="**/*.php" /> + <modified /> + </fileset> + </apply> + </target> + + <target name="phploc" description="Measure project size using PHPLOC"> + <exec executable="phploc"> + <arg value="--log-csv" /> + <arg value="${basedir}/build/logs/phploc.csv" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="pdepend" + description="Calculate software metrics using PHP_Depend"> + <exec executable="pdepend"> + <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /> + <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" /> + <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="phpmd" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHP" /> + <arg value="text" /> + <arg value="${basedir}/build/phpmd.xml" /> + </exec> + </target> + + <target name="phpmd-ci" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHP" /> + <arg value="xml" /> + <arg value="${basedir}/build/phpmd.xml" /> + <arg value="--reportfile" /> + <arg value="${basedir}/build/logs/pmd.xml" /> + </exec> + </target> + + <target name="phpcs" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs"> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHP" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcs-ci" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs" output="/dev/null"> + <arg value="--report=checkstyle" /> + <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" /> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHP" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcpd" description="Find duplicate code using PHPCPD"> + <exec executable="phpcpd"> + <arg value="--log-pmd" /> + <arg value="${basedir}/build/logs/pmd-cpd.xml" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="phpunit" description="Run unit tests with PHPUnit"> + <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}"> + <not> + <equals arg1="${phpunit}" arg2="phpunit" /> + </not> + </condition> + + <exec executable="${phpunit_cmd}" failonerror="true"/> + </target> + + <target name="phpcb" + description="Aggregate tool output with PHP_CodeBrowser"> + <exec executable="phpcb"> + <arg value="--log" /> + <arg path="${basedir}/build/logs" /> + <arg value="--source" /> + <arg path="${basedir}/PHP" /> + <arg value="--output" /> + <arg path="${basedir}/build/code-browser" /> + </exec> + </target> +</project> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff +{ + public function __construct() + { + parent::__construct(true); + } + + protected function getPatterns() + { + return array( + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + '}EOLelse if (...) {EOL', + '}EOLelse {EOL', + 'do {EOL', + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_Whitespace_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff +{ + public function register() + { + return array(T_STRING_CONCAT); + } + + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE || + $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + + $phpcsFile->addError( + 'Concatenation operator must be surrounded by whitespace', + $stackPtr + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/ruleset.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/build/PHPCS/ruleset.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<ruleset name="Sebastian"> + <description>Sebastian Bergmann's coding standard</description> + + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> + + <rule ref="Generic.Commenting.Todo"/> + + <rule ref="Generic.ControlStructures.InlineControlStructure"/> + + <rule ref="Generic.Files.LineEndings"/> + + <rule ref="Generic.Formatting.DisallowMultipleStatements"/> + <rule ref="Generic.Formatting.NoSpaceAfterCast"/> + + <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/> + <rule ref="PEAR.Functions.ValidDefaultValue"/> + + <rule ref="Generic.NamingConventions.ConstructorName"/> + <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> + <rule ref="PEAR.NamingConventions.ValidClassName"/> + + <rule ref="Generic.PHP.DisallowShortOpenTag"/> + <rule ref="Generic.PHP.NoSilencedErrors"/> + <rule ref="Generic.PHP.UpperCaseConstant"/> + + <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> + <rule ref="Generic.WhiteSpace.ScopeIndent"/> + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build/phpmd.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/build/phpmd.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> + +<ruleset name="Sebastian" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description>Sebastian Bergmann's ruleset</description> + + <rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> + <rule ref="rulesets/codesize.xml/NPathComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> + + <rule ref="rulesets/design.xml/EvalExpression" /> + <rule ref="rulesets/design.xml/ExitExpression" /> + <rule ref="rulesets/design.xml/GotoStatement" /> + + <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> + + <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> + <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/build/travis-ci.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/build/travis-ci.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true"> + <testsuites> + <testsuite name="PHP_CodeCoverage"> + <directory suffix="Test.php">../Tests/PHP</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-text" target="php://stdout"/> + </logging> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">../PHP</directory> + <exclude> + <file>../PHP/CodeCoverage/Autoload.php</file> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/composer.json b/libs/php-ssh/vendor/phpunit/php-code-coverage/composer.json @@ -0,0 +1,49 @@ +{ + "name": "phpunit/php-code-coverage", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "type": "library", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": ">=1.3.0@stable", + "phpunit/php-token-stream": ">=1.1.3,<1.3.0@stable", + "phpunit/php-text-template": ">=1.2.0@stable" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@dev" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.0.5" + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "include-path": [ + "" + ] +} diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/package.xml b/libs/php-ssh/vendor/phpunit/php-code-coverage/package.xml @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.4.10" version="2.0" + xmlns="http://pear.php.net/dtd/package-2.0" + xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>PHP_CodeCoverage</name> + <channel>pear.phpunit.de</channel> + <summary>Library that provides collection, processing, and rendering functionality for PHP code coverage information.</summary> + <description>Library that provides collection, processing, and rendering functionality for PHP code coverage information.</description> + <lead> + <name>Sebastian Bergmann</name> + <user>sb</user> + <email>sb@sebastian-bergmann.de</email> + <active>yes</active> + </lead> + <date>2014-03-28</date> + <version> + <release>1.2.17</release> + <api>1.2.11</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license>The BSD 3-Clause License</license> + <notes>http://github.com/sebastianbergmann/php-code-coverage/</notes> + <contents> + <dir name="/"> + <dir name="PHP"> + <dir name="CodeCoverage"> + <dir name="Driver"> + <file baseinstalldir="/" name="Xdebug.php" role="php" /> + </dir> + <dir name="Report"> + <dir name="HTML"> + <dir name="Renderer"> + <dir name="Template"> + <dir name="css"> + <file baseinstalldir="/" name="bootstrap-responsive.min.css" role="php" /> + <file baseinstalldir="/" name="bootstrap.min.css" role="php" /> + <file baseinstalldir="/" name="nv.d3.css" role="php" /> + <file baseinstalldir="/" name="style.css" role="php" /> + </dir> + <dir name="img"> + <file baseinstalldir="/" name="glyphicons-halflings-white.png" role="php" /> + <file baseinstalldir="/" name="glyphicons-halflings.png" role="php" /> + </dir> + <dir name="js"> + <file baseinstalldir="/" name="bootstrap.min.js" role="php" /> + <file baseinstalldir="/" name="d3.min.js" role="php" /> + <file baseinstalldir="/" name="html5shiv.js" role="php" /> + <file baseinstalldir="/" name="jquery.min.js" role="php" /> + <file baseinstalldir="/" name="nv.d3.min.js" role="php" /> + </dir> + <file baseinstalldir="/" name="coverage_bar.html.dist" role="php" /> + <file baseinstalldir="/" name="dashboard.html.dist" role="php" /> + <file baseinstalldir="/" name="directory.html.dist" role="php" /> + <file baseinstalldir="/" name="directory_item.html.dist" role="php" /> + <file baseinstalldir="/" name="file.html.dist" role="php" /> + <file baseinstalldir="/" name="file_item.html.dist" role="php" /> + <file baseinstalldir="/" name="method_item.html.dist" role="php" /> + </dir> + <file baseinstalldir="/" name="Dashboard.php" role="php" /> + <file baseinstalldir="/" name="Directory.php" role="php" /> + <file baseinstalldir="/" name="File.php" role="php" /> + </dir> + <file baseinstalldir="/" name="Renderer.php" role="php" /> + </dir> + <dir name="Node"> + <file baseinstalldir="/" name="Directory.php" role="php" /> + <file baseinstalldir="/" name="File.php" role="php" /> + <file baseinstalldir="/" name="Iterator.php" role="php" /> + </dir> + <file baseinstalldir="/" name="Clover.php" role="php" /> + <file baseinstalldir="/" name="Factory.php" role="php" /> + <file baseinstalldir="/" name="HTML.php" role="php" /> + <file baseinstalldir="/" name="Node.php" role="php" /> + <file baseinstalldir="/" name="PHP.php" role="php" /> + <file baseinstalldir="/" name="Text.php" role="php" /> + </dir> + <dir name="Util"> + <file baseinstalldir="/" name="InvalidArgumentHelper.php" role="php" /> + </dir> + <file baseinstalldir="/" name="Autoload.php" role="php" /> + <file baseinstalldir="/" name="Driver.php" role="php" /> + <file baseinstalldir="/" name="Exception.php" role="php" /> + <file baseinstalldir="/" name="Filter.php" role="php" /> + <file baseinstalldir="/" name="Util.php" role="php" /> + <file baseinstalldir="/" name="Version.php" role="php" /> + </dir> + <file baseinstalldir="/" name="CodeCoverage.php" role="php" /> + </dir> + <file baseinstalldir="/" name="LICENSE" role="doc" /> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.3.3</min> + </php> + <pearinstaller> + <min>1.9.4</min> + </pearinstaller> + <package> + <name>File_Iterator</name> + <channel>pear.phpunit.de</channel> + <min>1.3.0</min> + </package> + <package> + <name>PHP_TokenStream</name> + <channel>pear.phpunit.de</channel> + <min>1.1.3</min> + </package> + <package> + <name>Text_Template</name> + <channel>pear.phpunit.de</channel> + <min>1.2.0</min> + </package> + </required> + <optional> + <extension> + <name>dom</name> + </extension> + <extension> + <name>xdebug</name> + <min>2.0.5</min> + </extension> + </optional> + </dependencies> + <phprelease /> +</package> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/phpunit.xml.dist b/libs/php-ssh/vendor/phpunit/php-code-coverage/phpunit.xml.dist @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + syntaxCheck="false" + bootstrap="PHP/CodeCoverage/Autoload.php"> + <testsuites> + <testsuite name="php-code-coverage"> + <directory suffix="Test.php">Tests/PHP</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-html" target="build/coverage" title="PHP_CodeCoverage" + charset="UTF-8" yui="true" highlight="true" + lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="build/logs/clover.xml"/> + <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> + </logging> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">PHP</directory> + <exclude> + <file>PHP/CodeCoverage/Autoload.php</file> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_append.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_append.php @@ -0,0 +1,5 @@ +<?php +$coverage->stop(); + +$writer = new PHP_CodeCoverage_Report_HTML; +$writer->process($coverage, '/tmp/coverage'); diff --git a/libs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php b/libs/php-ssh/vendor/phpunit/php-code-coverage/scripts/auto_prepend.php @@ -0,0 +1,10 @@ +<?php +require_once 'PHP/CodeCoverage/Autoload.php'; + +$coverage = new PHP_CodeCoverage; +$filter = $coverage->filter(); + +$filter->addFileToBlacklist(__FILE__); +$filter->addFileToBlacklist(dirname(__FILE__) . '/auto_append.php'); + +$coverage->start($_SERVER['SCRIPT_FILENAME']); diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/.gitattributes b/libs/php-ssh/vendor/phpunit/php-file-iterator/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/.gitignore b/libs/php-ssh/vendor/phpunit/php-file-iterator/.gitignore @@ -0,0 +1,7 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +cache.properties +phpunit.xml diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/ChangeLog.md b/libs/php-ssh/vendor/phpunit/php-file-iterator/ChangeLog.md @@ -0,0 +1,10 @@ +# Change Log + +All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). + +## [1.4.0] - 2015-04-02 + +### Added + +* [Added support for wildcards (glob) in exclude](https://github.com/sebastianbergmann/php-file-iterator/pull/23) + diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/LICENSE b/libs/php-ssh/vendor/phpunit/php-file-iterator/LICENSE @@ -0,0 +1,33 @@ +File_Iterator + +Copyright (c) 2009-2015, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/README.md b/libs/php-ssh/vendor/phpunit/php-file-iterator/README.md @@ -0,0 +1,12 @@ +# File_Iterator + +## Installation + +To add File_Iterator as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-file-iterator` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on File_Iterator 1.4: + + { + "require": { + "phpunit/php-file-iterator": "~1.4" + } + } + diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/composer.json b/libs/php-ssh/vendor/phpunit/php-file-iterator/composer.json @@ -0,0 +1,36 @@ +{ + "name": "phpunit/php-file-iterator", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "type": "library", + "keywords": [ + "iterator", + "filesystem" + ], + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Facade.php b/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Facade.php @@ -0,0 +1,123 @@ +<?php +/* + * This file is part of the File_Iterator package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Façade implementation that uses File_Iterator_Factory to create a + * File_Iterator that operates on an AppendIterator that contains an + * RecursiveDirectoryIterator for each given path. The list of unique + * files is returned as an array. + * + * @since Class available since Release 1.3.0 + */ +class File_Iterator_Facade +{ + /** + * @param array|string $paths + * @param array|string $suffixes + * @param array|string $prefixes + * @param array $exclude + * @param bool $commonPath + * @return array + */ + public function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = array(), $commonPath = FALSE) + { + if (is_string($paths)) { + $paths = array($paths); + } + + $factory = new File_Iterator_Factory; + $iterator = $factory->getFileIterator( + $paths, $suffixes, $prefixes, $exclude + ); + + $files = array(); + + foreach ($iterator as $file) { + $file = $file->getRealPath(); + + if ($file) { + $files[] = $file; + } + } + + foreach ($paths as $path) { + if (is_file($path)) { + $files[] = realpath($path); + } + } + + $files = array_unique($files); + sort($files); + + if ($commonPath) { + return array( + 'commonPath' => $this->getCommonPath($files), + 'files' => $files + ); + } else { + return $files; + } + } + + /** + * Returns the common path of a set of files. + * + * @param array $files + * @return string + */ + protected function getCommonPath(array $files) + { + $count = count($files); + + if ($count == 0) { + return ''; + } + + if ($count == 1) { + return dirname($files[0]) . DIRECTORY_SEPARATOR; + } + + $_files = array(); + + foreach ($files as $file) { + $_files[] = $_fileParts = explode(DIRECTORY_SEPARATOR, $file); + + if (empty($_fileParts[0])) { + $_fileParts[0] = DIRECTORY_SEPARATOR; + } + } + + $common = ''; + $done = FALSE; + $j = 0; + $count--; + + while (!$done) { + for ($i = 0; $i < $count; $i++) { + if ($_files[$i][$j] != $_files[$i+1][$j]) { + $done = TRUE; + break; + } + } + + if (!$done) { + $common .= $_files[0][$j]; + + if ($j > 0) { + $common .= DIRECTORY_SEPARATOR; + } + } + + $j++; + } + + return DIRECTORY_SEPARATOR . $common; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Factory.php b/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Factory.php @@ -0,0 +1,91 @@ +<?php +/* + * This file is part of the File_Iterator package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Factory Method implementation that creates a File_Iterator that operates on + * an AppendIterator that contains an RecursiveDirectoryIterator for each given + * path. + * + * @since Class available since Release 1.1.0 + */ +class File_Iterator_Factory +{ + /** + * @param array|string $paths + * @param array|string $suffixes + * @param array|string $prefixes + * @param array $exclude + * @return AppendIterator + */ + public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = array()) + { + if (is_string($paths)) { + $paths = array($paths); + } + + $paths = $this->getPathsAfterResolvingWildcards($paths); + $exclude = $this->getPathsAfterResolvingWildcards($exclude); + + if (is_string($prefixes)) { + if ($prefixes != '') { + $prefixes = array($prefixes); + } else { + $prefixes = array(); + } + } + + if (is_string($suffixes)) { + if ($suffixes != '') { + $suffixes = array($suffixes); + } else { + $suffixes = array(); + } + } + + $iterator = new AppendIterator; + + foreach ($paths as $path) { + if (is_dir($path)) { + $iterator->append( + new File_Iterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS) + ), + $suffixes, + $prefixes, + $exclude, + $path + ) + ); + } + } + + return $iterator; + } + + /** + * @param array $paths + * @return array + */ + protected function getPathsAfterResolvingWildcards(array $paths) + { + $_paths = array(); + + foreach ($paths as $path) { + if ($locals = glob($path, GLOB_ONLYDIR)) { + $_paths = array_merge($_paths, $locals); + } else { + $_paths[] = $path; + } + } + + return $_paths; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Iterator.php b/libs/php-ssh/vendor/phpunit/php-file-iterator/src/Iterator.php @@ -0,0 +1,158 @@ +<?php +/* + * This file is part of the File_Iterator package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * FilterIterator implementation that filters files based on prefix(es) and/or + * suffix(es). Hidden files and files from hidden directories are also filtered. + * + * @since Class available since Release 1.0.0 + */ +class File_Iterator extends FilterIterator +{ + const PREFIX = 0; + const SUFFIX = 1; + + /** + * @var array + */ + protected $suffixes = array(); + + /** + * @var array + */ + protected $prefixes = array(); + + /** + * @var array + */ + protected $exclude = array(); + + /** + * @var string + */ + protected $basepath; + + /** + * @param Iterator $iterator + * @param array $suffixes + * @param array $prefixes + * @param array $exclude + * @param string $basepath + */ + public function __construct(Iterator $iterator, array $suffixes = array(), array $prefixes = array(), array $exclude = array(), $basepath = NULL) + { + $exclude = array_filter(array_map('realpath', $exclude)); + + if ($basepath !== NULL) { + $basepath = realpath($basepath); + } + + if ($basepath === FALSE) { + $basepath = NULL; + } else { + foreach ($exclude as &$_exclude) { + $_exclude = str_replace($basepath, '', $_exclude); + } + } + + $this->prefixes = $prefixes; + $this->suffixes = $suffixes; + $this->exclude = $exclude; + $this->basepath = $basepath; + + parent::__construct($iterator); + } + + /** + * @return bool + */ + public function accept() + { + $current = $this->getInnerIterator()->current(); + $filename = $current->getFilename(); + $realpath = $current->getRealPath(); + + if ($this->basepath !== NULL) { + $realpath = str_replace($this->basepath, '', $realpath); + } + + // Filter files in hidden directories. + if (preg_match('=/\.[^/]*/=', $realpath)) { + return FALSE; + } + + return $this->acceptPath($realpath) && + $this->acceptPrefix($filename) && + $this->acceptSuffix($filename); + } + + /** + * @param string $path + * @return bool + * @since Method available since Release 1.1.0 + */ + protected function acceptPath($path) + { + foreach ($this->exclude as $exclude) { + if (strpos($path, $exclude) === 0) { + return FALSE; + } + } + + return TRUE; + } + + /** + * @param string $filename + * @return bool + * @since Method available since Release 1.1.0 + */ + protected function acceptPrefix($filename) + { + return $this->acceptSubString($filename, $this->prefixes, self::PREFIX); + } + + /** + * @param string $filename + * @return bool + * @since Method available since Release 1.1.0 + */ + protected function acceptSuffix($filename) + { + return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX); + } + + /** + * @param string $filename + * @param array $subString + * @param int $type + * @return bool + * @since Method available since Release 1.1.0 + */ + protected function acceptSubString($filename, array $subStrings, $type) + { + if (empty($subStrings)) { + return TRUE; + } + + $matched = FALSE; + + foreach ($subStrings as $string) { + if (($type == self::PREFIX && strpos($filename, $string) === 0) || + ($type == self::SUFFIX && + substr($filename, -1 * strlen($string)) == $string)) { + $matched = TRUE; + break; + } + } + + return $matched; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/.gitattributes b/libs/php-ssh/vendor/phpunit/php-text-template/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/.gitignore b/libs/php-ssh/vendor/phpunit/php-text-template/.gitignore @@ -0,0 +1,5 @@ +/composer.lock +/composer.phar +/.idea +/vendor + diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/LICENSE b/libs/php-ssh/vendor/phpunit/php-text-template/LICENSE @@ -0,0 +1,33 @@ +Text_Template + +Copyright (c) 2009-2015, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/README.md b/libs/php-ssh/vendor/phpunit/php-text-template/README.md @@ -0,0 +1,14 @@ +# Text_Template + +## Installation + +## Installation + +To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-text-template` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Text_Template: + + { + "require": { + "phpunit/php-text-template": "~1.2" + } + } + diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/composer.json b/libs/php-ssh/vendor/phpunit/php-text-template/composer.json @@ -0,0 +1,29 @@ +{ + "name": "phpunit/php-text-template", + "description": "Simple template engine.", + "type": "library", + "keywords": [ + "template" + ], + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues" + }, + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "classmap": [ + "src/" + ] + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-text-template/src/Template.php b/libs/php-ssh/vendor/phpunit/php-text-template/src/Template.php @@ -0,0 +1,135 @@ +<?php +/* + * This file is part of the Text_Template package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * A simple template engine. + * + * @since Class available since Release 1.0.0 + */ +class Text_Template +{ + /** + * @var string + */ + protected $template = ''; + + /** + * @var string + */ + protected $openDelimiter = '{'; + + /** + * @var string + */ + protected $closeDelimiter = '}'; + + /** + * @var array + */ + protected $values = array(); + + /** + * Constructor. + * + * @param string $file + * @throws InvalidArgumentException + */ + public function __construct($file = '', $openDelimiter = '{', $closeDelimiter = '}') + { + $this->setFile($file); + $this->openDelimiter = $openDelimiter; + $this->closeDelimiter = $closeDelimiter; + } + + /** + * Sets the template file. + * + * @param string $file + * @throws InvalidArgumentException + */ + public function setFile($file) + { + $distFile = $file . '.dist'; + + if (file_exists($file)) { + $this->template = file_get_contents($file); + } + + else if (file_exists($distFile)) { + $this->template = file_get_contents($distFile); + } + + else { + throw new InvalidArgumentException( + 'Template file could not be loaded.' + ); + } + } + + /** + * Sets one or more template variables. + * + * @param array $values + * @param bool $merge + */ + public function setVar(array $values, $merge = TRUE) + { + if (!$merge || empty($this->values)) { + $this->values = $values; + } else { + $this->values = array_merge($this->values, $values); + } + } + + /** + * Renders the template and returns the result. + * + * @return string + */ + public function render() + { + $keys = array(); + + foreach ($this->values as $key => $value) { + $keys[] = $this->openDelimiter . $key . $this->closeDelimiter; + } + + return str_replace($keys, $this->values, $this->template); + } + + /** + * Renders the template and writes the result to a file. + * + * @param string $target + */ + public function renderTo($target) + { + $fp = @fopen($target, 'wt'); + + if ($fp) { + fwrite($fp, $this->render()); + fclose($fp); + } else { + $error = error_get_last(); + + throw new RuntimeException( + sprintf( + 'Could not write to %s: %s', + $target, + substr( + $error['message'], + strpos($error['message'], ':') + 2 + ) + ) + ); + } + } +} + diff --git a/libs/php-ssh/vendor/phpunit/php-timer/.gitattributes b/libs/php-ssh/vendor/phpunit/php-timer/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/php-timer/.gitignore b/libs/php-ssh/vendor/phpunit/php-timer/.gitignore @@ -0,0 +1,7 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +cache.properties +phpunit.xml diff --git a/libs/php-ssh/vendor/phpunit/php-timer/.travis.yml b/libs/php-ssh/vendor/phpunit/php-timer/.travis.yml @@ -0,0 +1,22 @@ +language: php + +php: + - 5.3.3 + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - hhvm + +script: + - phpunit --bootstrap src/Timer.php tests + +notifications: + email: false + webhooks: + urls: + - https://webhooks.gitter.im/e/6668f52f3dd4e3f81960 + on_success: always + on_failure: always + on_start: false + diff --git a/libs/php-ssh/vendor/phpunit/php-timer/LICENSE b/libs/php-ssh/vendor/phpunit/php-timer/LICENSE @@ -0,0 +1,33 @@ +PHP_Timer + +Copyright (c) 2010-2015, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/php-timer/README.md b/libs/php-ssh/vendor/phpunit/php-timer/README.md @@ -0,0 +1,47 @@ +[![Build Status](https://travis-ci.org/sebastianbergmann/php-timer.svg?branch=master)](https://travis-ci.org/sebastianbergmann/php-timer) + +# PHP_Timer + +Utility class for timing things, factored out of PHPUnit into a stand-alone component. + +## Installation + +To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-timer` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_Timer: + + { + "require": { + "phpunit/php-timer": "~1.0" + } + } + +## Usage + +### Basic Timing + +```php +PHP_Timer::start(); + +$timer->start(); + +// ... + +$time = PHP_Timer::stop(); +var_dump($time); + +print PHP_Timer::secondsToTimeString($time); +``` + +The code above yields the output below: + + double(1.0967254638672E-5) + 0 ms + +### Resource Consumption Since PHP Startup + +```php +print PHP_Timer::resourceUsage(); +``` + +The code above yields the output below: + + Time: 0 ms, Memory: 0.50Mb diff --git a/libs/php-ssh/vendor/phpunit/php-timer/composer.json b/libs/php-ssh/vendor/phpunit/php-timer/composer.json @@ -0,0 +1,29 @@ +{ + "name": "phpunit/php-timer", + "description": "Utility class for timing", + "type": "library", + "keywords": [ + "timer" + ], + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "classmap": [ + "src/" + ] + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-timer/src/Timer.php b/libs/php-ssh/vendor/phpunit/php-timer/src/Timer.php @@ -0,0 +1,107 @@ +<?php +/* + * This file is part of the PHP_Timer package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Utility class for timing. + * + * @since Class available since Release 1.0.0 + */ +class PHP_Timer +{ + /** + * @var array + */ + private static $times = array( + 'hour' => 3600000, + 'minute' => 60000, + 'second' => 1000 + ); + + /** + * @var array + */ + private static $startTimes = array(); + + /** + * @var float + */ + public static $requestTime; + + /** + * Starts the timer. + */ + public static function start() + { + array_push(self::$startTimes, microtime(true)); + } + + /** + * Stops the timer and returns the elapsed time. + * + * @return float + */ + public static function stop() + { + return microtime(true) - array_pop(self::$startTimes); + } + + /** + * Formats the elapsed time as a string. + * + * @param float $time + * @return string + */ + public static function secondsToTimeString($time) + { + $ms = round($time * 1000); + + foreach (self::$times as $unit => $value) { + if ($ms >= $value) { + $time = floor($ms / $value * 100.0) / 100.0; + + return $time . ' ' . ($time == 1 ? $unit : $unit . 's'); + } + } + + return $ms . ' ms'; + } + + /** + * Formats the elapsed time since the start of the request as a string. + * + * @return string + */ + public static function timeSinceStartOfRequest() + { + return self::secondsToTimeString(microtime(true) - self::$requestTime); + } + + /** + * Returns the resources (time, memory) of the request as a string. + * + * @return string + */ + public static function resourceUsage() + { + return sprintf( + 'Time: %s, Memory: %4.2fMb', + self::timeSinceStartOfRequest(), + memory_get_peak_usage(true) / 1048576 + ); + } +} + +if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { + PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME_FLOAT']; +} elseif (isset($_SERVER['REQUEST_TIME'])) { + PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME']; +} else { + PHP_Timer::$requestTime = microtime(true); +} diff --git a/libs/php-ssh/vendor/phpunit/php-timer/tests/TimerTest.php b/libs/php-ssh/vendor/phpunit/php-timer/tests/TimerTest.php @@ -0,0 +1,101 @@ +<?php +/* + * This file is part of the PHP_Timer package. + * + * (c) Sebastian Bergmann <sebastian@phpunit.de> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Tests for PHP_Timer. + * + * @since Class available since Release 1.0.0 + */ +class PHP_TimerTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHP_Timer::start + * @covers PHP_Timer::stop + */ + public function testStartStop() + { + $this->assertInternalType('float', PHP_Timer::stop()); + } + + /** + * @covers PHP_Timer::secondsToTimeString + * @dataProvider secondsProvider + */ + public function testSecondsToTimeString($string, $seconds) + { + $this->assertEquals( + $string, + PHP_Timer::secondsToTimeString($seconds) + ); + } + + /** + * @covers PHP_Timer::timeSinceStartOfRequest + */ + public function testTimeSinceStartOfRequest() + { + $this->assertStringMatchesFormat( + '%f %s', + PHP_Timer::timeSinceStartOfRequest() + ); + } + + + /** + * @covers PHP_Timer::resourceUsage + */ + public function testResourceUsage() + { + $this->assertStringMatchesFormat( + 'Time: %s, Memory: %s', + PHP_Timer::resourceUsage() + ); + } + + public function secondsProvider() + { + return array( + array('0 ms', 0), + array('1 ms', .001), + array('10 ms', .01), + array('100 ms', .1), + array('999 ms', .999), + array('1 second', .9999), + array('1 second', 1), + array('2 seconds', 2), + array('59.9 seconds', 59.9), + array('59.99 seconds', 59.99), + array('59.99 seconds', 59.999), + array('1 minute', 59.9999), + array('59 seconds', 59.001), + array('59.01 seconds', 59.01), + array('1 minute', 60), + array('1.01 minutes', 61), + array('2 minutes', 120), + array('2.01 minutes', 121), + array('59.99 minutes', 3599.9), + array('59.99 minutes', 3599.99), + array('59.99 minutes', 3599.999), + array('1 hour', 3599.9999), + array('59.98 minutes', 3599.001), + array('59.98 minutes', 3599.01), + array('1 hour', 3600), + array('1 hour', 3601), + array('1 hour', 3601.9), + array('1 hour', 3601.99), + array('1 hour', 3601.999), + array('1 hour', 3601.9999), + array('1.01 hours', 3659.9999), + array('1.01 hours', 3659.001), + array('1.01 hours', 3659.01), + array('2 hours', 7199.9999), + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/.gitattributes b/libs/php-ssh/vendor/phpunit/php-token-stream/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/.gitignore b/libs/php-ssh/vendor/phpunit/php-token-stream/.gitignore @@ -0,0 +1,7 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +cache.properties +phpunit.xml diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/LICENSE b/libs/php-ssh/vendor/phpunit/php-token-stream/LICENSE @@ -0,0 +1,33 @@ +PHP_TokenStream + +Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token.php b/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token.php @@ -0,0 +1,732 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +/** + * A PHP token. + * + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/tree + * @since Class available since Release 1.0.0 + */ +abstract class PHP_Token +{ + /** + * @var string + */ + protected $text; + + /** + * @var integer + */ + protected $line; + + /** + * @var PHP_Token_Stream + */ + protected $tokenStream; + + /** + * @var integer + */ + protected $id; + + /** + * Constructor. + * + * @param string $text + * @param integer $line + * @param PHP_Token_Stream $tokenStream + * @param integer $id + */ + public function __construct($text, $line, PHP_Token_Stream $tokenStream, $id) + { + $this->text = $text; + $this->line = $line; + $this->tokenStream = $tokenStream; + $this->id = $id; + } + + /** + * @return string + */ + public function __toString() + { + return $this->text; + } + + /** + * @return integer + */ + public function getLine() + { + return $this->line; + } +} + +abstract class PHP_TokenWithScope extends PHP_Token +{ + protected $endTokenId; + + /** + * Get the docblock for this token + * + * This method will fetch the docblock belonging to the current token. The + * docblock must be placed on the line directly above the token to be + * recognized. + * + * @return string|null Returns the docblock as a string if found + */ + public function getDocblock() + { + $tokens = $this->tokenStream->tokens(); + $currentLineNumber = $tokens[$this->id]->getLine(); + $prevLineNumber = $currentLineNumber - 1; + + for ($i = $this->id - 1; $i; $i--) { + if (!isset($tokens[$i])) { + return; + } + + if ($tokens[$i] instanceof PHP_Token_FUNCTION || + $tokens[$i] instanceof PHP_Token_CLASS || + $tokens[$i] instanceof PHP_Token_TRAIT) { + // Some other trait, class or function, no docblock can be + // used for the current token + break; + } + + $line = $tokens[$i]->getLine(); + + if ($line == $currentLineNumber || + ($line == $prevLineNumber && + $tokens[$i] instanceof PHP_Token_WHITESPACE)) { + continue; + } + + if ($line < $currentLineNumber && + !$tokens[$i] instanceof PHP_Token_DOC_COMMENT) { + break; + } + + return (string)$tokens[$i]; + } + } + + public function getEndTokenId() + { + $block = 0; + $i = $this->id; + $tokens = $this->tokenStream->tokens(); + + while ($this->endTokenId === NULL && isset($tokens[$i])) { + if ($tokens[$i] instanceof PHP_Token_OPEN_CURLY || + $tokens[$i] instanceof PHP_Token_CURLY_OPEN) { + $block++; + } + + else if ($tokens[$i] instanceof PHP_Token_CLOSE_CURLY) { + $block--; + + if ($block === 0) { + $this->endTokenId = $i; + } + } + + else if (($this instanceof PHP_Token_FUNCTION || + $this instanceof PHP_Token_NAMESPACE) && + $tokens[$i] instanceof PHP_Token_SEMICOLON) { + if ($block === 0) { + $this->endTokenId = $i; + } + } + + $i++; + } + + if ($this->endTokenId === NULL) { + $this->endTokenId = $this->id; + } + + return $this->endTokenId; + } + + public function getEndLine() + { + return $this->tokenStream[$this->getEndTokenId()]->getLine(); + } + +} + +abstract class PHP_TokenWithScopeAndVisibility extends PHP_TokenWithScope { + + public function getVisibility() + { + $tokens = $this->tokenStream->tokens(); + + for ($i = $this->id - 2; $i > $this->id - 7; $i -= 2) { + if (isset($tokens[$i]) && + ($tokens[$i] instanceof PHP_Token_PRIVATE || + $tokens[$i] instanceof PHP_Token_PROTECTED || + $tokens[$i] instanceof PHP_Token_PUBLIC)) { + return strtolower( + str_replace('PHP_Token_', '', get_class($tokens[$i])) + ); + } + if (isset($tokens[$i]) && + !($tokens[$i] instanceof PHP_Token_STATIC || + $tokens[$i] instanceof PHP_Token_FINAL || + $tokens[$i] instanceof PHP_Token_ABSTRACT)) { + // no keywords; stop visibility search + break; + } + } + } + + public function getKeywords() + { + $keywords = array(); + $tokens = $this->tokenStream->tokens(); + + for ($i = $this->id - 2; $i > $this->id - 7; $i -= 2) { + if (isset($tokens[$i]) && + ($tokens[$i] instanceof PHP_Token_PRIVATE || + $tokens[$i] instanceof PHP_Token_PROTECTED || + $tokens[$i] instanceof PHP_Token_PUBLIC)) { + continue; + } + + if (isset($tokens[$i]) && + ($tokens[$i] instanceof PHP_Token_STATIC || + $tokens[$i] instanceof PHP_Token_FINAL || + $tokens[$i] instanceof PHP_Token_ABSTRACT)) { + $keywords[] = strtolower( + str_replace('PHP_Token_', '', get_class($tokens[$i])) + ); + } + } + + return implode(',', $keywords); + } + +} + +abstract class PHP_Token_Includes extends PHP_Token +{ + protected $name; + protected $type; + + public function getName() + { + if ($this->name !== NULL) { + return $this->name; + } + + $tokens = $this->tokenStream->tokens(); + + if ($tokens[$this->id+2] instanceof PHP_Token_CONSTANT_ENCAPSED_STRING) { + $this->name = trim($tokens[$this->id+2], "'\""); + $this->type = strtolower( + str_replace('PHP_Token_', '', get_class($tokens[$this->id])) + ); + } + + return $this->name; + } + + public function getType() + { + $this->getName(); + return $this->type; + } +} + +class PHP_Token_REQUIRE_ONCE extends PHP_Token_Includes {} +class PHP_Token_REQUIRE extends PHP_Token_Includes {} +class PHP_Token_EVAL extends PHP_Token {} +class PHP_Token_INCLUDE_ONCE extends PHP_Token_Includes {} +class PHP_Token_INCLUDE extends PHP_Token_Includes {} +class PHP_Token_LOGICAL_OR extends PHP_Token {} +class PHP_Token_LOGICAL_XOR extends PHP_Token {} +class PHP_Token_LOGICAL_AND extends PHP_Token {} +class PHP_Token_PRINT extends PHP_Token {} +class PHP_Token_SR_EQUAL extends PHP_Token {} +class PHP_Token_SL_EQUAL extends PHP_Token {} +class PHP_Token_XOR_EQUAL extends PHP_Token {} +class PHP_Token_OR_EQUAL extends PHP_Token {} +class PHP_Token_AND_EQUAL extends PHP_Token {} +class PHP_Token_MOD_EQUAL extends PHP_Token {} +class PHP_Token_CONCAT_EQUAL extends PHP_Token {} +class PHP_Token_DIV_EQUAL extends PHP_Token {} +class PHP_Token_MUL_EQUAL extends PHP_Token {} +class PHP_Token_MINUS_EQUAL extends PHP_Token {} +class PHP_Token_PLUS_EQUAL extends PHP_Token {} +class PHP_Token_BOOLEAN_OR extends PHP_Token {} +class PHP_Token_BOOLEAN_AND extends PHP_Token {} +class PHP_Token_IS_NOT_IDENTICAL extends PHP_Token {} +class PHP_Token_IS_IDENTICAL extends PHP_Token {} +class PHP_Token_IS_NOT_EQUAL extends PHP_Token {} +class PHP_Token_IS_EQUAL extends PHP_Token {} +class PHP_Token_IS_GREATER_OR_EQUAL extends PHP_Token {} +class PHP_Token_IS_SMALLER_OR_EQUAL extends PHP_Token {} +class PHP_Token_SR extends PHP_Token {} +class PHP_Token_SL extends PHP_Token {} +class PHP_Token_INSTANCEOF extends PHP_Token {} +class PHP_Token_UNSET_CAST extends PHP_Token {} +class PHP_Token_BOOL_CAST extends PHP_Token {} +class PHP_Token_OBJECT_CAST extends PHP_Token {} +class PHP_Token_ARRAY_CAST extends PHP_Token {} +class PHP_Token_STRING_CAST extends PHP_Token {} +class PHP_Token_DOUBLE_CAST extends PHP_Token {} +class PHP_Token_INT_CAST extends PHP_Token {} +class PHP_Token_DEC extends PHP_Token {} +class PHP_Token_INC extends PHP_Token {} +class PHP_Token_CLONE extends PHP_Token {} +class PHP_Token_NEW extends PHP_Token {} +class PHP_Token_EXIT extends PHP_Token {} +class PHP_Token_IF extends PHP_Token {} +class PHP_Token_ELSEIF extends PHP_Token {} +class PHP_Token_ELSE extends PHP_Token {} +class PHP_Token_ENDIF extends PHP_Token {} +class PHP_Token_LNUMBER extends PHP_Token {} +class PHP_Token_DNUMBER extends PHP_Token {} +class PHP_Token_STRING extends PHP_Token {} +class PHP_Token_STRING_VARNAME extends PHP_Token {} +class PHP_Token_VARIABLE extends PHP_Token {} +class PHP_Token_NUM_STRING extends PHP_Token {} +class PHP_Token_INLINE_HTML extends PHP_Token {} +class PHP_Token_CHARACTER extends PHP_Token {} +class PHP_Token_BAD_CHARACTER extends PHP_Token {} +class PHP_Token_ENCAPSED_AND_WHITESPACE extends PHP_Token {} +class PHP_Token_CONSTANT_ENCAPSED_STRING extends PHP_Token {} +class PHP_Token_ECHO extends PHP_Token {} +class PHP_Token_DO extends PHP_Token {} +class PHP_Token_WHILE extends PHP_Token {} +class PHP_Token_ENDWHILE extends PHP_Token {} +class PHP_Token_FOR extends PHP_Token {} +class PHP_Token_ENDFOR extends PHP_Token {} +class PHP_Token_FOREACH extends PHP_Token {} +class PHP_Token_ENDFOREACH extends PHP_Token {} +class PHP_Token_DECLARE extends PHP_Token {} +class PHP_Token_ENDDECLARE extends PHP_Token {} +class PHP_Token_AS extends PHP_Token {} +class PHP_Token_SWITCH extends PHP_Token {} +class PHP_Token_ENDSWITCH extends PHP_Token {} +class PHP_Token_CASE extends PHP_Token {} +class PHP_Token_DEFAULT extends PHP_Token {} +class PHP_Token_BREAK extends PHP_Token {} +class PHP_Token_CONTINUE extends PHP_Token {} +class PHP_Token_GOTO extends PHP_Token {} +class PHP_Token_CALLABLE extends PHP_Token {} +class PHP_Token_INSTEADOF extends PHP_Token {} + +class PHP_Token_FUNCTION extends PHP_TokenWithScopeAndVisibility +{ + protected $arguments; + protected $ccn; + protected $name; + protected $signature; + + public function getArguments() + { + if ($this->arguments !== NULL) { + return $this->arguments; + } + + $this->arguments = array(); + $tokens = $this->tokenStream->tokens(); + $typeHint = NULL; + + // Search for first token inside brackets + $i = $this->id + 2; + while (!$tokens[$i-1] instanceof PHP_Token_OPEN_BRACKET) { + $i++; + } + + while (!$tokens[$i] instanceof PHP_Token_CLOSE_BRACKET) { + if ($tokens[$i] instanceof PHP_Token_STRING) { + $typeHint = (string)$tokens[$i]; + } + + else if ($tokens[$i] instanceof PHP_Token_VARIABLE) { + $this->arguments[(string)$tokens[$i]] = $typeHint; + $typeHint = NULL; + } + + $i++; + } + + return $this->arguments; + } + + public function getName() + { + if ($this->name !== NULL) { + return $this->name; + } + + $tokens = $this->tokenStream->tokens(); + + for ($i = $this->id + 1; $i < count($tokens); $i++) { + if ($tokens[$i] instanceof PHP_Token_STRING) { + $this->name = (string)$tokens[$i]; + break; + } + + else if ($tokens[$i] instanceof PHP_Token_AMPERSAND && + $tokens[$i+1] instanceof PHP_Token_STRING) { + $this->name = (string)$tokens[$i+1]; + break; + } + + else if ($tokens[$i] instanceof PHP_Token_OPEN_BRACKET) { + $this->name = 'anonymous function'; + break; + } + } + + if ($this->name != 'anonymous function') { + for ($i = $this->id; $i; --$i) { + if ($tokens[$i] instanceof PHP_Token_NAMESPACE) { + $this->name = $tokens[$i]->getName() . '\\' . $this->name; + break; + } + + if ($tokens[$i] instanceof PHP_Token_INTERFACE) { + break; + } + } + } + + return $this->name; + } + + public function getCCN() + { + if ($this->ccn !== NULL) { + return $this->ccn; + } + + $this->ccn = 1; + $end = $this->getEndTokenId(); + $tokens = $this->tokenStream->tokens(); + + for ($i = $this->id; $i <= $end; $i++) { + switch (get_class($tokens[$i])) { + case 'PHP_Token_IF': + case 'PHP_Token_ELSEIF': + case 'PHP_Token_FOR': + case 'PHP_Token_FOREACH': + case 'PHP_Token_WHILE': + case 'PHP_Token_CASE': + case 'PHP_Token_CATCH': + case 'PHP_Token_BOOLEAN_AND': + case 'PHP_Token_LOGICAL_AND': + case 'PHP_Token_BOOLEAN_OR': + case 'PHP_Token_LOGICAL_OR': + case 'PHP_Token_QUESTION_MARK': { + $this->ccn++; + } + break; + } + } + + return $this->ccn; + } + + public function getSignature() + { + if ($this->signature !== NULL) { + return $this->signature; + } + + if ($this->getName() == 'anonymous function') { + $this->signature = 'anonymous function'; + $i = $this->id + 1; + } else { + $this->signature = ''; + $i = $this->id + 2; + } + + $tokens = $this->tokenStream->tokens(); + + while (isset($tokens[$i]) && + !$tokens[$i] instanceof PHP_Token_OPEN_CURLY && + !$tokens[$i] instanceof PHP_Token_SEMICOLON) { + $this->signature .= $tokens[$i++]; + } + + $this->signature = trim($this->signature); + + return $this->signature; + } +} + +class PHP_Token_CONST extends PHP_Token {} +class PHP_Token_RETURN extends PHP_Token {} +class PHP_Token_YIELD extends PHP_Token {} +class PHP_Token_TRY extends PHP_Token {} +class PHP_Token_CATCH extends PHP_Token {} +class PHP_Token_FINALLY extends PHP_Token {} +class PHP_Token_THROW extends PHP_Token {} +class PHP_Token_USE extends PHP_Token {} +class PHP_Token_GLOBAL extends PHP_Token {} +class PHP_Token_PUBLIC extends PHP_Token {} +class PHP_Token_PROTECTED extends PHP_Token {} +class PHP_Token_PRIVATE extends PHP_Token {} +class PHP_Token_FINAL extends PHP_Token {} +class PHP_Token_ABSTRACT extends PHP_Token {} +class PHP_Token_STATIC extends PHP_Token {} +class PHP_Token_VAR extends PHP_Token {} +class PHP_Token_UNSET extends PHP_Token {} +class PHP_Token_ISSET extends PHP_Token {} +class PHP_Token_EMPTY extends PHP_Token {} +class PHP_Token_HALT_COMPILER extends PHP_Token {} + +class PHP_Token_INTERFACE extends PHP_TokenWithScopeAndVisibility +{ + protected $interfaces; + + public function getName() + { + return (string)$this->tokenStream[$this->id + 2]; + } + + public function hasParent() + { + return $this->tokenStream[$this->id + 4] instanceof PHP_Token_EXTENDS; + } + + public function getPackage() + { + $className = $this->getName(); + $docComment = $this->getDocblock(); + + $result = array( + 'namespace' => '', + 'fullPackage' => '', + 'category' => '', + 'package' => '', + 'subpackage' => '' + ); + + for ($i = $this->id; $i; --$i) { + if ($this->tokenStream[$i] instanceof PHP_Token_NAMESPACE) { + $result['namespace'] = $this->tokenStream[$i]->getName(); + break; + } + } + + if (preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['category'] = $matches[1]; + } + + if (preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['package'] = $matches[1]; + $result['fullPackage'] = $matches[1]; + } + + if (preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['subpackage'] = $matches[1]; + $result['fullPackage'] .= '.' . $matches[1]; + } + + if (empty($result['fullPackage'])) { + $result['fullPackage'] = $this->arrayToName( + explode('_', str_replace('\\', '_', $className)), '.' + ); + } + + return $result; + } + + protected function arrayToName(array $parts, $join = '\\') + { + $result = ''; + + if (count($parts) > 1) { + array_pop($parts); + + $result = join($join, $parts); + } + + return $result; + } + + public function getParent() + { + if (!$this->hasParent()) { + return FALSE; + } + + $i = $this->id + 6; + $tokens = $this->tokenStream->tokens(); + $className = (string)$tokens[$i]; + + while (isset($tokens[$i+1]) && + !$tokens[$i+1] instanceof PHP_Token_WHITESPACE) { + $className .= (string)$tokens[++$i]; + } + + return $className; + } + + public function hasInterfaces() + { + return (isset($this->tokenStream[$this->id + 4]) && + $this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) || + (isset($this->tokenStream[$this->id + 8]) && + $this->tokenStream[$this->id + 8] instanceof PHP_Token_IMPLEMENTS); + } + + public function getInterfaces() + { + if ($this->interfaces !== NULL) { + return $this->interfaces; + } + + if (!$this->hasInterfaces()) { + return ($this->interfaces = FALSE); + } + + if ($this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) { + $i = $this->id + 3; + } else { + $i = $this->id + 7; + } + + $tokens = $this->tokenStream->tokens(); + + while (!$tokens[$i+1] instanceof PHP_Token_OPEN_CURLY) { + $i++; + + if ($tokens[$i] instanceof PHP_Token_STRING) { + $this->interfaces[] = (string)$tokens[$i]; + } + } + + return $this->interfaces; + } +} + +class PHP_Token_CLASS extends PHP_Token_INTERFACE {} +class PHP_Token_CLASS_NAME_CONSTANT extends PHP_Token {} +class PHP_Token_TRAIT extends PHP_Token_INTERFACE {} +class PHP_Token_EXTENDS extends PHP_Token {} +class PHP_Token_IMPLEMENTS extends PHP_Token {} +class PHP_Token_OBJECT_OPERATOR extends PHP_Token {} +class PHP_Token_DOUBLE_ARROW extends PHP_Token {} +class PHP_Token_LIST extends PHP_Token {} +class PHP_Token_ARRAY extends PHP_Token {} +class PHP_Token_CLASS_C extends PHP_Token {} +class PHP_Token_TRAIT_C extends PHP_Token {} +class PHP_Token_METHOD_C extends PHP_Token {} +class PHP_Token_FUNC_C extends PHP_Token {} +class PHP_Token_LINE extends PHP_Token {} +class PHP_Token_FILE extends PHP_Token {} +class PHP_Token_COMMENT extends PHP_Token {} +class PHP_Token_DOC_COMMENT extends PHP_Token {} +class PHP_Token_OPEN_TAG extends PHP_Token {} +class PHP_Token_OPEN_TAG_WITH_ECHO extends PHP_Token {} +class PHP_Token_CLOSE_TAG extends PHP_Token {} +class PHP_Token_WHITESPACE extends PHP_Token {} +class PHP_Token_START_HEREDOC extends PHP_Token {} +class PHP_Token_END_HEREDOC extends PHP_Token {} +class PHP_Token_DOLLAR_OPEN_CURLY_BRACES extends PHP_Token {} +class PHP_Token_CURLY_OPEN extends PHP_Token {} +class PHP_Token_PAAMAYIM_NEKUDOTAYIM extends PHP_Token {} + +class PHP_Token_NAMESPACE extends PHP_TokenWithScope +{ + public function getName() + { + $tokens = $this->tokenStream->tokens(); + $namespace = (string)$tokens[$this->id+2]; + + for ($i = $this->id + 3; ; $i += 2) { + if (isset($tokens[$i]) && + $tokens[$i] instanceof PHP_Token_NS_SEPARATOR) { + $namespace .= '\\' . $tokens[$i+1]; + } else { + break; + } + } + + return $namespace; + } +} + +class PHP_Token_NS_C extends PHP_Token {} +class PHP_Token_DIR extends PHP_Token {} +class PHP_Token_NS_SEPARATOR extends PHP_Token {} +class PHP_Token_DOUBLE_COLON extends PHP_Token {} +class PHP_Token_OPEN_BRACKET extends PHP_Token {} +class PHP_Token_CLOSE_BRACKET extends PHP_Token {} +class PHP_Token_OPEN_SQUARE extends PHP_Token {} +class PHP_Token_CLOSE_SQUARE extends PHP_Token {} +class PHP_Token_OPEN_CURLY extends PHP_Token {} +class PHP_Token_CLOSE_CURLY extends PHP_Token {} +class PHP_Token_SEMICOLON extends PHP_Token {} +class PHP_Token_DOT extends PHP_Token {} +class PHP_Token_COMMA extends PHP_Token {} +class PHP_Token_EQUAL extends PHP_Token {} +class PHP_Token_LT extends PHP_Token {} +class PHP_Token_GT extends PHP_Token {} +class PHP_Token_PLUS extends PHP_Token {} +class PHP_Token_MINUS extends PHP_Token {} +class PHP_Token_MULT extends PHP_Token {} +class PHP_Token_DIV extends PHP_Token {} +class PHP_Token_QUESTION_MARK extends PHP_Token {} +class PHP_Token_EXCLAMATION_MARK extends PHP_Token {} +class PHP_Token_COLON extends PHP_Token {} +class PHP_Token_DOUBLE_QUOTES extends PHP_Token {} +class PHP_Token_AT extends PHP_Token {} +class PHP_Token_AMPERSAND extends PHP_Token {} +class PHP_Token_PERCENT extends PHP_Token {} +class PHP_Token_PIPE extends PHP_Token {} +class PHP_Token_DOLLAR extends PHP_Token {} +class PHP_Token_CARET extends PHP_Token {} +class PHP_Token_TILDE extends PHP_Token {} +class PHP_Token_BACKTICK extends PHP_Token {} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream.php b/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream.php @@ -0,0 +1,627 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +/** + * A stream of PHP tokens. + * + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/tree + * @since Class available since Release 1.0.0 + */ +class PHP_Token_Stream implements ArrayAccess, Countable, SeekableIterator +{ + /** + * @var array + */ + protected static $customTokens = array( + '(' => 'PHP_Token_OPEN_BRACKET', + ')' => 'PHP_Token_CLOSE_BRACKET', + '[' => 'PHP_Token_OPEN_SQUARE', + ']' => 'PHP_Token_CLOSE_SQUARE', + '{' => 'PHP_Token_OPEN_CURLY', + '}' => 'PHP_Token_CLOSE_CURLY', + ';' => 'PHP_Token_SEMICOLON', + '.' => 'PHP_Token_DOT', + ',' => 'PHP_Token_COMMA', + '=' => 'PHP_Token_EQUAL', + '<' => 'PHP_Token_LT', + '>' => 'PHP_Token_GT', + '+' => 'PHP_Token_PLUS', + '-' => 'PHP_Token_MINUS', + '*' => 'PHP_Token_MULT', + '/' => 'PHP_Token_DIV', + '?' => 'PHP_Token_QUESTION_MARK', + '!' => 'PHP_Token_EXCLAMATION_MARK', + ':' => 'PHP_Token_COLON', + '"' => 'PHP_Token_DOUBLE_QUOTES', + '@' => 'PHP_Token_AT', + '&' => 'PHP_Token_AMPERSAND', + '%' => 'PHP_Token_PERCENT', + '|' => 'PHP_Token_PIPE', + '$' => 'PHP_Token_DOLLAR', + '^' => 'PHP_Token_CARET', + '~' => 'PHP_Token_TILDE', + '`' => 'PHP_Token_BACKTICK' + ); + + /** + * @var string + */ + protected $filename; + + /** + * @var array + */ + protected $tokens = array(); + + /** + * @var integer + */ + protected $position = 0; + + /** + * @var array + */ + protected $linesOfCode = array('loc' => 0, 'cloc' => 0, 'ncloc' => 0); + + /** + * @var array + */ + protected $classes; + + /** + * @var array + */ + protected $functions; + + /** + * @var array + */ + protected $includes; + + /** + * @var array + */ + protected $interfaces; + + /** + * @var array + */ + protected $traits; + + /** + * @var array + */ + protected $lineToFunctionMap = array(); + + /** + * Constructor. + * + * @param string $sourceCode + */ + public function __construct($sourceCode) + { + if (is_file($sourceCode)) { + $this->filename = $sourceCode; + $sourceCode = file_get_contents($sourceCode); + } + + $this->scan($sourceCode); + } + + /** + * Destructor. + */ + public function __destruct() + { + $this->tokens = array(); + } + + /** + * @return string + */ + public function __toString() + { + $buffer = ''; + + foreach ($this as $token) { + $buffer .= $token; + } + + return $buffer; + } + + /** + * @return string + * @since Method available since Release 1.1.0 + */ + public function getFilename() + { + return $this->filename; + } + + /** + * Scans the source for sequences of characters and converts them into a + * stream of tokens. + * + * @param string $sourceCode + */ + protected function scan($sourceCode) + { + $line = 1; + $tokens = token_get_all($sourceCode); + $numTokens = count($tokens); + + $lastNonWhitespaceTokenWasDoubleColon = FALSE; + + for ($i = 0; $i < $numTokens; ++$i) { + $token = $tokens[$i]; + unset($tokens[$i]); + + if (is_array($token)) { + $name = substr(token_name($token[0]), 2); + $text = $token[1]; + + if ($lastNonWhitespaceTokenWasDoubleColon && $name == 'CLASS') { + $name = 'CLASS_NAME_CONSTANT'; + } + + $tokenClass = 'PHP_Token_' . $name; + } else { + $text = $token; + $tokenClass = self::$customTokens[$token]; + } + + $this->tokens[] = new $tokenClass($text, $line, $this, $i); + $lines = substr_count($text, "\n"); + $line += $lines; + + if ($tokenClass == 'PHP_Token_HALT_COMPILER') { + break; + } + + else if ($tokenClass == 'PHP_Token_COMMENT' || + $tokenClass == 'PHP_Token_DOC_COMMENT') { + $this->linesOfCode['cloc'] += $lines + 1; + } + + if ($name == 'DOUBLE_COLON') { + $lastNonWhitespaceTokenWasDoubleColon = TRUE; + } + + else if ($name != 'WHITESPACE') { + $lastNonWhitespaceTokenWasDoubleColon = FALSE; + } + } + + $this->linesOfCode['loc'] = substr_count($sourceCode, "\n"); + $this->linesOfCode['ncloc'] = $this->linesOfCode['loc'] - + $this->linesOfCode['cloc']; + } + + /** + * @return integer + */ + public function count() + { + return count($this->tokens); + } + + /** + * @return PHP_Token[] + */ + public function tokens() + { + return $this->tokens; + } + + /** + * @return array + */ + public function getClasses() + { + if ($this->classes !== NULL) { + return $this->classes; + } + + $this->parse(); + + return $this->classes; + } + + /** + * @return array + */ + public function getFunctions() + { + if ($this->functions !== NULL) { + return $this->functions; + } + + $this->parse(); + + return $this->functions; + } + + /** + * @return array + */ + public function getInterfaces() + { + if ($this->interfaces !== NULL) { + return $this->interfaces; + } + + $this->parse(); + + return $this->interfaces; + } + + /** + * @return array + * @since Method available since Release 1.1.0 + */ + public function getTraits() + { + if ($this->traits !== NULL) { + return $this->traits; + } + + $this->parse(); + + return $this->traits; + } + + /** + * Gets the names of all files that have been included + * using include(), include_once(), require() or require_once(). + * + * Parameter $categorize set to TRUE causing this function to return a + * multi-dimensional array with categories in the keys of the first dimension + * and constants and their values in the second dimension. + * + * Parameter $category allow to filter following specific inclusion type + * + * @param bool $categorize OPTIONAL + * @param string $category OPTIONAL Either 'require_once', 'require', + * 'include_once', 'include'. + * @return array + * @since Method available since Release 1.1.0 + */ + public function getIncludes($categorize = FALSE, $category = NULL) + { + if ($this->includes === NULL) { + $this->includes = array( + 'require_once' => array(), + 'require' => array(), + 'include_once' => array(), + 'include' => array() + ); + + foreach ($this->tokens as $token) { + switch (get_class($token)) { + case 'PHP_Token_REQUIRE_ONCE': + case 'PHP_Token_REQUIRE': + case 'PHP_Token_INCLUDE_ONCE': + case 'PHP_Token_INCLUDE': { + $this->includes[$token->getType()][] = $token->getName(); + } + break; + } + } + } + + if (isset($this->includes[$category])) { + $includes = $this->includes[$category]; + } + + else if ($categorize === FALSE) { + $includes = array_merge( + $this->includes['require_once'], + $this->includes['require'], + $this->includes['include_once'], + $this->includes['include'] + ); + } else { + $includes = $this->includes; + } + + return $includes; + } + + /** + * Returns the name of the function or method a line belongs to. + * + * @return string or null if the line is not in a function or method + * @since Method available since Release 1.2.0 + */ + public function getFunctionForLine($line) + { + $this->parse(); + + if (isset($this->lineToFunctionMap[$line])) { + return $this->lineToFunctionMap[$line]; + } + } + + protected function parse() + { + $this->interfaces = array(); + $this->classes = array(); + $this->traits = array(); + $this->functions = array(); + $class = FALSE; + $classEndLine = FALSE; + $trait = FALSE; + $traitEndLine = FALSE; + $interface = FALSE; + $interfaceEndLine = FALSE; + + foreach ($this->tokens as $token) { + switch (get_class($token)) { + case 'PHP_Token_HALT_COMPILER': { + return; + } + break; + + case 'PHP_Token_INTERFACE': { + $interface = $token->getName(); + $interfaceEndLine = $token->getEndLine(); + + $this->interfaces[$interface] = array( + 'methods' => array(), + 'parent' => $token->getParent(), + 'keywords' => $token->getKeywords(), + 'docblock' => $token->getDocblock(), + 'startLine' => $token->getLine(), + 'endLine' => $interfaceEndLine, + 'package' => $token->getPackage(), + 'file' => $this->filename + ); + } + break; + + case 'PHP_Token_CLASS': + case 'PHP_Token_TRAIT': { + $tmp = array( + 'methods' => array(), + 'parent' => $token->getParent(), + 'interfaces'=> $token->getInterfaces(), + 'keywords' => $token->getKeywords(), + 'docblock' => $token->getDocblock(), + 'startLine' => $token->getLine(), + 'endLine' => $token->getEndLine(), + 'package' => $token->getPackage(), + 'file' => $this->filename + ); + + if ($token instanceof PHP_Token_CLASS) { + $class = $token->getName(); + $classEndLine = $token->getEndLine(); + $this->classes[$class] = $tmp; + } else { + $trait = $token->getName(); + $traitEndLine = $token->getEndLine(); + $this->traits[$trait] = $tmp; + } + } + break; + + case 'PHP_Token_FUNCTION': { + $name = $token->getName(); + $tmp = array( + 'docblock' => $token->getDocblock(), + 'keywords' => $token->getKeywords(), + 'visibility'=> $token->getVisibility(), + 'signature' => $token->getSignature(), + 'startLine' => $token->getLine(), + 'endLine' => $token->getEndLine(), + 'ccn' => $token->getCCN(), + 'file' => $this->filename + ); + + if ($class === FALSE && + $trait === FALSE && + $interface === FALSE) { + $this->functions[$name] = $tmp; + + $this->addFunctionToMap( + $name, $tmp['startLine'], $tmp['endLine'] + ); + } + + else if ($class !== FALSE) { + $this->classes[$class]['methods'][$name] = $tmp; + + $this->addFunctionToMap( + $class . '::' . $name, + $tmp['startLine'], + $tmp['endLine'] + ); + } + + else if ($trait !== FALSE) { + $this->traits[$trait]['methods'][$name] = $tmp; + + $this->addFunctionToMap( + $trait . '::' . $name, + $tmp['startLine'], + $tmp['endLine'] + ); + } + + else { + $this->interfaces[$interface]['methods'][$name] = $tmp; + } + } + break; + + case 'PHP_Token_CLOSE_CURLY': { + if ($classEndLine !== FALSE && + $classEndLine == $token->getLine()) { + $class = FALSE; + $classEndLine = FALSE; + } + + else if ($traitEndLine !== FALSE && + $traitEndLine == $token->getLine()) { + $trait = FALSE; + $traitEndLine = FALSE; + } + + else if ($interfaceEndLine !== FALSE && + $interfaceEndLine == $token->getLine()) { + $interface = FALSE; + $interfaceEndLine = FALSE; + } + } + break; + } + } + } + + /** + * @return array + */ + public function getLinesOfCode() + { + return $this->linesOfCode; + } + + /** + */ + public function rewind() + { + $this->position = 0; + } + + /** + * @return boolean + */ + public function valid() + { + return isset($this->tokens[$this->position]); + } + + /** + * @return integer + */ + public function key() + { + return $this->position; + } + + /** + * @return PHP_Token + */ + public function current() + { + return $this->tokens[$this->position]; + } + + /** + */ + public function next() + { + $this->position++; + } + + /** + * @param mixed $offset + */ + public function offsetExists($offset) + { + return isset($this->tokens[$offset]); + } + + /** + * @param mixed $offset + * @return mixed + */ + public function offsetGet($offset) + { + return $this->tokens[$offset]; + } + + /** + * @param mixed $offset + * @param mixed $value + */ + public function offsetSet($offset, $value) + { + $this->tokens[$offset] = $value; + } + + /** + * @param mixed $offset + */ + public function offsetUnset($offset) + { + unset($this->tokens[$offset]); + } + + /** + * Seek to an absolute position. + * + * @param integer $position + * @throws OutOfBoundsException + */ + public function seek($position) + { + $this->position = $position; + + if (!$this->valid()) { + throw new OutOfBoundsException('Invalid seek position'); + } + } + + private function addFunctionToMap($name, $startLine, $endLine) + { + for ($line = $startLine; $line <= $endLine; $line++) { + $this->lineToFunctionMap[$line] = $name; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php b/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php @@ -0,0 +1,226 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2010, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2010 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-token-stream/tree + * @since File available since Release 1.1.0 + */ + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL;; + + if ($classes === NULL) { + $classes = array( + 'php_token' => '/Token.php', + 'php_token_abstract' => '/Token.php', + 'php_token_ampersand' => '/Token.php', + 'php_token_and_equal' => '/Token.php', + 'php_token_array' => '/Token.php', + 'php_token_array_cast' => '/Token.php', + 'php_token_as' => '/Token.php', + 'php_token_at' => '/Token.php', + 'php_token_backtick' => '/Token.php', + 'php_token_bad_character' => '/Token.php', + 'php_token_bool_cast' => '/Token.php', + 'php_token_boolean_and' => '/Token.php', + 'php_token_boolean_or' => '/Token.php', + 'php_token_break' => '/Token.php', + 'php_token_callable' => '/Token.php', + 'php_token_caret' => '/Token.php', + 'php_token_case' => '/Token.php', + 'php_token_catch' => '/Token.php', + 'php_token_character' => '/Token.php', + 'php_token_class' => '/Token.php', + 'php_token_class_c' => '/Token.php', + 'php_token_clone' => '/Token.php', + 'php_token_close_bracket' => '/Token.php', + 'php_token_close_curly' => '/Token.php', + 'php_token_close_square' => '/Token.php', + 'php_token_close_tag' => '/Token.php', + 'php_token_colon' => '/Token.php', + 'php_token_comma' => '/Token.php', + 'php_token_comment' => '/Token.php', + 'php_token_concat_equal' => '/Token.php', + 'php_token_const' => '/Token.php', + 'php_token_constant_encapsed_string' => '/Token.php', + 'php_token_continue' => '/Token.php', + 'php_token_curly_open' => '/Token.php', + 'php_token_dec' => '/Token.php', + 'php_token_declare' => '/Token.php', + 'php_token_default' => '/Token.php', + 'php_token_dir' => '/Token.php', + 'php_token_div' => '/Token.php', + 'php_token_div_equal' => '/Token.php', + 'php_token_dnumber' => '/Token.php', + 'php_token_do' => '/Token.php', + 'php_token_doc_comment' => '/Token.php', + 'php_token_dollar' => '/Token.php', + 'php_token_dollar_open_curly_braces' => '/Token.php', + 'php_token_dot' => '/Token.php', + 'php_token_double_arrow' => '/Token.php', + 'php_token_double_cast' => '/Token.php', + 'php_token_double_colon' => '/Token.php', + 'php_token_double_quotes' => '/Token.php', + 'php_token_echo' => '/Token.php', + 'php_token_else' => '/Token.php', + 'php_token_elseif' => '/Token.php', + 'php_token_empty' => '/Token.php', + 'php_token_encapsed_and_whitespace' => '/Token.php', + 'php_token_end_heredoc' => '/Token.php', + 'php_token_enddeclare' => '/Token.php', + 'php_token_endfor' => '/Token.php', + 'php_token_endforeach' => '/Token.php', + 'php_token_endif' => '/Token.php', + 'php_token_endswitch' => '/Token.php', + 'php_token_endwhile' => '/Token.php', + 'php_token_equal' => '/Token.php', + 'php_token_eval' => '/Token.php', + 'php_token_exclamation_mark' => '/Token.php', + 'php_token_exit' => '/Token.php', + 'php_token_extends' => '/Token.php', + 'php_token_file' => '/Token.php', + 'php_token_final' => '/Token.php', + 'php_token_for' => '/Token.php', + 'php_token_foreach' => '/Token.php', + 'php_token_func_c' => '/Token.php', + 'php_token_function' => '/Token.php', + 'php_token_global' => '/Token.php', + 'php_token_goto' => '/Token.php', + 'php_token_gt' => '/Token.php', + 'php_token_halt_compiler' => '/Token.php', + 'php_token_if' => '/Token.php', + 'php_token_implements' => '/Token.php', + 'php_token_inc' => '/Token.php', + 'php_token_include' => '/Token.php', + 'php_token_include_once' => '/Token.php', + 'php_token_includes' => '/Token.php', + 'php_token_inline_html' => '/Token.php', + 'php_token_instanceof' => '/Token.php', + 'php_token_insteadof' => '/Token.php', + 'php_token_int_cast' => '/Token.php', + 'php_token_interface' => '/Token.php', + 'php_token_is_equal' => '/Token.php', + 'php_token_is_greater_or_equal' => '/Token.php', + 'php_token_is_identical' => '/Token.php', + 'php_token_is_not_equal' => '/Token.php', + 'php_token_is_not_identical' => '/Token.php', + 'php_token_is_smaller_or_equal' => '/Token.php', + 'php_token_isset' => '/Token.php', + 'php_token_line' => '/Token.php', + 'php_token_list' => '/Token.php', + 'php_token_lnumber' => '/Token.php', + 'php_token_logical_and' => '/Token.php', + 'php_token_logical_or' => '/Token.php', + 'php_token_logical_xor' => '/Token.php', + 'php_token_lt' => '/Token.php', + 'php_token_method_c' => '/Token.php', + 'php_token_minus' => '/Token.php', + 'php_token_minus_equal' => '/Token.php', + 'php_token_mod_equal' => '/Token.php', + 'php_token_mul_equal' => '/Token.php', + 'php_token_mult' => '/Token.php', + 'php_token_namespace' => '/Token.php', + 'php_token_new' => '/Token.php', + 'php_token_ns_c' => '/Token.php', + 'php_token_ns_separator' => '/Token.php', + 'php_token_num_string' => '/Token.php', + 'php_token_object_cast' => '/Token.php', + 'php_token_object_operator' => '/Token.php', + 'php_token_open_bracket' => '/Token.php', + 'php_token_open_curly' => '/Token.php', + 'php_token_open_square' => '/Token.php', + 'php_token_open_tag' => '/Token.php', + 'php_token_open_tag_with_echo' => '/Token.php', + 'php_token_or_equal' => '/Token.php', + 'php_token_paamayim_nekudotayim' => '/Token.php', + 'php_token_percent' => '/Token.php', + 'php_token_pipe' => '/Token.php', + 'php_token_plus' => '/Token.php', + 'php_token_plus_equal' => '/Token.php', + 'php_token_print' => '/Token.php', + 'php_token_private' => '/Token.php', + 'php_token_protected' => '/Token.php', + 'php_token_public' => '/Token.php', + 'php_token_question_mark' => '/Token.php', + 'php_token_require' => '/Token.php', + 'php_token_require_once' => '/Token.php', + 'php_token_return' => '/Token.php', + 'php_token_semicolon' => '/Token.php', + 'php_token_sl' => '/Token.php', + 'php_token_sl_equal' => '/Token.php', + 'php_token_sr' => '/Token.php', + 'php_token_sr_equal' => '/Token.php', + 'php_token_start_heredoc' => '/Token.php', + 'php_token_static' => '/Token.php', + 'php_token_stream' => '/Token/Stream.php', + 'php_token_stream_cachingfactory' => '/Token/Stream/CachingFactory.php', + 'php_token_string' => '/Token.php', + 'php_token_string_cast' => '/Token.php', + 'php_token_string_varname' => '/Token.php', + 'php_token_switch' => '/Token.php', + 'php_token_throw' => '/Token.php', + 'php_token_tilde' => '/Token.php', + 'php_token_trait' => '/Token.php', + 'php_token_trait_c' => '/Token.php', + 'php_token_try' => '/Token.php', + 'php_token_unset' => '/Token.php', + 'php_token_unset_cast' => '/Token.php', + 'php_token_use' => '/Token.php', + 'php_token_var' => '/Token.php', + 'php_token_variable' => '/Token.php', + 'php_token_while' => '/Token.php', + 'php_token_whitespace' => '/Token.php', + 'php_token_xor_equal' => '/Token.php', + 'php_tokenwithscope' => '/Token.php', + 'php_tokenwithscopeandvisibility' => '/Token.php' + ); + + $path = dirname(dirname(dirname(__FILE__))); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in b/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in @@ -0,0 +1,65 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2010, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2010 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/php-token-stream/tree + * @since File available since Release 1.1.0 + */ + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL;; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + + $path = dirname(dirname(dirname(__FILE__))); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php b/libs/php-ssh/vendor/phpunit/php-token-stream/PHP/Token/Stream/CachingFactory.php @@ -0,0 +1,85 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +/** + * A caching factory for token stream objects. + * + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/tree + * @since Class available since Release 1.0.0 + */ +class PHP_Token_Stream_CachingFactory +{ + /** + * @var array + */ + protected static $cache = array(); + + /** + * @param string $filename + * @return PHP_Token_Stream + */ + public static function get($filename) + { + if (!isset(self::$cache[$filename])) { + self::$cache[$filename] = new PHP_Token_Stream($filename); + } + + return self::$cache[$filename]; + } + + /** + * @param string $filename + */ + public static function clear($filename = NULL) + { + if (is_string($filename)) { + unset(self::$cache[$filename]); + } else { + self::$cache = array(); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/README.md b/libs/php-ssh/vendor/phpunit/php-token-stream/README.md @@ -0,0 +1,22 @@ +# PHP_TokenStream + +## Installation + +You can use [Composer](http://getcomposer.org/) or the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) to download and install this package as well as its dependencies. + +### Composer + +To add this package as a local, per-project dependency to your project, simply add a dependency on `phpunit/php-token-stream` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on PHP_TokenStream: + + { + "require": { + "phpunit/php-token-stream": "*" + } + } + +### PEAR Installer + +The following two commands (which you may have to run as `root`) are all that is required to install this package using the PEAR Installer: + + pear config-set auto_discover 1 + pear install pear.phpunit.de/PHP_TokenStream diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClassTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClassTest.php @@ -0,0 +1,128 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.2 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_CLASS class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.2 + */ +class PHP_Token_ClassTest extends PHPUnit_Framework_TestCase +{ + protected $class; + protected $function; + + protected function setUp() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source2.php'); + + foreach ($ts as $token) { + if ($token instanceof PHP_Token_CLASS) { + $this->class = $token; + } + + if ($token instanceof PHP_Token_FUNCTION) { + $this->function = $token; + break; + } + } + } + + /** + * @covers PHP_Token_CLASS::getKeywords + */ + public function testGetClassKeywords() + { + $this->assertEquals('abstract', $this->class->getKeywords()); + } + + /** + * @covers PHP_Token_FUNCTION::getKeywords + */ + public function testGetFunctionKeywords() + { + $this->assertEquals('abstract,static', $this->function->getKeywords()); + } + + /** + * @covers PHP_Token_FUNCTION::getVisibility + */ + public function testGetFunctionVisibility() + { + $this->assertEquals('public', $this->function->getVisibility()); + } + + public function testIssue19() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'issue19.php'); + + foreach ($ts as $token) { + if ($token instanceof PHP_Token_CLASS) { + $this->assertFalse($token->hasInterfaces()); + } + } + } + + public function testIssue30() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'issue30.php'); + $this->assertCount(1, $ts->getClasses()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClosureTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/ClosureTest.php @@ -0,0 +1,129 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_FUNCTION class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.0 + */ +class PHP_Token_ClosureTest extends PHPUnit_Framework_TestCase +{ + protected $functions; + + protected function setUp() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'closure.php'); + + foreach ($ts as $token) { + if ($token instanceof PHP_Token_FUNCTION) { + $this->functions[] = $token; + } + } + } + + /** + * @covers PHP_Token_FUNCTION::getArguments + */ + public function testGetArguments() + { + $this->assertEquals(array('$foo' => null, '$bar' => null), $this->functions[0]->getArguments()); + $this->assertEquals(array('$foo' => 'Foo', '$bar' => null), $this->functions[1]->getArguments()); + $this->assertEquals(array('$foo' => null, '$bar' => null, '$baz' => null), $this->functions[2]->getArguments()); + $this->assertEquals(array('$foo' => 'Foo', '$bar' => null, '$baz' => null), $this->functions[3]->getArguments()); + $this->assertEquals(array(), $this->functions[4]->getArguments()); + $this->assertEquals(array(), $this->functions[5]->getArguments()); + } + + /** + * @covers PHP_Token_FUNCTION::getName + */ + public function testGetName() + { + $this->assertEquals('anonymous function', $this->functions[0]->getName()); + $this->assertEquals('anonymous function', $this->functions[1]->getName()); + $this->assertEquals('anonymous function', $this->functions[2]->getName()); + $this->assertEquals('anonymous function', $this->functions[3]->getName()); + $this->assertEquals('anonymous function', $this->functions[4]->getName()); + $this->assertEquals('anonymous function', $this->functions[5]->getName()); + } + + /** + * @covers PHP_Token::getLine + */ + public function testGetLine() + { + $this->assertEquals(2, $this->functions[0]->getLine()); + $this->assertEquals(3, $this->functions[1]->getLine()); + $this->assertEquals(4, $this->functions[2]->getLine()); + $this->assertEquals(5, $this->functions[3]->getLine()); + } + + /** + * @covers PHP_TokenWithScope::getEndLine + */ + public function testGetEndLine() + { + $this->assertEquals(2, $this->functions[0]->getLine()); + $this->assertEquals(3, $this->functions[1]->getLine()); + $this->assertEquals(4, $this->functions[2]->getLine()); + $this->assertEquals(5, $this->functions[3]->getLine()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/FunctionTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/FunctionTest.php @@ -0,0 +1,190 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_FUNCTION class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.0 + */ +class PHP_Token_FunctionTest extends PHPUnit_Framework_TestCase +{ + protected $functions; + + protected function setUp() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source.php'); + + foreach ($ts as $token) { + if ($token instanceof PHP_Token_FUNCTION) { + $this->functions[] = $token; + } + } + } + + /** + * @covers PHP_Token_FUNCTION::getArguments + */ + public function testGetArguments() + { + $this->assertEquals(array(), $this->functions[0]->getArguments()); + + $this->assertEquals( + array('$baz' => 'Baz'), $this->functions[1]->getArguments() + ); + + $this->assertEquals( + array('$foobar' => 'Foobar'), $this->functions[2]->getArguments() + ); + + $this->assertEquals( + array('$barfoo' => 'Barfoo'), $this->functions[3]->getArguments() + ); + + $this->assertEquals(array(), $this->functions[4]->getArguments()); + + $this->assertEquals(array('$x' => null, '$y' => null), $this->functions[5]->getArguments()); + } + + /** + * @covers PHP_Token_FUNCTION::getName + */ + public function testGetName() + { + $this->assertEquals('foo', $this->functions[0]->getName()); + $this->assertEquals('bar', $this->functions[1]->getName()); + $this->assertEquals('foobar', $this->functions[2]->getName()); + $this->assertEquals('barfoo', $this->functions[3]->getName()); + $this->assertEquals('baz', $this->functions[4]->getName()); + } + + /** + * @covers PHP_Token::getLine + */ + public function testGetLine() + { + $this->assertEquals(5, $this->functions[0]->getLine()); + $this->assertEquals(10, $this->functions[1]->getLine()); + $this->assertEquals(17, $this->functions[2]->getLine()); + $this->assertEquals(21, $this->functions[3]->getLine()); + $this->assertEquals(29, $this->functions[4]->getLine()); + } + + /** + * @covers PHP_TokenWithScope::getEndLine + */ + public function testGetEndLine() + { + $this->assertEquals(5, $this->functions[0]->getEndLine()); + $this->assertEquals(12, $this->functions[1]->getEndLine()); + $this->assertEquals(19, $this->functions[2]->getEndLine()); + $this->assertEquals(23, $this->functions[3]->getEndLine()); + $this->assertEquals(31, $this->functions[4]->getEndLine()); + } + + /** + * @covers PHP_Token_FUNCTION::getDocblock + */ + public function testGetDocblock() + { + $this->assertNull($this->functions[0]->getDocblock()); + + $this->assertEquals( + "/**\n * @param Baz \$baz\n */", + $this->functions[1]->getDocblock() + ); + + $this->assertEquals( + "/**\n * @param Foobar \$foobar\n */", + $this->functions[2]->getDocblock() + ); + + $this->assertNull($this->functions[3]->getDocblock()); + $this->assertNull($this->functions[4]->getDocblock()); + } + + public function testSignature() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source5.php'); + $f = $ts->getFunctions(); + $c = $ts->getClasses(); + $i = $ts->getInterfaces(); + + $this->assertEquals( + 'foo($a, array $b, array $c = array())', + $f['foo']['signature'] + ); + + $this->assertEquals( + 'm($a, array $b, array $c = array())', + $c['c']['methods']['m']['signature'] + ); + + $this->assertEquals( + 'm($a, array $b, array $c = array())', + $c['a']['methods']['m']['signature'] + ); + + $this->assertEquals( + 'm($a, array $b, array $c = array())', + $i['i']['methods']['m']['signature'] + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/IncludeTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/IncludeTest.php @@ -0,0 +1,117 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.2 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_REQUIRE_ONCE, PHP_Token_REQUIRE + * PHP_Token_INCLUDE_ONCE and PHP_Token_INCLUDE_ONCE classes. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.2 + */ +class PHP_Token_IncludeTest extends PHPUnit_Framework_TestCase +{ + protected $ts; + + protected function setUp() + { + $this->ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source3.php'); + } + + /** + * @covers PHP_Token_Includes::getName + * @covers PHP_Token_Includes::getType + */ + public function testGetIncludes() + { + $this->assertSame( + array('test4.php', 'test3.php', 'test2.php', 'test1.php'), + $this->ts->getIncludes() + ); + } + + /** + * @covers PHP_Token_Includes::getName + * @covers PHP_Token_Includes::getType + */ + public function testGetIncludesCategorized() + { + $this->assertSame( + array( + 'require_once' => array('test4.php'), + 'require' => array('test3.php'), + 'include_once' => array('test2.php'), + 'include' => array('test1.php') + ), + $this->ts->getIncludes(TRUE) + ); + } + + /** + * @covers PHP_Token_Includes::getName + * @covers PHP_Token_Includes::getType + */ + public function testGetIncludesCategory() + { + $this->assertSame( + array('test4.php'), + $this->ts->getIncludes(TRUE, 'require_once') + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/InterfaceTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/InterfaceTest.php @@ -0,0 +1,236 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_INTERFACE class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Laurent Laville <pear@laurent-laville.org> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.0 + */ +class PHP_Token_InterfaceTest extends PHPUnit_Framework_TestCase +{ + protected $class; + protected $interfaces; + + protected function setUp() + { + $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source4.php'); + $i = 0; + foreach ($ts as $token) { + if ($token instanceof PHP_Token_CLASS) { + $this->class = $token; + } + elseif ($token instanceof PHP_Token_INTERFACE) { + $this->interfaces[$i] = $token; + $i++; + } + } + } + + /** + * @covers PHP_Token_INTERFACE::getName + */ + public function testGetName() + { + $this->assertEquals( + 'iTemplate', $this->interfaces[0]->getName() + ); + } + + /** + * @covers PHP_Token_INTERFACE::getParent + */ + public function testGetParentNotExists() + { + $this->assertFalse( + $this->interfaces[0]->getParent() + ); + } + + /** + * @covers PHP_Token_INTERFACE::hasParent + */ + public function testHasParentNotExists() + { + $this->assertFalse( + $this->interfaces[0]->hasParent() + ); + } + + /** + * @covers PHP_Token_INTERFACE::getParent + */ + public function testGetParentExists() + { + $this->assertEquals( + 'a', $this->interfaces[2]->getParent() + ); + } + + /** + * @covers PHP_Token_INTERFACE::hasParent + */ + public function testHasParentExists() + { + $this->assertTrue( + $this->interfaces[2]->hasParent() + ); + } + + /** + * @covers PHP_Token_INTERFACE::getInterfaces + */ + public function testGetInterfacesExists() + { + $this->assertEquals( + array('b'), + $this->class->getInterfaces() + ); + } + + /** + * @covers PHP_Token_INTERFACE::hasInterfaces + */ + public function testHasInterfacesExists() + { + $this->assertTrue( + $this->class->hasInterfaces() + ); + } + /** + * @covers PHP_Token_INTERFACE::getPackage + */ + public function testGetPackageNamespace() { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); + foreach($tokenStream as $token) { + if($token instanceOf PHP_Token_INTERFACE) { + $package = $token->getPackage(); + $this->assertSame('Foo\\Bar', $package['namespace']); + } + } + } + + + public function provideFilesWithClassesWithinMultipleNamespaces() { + return array( + array(TEST_FILES_PATH . 'multipleNamespacesWithOneClassUsingBraces.php'), + array(TEST_FILES_PATH . 'multipleNamespacesWithOneClassUsingNonBraceSyntax.php'), + ); + } + + /** + * @dataProvider provideFilesWithClassesWithinMultipleNamespaces + * @covers PHP_Token_INTERFACE::getPackage + */ + public function testGetPackageNamespaceForFileWithMultipleNamespaces($filepath) { + $tokenStream = new PHP_Token_Stream($filepath); + $firstClassFound = false; + foreach($tokenStream as $token) { + if($firstClassFound === false && $token instanceOf PHP_Token_INTERFACE) { + $package = $token->getPackage(); + $this->assertSame('TestClassInBar', $token->getName()); + $this->assertSame('Foo\\Bar', $package['namespace']); + $firstClassFound = true; + continue; + } + // Secound class + if($token instanceOf PHP_Token_INTERFACE) { + $package = $token->getPackage(); + $this->assertSame('TestClassInBaz', $token->getName()); + $this->assertSame('Foo\\Baz', $package['namespace']); + return; + } + } + $this->fail("Seachring for 2 classes failed"); + } + + public function testGetPackageNamespaceIsEmptyForInterfacesThatAreNotWithinNamespaces() { + foreach($this->interfaces as $token) { + $package = $token->getPackage(); + $this->assertSame("", $package['namespace']); + } + } + + /** + * @covers PHP_Token_INTERFACE::getPackage + */ + public function testGetPackageNamespaceWhenExtentingFromNamespaceClass() { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classExtendsNamespacedClass.php'); + $firstClassFound = false; + foreach($tokenStream as $token) { + if($firstClassFound === false && $token instanceOf PHP_Token_INTERFACE) { + $package = $token->getPackage(); + $this->assertSame('Baz', $token->getName()); + $this->assertSame('Foo\\Bar', $package['namespace']); + $firstClassFound = true; + continue; + } + if($token instanceOf PHP_Token_INTERFACE) { + $package = $token->getPackage(); + $this->assertSame('Extender', $token->getName()); + $this->assertSame('Other\\Space', $package['namespace']); + return; + } + } + $this->fail("Searching for 2 classes failed"); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/NamespaceTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/Token/NamespaceTest.php @@ -0,0 +1,124 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . + '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token_NAMESPACE class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.0 + */ +class PHP_Token_NamespaceTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHP_Token_NAMESPACE::getName + */ + public function testGetName() + { + $tokenStream = new PHP_Token_Stream( + TEST_FILES_PATH . 'classInNamespace.php' + ); + + foreach ($tokenStream as $token) { + if ($token instanceof PHP_Token_NAMESPACE) { + $this->assertSame('Foo\\Bar', $token->getName()); + } + } + } + + public function testGetStartLineWithUnscopedNamespace() + { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); + foreach($tokenStream as $token) { + if($token instanceOf PHP_Token_NAMESPACE) { + $this->assertSame(2, $token->getLine()); + } + } + } + + public function testGetEndLineWithUnscopedNamespace() + { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInNamespace.php'); + foreach($tokenStream as $token) { + if($token instanceOf PHP_Token_NAMESPACE) { + $this->assertSame(2, $token->getEndLine()); + } + } + } + public function testGetStartLineWithScopedNamespace() + { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInScopedNamespace.php'); + foreach($tokenStream as $token) { + if($token instanceOf PHP_Token_NAMESPACE) { + $this->assertSame(2, $token->getLine()); + } + } + } + + public function testGetEndLineWithScopedNamespace() + { + $tokenStream = new PHP_Token_Stream(TEST_FILES_PATH . 'classInScopedNamespace.php'); + foreach($tokenStream as $token) { + if($token instanceOf PHP_Token_NAMESPACE) { + $this->assertSame(8, $token->getEndLine()); + } + } + } + +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/TokenTest.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/TokenTest.php @@ -0,0 +1,85 @@ +<?php +/** + * php-token-stream + * + * Copyright (c) 2009-2013, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @since File available since Release 1.0.0 + */ + +if (!defined('TEST_FILES_PATH')) { + define( + 'TEST_FILES_PATH', + dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR + ); +} + +require_once 'PHP/Token/Stream.php'; + +/** + * Tests for the PHP_Token class. + * + * @package PHP_TokenStream + * @subpackage Tests + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2009-2013 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/php-token-stream/ + * @since Class available since Release 1.0.0 + */ +class PHP_TokenTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHP_Token::__construct + * @covers PHP_Token::__toString + */ + public function testToString() + { + $this->markTestIncomplete(); + } + + /** + * @covers PHP_Token::__construct + * @covers PHP_Token::getLine + */ + public function testGetLine() + { + $this->markTestIncomplete(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classExtendsNamespacedClass.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classExtendsNamespacedClass.php @@ -0,0 +1,10 @@ +<?php + +namespace Foo\Bar; + +class Baz {} + +namespace Other\Space; + +class Extender extends \Foo\Bar\Baz {} + diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInNamespace.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInNamespace.php @@ -0,0 +1,6 @@ +<?php +namespace Foo\Bar; + +class TestClass +{ +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInScopedNamespace.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/classInScopedNamespace.php @@ -0,0 +1,9 @@ +<?php +namespace Foo\BarScoped { + + class TestClass { + + } + +} + diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/closure.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/closure.php @@ -0,0 +1,7 @@ +<?php +$function1 = function($foo, $bar) use ($var) {}; +$function2 = function(Foo $foo, $bar) use ($var) {}; +$function3 = function ($foo, $bar, $baz) {}; +$function4 = function (Foo $foo, $bar, $baz) {}; +$function5 = function () {}; +$function6 = function() {}; diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue19.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue19.php @@ -0,0 +1,3 @@ +<?php +class TestClass { +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue30.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/issue30.php @@ -0,0 +1,8 @@ +<?php +class Foo +{ + public function bar() + { + return Foo::CLASS; + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingBraces.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingBraces.php @@ -0,0 +1,12 @@ +<?php +namespace Foo\Bar; + +class TestClassInBar +{ +} + +namespace Foo\Baz; + +class TestClassInBaz +{ +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingNonBraceSyntax.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/multipleNamespacesWithOneClassUsingNonBraceSyntax.php @@ -0,0 +1,14 @@ +<?php +namespace Foo\Bar +{ + class TestClassInBar + { + } +} + +namespace Foo\Baz +{ + class TestClassInBaz + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source.php @@ -0,0 +1,36 @@ +<?php +/** + * Some comment + */ +class Foo{function foo(){} + + /** + * @param Baz $baz + */ + public function bar(Baz $baz) + { + } + + /** + * @param Foobar $foobar + */ + static public function foobar(Foobar $foobar) + { + } + + public function barfoo(Barfoo $barfoo) + { + } + + /** + * This docblock does not belong to the baz function + */ + + public function baz() + { + } + + public function blaz($x, $y) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source2.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source2.php @@ -0,0 +1,6 @@ +<?php +// short desc +abstract class A { + /* abst meth: */ + public static abstract function method(); +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source3.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source3.php @@ -0,0 +1,14 @@ +<?php +// This file is example#1 +// from http://www.php.net/manual/en/function.get-included-files.php + +include 'test1.php'; +include_once 'test2.php'; +require 'test3.php'; +require_once 'test4.php'; + +$included_files = get_included_files(); + +foreach ($included_files as $filename) { + echo "$filename\n"; +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source4.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source4.php @@ -0,0 +1,30 @@ +<?php +// Declare the interface 'iTemplate' +interface iTemplate +{ + public function setVariable($name, $var); + public function + getHtml($template); +} + +interface a +{ + public function foo(); +} + +interface b extends a +{ + public function baz(Baz $baz); +} + +// short desc for class that implement a unique interface +class c implements b +{ + public function foo() + { + } + + public function baz(Baz $baz) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source5.php b/libs/php-ssh/vendor/phpunit/php-token-stream/Tests/_files/source5.php @@ -0,0 +1,5 @@ +<?php +function foo($a, array $b, array $c = array()) {} +interface i { public function m($a, array $b, array $c = array()); } +abstract class a { abstract public function m($a, array $b, array $c = array()); } +class c { public function m($a, array $b, array $c = array()) {} } diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/build.xml b/libs/php-ssh/vendor/phpunit/php-token-stream/build.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="PHP_TokenStream" default="build"> + <property name="php" value="php"/> + <property name="phpunit" value="phpunit"/> + + <target name="build" + depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/> + + <target name="build-parallel" + depends="prepare,lint,tools-parallel,phpunit,phpcb"/> + + <target name="tools-parallel" + description="Run tools in parallel"> + <parallel threadCount="2"> + <sequential> + <antcall target="pdepend"/> + <antcall target="phpmd-ci"/> + </sequential> + <antcall target="phpcpd"/> + <antcall target="phpcs-ci"/> + <antcall target="phploc"/> + </parallel> + </target> + + <target name="clean" description="Cleanup build artifacts"> + <delete dir="${basedir}/build/api"/> + <delete dir="${basedir}/build/code-browser"/> + <delete dir="${basedir}/build/coverage"/> + <delete dir="${basedir}/build/logs"/> + <delete dir="${basedir}/build/pdepend"/> + </target> + + <target name="prepare" depends="clean,phpab" + description="Prepare for build"> + <mkdir dir="${basedir}/build/api"/> + <mkdir dir="${basedir}/build/code-browser"/> + <mkdir dir="${basedir}/build/coverage"/> + <mkdir dir="${basedir}/build/logs"/> + <mkdir dir="${basedir}/build/pdepend"/> + </target> + + <target name="phpab" description="Generate autoloader scripts"> + <exec executable="phpab"> + <arg value="--output" /> + <arg path="PHP/Token/Stream/Autoload.php" /> + <arg value="--template" /> + <arg path="PHP/Token/Stream/Autoload.php.in" /> + <arg value="--indent" /> + <arg value=" " /> + <arg path="PHP" /> + </exec> + </target> + + <target name="lint"> + <apply executable="${php}" failonerror="true"> + <arg value="-l" /> + + <fileset dir="${basedir}/PHP"> + <include name="**/*.php" /> + <modified /> + </fileset> + + <fileset dir="${basedir}/Tests"> + <include name="**/*.php" /> + <modified /> + </fileset> + </apply> + </target> + + <target name="phploc" description="Measure project size using PHPLOC"> + <exec executable="phploc"> + <arg value="--log-csv" /> + <arg value="${basedir}/build/logs/phploc.csv" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="pdepend" + description="Calculate software metrics using PHP_Depend"> + <exec executable="pdepend"> + <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /> + <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" /> + <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="phpmd" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHP" /> + <arg value="text" /> + <arg value="${basedir}/build/phpmd.xml" /> + </exec> + </target> + + <target name="phpmd-ci" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHP" /> + <arg value="xml" /> + <arg value="${basedir}/build/phpmd.xml" /> + <arg value="--reportfile" /> + <arg value="${basedir}/build/logs/pmd.xml" /> + </exec> + </target> + + <target name="phpcs" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs"> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHP" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcs-ci" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs" output="/dev/null"> + <arg value="--report=checkstyle" /> + <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" /> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHP" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcpd" description="Find duplicate code using PHPCPD"> + <exec executable="phpcpd"> + <arg value="--log-pmd" /> + <arg value="${basedir}/build/logs/pmd-cpd.xml" /> + <arg path="${basedir}/PHP" /> + </exec> + </target> + + <target name="phpunit" description="Run unit tests with PHPUnit"> + <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}"> + <not> + <equals arg1="${phpunit}" arg2="phpunit" /> + </not> + </condition> + + <exec executable="${phpunit_cmd}" failonerror="true"/> + </target> + + <target name="phpcb" + description="Aggregate tool output with PHP_CodeBrowser"> + <exec executable="phpcb"> + <arg value="--log" /> + <arg path="${basedir}/build/logs" /> + <arg value="--source" /> + <arg path="${basedir}/PHP" /> + <arg value="--output" /> + <arg path="${basedir}/build/code-browser" /> + </exec> + </target> +</project> diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php b/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff +{ + public function __construct() + { + parent::__construct(true); + } + + protected function getPatterns() + { + return array( + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + '}EOLelse if (...) {EOL', + '}EOLelse {EOL', + 'do {EOL', + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php b/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_Whitespace_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff +{ + public function register() + { + return array(T_STRING_CONCAT); + } + + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE || + $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + + $phpcsFile->addError( + 'Concatenation operator must be surrounded by whitespace', + $stackPtr + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/ruleset.xml b/libs/php-ssh/vendor/phpunit/php-token-stream/build/PHPCS/ruleset.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<ruleset name="Sebastian"> + <description>Sebastian Bergmann's coding standard</description> + + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> + + <rule ref="Generic.Commenting.Todo"/> + + <rule ref="Generic.ControlStructures.InlineControlStructure"/> + + <rule ref="Generic.Files.LineEndings"/> + + <rule ref="Generic.Formatting.DisallowMultipleStatements"/> + <rule ref="Generic.Formatting.NoSpaceAfterCast"/> + + <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/> + <rule ref="PEAR.Functions.ValidDefaultValue"/> + + <rule ref="Generic.NamingConventions.ConstructorName"/> + <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> + <rule ref="PEAR.NamingConventions.ValidClassName"/> + + <rule ref="Generic.PHP.DisallowShortOpenTag"/> + <rule ref="Generic.PHP.NoSilencedErrors"/> + <rule ref="Generic.PHP.UpperCaseConstant"/> + + <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> + <rule ref="Generic.WhiteSpace.ScopeIndent"/> + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/build/phpmd.xml b/libs/php-ssh/vendor/phpunit/php-token-stream/build/phpmd.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> + +<ruleset name="Sebastian" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description>Sebastian Bergmann's ruleset</description> + + <rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> + <rule ref="rulesets/codesize.xml/NPathComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> + + <rule ref="rulesets/design.xml/EvalExpression" /> + <rule ref="rulesets/design.xml/ExitExpression" /> + <rule ref="rulesets/design.xml/GotoStatement" /> + + <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> + + <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> + <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/composer.json b/libs/php-ssh/vendor/phpunit/php-token-stream/composer.json @@ -0,0 +1,38 @@ +{ + "name": "phpunit/php-token-stream", + "description": "Wrapper around PHP's tokenizer extension.", + "type": "library", + "keywords": [ + "tokenizer" + ], + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3", + "ext-tokenizer": "*" + }, + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "include-path": [ + "" + ], + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/package.xml b/libs/php-ssh/vendor/phpunit/php-token-stream/package.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.4.10" version="2.0" + xmlns="http://pear.php.net/dtd/package-2.0" + xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>PHP_TokenStream</name> + <channel>pear.phpunit.de</channel> + <summary>Wrapper around PHP's tokenizer extension.</summary> + <description>Wrapper around PHP's tokenizer extension.</description> + <lead> + <name>Sebastian Bergmann</name> + <user>sb</user> + <email>sb@sebastian-bergmann.de</email> + <active>yes</active> + </lead> + <date>2014-03-03</date> + <version> + <release>1.2.2</release> + <api>1.2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license>The BSD 3-Clause License</license> + <notes>http://github.com/sebastianbergmann/php-token-stream/tree</notes> + <contents> + <dir name="/"> + <dir name="PHP"> + <dir name="Token"> + <dir name="Stream"> + <file baseinstalldir="/" name="Autoload.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="CachingFactory.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <file baseinstalldir="/" name="Stream.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <file baseinstalldir="/" name="Token.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <file baseinstalldir="/" name="LICENSE" role="doc"/> + <file baseinstalldir="/" name="README.md" role="doc"/> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.3.3</min> + </php> + <pearinstaller> + <min>1.9.4</min> + </pearinstaller> + <extension> + <name>tokenizer</name> + </extension> + </required> + </dependencies> + <phprelease/> +</package> diff --git a/libs/php-ssh/vendor/phpunit/php-token-stream/phpunit.xml.dist b/libs/php-ssh/vendor/phpunit/php-token-stream/phpunit.xml.dist @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + syntaxCheck="false" + bootstrap="PHP/Token/Stream/Autoload.php" + strict="true"> + <testsuites> + <testsuite name="php-token-stream"> + <directory suffix="Test.php">Tests</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-html" target="build/coverage" title="PHP_TokenStream" + charset="UTF-8" yui="true" highlight="true" + lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="build/logs/clover.xml"/> + <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> + </logging> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">PHP</directory> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitattributes b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitignore b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.gitignore @@ -0,0 +1,7 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +cache.properties +phpunit.xml diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.travis.yml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/.travis.yml @@ -0,0 +1,22 @@ +language: php + +php: + - 5.3 + - 5.4 + +before_script: + - mkdir -p vendor + - git clone --branch=3.7 --depth=100 --quiet git://github.com/sebastianbergmann/phpunit.git vendor/phpunit + - git clone --branch=1.2 --depth=100 --quiet git://github.com/sebastianbergmann/php-code-coverage.git vendor/php-code-coverage + - git clone --branch=master --depth=100 --quiet git://github.com/sebastianbergmann/php-text-template.git vendor/php-text-template + - git clone --branch=master --depth=100 --quiet git://github.com/sebastianbergmann/php-token-stream.git vendor/php-token-stream + - git clone --branch=master --depth=100 --quiet git://github.com/sebastianbergmann/php-file-iterator.git vendor/php-file-iterator + - git clone --branch=master --depth=100 --quiet git://github.com/sebastianbergmann/php-timer.git vendor/php-timer + - git clone --branch=master --depth=100 --quiet git://github.com/pear/pear-core.git vendor/pear-core + - git clone --branch=trunk --depth=100 --quiet git://github.com/pear/Console_Getopt.git vendor/console-getopt + +script: php -d include_path=vendor/php-text-template:vendor/php-token-stream:vendor/php-file-iterator:vendor/phpunit:vendor/php-code-coverage:vendor/php-timer:vendor/php-invoker:vendor/pear-core:vendor/console-getopt:vendor:. ./vendor/phpunit/phpunit.php --configuration ./build/travis-ci.xml + +notifications: + email: false + irc: "irc.freenode.org#phpunit" diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/CONTRIBUTING.md b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Pull Requests for bug fixes should be made against the current release branch (1.2). + +Pull Requests for new features should be made against master. + +For further notes please refer to [https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/ChangeLog.markdown b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/ChangeLog.markdown @@ -0,0 +1,27 @@ +PHPUnit_MockObject 1.2 +====================== + +This is the list of changes for the PHPUnit_MockObject 1.2 release series. + +PHPUnit_MockObject 1.2.3 +------------------------ + +* Fixed a bug where getting two mocks with different argument cloning options returned the same mock. + +PHPUnit_MockObject 1.2.2 +------------------------ + +* Fixed #100: Removed the unique mock object ID introduced in version 1.2. + +PHPUnit_MockObject 1.2.1 +------------------------ + +* No changes. + +PHPUnit_MockObject 1.2.0 +------------------------ + +* Implemented #47: Make cloning of arguments passed to mocked methods optional. +* Implemented #84: `getMockFromWsdl()` now works with namespaces. +* Fixed #90: Mocks with a fixed class name could only be created once. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/LICENSE b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/LICENSE @@ -0,0 +1,33 @@ +PHPUnit_MockObject + +Copyright (c) 2002-2013, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php @@ -0,0 +1,100 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2002-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2002-2011 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.1.0 + */ + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + 'phpunit_framework_mockobject_builder_identity' => '/Framework/MockObject/Builder/Identity.php', + 'phpunit_framework_mockobject_builder_invocationmocker' => '/Framework/MockObject/Builder/InvocationMocker.php', + 'phpunit_framework_mockobject_builder_match' => '/Framework/MockObject/Builder/Match.php', + 'phpunit_framework_mockobject_builder_methodnamematch' => '/Framework/MockObject/Builder/MethodNameMatch.php', + 'phpunit_framework_mockobject_builder_namespace' => '/Framework/MockObject/Builder/Namespace.php', + 'phpunit_framework_mockobject_builder_parametersmatch' => '/Framework/MockObject/Builder/ParametersMatch.php', + 'phpunit_framework_mockobject_builder_stub' => '/Framework/MockObject/Builder/Stub.php', + 'phpunit_framework_mockobject_generator' => '/Framework/MockObject/Generator.php', + 'phpunit_framework_mockobject_invocation' => '/Framework/MockObject/Invocation.php', + 'phpunit_framework_mockobject_invocation_object' => '/Framework/MockObject/Invocation/Object.php', + 'phpunit_framework_mockobject_invocation_static' => '/Framework/MockObject/Invocation/Static.php', + 'phpunit_framework_mockobject_invocationmocker' => '/Framework/MockObject/InvocationMocker.php', + 'phpunit_framework_mockobject_invokable' => '/Framework/MockObject/Invokable.php', + 'phpunit_framework_mockobject_matcher' => '/Framework/MockObject/Matcher.php', + 'phpunit_framework_mockobject_matcher_anyinvokedcount' => '/Framework/MockObject/Matcher/AnyInvokedCount.php', + 'phpunit_framework_mockobject_matcher_anyparameters' => '/Framework/MockObject/Matcher/AnyParameters.php', + 'phpunit_framework_mockobject_matcher_invocation' => '/Framework/MockObject/Matcher/Invocation.php', + 'phpunit_framework_mockobject_matcher_invokedatindex' => '/Framework/MockObject/Matcher/InvokedAtIndex.php', + 'phpunit_framework_mockobject_matcher_invokedatleastonce' => '/Framework/MockObject/Matcher/InvokedAtLeastOnce.php', + 'phpunit_framework_mockobject_matcher_invokedcount' => '/Framework/MockObject/Matcher/InvokedCount.php', + 'phpunit_framework_mockobject_matcher_invokedrecorder' => '/Framework/MockObject/Matcher/InvokedRecorder.php', + 'phpunit_framework_mockobject_matcher_methodname' => '/Framework/MockObject/Matcher/MethodName.php', + 'phpunit_framework_mockobject_matcher_parameters' => '/Framework/MockObject/Matcher/Parameters.php', + 'phpunit_framework_mockobject_matcher_statelessinvocation' => '/Framework/MockObject/Matcher/StatelessInvocation.php', + 'phpunit_framework_mockobject_mockbuilder' => '/Framework/MockObject/MockBuilder.php', + 'phpunit_framework_mockobject_mockobject' => '/Framework/MockObject/MockObject.php', + 'phpunit_framework_mockobject_stub' => '/Framework/MockObject/Stub.php', + 'phpunit_framework_mockobject_stub_consecutivecalls' => '/Framework/MockObject/Stub/ConsecutiveCalls.php', + 'phpunit_framework_mockobject_stub_exception' => '/Framework/MockObject/Stub/Exception.php', + 'phpunit_framework_mockobject_stub_matchercollection' => '/Framework/MockObject/Stub/MatcherCollection.php', + 'phpunit_framework_mockobject_stub_return' => '/Framework/MockObject/Stub/Return.php', + 'phpunit_framework_mockobject_stub_returnargument' => '/Framework/MockObject/Stub/ReturnArgument.php', + 'phpunit_framework_mockobject_stub_returncallback' => '/Framework/MockObject/Stub/ReturnCallback.php', + 'phpunit_framework_mockobject_stub_returnself' => '/Framework/MockObject/Stub/ReturnSelf.php', + 'phpunit_framework_mockobject_stub_returnvaluemap' => '/Framework/MockObject/Stub/ReturnValueMap.php', + 'phpunit_framework_mockobject_verifiable' => '/Framework/MockObject/Verifiable.php' + ); + + $path = dirname(dirname(dirname(__FILE__))); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php.in b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php.in @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2002-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2002-2011 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.1.0 + */ + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + + $path = dirname(dirname(dirname(__FILE__))); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Identity.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Identity.php @@ -0,0 +1,70 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder interface for unique identifiers. + * + * Defines the interface for recording unique identifiers. The identifiers + * can be used to define the invocation order of expectations. The expectation + * is recorded using id() and then defined in order using + * PHPUnit_Framework_MockObject_Builder_Match::after(). + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_Identity +{ + /** + * Sets the identification of the expectation to $id. + * + * @note The identifier is unique per mock object. + * @param string $id Unique identifiation of expectation. + */ + public function id($id); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/InvocationMocker.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/InvocationMocker.php @@ -0,0 +1,193 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder for mocked or stubbed invocations. + * + * Provides methods for building expectations without having to resort to + * instantiating the various matchers manually. These methods also form a + * more natural way of reading the expectation. This class should be together + * with the test case PHPUnit_Framework_MockObject_TestCase. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Builder_InvocationMocker implements PHPUnit_Framework_MockObject_Builder_MethodNameMatch +{ + /** + * @var PHPUnit_Framework_MockObject_Stub_MatcherCollection + */ + protected $collection; + + /** + * @var PHPUnit_Framework_MockObject_Matcher + */ + protected $matcher; + + /** + * @param PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher + */ + public function __construct(PHPUnit_Framework_MockObject_Stub_MatcherCollection $collection, PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher) + { + $this->collection = $collection; + $this->matcher = new PHPUnit_Framework_MockObject_Matcher( + $invocationMatcher + ); + + $this->collection->addMatcher($this->matcher); + } + + /** + * @return PHPUnit_Framework_MockObject_Matcher + */ + public function getMatcher() + { + return $this->matcher; + } + + /** + * @param mixed $id + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function id($id) + { + $this->collection->registerId($id, $this); + + return $this; + } + + /** + * @param PHPUnit_Framework_MockObject_Stub $stub + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function will(PHPUnit_Framework_MockObject_Stub $stub) + { + $this->matcher->stub = $stub; + + return $this; + } + + /** + * @param mixed $id + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function after($id) + { + $this->matcher->afterMatchBuilderId = $id; + + return $this; + } + + /** + * @param mixed $argument, ... + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function with() + { + $args = func_get_args(); + + if ($this->matcher->methodNameMatcher === NULL) { + throw new PHPUnit_Framework_Exception( + 'Method name matcher is not defined, cannot define parameter ' . + ' matcher without one' + ); + } + + if ($this->matcher->parametersMatcher !== NULL) { + throw new PHPUnit_Framework_Exception( + 'Parameter matcher is already defined, cannot redefine' + ); + } + + $this->matcher->parametersMatcher = new PHPUnit_Framework_MockObject_Matcher_Parameters($args); + + return $this; + } + + /** + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function withAnyParameters() + { + if ($this->matcher->methodNameMatcher === NULL) { + throw new PHPUnit_Framework_Exception( + 'Method name matcher is not defined, cannot define parameter ' . + 'matcher without one' + ); + } + + if ($this->matcher->parametersMatcher !== NULL) { + throw new PHPUnit_Framework_Exception( + 'Parameter matcher is already defined, cannot redefine' + ); + } + + $this->matcher->parametersMatcher = new PHPUnit_Framework_MockObject_Matcher_AnyParameters; + + return $this; + } + + /** + * @param PHPUnit_Framework_Constraint|string $constraint + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function method($constraint) + { + if ($this->matcher->methodNameMatcher !== NULL) { + throw new PHPUnit_Framework_Exception( + 'Method name matcher is already defined, cannot redefine' + ); + } + + $this->matcher->methodNameMatcher = new PHPUnit_Framework_MockObject_Matcher_MethodName($constraint); + + return $this; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Match.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Match.php @@ -0,0 +1,66 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder interface for invocation order matches. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_Match extends PHPUnit_Framework_MockObject_Builder_Stub +{ + /** + * Defines the expectation which must occur before the current is valid. + * + * @param string $id The identification of the expectation that should + * occur before this one. + * @return PHPUnit_Framework_MockObject_Builder_Stub + */ + public function after($id); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/MethodNameMatch.php @@ -0,0 +1,68 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder interface for matcher of method names. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_MethodNameMatch extends PHPUnit_Framework_MockObject_Builder_ParametersMatch +{ + /** + * Adds a new method name match and returns the parameter match object for + * further matching possibilities. + * + * @param PHPUnit_Framework_Constraint $name + * Constraint for matching method, if a string is passed it will use + * the PHPUnit_Framework_Constraint_IsEqual. + * @return PHPUnit_Framework_MockObject_Builder_ParametersMatch + */ + public function method($name); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Namespace.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Namespace.php @@ -0,0 +1,79 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for builders which can register builders with a given identification. + * + * This interface relates to PHPUnit_Framework_MockObject_Builder_Identity. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_Namespace +{ + /** + * Looks up the match builder with identification $id and returns it. + * + * @param string $id The identifiction of the match builder. + * @return PHPUnit_Framework_MockObject_Builder_Match + */ + public function lookupId($id); + + /** + * Registers the match builder $builder with the identification $id. The + * builder can later be looked up using lookupId() to figure out if it + * has been invoked. + * + * @param string $id + * The identification of the match builder. + * @param PHPUnit_Framework_MockObject_Builder_Match $builder + * The builder which is being registered. + */ + public function registerId($id, PHPUnit_Framework_MockObject_Builder_Match $builder); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/ParametersMatch.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/ParametersMatch.php @@ -0,0 +1,89 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder interface for parameter matchers. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_ParametersMatch extends PHPUnit_Framework_MockObject_Builder_Match +{ + /** + * Sets the parameters to match for, each parameter to this funtion will + * be part of match. To perform specific matches or constraints create a + * new PHPUnit_Framework_Constraint and use it for the parameter. + * If the parameter value is not a constraint it will use the + * PHPUnit_Framework_Constraint_IsEqual for the value. + * + * Some examples: + * <code> + * // match first parameter with value 2 + * $b->with(2); + * // match first parameter with value 'smock' and second identical to 42 + * $b->with('smock', new PHPUnit_Framework_Constraint_IsEqual(42)); + * </code> + * + * @return PHPUnit_Framework_MockObject_Builder_ParametersMatch + */ + public function with(); + + /** + * Sets a matcher which allows any kind of parameters. + * + * Some examples: + * <code> + * // match any number of parameters + * $b->withAnyParamers(); + * </code> + * + * @return PHPUnit_Framework_MockObject_Matcher_AnyParameters + */ + public function withAnyParameters(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Stub.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Builder/Stub.php @@ -0,0 +1,66 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Builder interface for stubs which are actions replacing an invocation. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Builder_Stub extends PHPUnit_Framework_MockObject_Builder_Identity +{ + /** + * Stubs the matching method with the stub object $stub. Any invocations of + * the matched method will now be handled by the stub instead. + * + * @param PHPUnit_Framework_MockObject_Stub $stub The stub object. + * @return PHPUnit_Framework_MockObject_Builder_Identity + */ + public function will(PHPUnit_Framework_MockObject_Stub $stub); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator.php @@ -0,0 +1,808 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Mock Object Code Generator + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Generator +{ + /** + * @var array + */ + protected static $cache = array(); + + /** + * @var array + */ + protected static $blacklistedMethodNames = array( + '__clone' => TRUE, + 'abstract' => TRUE, + 'and' => TRUE, + 'array' => TRUE, + 'as' => TRUE, + 'break' => TRUE, + 'case' => TRUE, + 'catch' => TRUE, + 'class' => TRUE, + 'clone' => TRUE, + 'const' => TRUE, + 'continue' => TRUE, + 'declare' => TRUE, + 'default' => TRUE, + 'die' => TRUE, + 'do' => TRUE, + 'echo' => TRUE, + 'else' => TRUE, + 'elseif' => TRUE, + 'empty' => TRUE, + 'enddeclare' => TRUE, + 'endfor' => TRUE, + 'endforeach' => TRUE, + 'endif' => TRUE, + 'endswitch' => TRUE, + 'endwhile' => TRUE, + 'eval' => TRUE, + 'exit' => TRUE, + 'expects' => TRUE, + 'extends' => TRUE, + 'final' => TRUE, + 'for' => TRUE, + 'foreach' => TRUE, + 'function' => TRUE, + 'global' => TRUE, + 'goto' => TRUE, + 'if' => TRUE, + 'implements' => TRUE, + 'include' => TRUE, + 'include_once' => TRUE, + 'instanceof' => TRUE, + 'interface' => TRUE, + 'isset' => TRUE, + 'list' => TRUE, + 'namespace' => TRUE, + 'new' => TRUE, + 'or' => TRUE, + 'print' => TRUE, + 'private' => TRUE, + 'protected' => TRUE, + 'public' => TRUE, + 'require' => TRUE, + 'require_once' => TRUE, + 'return' => TRUE, + 'static' => TRUE, + 'staticExpects' => TRUE, + 'switch' => TRUE, + 'throw' => TRUE, + 'try' => TRUE, + 'unset' => TRUE, + 'use' => TRUE, + 'var' => TRUE, + 'while' => TRUE, + 'xor' => TRUE + ); + + /** + * @var boolean + */ + protected static $soapLoaded = NULL; + + /** + * Returns a mock object for the specified class. + * + * @param string $originalClassName + * @param array $methods + * @param array $arguments + * @param string $mockClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param boolean $cloneArguments + * @return object + * @throws InvalidArgumentException + * @since Method available since Release 1.0.0 + */ + public static function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = TRUE) + { + if (!is_string($originalClassName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($mockClassName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'string'); + } + + if (!is_array($methods) && !is_null($methods)) { + throw new InvalidArgumentException; + } + + if (NULL !== $methods) { + foreach ($methods as $method) { + if (!preg_match('~[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*~', $method)) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Cannot stub or mock method with invalid name "%s"', + $method + ) + ); + } + } + if ($methods != array_unique($methods)) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Cannot stub or mock using a method list that contains duplicates: "%s"', + implode(', ', $methods) + ) + ); + } + } + + if ($mockClassName != '' && class_exists($mockClassName, FALSE)) { + $reflect = new ReflectionClass($mockClassName); + if (!$reflect->implementsInterface("PHPUnit_Framework_MockObject_MockObject")) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Class "%s" already exists.', + $mockClassName + ) + ); + } + } + + $mock = self::generate( + $originalClassName, + $methods, + $mockClassName, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + + return self::getObject( + $mock['code'], + $mock['mockClassName'], + $originalClassName, + $callOriginalConstructor, + $callAutoload, + $arguments + ); + } + + /** + * @param string $code + * @param string $className + * @param string $originalClassName + * @param string $callOriginalConstructor + * @param string $callAutoload + * @param array $arguments + * @return object + */ + protected static function getObject($code, $className, $originalClassName = '', $callOriginalConstructor = FALSE, $callAutoload = FALSE, array $arguments = array()) + { + if (!class_exists($className, FALSE)) { + eval($code); + } + + if ($callOriginalConstructor && + !interface_exists($originalClassName, $callAutoload)) { + if (count($arguments) == 0) { + $object = new $className; + } else { + $class = new ReflectionClass($className); + $object = $class->newInstanceArgs($arguments); + } + } else { + // Use a trick to create a new object of a class + // without invoking its constructor. + $object = unserialize( + sprintf('O:%d:"%s":0:{}', strlen($className), $className) + ); + } + + return $object; + } + + /** + * Returns a mock object for the specified abstract class with all abstract + * methods of the class mocked. Concrete methods to mock can be specified with + * the last parameter + * + * @param string $originalClassName + * @param array $arguments + * @param string $mockClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param array $mockedMethods + * @param boolean $cloneArguments + * @return object + * @since Method available since Release 1.0.0 + * @throws InvalidArgumentException + */ + public static function getMockForAbstractClass($originalClassName, array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $mockedMethods = array(), $cloneArguments = TRUE) + { + if (!is_string($originalClassName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($mockClassName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'string'); + } + + if (class_exists($originalClassName, $callAutoload) || + interface_exists($originalClassName, $callAutoload)) { + $methods = array(); + $reflector = new ReflectionClass($originalClassName); + + foreach ($reflector->getMethods() as $method) { + if ($method->isAbstract() || in_array($method->getName(), $mockedMethods)) { + $methods[] = $method->getName(); + } + } + + if (empty($methods)) { + $methods = NULL; + } + + return self::getMock( + $originalClassName, + $methods, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + } else { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Class "%s" does not exist.', + $originalClassName + ) + ); + } + } + + /** + * Returns an object for the specified trait. + * + * @param string $traitName + * @param array $arguments + * @param string $traitClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @return object + * @since Method available since Release 1.1.0 + * @throws InvalidArgumentException + */ + public static function getObjectForTrait($traitName, array $arguments = array(), $traitClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE) + { + if (!is_string($traitName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($traitClassName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'string'); + } + + if (!trait_exists($traitName, $callAutoload)) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Trait "%s" does not exist.', + $traitName + ) + ); + } + + $className = self::generateClassName( + $traitName, $traitClassName, 'Trait_' + ); + + $templateDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Generator' . + DIRECTORY_SEPARATOR; + $classTemplate = new Text_Template( + $templateDir . 'trait_class.tpl' + ); + + $classTemplate->setVar( + array( + 'class_name' => $className['className'], + 'trait_name' => $traitName + ) + ); + + return self::getObject( + $classTemplate->render(), + $className['className'] + ); + } + + /** + * @param string $originalClassName + * @param array $methods + * @param string $mockClassName + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param boolean $cloneArguments + * @return array + */ + public static function generate($originalClassName, array $methods = NULL, $mockClassName = '', $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = TRUE) + { + if ($mockClassName == '') { + $key = md5( + $originalClassName . + serialize($methods) . + serialize($callOriginalClone) . + serialize($cloneArguments) + ); + + if (isset(self::$cache[$key])) { + return self::$cache[$key]; + } + } + + $mock = self::generateMock( + $originalClassName, + $methods, + $mockClassName, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + + if (isset($key)) { + self::$cache[$key] = $mock; + } + + return $mock; + } + + /** + * @param string $wsdlFile + * @param string $originalClassName + * @param array $methods + * @param array $options + * @return array + */ + public static function generateClassFromWsdl($wsdlFile, $originalClassName, array $methods = array(), array $options = array()) + { + if (self::$soapLoaded === NULL) { + self::$soapLoaded = extension_loaded('soap'); + } + + if (self::$soapLoaded) { + $client = new SOAPClient($wsdlFile, $options); + $_methods = array_unique($client->__getFunctions()); + unset($client); + + $templateDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . + 'Generator' . DIRECTORY_SEPARATOR; + $methodTemplate = new Text_Template( + $templateDir . 'wsdl_method.tpl' + ); + $methodsBuffer = ''; + + foreach ($_methods as $method) { + $nameStart = strpos($method, ' ') + 1; + $nameEnd = strpos($method, '('); + $name = substr($method, $nameStart, $nameEnd - $nameStart); + + if (empty($methods) || in_array($name, $methods)) { + $args = explode( + ',', + substr( + $method, + $nameEnd + 1, + strpos($method, ')') - $nameEnd - 1 + ) + ); + $numArgs = count($args); + + for ($i = 0; $i < $numArgs; $i++) { + $args[$i] = substr($args[$i], strpos($args[$i], '$')); + } + + $methodTemplate->setVar( + array( + 'method_name' => $name, + 'arguments' => join(', ', $args) + ) + ); + + $methodsBuffer .= $methodTemplate->render(); + } + } + + $optionsBuffer = 'array('; + foreach ($options as $key => $value) { + $optionsBuffer .= $key . ' => ' . $value; + } + + $optionsBuffer .= ')'; + + $classTemplate = new Text_Template( + $templateDir . 'wsdl_class.tpl' + ); + + $namespace = ''; + if(strpos($originalClassName, '\\') !== FALSE) { + $parts = explode('\\', $originalClassName); + $originalClassName = array_pop($parts); + $namespace = 'namespace ' . join('\\', $parts) . ';'; + } + + $classTemplate->setVar( + array( + 'namespace' => $namespace, + 'class_name' => $originalClassName, + 'wsdl' => $wsdlFile, + 'options' => $optionsBuffer, + 'methods' => $methodsBuffer + ) + ); + + return $classTemplate->render(); + } else { + throw new PHPUnit_Framework_Exception( + 'The SOAP extension is required to generate a mock object ' . + 'from WSDL.' + ); + } + } + + /** + * @param string $originalClassName + * @param array|null $methods + * @param string $mockClassName + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param boolean $cloneArguments + * @return array + */ + protected static function generateMock($originalClassName, $methods, $mockClassName, $callOriginalClone, $callAutoload, $cloneArguments = TRUE) + { + $templateDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Generator' . + DIRECTORY_SEPARATOR; + $classTemplate = new Text_Template( + $templateDir . 'mocked_class.tpl' + ); + $cloneTemplate = ''; + $isClass = FALSE; + $isInterface = FALSE; + + $mockClassName = self::generateClassName( + $originalClassName, $mockClassName, 'Mock_' + ); + + if (class_exists($mockClassName['fullClassName'], $callAutoload)) { + $isClass = TRUE; + } else { + if (interface_exists($mockClassName['fullClassName'], $callAutoload)) { + $isInterface = TRUE; + } + } + + if (!class_exists($mockClassName['fullClassName'], $callAutoload) && + !interface_exists($mockClassName['fullClassName'], $callAutoload)) { + $prologue = 'class ' . $mockClassName['originalClassName'] . "\n{\n}\n\n"; + + if (!empty($mockClassName['namespaceName'])) { + $prologue = 'namespace ' . $mockClassName['namespaceName'] . + " {\n\n" . $prologue . "}\n\n" . + "namespace {\n\n"; + + $epilogue = "\n\n}"; + } + + $cloneTemplate = new Text_Template( + $templateDir . 'mocked_clone.tpl' + ); + } else { + $class = new ReflectionClass($mockClassName['fullClassName']); + + if ($class->isFinal()) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Class "%s" is declared "final" and cannot be mocked.', + $mockClassName['fullClassName'] + ) + ); + } + + if ($class->hasMethod('__clone')) { + $cloneMethod = $class->getMethod('__clone'); + + if (!$cloneMethod->isFinal()) { + if ($callOriginalClone && !$isInterface) { + $cloneTemplate = new Text_Template( + $templateDir . 'unmocked_clone.tpl' + ); + } else { + $cloneTemplate = new Text_Template( + $templateDir . 'mocked_clone.tpl' + ); + } + } + } else { + $cloneTemplate = new Text_Template( + $templateDir . 'mocked_clone.tpl' + ); + } + } + + if (is_object($cloneTemplate)) { + $cloneTemplate = $cloneTemplate->render(); + } + + if (is_array($methods) && empty($methods) && + ($isClass || $isInterface)) { + $methods = get_class_methods($mockClassName['fullClassName']); + } + + if (!is_array($methods)) { + $methods = array(); + } + + $mockedMethods = ''; + + if (isset($class)) { + foreach ($methods as $methodName) { + try { + $method = $class->getMethod($methodName); + + if (self::canMockMethod($method)) { + $mockedMethods .= self::generateMockedMethodDefinitionFromExisting( + $templateDir, $method, $cloneArguments + ); + } + } + + catch (ReflectionException $e) { + $mockedMethods .= self::generateMockedMethodDefinition( + $templateDir, $mockClassName['fullClassName'], $methodName, $cloneArguments + ); + } + } + } else { + foreach ($methods as $methodName) { + $mockedMethods .= self::generateMockedMethodDefinition( + $templateDir, $mockClassName['fullClassName'], $methodName, $cloneArguments + ); + } + } + + $classTemplate->setVar( + array( + 'prologue' => isset($prologue) ? $prologue : '', + 'epilogue' => isset($epilogue) ? $epilogue : '', + 'class_declaration' => self::generateMockClassDeclaration( + $mockClassName, $isInterface + ), + 'clone' => $cloneTemplate, + 'mock_class_name' => $mockClassName['className'], + 'mocked_methods' => $mockedMethods + ) + ); + + return array( + 'code' => $classTemplate->render(), + 'mockClassName' => $mockClassName['className'] + ); + } + + /** + * @param string $originalClassName + * @param string $className + * @param string $prefix + * @return array + */ + protected static function generateClassName($originalClassName, $className, $prefix) + { + if ($originalClassName[0] == '\\') { + $originalClassName = substr($originalClassName, 1); + } + + $classNameParts = explode('\\', $originalClassName); + + if (count($classNameParts) > 1) { + $originalClassName = array_pop($classNameParts); + $namespaceName = join('\\', $classNameParts); + $fullClassName = $namespaceName . '\\' . $originalClassName; + } else { + $namespaceName = ''; + $fullClassName = $originalClassName; + } + + if ($className == '') { + do { + $className = $prefix . $originalClassName . '_' . + substr(md5(microtime()), 0, 8); + } + while (class_exists($className, FALSE)); + } + + return array( + 'className' => $className, + 'originalClassName' => $originalClassName, + 'fullClassName' => $fullClassName, + 'namespaceName' => $namespaceName + ); + } + + /** + * @param array $mockClassName + * @param boolean $isInterface + * @return array + */ + protected static function generateMockClassDeclaration(array $mockClassName, $isInterface) + { + $buffer = 'class '; + + if ($isInterface) { + $buffer .= sprintf( + "%s implements PHPUnit_Framework_MockObject_MockObject, %s%s", + $mockClassName['className'], + !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', + $mockClassName['originalClassName'] + ); + } else { + $buffer .= sprintf( + "%s extends %s%s implements PHPUnit_Framework_MockObject_MockObject", + $mockClassName['className'], + !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', + $mockClassName['originalClassName'] + ); + } + + return $buffer; + } + + /** + * @param string $templateDir + * @param ReflectionMethod $method + * @param boolean $cloneArguments + * @return string + */ + protected static function generateMockedMethodDefinitionFromExisting($templateDir, ReflectionMethod $method, $cloneArguments = TRUE) + { + if ($method->isPrivate()) { + $modifier = 'private'; + } + + else if ($method->isProtected()) { + $modifier = 'protected'; + } + + else { + $modifier = 'public'; + } + + if ($method->isStatic()) { + $static = TRUE; + } else { + $static = FALSE; + } + + if ($method->returnsReference()) { + $reference = '&'; + } else { + $reference = ''; + } + + return self::generateMockedMethodDefinition( + $templateDir, + $method->getDeclaringClass()->getName(), + $method->getName(), + $cloneArguments, + $modifier, + PHPUnit_Util_Class::getMethodParameters($method), + PHPUnit_Util_Class::getMethodParameters($method, TRUE), + $reference, + $static + ); + } + + /** + * @param string $templateDir + * @param string $className + * @param string $methodName + * @param boolean $cloneArguments + * @param string $modifier + * @param string $arguments_decl + * @param string $arguments_call + * @param string $reference + * @param boolean $static + * @return string + */ + protected static function generateMockedMethodDefinition($templateDir, $className, $methodName, $cloneArguments = TRUE, $modifier = 'public', $arguments_decl = '', $arguments_call = '', $reference = '', $static = FALSE) + { + if ($static) { + $template = new Text_Template( + $templateDir . 'mocked_static_method.tpl' + ); + } else { + $template = new Text_Template( + $templateDir . 'mocked_object_method.tpl' + ); + } + + $template->setVar( + array( + 'arguments_decl' => $arguments_decl, + 'arguments_call' => $arguments_call, + 'arguments_count' => !empty($arguments_call) ? count(explode(',', $arguments_call)) : 0, + 'class_name' => $className, + 'method_name' => $methodName, + 'modifier' => $modifier, + 'reference' => $reference, + 'clone_arguments' => $cloneArguments ? 'TRUE' : 'FALSE' + ) + ); + + return $template->render(); + } + + /** + * @param ReflectionMethod $method + * @return boolean + */ + protected static function canMockMethod(ReflectionMethod $method) + { + if ($method->isConstructor() || $method->isFinal() || + isset(self::$blacklistedMethodNames[$method->getName()])) { + return FALSE; + } + + return TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_class.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_class.tpl.dist @@ -0,0 +1,52 @@ +{prologue}{class_declaration} +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + +{clone}{mocked_methods} + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +}{epilogue} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_clone.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_clone.tpl.dist @@ -0,0 +1,4 @@ + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_object_method.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_object_method.tpl.dist @@ -0,0 +1,22 @@ + + {modifier} function {reference}{method_name}({arguments_decl}) + { + $arguments = array({arguments_call}); + $count = func_num_args(); + + if ($count > {arguments_count}) { + $_arguments = func_get_args(); + + for ($i = {arguments_count}; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + '{class_name}', '{method_name}', $arguments, $this, {clone_arguments} + ) + ); + + return $result; + } diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_static_method.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/mocked_static_method.tpl.dist @@ -0,0 +1,22 @@ + + {modifier} static function {reference}{method_name}({arguments_decl}) + { + $arguments = array({arguments_call}); + $count = func_num_args(); + + if ($count > {arguments_count}) { + $_arguments = func_get_args(); + + for ($i = {arguments_count}; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = self::__phpunit_getStaticInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Static( + '{class_name}', '{method_name}', $arguments, {clone_arguments} + ) + ); + + return $result; + } diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/trait_class.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/trait_class.tpl.dist @@ -0,0 +1,4 @@ +class {class_name} +{ + use {trait_name}; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/unmocked_clone.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/unmocked_clone.tpl.dist @@ -0,0 +1,5 @@ + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + parent::__clone(); + } diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_class.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_class.tpl.dist @@ -0,0 +1,9 @@ +{namespace} + +class {class_name} extends \SOAPClient +{ + public function __construct($wsdl, array $options) + { + parent::__construct('{wsdl}', $options); + } +{methods}} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_method.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Generator/wsdl_method.tpl.dist @@ -0,0 +1,4 @@ + + public function {method_name}({arguments}) + { + } diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation.php @@ -0,0 +1,58 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for invocations. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Invocation +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Object.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Object.php @@ -0,0 +1,75 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Represents a non-static invocation. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Invocation_Object extends PHPUnit_Framework_MockObject_Invocation_Static +{ + /** + * @var object + */ + public $object; + + /** + * @param string $className + * @param string $methodname + * @param array $parameters + * @param object $object + * @param object $cloneObjects + */ + public function __construct($className, $methodName, array $parameters, $object, $cloneObjects = FALSE) + { + parent::__construct($className, $methodName, $parameters, $cloneObjects); + $this->object = $object; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Static.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invocation/Static.php @@ -0,0 +1,191 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Represents a static invocation. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Invocation_Static implements PHPUnit_Framework_MockObject_Invocation, PHPUnit_Framework_SelfDescribing +{ + /** + * @var array + */ + protected static $uncloneableExtensions = array( + 'mysqli' => TRUE, + 'SQLite' => TRUE, + 'sqlite3' => TRUE, + 'tidy' => TRUE, + 'xmlwriter' => TRUE, + 'xsl' => TRUE + ); + + /** + * @var array + */ + protected static $uncloneableClasses = array( + 'Closure', + 'COMPersistHelper', + 'IteratorIterator', + 'RecursiveIteratorIterator', + 'SplFileObject', + 'PDORow', + 'ZipArchive' + ); + + /** + * @var string + */ + public $className; + + /** + * @var string + */ + public $methodName; + + /** + * @var array + */ + public $parameters; + + /** + * @param string $className + * @param string $methodname + * @param array $parameters + * @param boolean $cloneObjects + */ + public function __construct($className, $methodName, array $parameters, $cloneObjects = FALSE) + { + $this->className = $className; + $this->methodName = $methodName; + $this->parameters = $parameters; + + if (!$cloneObjects) { + return; + } + + foreach ($this->parameters as $key => $value) { + if (is_object($value)) { + $this->parameters[$key] = $this->cloneObject($value); + } + } + } + + /** + * @return string + */ + public function toString() + { + return sprintf( + "%s::%s(%s)", + + $this->className, + $this->methodName, + join( + ', ', + array_map( + array('PHPUnit_Util_Type', 'shortenedExport'), + $this->parameters + ) + ) + ); + } + + /** + * @param object $original + * @return object + */ + protected function cloneObject($original) + { + $cloneable = NULL; + $object = new ReflectionObject($original); + + // Check the blacklist before asking PHP reflection to work around + // https://bugs.php.net/bug.php?id=53967 + if ($object->isInternal() && + isset(self::$uncloneableExtensions[$object->getExtensionName()])) { + $cloneable = FALSE; + } + + if ($cloneable === NULL) { + foreach (self::$uncloneableClasses as $class) { + if ($original instanceof $class) { + $cloneable = FALSE; + break; + } + } + } + + if ($cloneable === NULL && method_exists($object, 'isCloneable')) { + $cloneable = $object->isCloneable(); + } + + if ($cloneable === NULL && $object->hasMethod('__clone')) { + $method = $object->getMethod('__clone'); + $cloneable = $method->isPublic(); + } + + if ($cloneable === NULL) { + $cloneable = TRUE; + } + + if ($cloneable) { + try { + return clone $original; + } + + catch (Exception $e) { + return $original; + } + } else { + return $original; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/InvocationMocker.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/InvocationMocker.php @@ -0,0 +1,201 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Mocker for invocations which are sent from + * PHPUnit_Framework_MockObject_MockObject objects. + * + * Keeps track of all expectations and stubs as well as registering + * identifications for builders. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_InvocationMocker implements PHPUnit_Framework_MockObject_Stub_MatcherCollection, PHPUnit_Framework_MockObject_Invokable, PHPUnit_Framework_MockObject_Builder_Namespace +{ + /** + * @var PHPUnit_Framework_MockObject_Matcher_Invocation[] + */ + protected $matchers = array(); + + /** + * @var PHPUnit_Framework_MockObject_Builder_Match[] + */ + protected $builderMap = array(); + + /** + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher + */ + public function addMatcher(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + $this->matchers[] = $matcher; + } + + /** + * @since Method available since Release 1.1.0 + */ + public function hasMatchers() + { + if (empty($this->matchers)) { + return FALSE; + } + + foreach ($this->matchers as $matcher) { + if (!$matcher instanceof PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount) { + return TRUE; + } + } + + return FALSE; + } + + /** + * @param mixed $id + * @return boolean|null + */ + public function lookupId($id) + { + if (isset($this->builderMap[$id])) { + return $this->builderMap[$id]; + } + + return NULL; + } + + /** + * @param mixed $id + * @param PHPUnit_Framework_MockObject_Builder_Match $builder + * @throws PHPUnit_Framework_Exception + */ + public function registerId($id, PHPUnit_Framework_MockObject_Builder_Match $builder) + { + if (isset($this->builderMap[$id])) { + throw new PHPUnit_Framework_Exception( + 'Match builder with id <' . $id . '> is already registered.' + ); + } + + $this->builderMap[$id] = $builder; + } + + /** + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return new PHPUnit_Framework_MockObject_Builder_InvocationMocker( + $this, $matcher + ); + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return mixed + */ + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $exception = NULL; + $hasReturnValue = FALSE; + + if (strtolower($invocation->methodName) == '__tostring') { + $returnValue = ''; + } else { + $returnValue = NULL; + } + + foreach ($this->matchers as $match) { + try { + if ($match->matches($invocation)) { + $value = $match->invoked($invocation); + + if (!$hasReturnValue) { + $returnValue = $value; + $hasReturnValue = TRUE; + } + } + } + + catch (Exception $e) { + $exception = $e; + } + } + + if ($exception !== NULL) { + throw $exception; + } + + return $returnValue; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + foreach ($this->matchers as $matcher) { + if (!$matcher->matches($invocation)) { + return FALSE; + } + } + + return TRUE; + } + + /** + * @return boolean + */ + public function verify() + { + foreach ($this->matchers as $matcher) { + $matcher->verify(); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invokable.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Invokable.php @@ -0,0 +1,79 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for classes which can be invoked. + * + * The invocation will be taken from a mock object and passed to an object + * of this class. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Invokable extends PHPUnit_Framework_MockObject_Verifiable +{ + /** + * Invokes the invocation object $invocation so that it can be checked for + * expectations or matched against stubs. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * The invocation object passed from mock object. + * @return object + */ + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation); + + /** + * Checks if the invocation matches. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * The invocation object passed from mock object. + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher.php @@ -0,0 +1,308 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Main matcher which defines a full expectation using method, parameter and + * invocation matchers. + * This matcher encapsulates all the other matchers and allows the builder to + * set the specific matchers when the appropriate methods are called (once(), + * where() etc.). + * + * All properties are public so that they can easily be accessed by the builder. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher implements PHPUnit_Framework_MockObject_Matcher_Invocation +{ + /** + * @var PHPUnit_Framework_MockObject_Matcher_Invocation + */ + public $invocationMatcher; + + /** + * @var mixed + */ + public $afterMatchBuilderId = NULL; + + /** + * @var boolean + */ + public $afterMatchBuilderIsInvoked = FALSE; + + /** + * @var PHPUnit_Framework_MockObject_Matcher_MethodName + */ + public $methodNameMatcher = NULL; + + /** + * @var PHPUnit_Framework_MockObject_Matcher_Parameters + */ + public $parametersMatcher = NULL; + + /** + * @var PHPUnit_Framework_MockObject_Stub + */ + public $stub = NULL; + + /** + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher + */ + public function __construct(PHPUnit_Framework_MockObject_Matcher_Invocation $invocationMatcher) + { + $this->invocationMatcher = $invocationMatcher; + } + + /** + * @return string + */ + public function toString() + { + $list = array(); + + if ($this->invocationMatcher !== NULL) { + $list[] = $this->invocationMatcher->toString(); + } + + if ($this->methodNameMatcher !== NULL) { + $list[] = 'where ' . $this->methodNameMatcher->toString(); + } + + if ($this->parametersMatcher !== NULL) { + $list[] = 'and ' . $this->parametersMatcher->toString(); + } + + if ($this->afterMatchBuilderId !== NULL) { + $list[] = 'after ' . $this->afterMatchBuilderId; + } + + if ($this->stub !== NULL) { + $list[] = 'will ' . $this->stub->toString(); + } + + return join(' ', $list); + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return mixed + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) + { + if ($this->invocationMatcher === NULL) { + throw new PHPUnit_Framework_Exception( + 'No invocation matcher is set' + ); + } + + if ($this->methodNameMatcher === NULL) { + throw new PHPUnit_Framework_Exception('No method matcher is set'); + } + + if ($this->afterMatchBuilderId !== NULL) { + $builder = $invocation->object + ->__phpunit_getInvocationMocker() + ->lookupId($this->afterMatchBuilderId); + + if (!$builder) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'No builder found for match builder identification <%s>', + + $this->afterMatchBuilderId + ) + ); + } + + $matcher = $builder->getMatcher(); + + if ($matcher && $matcher->invocationMatcher->hasBeenInvoked()) { + $this->afterMatchBuilderIsInvoked = TRUE; + } + } + + $this->invocationMatcher->invoked($invocation); + + try { + if ( $this->parametersMatcher !== NULL && + !$this->parametersMatcher->matches($invocation)) { + $this->parametersMatcher->verify(); + } + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + "Expectation failed for %s when %s\n%s", + + $this->methodNameMatcher->toString(), + $this->invocationMatcher->toString(), + $e->getMessage() + ), + $e->getComparisonFailure() + ); + } + + if ($this->stub) { + return $this->stub->invoke($invocation); + } + + return NULL; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + if ($this->afterMatchBuilderId !== NULL) { + $builder = $invocation->object + ->__phpunit_getInvocationMocker() + ->lookupId($this->afterMatchBuilderId); + + if (!$builder) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'No builder found for match builder identification <%s>', + + $this->afterMatchBuilderId + ) + ); + } + + $matcher = $builder->getMatcher(); + + if (!$matcher) { + return FALSE; + } + + if (!$matcher->invocationMatcher->hasBeenInvoked()) { + return FALSE; + } + } + + if ($this->invocationMatcher === NULL) { + throw new PHPUnit_Framework_Exception( + 'No invocation matcher is set' + ); + } + + if ($this->methodNameMatcher === NULL) { + throw new PHPUnit_Framework_Exception('No method matcher is set'); + } + + if (!$this->invocationMatcher->matches($invocation)) { + return FALSE; + } + + try { + if (!$this->methodNameMatcher->matches($invocation)) { + return FALSE; + } + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + "Expectation failed for %s when %s\n%s", + + $this->methodNameMatcher->toString(), + $this->invocationMatcher->toString(), + $e->getMessage() + ), + $e->getComparisonFailure() + ); + } + + return TRUE; + } + + /** + * @throws PHPUnit_Framework_Exception + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify() + { + if ($this->invocationMatcher === NULL) { + throw new PHPUnit_Framework_Exception( + 'No invocation matcher is set' + ); + } + + if ($this->methodNameMatcher === NULL) { + throw new PHPUnit_Framework_Exception('No method matcher is set'); + } + + try { + $this->invocationMatcher->verify(); + + if ($this->parametersMatcher === NULL) { + $this->parametersMatcher = new PHPUnit_Framework_MockObject_Matcher_AnyParameters; + } + + $invocationIsAny = get_class($this->invocationMatcher) === 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount'; + if (!$invocationIsAny) { + $this->parametersMatcher->verify(); + } + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + "Expectation failed for %s when %s.\n%s", + + $this->methodNameMatcher->toString(), + $this->invocationMatcher->toString(), + $e->getMessage() + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyInvokedCount.php @@ -0,0 +1,72 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which checks if a method has been invoked zero or more + * times. This matcher will always match. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder +{ + /** + * @return string + */ + public function toString() + { + return 'invoked zero or more times'; + } + + /** + */ + public function verify() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyParameters.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/AnyParameters.php @@ -0,0 +1,74 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which allos any parameters to a method. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_AnyParameters extends PHPUnit_Framework_MockObject_Matcher_StatelessInvocation +{ + /** + * @return string + */ + public function toString() + { + return 'with any parameters'; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + return TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Invocation.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Invocation.php @@ -0,0 +1,88 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for classes which matches an invocation based on its + * method name, argument, order or call count. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Matcher_Invocation extends PHPUnit_Framework_SelfDescribing, PHPUnit_Framework_MockObject_Verifiable +{ + /** + * Registers the invocation $invocation in the object as being invoked. + * This will only occur after matches() returns true which means the + * current invocation is the correct one. + * + * The matcher can store information from the invocation which can later + * be checked in verify(), or it can check the values directly and throw + * and exception if an expectation is not met. + * + * If the matcher is a stub it will also have a return value. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * Object containing information on a mocked or stubbed method which + * was invoked. + * @return mixed + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation); + + /** + * Checks if the invocation $invocation matches the current rules. If it does + * the matcher will get the invoked() method called which should check if an + * expectation is met. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * Object containing information on a mocked or stubbed method which + * was invoked. + * @return bool + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php @@ -0,0 +1,127 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which checks if a method was invoked at a certain index. + * + * If the expected index number does not match the current invocation index it + * will not match which means it skips all method and parameter matching. Only + * once the index is reached will the method and parameter start matching and + * verifying. + * + * If the index is never reached it will throw an exception in index. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex implements PHPUnit_Framework_MockObject_Matcher_Invocation +{ + /** + * @var integer + */ + protected $sequenceIndex; + + /** + * @var integer + */ + protected $currentIndex = -1; + + /** + * @param integer $sequenceIndex + */ + public function __construct($sequenceIndex) + { + $this->sequenceIndex = $sequenceIndex; + } + + /** + * @return string + */ + public function toString() + { + return 'invoked at sequence index ' . $this->sequenceIndex; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $this->currentIndex++; + + return $this->currentIndex == $this->sequenceIndex; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) + { + } + + /** + * Verifies that the current expectation is valid. If everything is OK the + * code should just return, if not it must throw an exception. + * + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify() + { + if ($this->currentIndex < $this->sequenceIndex) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + 'The expected invocation at index %s was never reached.', + + $this->sequenceIndex + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php @@ -0,0 +1,85 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which checks if a method has been invoked at least one + * time. + * + * If the number of invocations is 0 it will throw an exception in verify. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder +{ + /** + * @return string + */ + public function toString() + { + return 'invoked at least once'; + } + + /** + * Verifies that the current expectation is valid. If everything is OK the + * code should just return, if not it must throw an exception. + * + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify() + { + $count = $this->getInvocationCount(); + + if ($count < 1) { + throw new PHPUnit_Framework_ExpectationFailedException( + 'Expected invocation at least once but it never occured.' + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedCount.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedCount.php @@ -0,0 +1,143 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which checks if a method has been invoked a certain amount + * of times. + * If the number of invocations exceeds the value it will immediately throw an + * exception, + * If the number is less it will later be checked in verify() and also throw an + * exception. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_InvokedCount extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder +{ + /** + * @var integer + */ + protected $expectedCount; + + /** + * @param interger $expectedCount + */ + public function __construct($expectedCount) + { + $this->expectedCount = $expectedCount; + } + + /** + * @return string + */ + public function toString() + { + return 'invoked ' . $this->expectedCount . ' time(s)'; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) + { + parent::invoked($invocation); + + $count = $this->getInvocationCount(); + + if ($count > $this->expectedCount) { + $message = $invocation->toString() . ' '; + + switch ($this->expectedCount) { + case 0: { + $message .= 'was not expected to be called.'; + } + break; + + case 1: { + $message .= 'was not expected to be called more than once.'; + } + break; + + default: { + $message .= sprintf( + 'was not expected to be called more than %d times.', + + $this->expectedCount + ); + } + } + + throw new PHPUnit_Framework_ExpectationFailedException($message); + } + } + + /** + * Verifies that the current expectation is valid. If everything is OK the + * code should just return, if not it must throw an exception. + * + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify() + { + $count = $this->getInvocationCount(); + + if ($count !== $this->expectedCount) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + 'Method was expected to be called %d times, ' . + 'actually called %d times.', + + $this->expectedCount, + $count + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/InvokedRecorder.php @@ -0,0 +1,107 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Records invocations and provides convenience methods for checking them later + * on. + * This abstract class can be implemented by matchers which needs to check the + * number of times an invocation has occured. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + * @abstract + */ +abstract class PHPUnit_Framework_MockObject_Matcher_InvokedRecorder implements PHPUnit_Framework_MockObject_Matcher_Invocation +{ + /** + * @var PHPUnit_Framework_MockObject_Invocation[] + */ + protected $invocations = array(); + + /** + * @return integer + */ + public function getInvocationCount() + { + return count($this->invocations); + } + + /** + * @return PHPUnit_Framework_MockObject_Invocation[] + */ + public function getInvocations() + { + return $this->invocations; + } + + /** + * @return boolean + */ + public function hasBeenInvoked() + { + return count($this->invocations) > 0; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $this->invocations[] = $invocation; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + return TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php @@ -0,0 +1,102 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which looks for a specific method name in the invocations. + * + * Checks the method name all incoming invocations, the name is checked against + * the defined constraint $constraint. If the constraint is met it will return + * true in matches(). + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_MethodName extends PHPUnit_Framework_MockObject_Matcher_StatelessInvocation +{ + /** + * @var PHPUnit_Framework_Constraint + */ + protected $constraint; + + /** + * @param PHPUnit_Framework_Constraint|string + * @throws PHPUnit_Framework_Constraint + */ + public function __construct($constraint) + { + if (!$constraint instanceof PHPUnit_Framework_Constraint) { + if (!is_string($constraint)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_IsEqual( + $constraint, 0, 10, FALSE, TRUE + ); + } + + $this->constraint = $constraint; + } + + /** + * @return string + */ + public function toString() + { + return 'method name ' . $this->constraint->toString(); + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + return $this->constraint->evaluate($invocation->methodName, '', TRUE); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Parameters.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/Parameters.php @@ -0,0 +1,160 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which looks for specific parameters in the invocations. + * + * Checks the parameters of all incoming invocations, the parameter list is + * checked against the defined constraints in $parameters. If the constraint + * is met it will return true in matches(). + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Matcher_Parameters extends PHPUnit_Framework_MockObject_Matcher_StatelessInvocation +{ + /** + * @var array + */ + protected $parameters = array(); + + /** + * @var PHPUnit_Framework_MockObject_Invocation + */ + protected $invocation; + + /** + * @param array $parameters + */ + public function __construct(array $parameters) + { + foreach ($parameters as $parameter) { + if (!($parameter instanceof PHPUnit_Framework_Constraint)) { + $parameter = new PHPUnit_Framework_Constraint_IsEqual( + $parameter + ); + } + + $this->parameters[] = $parameter; + } + } + + /** + * @return string + */ + public function toString() + { + $text = 'with parameter'; + + foreach ($this->parameters as $index => $parameter) { + if ($index > 0) { + $text .= ' and'; + } + + $text .= ' ' . $index . ' ' . $parameter->toString(); + } + + return $text; + } + + /** + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * @return boolean + */ + public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $this->invocation = $invocation; + $this->verify(); + + return count($invocation->parameters) < count($this->parameters); + } + + /** + * Checks if the invocation $invocation matches the current rules. If it + * does the matcher will get the invoked() method called which should check + * if an expectation is met. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * Object containing information on a mocked or stubbed method which + * was invoked. + * @return bool + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify() + { + if ($this->invocation === NULL) { + throw new PHPUnit_Framework_ExpectationFailedException( + 'Mocked method does not exist.' + ); + } + + if (count($this->invocation->parameters) < count($this->parameters)) { + throw new PHPUnit_Framework_ExpectationFailedException( + sprintf( + 'Parameter count for invocation %s is too low.', + + $this->invocation->toString() + ) + ); + } + + foreach ($this->parameters as $i => $parameter) { + $parameter->evaluate( + $this->invocation->parameters[$i], + sprintf( + 'Parameter %s for invocation %s does not match expected ' . + 'value.', + + $i, + $this->invocation->toString() + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/StatelessInvocation.php @@ -0,0 +1,96 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Invocation matcher which does not care about previous state from earlier + * invocations. + * + * This abstract class can be implemented by matchers which does not care about + * state but only the current run-time value of the invocation itself. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + * @abstract + */ +abstract class PHPUnit_Framework_MockObject_Matcher_StatelessInvocation implements PHPUnit_Framework_MockObject_Matcher_Invocation +{ + /** + * Registers the invocation $invocation in the object as being invoked. + * This will only occur after matches() returns true which means the + * current invocation is the correct one. + * + * The matcher can store information from the invocation which can later + * be checked in verify(), or it can check the values directly and throw + * and exception if an expectation is not met. + * + * If the matcher is a stub it will also have a return value. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * Object containing information on a mocked or stubbed method which + * was invoked. + * @return mixed + */ + public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) + { + } + + /** + * Checks if the invocation $invocation matches the current rules. If it does + * the matcher will get the invoked() method called which should check if an + * expectation is met. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * Object containing information on a mocked or stubbed method which + * was invoked. + * @return bool + */ + public function verify() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockBuilder.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockBuilder.php @@ -0,0 +1,291 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Giorgio Sironi <piccoloprincipeazzurro@gmail.com> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Implementation of the Builder pattern for Mock objects. + * + * @package PHPUnit_MockObject + * @author Giorgio Sironi <piccoloprincipeazzurro@gmail.com> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_MockBuilder +{ + /** + * @var PHPUnit_Framework_TestCase + */ + protected $testCase; + + /** + * @var string + */ + protected $className; + + /** + * @var array + */ + protected $methods = array(); + + /** + * @var string + */ + protected $mockClassName = ''; + + /** + * @var array + */ + protected $constructorArgs = array(); + + /** + * @var boolean + */ + protected $originalConstructor = TRUE; + + /** + * @var boolean + */ + protected $originalClone = TRUE; + + /** + * @var boolean + */ + protected $autoload = TRUE; + + /** + * @var boolean + */ + protected $cloneArguments = FALSE; + + /** + * @param PHPUnit_Framework_TestCase + * @param string + */ + public function __construct(PHPUnit_Framework_TestCase $testCase, $className) + { + $this->testCase = $testCase; + $this->className = $className; + } + + /** + * Creates a mock object using a fluent interface. + * + * @return PHPUnit_Framework_MockObject_MockObject + */ + public function getMock() + { + return $this->testCase->getMock( + $this->className, + $this->methods, + $this->constructorArgs, + $this->mockClassName, + $this->originalConstructor, + $this->originalClone, + $this->autoload, + $this->cloneArguments + ); + } + + /** + * Creates a mock object for an abstract class using a fluent interface. + * + * @return PHPUnit_Framework_MockObject_MockObject + */ + public function getMockForAbstractClass() + { + return $this->testCase->getMockForAbstractClass( + $this->className, + $this->constructorArgs, + $this->mockClassName, + $this->originalConstructor, + $this->originalClone, + $this->autoload, + $this->methods, + $this->cloneArguments + ); + } + + /** + * Specifies the subset of methods to mock. Default is to mock all of them. + * + * @param array|null $methods + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function setMethods($methods) + { + $this->methods = $methods; + + return $this; + } + + /** + * Specifies the arguments for the constructor. + * + * @param array $args + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function setConstructorArgs(array $args) + { + $this->constructorArgs = $args; + + return $this; + } + + /** + * Specifies the name for the mock class. + * + * @param string $name + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function setMockClassName($name) + { + $this->mockClassName = $name; + + return $this; + } + + /** + * Disables the invocation of the original constructor. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function disableOriginalConstructor() + { + $this->originalConstructor = FALSE; + + return $this; + } + + /** + * Enables the invocation of the original constructor. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 1.2.0 + */ + public function enableOriginalConstructor() + { + $this->originalConstructor = TRUE; + + return $this; + } + + /** + * Disables the invocation of the original clone constructor. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function disableOriginalClone() + { + $this->originalClone = FALSE; + + return $this; + } + + /** + * Enables the invocation of the original clone constructor. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 1.2.0 + */ + public function enableOriginalClone() + { + $this->originalClone = TRUE; + + return $this; + } + + /** + * Disables the use of class autoloading while creating the mock object. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + */ + public function disableAutoload() + { + $this->autoload = FALSE; + + return $this; + } + + /** + * Enables the use of class autoloading while creating the mock object. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 1.2.0 + */ + public function enableAutoload() + { + $this->autoload = TRUE; + + return $this; + } + + /** + * Disables the cloning of arguments passed to mocked methods. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 1.2.0 + */ + public function disableArgumentCloning() + { + $this->cloneArguments = FALSE; + + return $this; + } + + /** + * Enables the cloning of arguments passed to mocked methods. + * + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 1.2.0 + */ + public function enableArgumentCloning() + { + $this->cloneArguments = TRUE; + + return $this; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockObject.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/MockObject.php @@ -0,0 +1,94 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for all mock objects which are generated by + * PHPUnit_Framework_MockObject_Mock. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_MockObject /*extends PHPUnit_Framework_MockObject_Verifiable*/ +{ + /** + * Registers a new expectation in the mock object and returns the match + * object which can be infused with further details. + * + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher); + + /** + * Registers a new static expectation in the mock object and returns the + * match object which can be infused with further details. + * + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher + * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker + */ + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher); + + /** + * @return PHPUnit_Framework_MockObject_InvocationMocker + */ + public function __phpunit_getInvocationMocker(); + + /** + * @return PHPUnit_Framework_MockObject_InvocationMocker + */ + public static function __phpunit_getStaticInvocationMocker(); + + /** + * Verifies that the current expectation is valid. If everything is OK the + * code should just return, if not it must throw an exception. + * + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function __phpunit_verify(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub.php @@ -0,0 +1,71 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * An object that stubs the process of a normal method for a mock object. + * + * The stub object will replace the code for the stubbed method and return a + * specific value instead of the original value. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Stub extends PHPUnit_Framework_SelfDescribing +{ + /** + * Fakes the processing of the invocation $invocation by returning a + * specific value. + * + * @param PHPUnit_Framework_MockObject_Invocation $invocation + * The invocation which was mocked and matched by the current method + * and argument matchers. + * @return mixed + */ + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php @@ -0,0 +1,87 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Patrick Müller <elias0@gmx.net> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Stubs a method by returning a user-defined stack of values. + * + * @package PHPUnit_MockObject + * @author Patrick Müller <elias0@gmx.net> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls implements PHPUnit_Framework_MockObject_Stub +{ + protected $stack; + protected $value; + + public function __construct($stack) + { + $this->stack = $stack; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $this->value = array_shift($this->stack); + + if ($this->value instanceof PHPUnit_Framework_MockObject_Stub) { + $this->value = $this->value->invoke($invocation); + } + + return $this->value; + } + + public function toString() + { + return sprintf( + 'return user-specified value %s', + + PHPUnit_Util_Type::toString($this->value) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Exception.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Exception.php @@ -0,0 +1,80 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Oliver Schlicht <o.schlicht@bitExpert.de> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Stubs a method by raising a user-defined exception. + * + * @package PHPUnit_MockObject + * @author Oliver Schlicht <o.schlicht@bitExpert.de> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Stub_Exception implements PHPUnit_Framework_MockObject_Stub +{ + protected $exception; + + public function __construct(Exception $exception) + { + $this->exception = $exception; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + throw $this->exception; + } + + public function toString() + { + return sprintf( + 'raise user-specified exception %s', + + PHPUnit_Util_Type::toString($this->exception) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/MatcherCollection.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/MatcherCollection.php @@ -0,0 +1,66 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Stubs a method by returning a user-defined value. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Stub_MatcherCollection +{ + /** + * Adds a new matcher to the collection which can be used as an expectation + * or a stub. + * + * @param PHPUnit_Framework_MockObject_Matcher_Invocation $matcher + * Matcher for invocations to mock objects. + */ + public function addMatcher(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Return.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/Return.php @@ -0,0 +1,78 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Stubs a method by returning a user-defined value. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Stub_Return implements PHPUnit_Framework_MockObject_Stub +{ + protected $value; + + public function __construct($value) + { + $this->value = $value; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + return $this->value; + } + + public function toString() + { + return sprintf( + 'return user-specified value %s', + + PHPUnit_Util_Type::toString($this->value) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnArgument.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnArgument.php @@ -0,0 +1,78 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Stubs a method by returning an argument that was passed to the mocked method. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Stub_ReturnArgument extends PHPUnit_Framework_MockObject_Stub_Return +{ + protected $argumentIndex; + + public function __construct($argumentIndex) + { + $this->argumentIndex = $argumentIndex; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + if (isset($invocation->parameters[$this->argumentIndex])) { + return $invocation->parameters[$this->argumentIndex]; + } else { + return NULL; + } + } + + public function toString() + { + return sprintf('return argument #%d', $this->argumentIndex); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnCallback.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnCallback.php @@ -0,0 +1,94 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.0.0 + */ +class PHPUnit_Framework_MockObject_Stub_ReturnCallback implements PHPUnit_Framework_MockObject_Stub +{ + protected $callback; + + public function __construct($callback) + { + $this->callback = $callback; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + return call_user_func_array($this->callback, $invocation->parameters); + } + + public function toString() + { + if (is_array($this->callback)) { + if (is_object($this->callback[0])) { + $class = get_class($this->callback[0]); + $type = '->'; + } else { + $class = $this->callback[0]; + $type = '::'; + } + + return sprintf( + 'return result of user defined callback %s%s%s() with the ' . + 'passed arguments', + + $class, + $type, + $this->callback[1] + ); + } else { + return 'return result of user defined callback ' . $this->callback . + ' with the passed arguments'; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnSelf.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnSelf.php @@ -0,0 +1,76 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @author Kris Wallsmith <kris.wallsmith@gmail.com> + * @copyright 2010 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.1.0 + */ + +/** + * Stubs a method by returning the current object. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @author Kris Wallsmith <kris.wallsmith@gmail.com> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.1.0 + */ +class PHPUnit_Framework_MockObject_Stub_ReturnSelf implements PHPUnit_Framework_MockObject_Stub +{ + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + if (!$invocation instanceof PHPUnit_Framework_MockObject_Invocation_Object) { + throw new PHPUnit_Framework_Exception( + 'The current object can only be returned when mocking an ' . + 'object, not a static class.' + ); + } + + return $invocation->object; + } + + public function toString() + { + return 'return the current object'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnValueMap.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ReturnValueMap.php @@ -0,0 +1,87 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.1.0 + */ + +/** + * Stubs a method by returning a value from a map. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Class available since Release 1.1.0 + */ +class PHPUnit_Framework_MockObject_Stub_ReturnValueMap implements PHPUnit_Framework_MockObject_Stub +{ + protected $valueMap; + + public function __construct(array $valueMap) + { + $this->valueMap = $valueMap; + } + + public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) + { + $parameterCount = count($invocation->parameters); + + foreach ($this->valueMap as $map) { + if (!is_array($map) || $parameterCount != count($map) - 1) { + continue; + } + + $return = array_pop($map); + if ($invocation->parameters === $map) { + return $return; + } + } + + return NULL; + } + + public function toString() + { + return 'return value from a map'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Verifiable.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Verifiable.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +/** + * Interface for classes which must verify a given expectation. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since Interface available since Release 1.0.0 + */ +interface PHPUnit_Framework_MockObject_Verifiable +{ + /** + * Verifies that the current expectation is valid. If everything is OK the + * code should just return, if not it must throw an exception. + * + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function verify(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/GeneratorTest.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/GeneratorTest.php @@ -0,0 +1,79 @@ +<?php +class Framework_MockObject_GeneratorTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMock + * @expectedException PHPUnit_Framework_Exception + */ + public function testGetMockFailsWhenInvalidFunctionNameIsPassedInAsAFunctionToMock() + { + PHPUnit_Framework_MockObject_Generator::getMock('StdClass', array(0)); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMock + */ + public function testGetMockCanCreateNonExistingFunctions() + { + $mock = PHPUnit_Framework_MockObject_Generator::getMock('StdClass', array('testFunction')); + $this->assertTrue(method_exists($mock, 'testFunction')); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMock + * @expectedException PHPUnit_Framework_Exception + * @expectedExceptionMessage duplicates: "foo, foo" + */ + public function testGetMockGeneratorFails() + { + $mock = PHPUnit_Framework_MockObject_Generator::getMock('StdClass', array('foo', 'foo')); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass + */ + public function testGetMockForAbstractClassDoesNotFailWhenFakingInterfaces() + { + $mock = PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass('Countable'); + $this->assertTrue(method_exists($mock, 'count')); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass + */ + public function testGetMockForAbstractClassStubbingAbstractClass() + { + $mock = PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass('AbstractMockTestClass'); + $this->assertTrue(method_exists($mock, 'doSomething')); + } + + /** + * @dataProvider getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider + * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass + * @expectedException PHPUnit_Framework_Exception + */ + public function testGetMockForAbstractClassExpectingInvalidArgumentException($className, $mockClassName) + { + $mock = PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass($className, array(), $mockClassName); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass + * @expectedException PHPUnit_Framework_Exception + */ + public function testGetMockForAbstractClassAnstractClassDoesNotExist() + { + $mock = PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass('Tux'); + } + + /** + * Dataprovider for test "testGetMockForAbstractClassExpectingInvalidArgumentException" + */ + public static function getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider() + { + return array( + 'className not a string' => array(array(), ''), + 'mockClassName not a string' => array('Countable', new StdClass), + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockBuilderTest.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockBuilderTest.php @@ -0,0 +1,152 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Giorgio Sironi <piccoloprincipeazzurro@gmail.com> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; + +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Mockable.php'; + +/** + * @package PHPUnit_MockObject + * @author Giorgio Sironi <piccoloprincipeazzurro@gmail.com> + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://github.com/sebastianbergmann/phpunit-mock-objects + * @since File available since Release 1.0.0 + */ +class Framework_MockBuilderTest extends PHPUnit_Framework_TestCase +{ + public function testMockBuilderRequiresClassName() + { + $spec = $this->getMockBuilder('Mockable'); + $mock = $spec->getMock(); + $this->assertTrue($mock instanceof Mockable); + } + + public function testByDefaultMocksAllMethods() + { + $spec = $this->getMockBuilder('Mockable'); + $mock = $spec->getMock(); + $this->assertNull($mock->mockableMethod()); + $this->assertNull($mock->anotherMockableMethod()); + } + + public function testMethodsToMockCanBeSpecified() + { + $spec = $this->getMockBuilder('Mockable'); + $spec->setMethods(array('mockableMethod')); + $mock = $spec->getMock(); + $this->assertNull($mock->mockableMethod()); + $this->assertTrue($mock->anotherMockableMethod()); + } + + public function testByDefaultDoesNotPassArgumentsToTheConstructor() + { + $spec = $this->getMockBuilder('Mockable'); + $mock = $spec->getMock(); + $this->assertEquals(array(NULL, NULL), $mock->constructorArgs); + } + + public function testMockClassNameCanBeSpecified() + { + $spec = $this->getMockBuilder('Mockable'); + $spec->setMockClassName('ACustomClassName'); + $mock = $spec->getMock(); + $this->assertTrue($mock instanceof ACustomClassName); + } + + public function testConstructorArgumentsCanBeSpecified() + { + $spec = $this->getMockBuilder('Mockable'); + $spec->setConstructorArgs($expected = array(23, 42)); + $mock = $spec->getMock(); + $this->assertEquals($expected, $mock->constructorArgs); + } + + public function testOriginalConstructorCanBeDisabled() + { + $spec = $this->getMockBuilder('Mockable'); + $spec->disableOriginalConstructor(); + $mock = $spec->getMock(); + $this->assertNull($mock->constructorArgs); + } + + public function testByDefaultOriginalCloneIsPreserved() + { + $spec = $this->getMockBuilder('Mockable'); + $mock = $spec->getMock(); + $cloned = clone $mock; + $this->assertTrue($cloned->cloned); + } + + public function testOriginalCloneCanBeDisabled() + { + $spec = $this->getMockBuilder('Mockable'); + $spec->disableOriginalClone(); + $mock = $spec->getMock(); + $mock->cloned = FALSE; + $cloned = clone $mock; + $this->assertFalse($cloned->cloned); + } + + public function testCallingAutoloadCanBeDisabled() + { + // it is not clear to me how to test this nor the difference + // between calling it or not + $this->markTestIncomplete(); + } + + public function testProvidesAFluentInterface() + { + $spec = $this->getMockBuilder('Mockable') + ->setMethods(array('mockableMethod')) + ->setConstructorArgs(array()) + ->setMockClassName('DummyClassName') + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableAutoload(); + $this->assertTrue($spec instanceof PHPUnit_Framework_MockObject_MockBuilder); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/ObjectTest.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/ObjectTest.php @@ -0,0 +1,82 @@ +<?php + +class Framework_MockObject_Invocation_ObjectTest extends PHPUnit_Framework_TestCase +{ + public function testConstructorRequiresClassAndMethodAndParametersAndObject() + { + new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + array('an_argument'), + new StdClass); + } + + public function testAllowToGetClassNameSetInConstructor() + { + $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + array('an_argument'), + new StdClass); + + $this->assertSame('FooClass', $invocation->className); + } + + public function testAllowToGetMethodNameSetInConstructor() + { + $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + array('an_argument'), + new StdClass); + + $this->assertSame('FooMethod', $invocation->methodName); + } + + public function testAllowToGetObjectSetInConstructor() + { + $expectedObject = new StdClass; + + $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + array('an_argument'), + $expectedObject); + + $this->assertSame($expectedObject, $invocation->object); + } + + public function testAllowToGetMethodParametersSetInConstructor() + { + $expectedParameters = array( + 'foo', 5, array('a', 'b'), new StdClass, NULL, FALSE + ); + + $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + $expectedParameters, + new StdClass + ); + + $this->assertSame($expectedParameters, $invocation->parameters); + } + + public function testConstructorAllowToSetFlagCloneObjectsInParameters() + { + $parameters = array(new StdClass); + $cloneObjects = TRUE; + + $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( + 'FooClass', + 'FooMethod', + $parameters, + new StdClass, + $cloneObjects + ); + + $this->assertEquals($parameters, $invocation->parameters); + $this->assertNotSame($parameters, $invocation->parameters); + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/StaticTest.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/Invocation/StaticTest.php @@ -0,0 +1,52 @@ +<?php + +class Framework_MockObject_Invocation_StaticTest extends PHPUnit_Framework_TestCase +{ + public function testConstructorRequiresClassAndMethodAndParameters() + { + new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument')); + } + + public function testAllowToGetClassNameSetInConstructor() + { + $invocation = new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument')); + + $this->assertSame('FooClass', $invocation->className); + } + + public function testAllowToGetMethodNameSetInConstructor() + { + $invocation = new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument')); + + $this->assertSame('FooMethod', $invocation->methodName); + } + + public function testAllowToGetMethodParametersSetInConstructor() + { + $expectedParameters = array( + 'foo', 5, array('a', 'b'), new StdClass, NULL, FALSE + ); + + $invocation = new PHPUnit_Framework_MockObject_Invocation_Static( + 'FooClass', 'FooMethod', $expectedParameters + ); + + $this->assertSame($expectedParameters, $invocation->parameters); + } + + public function testConstructorAllowToSetFlagCloneObjectsInParameters() + { + $parameters = array(new StdClass); + $cloneObjects = TRUE; + + $invocation = new PHPUnit_Framework_MockObject_Invocation_Static( + 'FooClass', + 'FooMethod', + $parameters, + $cloneObjects + ); + + $this->assertEquals($parameters, $invocation->parameters); + $this->assertNotSame($parameters, $invocation->parameters); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class.phpt @@ -0,0 +1,128 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +class Foo +{ + public function bar(Foo $foo) + { + } + + public function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function baz(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'baz', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_clone.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_clone.phpt @@ -0,0 +1,82 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +class Foo +{ + public function __clone() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + parent::__clone(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_call_parent_constructor.phpt @@ -0,0 +1,81 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +class Foo +{ + public function __construct() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_clone.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_clone.phpt @@ -0,0 +1,81 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', FALSE) +--FILE-- +<?php +class Foo +{ + public function __clone() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + FALSE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_dont_call_parent_constructor.phpt @@ -0,0 +1,81 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +class Foo +{ + public function __construct() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_call_parent_constructor.phpt @@ -0,0 +1,86 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +interface IFoo +{ + public function __construct($bar); +} + +class Foo implements IFoo +{ + public function __construct($bar) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_dont_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_implementing_interface_dont_call_parent_constructor.phpt @@ -0,0 +1,86 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +interface IFoo +{ + public function __construct($bar); +} + +class Foo implements IFoo +{ + public function __construct($bar) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_partial.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/class_partial.phpt @@ -0,0 +1,107 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array('bar'), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +class Foo +{ + public function bar(Foo $foo) + { + } + + public function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array('bar'), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/interface.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/interface.phpt @@ -0,0 +1,101 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +interface Foo +{ + public function bar(Foo $foo); +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo implements PHPUnit_Framework_MockObject_MockObject, Foo +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_object_clone_object.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_object_clone_object.phpt @@ -0,0 +1,130 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE, TRUE) +--FILE-- +<?php +class Foo +{ + public function bar(Foo $foo) + { + } + + public function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE, + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function baz(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'Foo', 'baz', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_static_clone_object.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/invocation_static_clone_object.phpt @@ -0,0 +1,130 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE, TRUE) +--FILE-- +<?php +class Foo +{ + public static function bar(Foo $foo) + { + } + + public static function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE, + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public static function bar(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = self::__phpunit_getStaticInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Static( + 'Foo', 'bar', $arguments, TRUE + ) + ); + + return $result; + } + + public static function baz(Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = self::__phpunit_getStaticInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Static( + 'Foo', 'baz', $arguments, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class.phpt @@ -0,0 +1,131 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function bar(Foo $foo) + { + } + + public function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(NS\Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'NS\Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function baz(NS\Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'NS\Foo', 'baz', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_clone.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_clone.phpt @@ -0,0 +1,84 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function __clone() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + parent::__clone(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_call_parent_constructor.phpt @@ -0,0 +1,83 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function __construct() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_clone.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_clone.phpt @@ -0,0 +1,83 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', FALSE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function __clone() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + FALSE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_dont_call_parent_constructor.phpt @@ -0,0 +1,83 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function __construct() + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_call_parent_constructor.phpt @@ -0,0 +1,88 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +namespace NS; + +interface IFoo +{ + public function __construct($bar); +} + +class Foo implements IFoo +{ + public function __construct($bar) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt @@ -0,0 +1,88 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE) +--FILE-- +<?php +namespace NS; + +interface IFoo +{ + public function __construct($bar); +} + +class Foo implements IFoo +{ + public function __construct($bar) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_partial.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_class_partial.phpt @@ -0,0 +1,109 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array('bar'), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +namespace NS; + +class Foo +{ + public function bar(Foo $foo) + { + } + + public function baz(Foo $foo) + { + } +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array('bar'), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(NS\Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'NS\Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_interface.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/namespaced_interface.phpt @@ -0,0 +1,103 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +namespace NS; + +interface Foo +{ + public function bar(Foo $foo); +} + +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = \PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class MockFoo implements PHPUnit_Framework_MockObject_MockObject, NS\Foo +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function bar(NS\Foo $foo) + { + $arguments = array($foo); + $count = func_num_args(); + + if ($count > 1) { + $_arguments = func_get_args(); + + for ($i = 1; $i < $count; $i++) { + $arguments[] = $_arguments[$i]; + } + } + + $result = $this->__phpunit_getInvocationMocker()->invoke( + new PHPUnit_Framework_MockObject_Invocation_Object( + 'NS\Foo', 'bar', $arguments, $this, TRUE + ) + ); + + return $result; + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class.phpt @@ -0,0 +1,78 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +class Foo +{ +} + +class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace.phpt @@ -0,0 +1,86 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + 'NS\Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +namespace NS { + +class Foo +{ +} + +} + +namespace { + +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace_starting_with_separator.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/nonexistent_class_with_namespace_starting_with_separator.phpt @@ -0,0 +1,86 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE) +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +$mock = PHPUnit_Framework_MockObject_Generator::generate( + '\NS\Foo', + array(), + 'MockFoo', + TRUE, + TRUE +); + +print $mock['code']; +?> +--EXPECTF-- +namespace NS { + +class Foo +{ +} + +} + +namespace { + +class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject +{ + private static $__phpunit_staticInvocationMocker; + private $__phpunit_invocationMocker; + + public function __clone() + { + $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker(); + } + + public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return $this->__phpunit_getInvocationMocker()->expects($matcher); + } + + public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) + { + return self::__phpunit_getStaticInvocationMocker()->expects($matcher); + } + + public function __phpunit_getInvocationMocker() + { + if ($this->__phpunit_invocationMocker === NULL) { + $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return $this->__phpunit_invocationMocker; + } + + public static function __phpunit_getStaticInvocationMocker() + { + if (self::$__phpunit_staticInvocationMocker === NULL) { + self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker; + } + + return self::$__phpunit_staticInvocationMocker; + } + + public function __phpunit_hasMatchers() + { + return self::__phpunit_getStaticInvocationMocker()->hasMatchers() || + $this->__phpunit_getInvocationMocker()->hasMatchers(); + } + + public function __phpunit_verify() + { + self::__phpunit_getStaticInvocationMocker()->verify(); + $this->__phpunit_getInvocationMocker()->verify(); + } + + public function __phpunit_cleanup() + { + self::$__phpunit_staticInvocationMocker = NULL; + $this->__phpunit_invocationMocker = NULL; + } +} + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class.phpt @@ -0,0 +1,36 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch') +--SKIPIF-- +<?php +if (!extension_loaded('soap')) echo 'skip: SOAP extension is required'; +?> +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +print PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl( + dirname(dirname(__FILE__)) . '/_files/GoogleSearch.wsdl', + 'GoogleSearch' +); +?> +--EXPECTF-- +class GoogleSearch extends \SOAPClient +{ + public function __construct($wsdl, array $options) + { + parent::__construct('%s/GoogleSearch.wsdl', $options); + } + + public function doGetCachedPage($key, $url) + { + } + + public function doSpellingSuggestion($key, $phrase) + { + } + + public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_namespace.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_namespace.phpt @@ -0,0 +1,38 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch') +--SKIPIF-- +<?php +if (!extension_loaded('soap')) echo 'skip: SOAP extension is required'; +?> +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +print PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl( + dirname(dirname(__FILE__)) . '/_files/GoogleSearch.wsdl', + 'My\\Space\\GoogleSearch' +); +?> +--EXPECTF-- +namespace My\Space; + +class GoogleSearch extends \SOAPClient +{ + public function __construct($wsdl, array $options) + { + parent::__construct('%s/GoogleSearch.wsdl', $options); + } + + public function doGetCachedPage($key, $url) + { + } + + public function doSpellingSuggestion($key, $phrase) + { + } + + public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_partial.phpt b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObject/wsdl_class_partial.phpt @@ -0,0 +1,29 @@ +--TEST-- +PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch', array('doGoogleSearch')) +--SKIPIF-- +<?php +if (!extension_loaded('soap')) echo 'skip: SOAP extension is required'; +?> +--FILE-- +<?php +require_once 'PHPUnit/Autoload.php'; +require_once 'Text/Template.php'; + +print PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl( + dirname(dirname(__FILE__)) . '/_files/GoogleSearch.wsdl', + 'GoogleSearch', + array('doGoogleSearch') +); +?> +--EXPECTF-- +class GoogleSearch extends \SOAPClient +{ + public function __construct($wsdl, array $options) + { + parent::__construct('%s/GoogleSearch.wsdl', $options); + } + + public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php @@ -0,0 +1,648 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2010-2013, Sebastian Bergmann <sb@sebastian-bergmann.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; + +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'AbstractMockTestClass.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'AnInterface.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'FunctionCallback.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MethodCallback.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MethodCallbackByReference.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'PartialMockTestClass.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'SomeClass.php'; +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'StaticMockTestClass.php'; + +/** + * + * + * @package PHPUnit_MockObject + * @author Sebastian Bergmann <sb@sebastian-bergmann.de> + * @author Patrick Mueller <elias0@gmx.net> + * @author Frank Kleine <mikey@stubbles.net> + * @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @version Release: @package_version@ + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class Framework_MockObjectTest extends PHPUnit_Framework_TestCase +{ + public function testMockedMethodIsNeverCalled() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->never()) + ->method('doSomething'); + } + + public function testMockedMethodIsNotCalledWhenExpectsAnyWithParameter() + { + $mock = $this->getMock('SomeClass'); + $mock->expects($this->any()) + ->method('doSomethingElse') + ->with('someArg'); + } + + public function testMockedMethodIsCalledAtLeastOnce() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->atLeastOnce()) + ->method('doSomething'); + + $mock->doSomething(); + } + + public function testMockedMethodIsCalledAtLeastOnce2() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->atLeastOnce()) + ->method('doSomething'); + + $mock->doSomething(); + $mock->doSomething(); + } + + public function testMockedMethodIsCalledOnce() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->once()) + ->method('doSomething'); + + $mock->doSomething(); + } + + public function testMockedMethodIsCalledOnceWithParameter() + { + $mock = $this->getMock('SomeClass'); + $mock->expects($this->once()) + ->method('doSomethingElse') + ->with($this->equalTo('something')); + + $mock->doSomethingElse('something'); + } + + public function testMockedMethodIsCalledExactly() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->exactly(2)) + ->method('doSomething'); + + $mock->doSomething(); + $mock->doSomething(); + } + + public function testStubbedException() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->any()) + ->method('doSomething') + ->will($this->throwException(new Exception)); + + try { + $mock->doSomething(); + } + + catch (Exception $e) { + return; + } + + $this->fail(); + } + + public function testStubbedReturnValue() + { + $mock = $this->getMock('AnInterface'); + $mock->expects($this->any()) + ->method('doSomething') + ->will($this->returnValue('something')); + + $this->assertEquals('something', $mock->doSomething()); + } + + public function testStubbedReturnValueMap() + { + $map = array( + array('a', 'b', 'c', 'd'), + array('e', 'f', 'g', 'h') + ); + + $mock = $this->getMock('AnInterface'); + $mock->expects($this->any()) + ->method('doSomething') + ->will($this->returnValueMap($map)); + + $this->assertEquals('d', $mock->doSomething('a', 'b', 'c')); + $this->assertEquals('h', $mock->doSomething('e', 'f', 'g')); + $this->assertEquals(NULL, $mock->doSomething('foo', 'bar')); + } + + public function testFunctionCallback() + { + $mock = $this->getMock('SomeClass', array('doSomething'), array(), '', FALSE); + $mock->expects($this->once()) + ->method('doSomething') + ->will($this->returnCallback('functionCallback')); + + $this->assertEquals('pass', $mock->doSomething('foo', 'bar')); + } + + public function testStaticMethodCallback() + { + $mock = $this->getMock('SomeClass', array('doSomething'), array(), '', FALSE); + $mock->expects($this->once()) + ->method('doSomething') + ->will($this->returnCallback(array('MethodCallback', 'staticCallback'))); + + $this->assertEquals('pass', $mock->doSomething('foo', 'bar')); + } + + public function testPublicMethodCallback() + { + $mock = $this->getMock('SomeClass', array('doSomething'), array(), '', FALSE); + $mock->expects($this->once()) + ->method('doSomething') + ->will($this->returnCallback(array(new MethodCallback, 'nonStaticCallback'))); + + $this->assertEquals('pass', $mock->doSomething('foo', 'bar')); + } + + public function testMockClassOnlyGeneratedOnce() + { + $mock1 = $this->getMock('AnInterface'); + $mock2 = $this->getMock('AnInterface'); + + $this->assertEquals(get_class($mock1), get_class($mock2)); + } + + public function testMockClassDifferentForPartialMocks() + { + $mock1 = $this->getMock('PartialMockTestClass'); + $mock2 = $this->getMock('PartialMockTestClass', array('doSomething')); + $mock3 = $this->getMock('PartialMockTestClass', array('doSomething')); + $mock4 = $this->getMock('PartialMockTestClass', array('doAnotherThing')); + $mock5 = $this->getMock('PartialMockTestClass', array('doAnotherThing')); + + $this->assertNotEquals(get_class($mock1), get_class($mock2)); + $this->assertNotEquals(get_class($mock1), get_class($mock3)); + $this->assertNotEquals(get_class($mock1), get_class($mock4)); + $this->assertNotEquals(get_class($mock1), get_class($mock5)); + $this->assertEquals(get_class($mock2), get_class($mock3)); + $this->assertNotEquals(get_class($mock2), get_class($mock4)); + $this->assertNotEquals(get_class($mock2), get_class($mock5)); + $this->assertEquals(get_class($mock4), get_class($mock5)); + } + + public function testMockClassStoreOverrulable() + { + $mock1 = $this->getMock('PartialMockTestClass'); + $mock2 = $this->getMock('PartialMockTestClass', array(), array(), 'MyMockClassNameForPartialMockTestClass1'); + $mock3 = $this->getMock('PartialMockTestClass'); + $mock4 = $this->getMock('PartialMockTestClass', array('doSomething'), array(), 'AnotherMockClassNameForPartialMockTestClass'); + $mock5 = $this->getMock('PartialMockTestClass', array(), array(), 'MyMockClassNameForPartialMockTestClass2'); + + $this->assertNotEquals(get_class($mock1), get_class($mock2)); + $this->assertEquals(get_class($mock1), get_class($mock3)); + $this->assertNotEquals(get_class($mock1), get_class($mock4)); + $this->assertNotEquals(get_class($mock2), get_class($mock3)); + $this->assertNotEquals(get_class($mock2), get_class($mock4)); + $this->assertNotEquals(get_class($mock2), get_class($mock5)); + $this->assertNotEquals(get_class($mock3), get_class($mock4)); + $this->assertNotEquals(get_class($mock3), get_class($mock5)); + $this->assertNotEquals(get_class($mock4), get_class($mock5)); + } + + /** + * @covers PHPUnit_Framework_MockObject_Generator::getMock + */ + public function testGetMockWithFixedClassNameCanProduceTheSameMockTwice() + { + $mock = $this->getMockBuilder('StdClass')->setMockClassName('FixedName')->getMock(); + $mock = $this->getMockBuilder('StdClass')->setMockClassName('FixedName')->getMock(); + $this->assertInstanceOf('StdClass', $mock); + } + + public function testOriginalConstructorSettingConsidered() + { + $mock1 = $this->getMock('PartialMockTestClass'); + $mock2 = $this->getMock('PartialMockTestClass', array(), array(), '', FALSE); + + $this->assertTrue($mock1->constructorCalled); + $this->assertFalse($mock2->constructorCalled); + } + + public function testOriginalCloneSettingConsidered() + { + $mock1 = $this->getMock('PartialMockTestClass'); + $mock2 = $this->getMock('PartialMockTestClass', array(), array(), '', TRUE, FALSE); + + $this->assertNotEquals(get_class($mock1), get_class($mock2)); + } + + public function testStubbedReturnValueForStaticMethod() + { + $this->getMockClass( + 'StaticMockTestClass', + array('doSomething'), + array(), + 'StaticMockTestClassMock' + ); + + StaticMockTestClassMock::staticExpects($this->any()) + ->method('doSomething') + ->will($this->returnValue('something')); + + $this->assertEquals( + 'something', StaticMockTestClassMock::doSomething() + ); + } + + public function testStubbedReturnValueForStaticMethod2() + { + $this->getMockClass( + 'StaticMockTestClass', + array('doSomething'), + array(), + 'StaticMockTestClassMock2' + ); + + StaticMockTestClassMock2::staticExpects($this->any()) + ->method('doSomething') + ->will($this->returnValue('something')); + + $this->assertEquals( + 'something', StaticMockTestClassMock2::doSomethingElse() + ); + } + + public function testGetMockForAbstractClass() + { + $mock = $this->getMock('AbstractMockTestClass'); + $mock->expects($this->never()) + ->method('doSomething'); + } + + public function testClonedMockObjectShouldStillEqualTheOriginal() + { + $a = $this->getMock('stdClass'); + $b = clone $a; + $this->assertEquals($a, $b); + } + + public function testMockObjectsConstructedIndepentantlyShouldBeEqual() + { + $a = $this->getMock('stdClass'); + $b = $this->getMock('stdClass'); + $this->assertEquals($a, $b); + } + + public function testMockObjectsConstructedIndepentantlyShouldNotBeTheSame() + { + $a = $this->getMock('stdClass'); + $b = $this->getMock('stdClass'); + $this->assertNotSame($a, $b); + } + + public function testClonedMockObjectCanBeUsedInPlaceOfOriginalOne() + { + $x = $this->getMock('stdClass'); + $y = clone $x; + + $mock = $this->getMock('stdClass', array('foo')); + $mock->expects($this->once())->method('foo')->with($this->equalTo($x)); + $mock->foo($y); + } + + public function testClonedMockObjectIsNotIdenticalToOriginalOne() + { + $x = $this->getMock('stdClass'); + $y = clone $x; + + $mock = $this->getMock('stdClass', array('foo')); + $mock->expects($this->once())->method('foo')->with($this->logicalNot($this->identicalTo($x))); + $mock->foo($y); + } + + public function testStaticMethodCallWithArgumentCloningEnabled() + { + $expectedObject = new StdClass; + + $this->getMockClass( + 'StaticMockTestClass', + array('doSomething'), + array(), + 'StaticMockTestClassMock3', + FALSE, + TRUE, + TRUE, + TRUE + ); + + $actualArguments = array(); + + StaticMockTestClassMock3::staticExpects($this->any()) + ->method('doSomething') + ->will($this->returnCallback(function() use (&$actualArguments) { + $actualArguments = func_get_args(); + })); + + StaticMockTestClassMock3::doSomething($expectedObject); + + $this->assertEquals(1, count($actualArguments)); + $this->assertNotSame($expectedObject, $actualArguments[0]); + } + + public function testStaticMethodCallWithArgumentCloningDisabled() + { + $expectedObject = new StdClass; + + $this->getMockClass( + 'StaticMockTestClass', + array('doSomething'), + array(), + 'StaticMockTestClassMock4', + FALSE, + TRUE, + TRUE, + FALSE + ); + + $actualArguments = array(); + + StaticMockTestClassMock4::staticExpects($this->any()) + ->method('doSomething') + ->will($this->returnCallback(function() use (&$actualArguments) { + $actualArguments = func_get_args(); + })); + + StaticMockTestClassMock4::doSomething($expectedObject); + + $this->assertEquals(1, count($actualArguments)); + $this->assertEquals($expectedObject, $actualArguments[0]); + $this->assertSame($expectedObject, $actualArguments[0]); + } + + public function testObjectMethodCallWithArgumentCloningEnabled() + { + $expectedObject = new StdClass; + + $mock = $this->getMockBuilder('SomeClass') + ->setMethods(array('doSomethingElse')) + ->enableArgumentCloning() + ->getMock(); + + $actualArguments = array(); + + $mock->expects($this->any()) + ->method('doSomethingElse') + ->will($this->returnCallback(function() use (&$actualArguments) { + $actualArguments = func_get_args(); + })); + + $mock->doSomethingElse($expectedObject); + + $this->assertEquals(1, count($actualArguments)); + $this->assertEquals($expectedObject, $actualArguments[0]); + $this->assertNotSame($expectedObject, $actualArguments[0]); + } + + public function testObjectMethodCallWithArgumentCloningDisabled() + { + $expectedObject = new StdClass; + + $mock = $this->getMockBuilder('SomeClass') + ->setMethods(array('doSomethingElse')) + ->disableArgumentCloning() + ->getMock(); + + $actualArguments = array(); + + $mock->expects($this->any()) + ->method('doSomethingElse') + ->will($this->returnCallback(function() use (&$actualArguments) { + $actualArguments = func_get_args(); + })); + + $mock->doSomethingElse($expectedObject); + + $this->assertEquals(1, count($actualArguments)); + $this->assertSame($expectedObject, $actualArguments[0]); + } + + public function testArgumentCloningOptionGeneratesUniqueMock() + { + $mockWithCloning = $this->getMockBuilder('SomeClass') + ->setMethods(array('doSomethingElse')) + ->enableArgumentCloning() + ->getMock(); + + $mockWithoutCloning = $this->getMockBuilder('SomeClass') + ->setMethods(array('doSomethingElse')) + ->disableArgumentCloning() + ->getMock(); + + $this->assertNotEquals($mockWithCloning, $mockWithoutCloning); + } + + public function testVerificationOfMethodNameFailsWithoutParameters() + { + $mock = $this->getMock('SomeClass', array('right', 'wrong'), array(), '', TRUE, TRUE, TRUE); + $mock->expects($this->once()) + ->method('right'); + + $mock->wrong(); + try { + $mock->__phpunit_verify(); + $this->fail('Expected exception'); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertSame( + "Expectation failed for method name is equal to <string:right> when invoked 1 time(s).\n" + . 'Method was expected to be called 1 times, actually called 0 times.', + $e->getMessage() + ); + } + + $this->resetMockObjects(); + } + + public function testVerificationOfMethodNameFailsWithParameters() + { + $mock = $this->getMock('SomeClass', array('right', 'wrong'), array(), '', TRUE, TRUE, TRUE); + $mock->expects($this->once()) + ->method('right'); + + $mock->wrong(); + try { + $mock->__phpunit_verify(); + $this->fail('Expected exception'); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertSame( + "Expectation failed for method name is equal to <string:right> when invoked 1 time(s).\n" + . 'Method was expected to be called 1 times, actually called 0 times.', + $e->getMessage() + ); + } + + $this->resetMockObjects(); + } + + public function testVerificationOfNeverFailsWithEmptyParameters() + { + $mock = $this->getMock('SomeClass', array('right', 'wrong'), array(), '', TRUE, TRUE, TRUE); + $mock->expects($this->never()) + ->method('right') + ->with(); + + try { + $mock->right(); + $this->fail('Expected exception'); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertSame( + 'SomeClass::right() was not expected to be called.', + $e->getMessage() + ); + } + + $this->resetMockObjects(); + } + + public function testVerificationOfNeverFailsWithAnyParameters() + { + $mock = $this->getMock('SomeClass', array('right', 'wrong'), array(), '', TRUE, TRUE, TRUE); + $mock->expects($this->never()) + ->method('right') + ->withAnyParameters(); + + try { + $mock->right(); + $this->fail('Expected exception'); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertSame( + 'SomeClass::right() was not expected to be called.', + $e->getMessage() + ); + } + + $this->resetMockObjects(); + } + + public function testMockArgumentsPassedByReference() { + $foo = $this->getMockBuilder('MethodCallbackByReference') + ->setMethods(array('bar')) + ->disableOriginalConstructor() + ->disableArgumentCloning() + ->getMock(); + + $foo->expects($this->any()) + ->method('bar') + ->will($this->returnCallback(array($foo, 'callback'))); + + $a = $b = $c = 0; + + $foo->bar($a, $b, $c); + + $this->assertEquals(1, $b); + } + + public function testMockArgumentsPassedByReference2() { + $foo = $this->getMockBuilder('MethodCallbackByReference') + ->disableOriginalConstructor() + ->disableArgumentCloning() + ->getMock(); + + $foo->expects($this->any()) + ->method('bar') + ->will($this->returnCallback( + function ($a, &$b, $c) { + $b = 1; + } + )); + + $a = $b = $c = 0; + + $foo->bar($a, $b, $c); + + $this->assertEquals(1, $b); + } + + /** + * @requires extension soap + */ + public function testCreateMockFromWsdl() + { + $mock = $this->getMockFromWsdl(__DIR__ . '/_files/GoogleSearch.wsdl', 'WsdlMock'); + $this->assertStringStartsWith( + 'Mock_WsdlMock_', + get_class($mock) + ); + } + + /** + * @requires extension soap + */ + public function testCreateNamespacedMockFromWsdl() + { + $mock = $this->getMockFromWsdl(__DIR__ . '/_files/GoogleSearch.wsdl', 'My\\Space\\WsdlMock'); + $this->assertStringStartsWith( + 'Mock_WsdlMock_', + get_class($mock) + ); + } + + /** + * @requires extension soap + */ + public function testCreateTwoMocksOfOneWsdlFile() + { + $mock = $this->getMockFromWsdl(__DIR__ . '/_files/GoogleSearch.wsdl'); + $mock = $this->getMockFromWsdl(__DIR__ . '/_files/GoogleSearch.wsdl'); + } + + private function resetMockObjects() + { + $refl = new ReflectionObject($this); + $refl = $refl->getParentClass(); + $prop = $refl->getProperty('mockObjects'); + $prop->setAccessible(true); + $prop->setValue($this, array()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AbstractMockTestClass.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AbstractMockTestClass.php @@ -0,0 +1,5 @@ +<?php +abstract class AbstractMockTestClass +{ + abstract public function doSomething(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AnInterface.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/AnInterface.php @@ -0,0 +1,5 @@ +<?php +interface AnInterface +{ + public function doSomething(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/FunctionCallback.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/FunctionCallback.php @@ -0,0 +1,9 @@ +<?php +function functionCallback() +{ + $args = func_get_args(); + + if ($args == array('foo', 'bar')) { + return 'pass'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/GoogleSearch.wsdl b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/GoogleSearch.wsdl @@ -0,0 +1,198 @@ +<?xml version="1.0"?> + +<!-- WSDL description of the Google Web APIs. + The Google Web APIs are in beta release. All interfaces are subject to + change as we refine and extend our APIs. Please see the terms of use + for more information. --> + +<!-- Revision 2002-08-16 --> + +<definitions name="GoogleSearch" + targetNamespace="urn:GoogleSearch" + xmlns:typens="urn:GoogleSearch" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + + <!-- Types for search - result elements, directory categories --> + + <types> + <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" + targetNamespace="urn:GoogleSearch"> + + <xsd:complexType name="GoogleSearchResult"> + <xsd:all> + <xsd:element name="documentFiltering" type="xsd:boolean"/> + <xsd:element name="searchComments" type="xsd:string"/> + <xsd:element name="estimatedTotalResultsCount" type="xsd:int"/> + <xsd:element name="estimateIsExact" type="xsd:boolean"/> + <xsd:element name="resultElements" type="typens:ResultElementArray"/> + <xsd:element name="searchQuery" type="xsd:string"/> + <xsd:element name="startIndex" type="xsd:int"/> + <xsd:element name="endIndex" type="xsd:int"/> + <xsd:element name="searchTips" type="xsd:string"/> + <xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/> + <xsd:element name="searchTime" type="xsd:double"/> + </xsd:all> + </xsd:complexType> + + <xsd:complexType name="ResultElement"> + <xsd:all> + <xsd:element name="summary" type="xsd:string"/> + <xsd:element name="URL" type="xsd:string"/> + <xsd:element name="snippet" type="xsd:string"/> + <xsd:element name="title" type="xsd:string"/> + <xsd:element name="cachedSize" type="xsd:string"/> + <xsd:element name="relatedInformationPresent" type="xsd:boolean"/> + <xsd:element name="hostName" type="xsd:string"/> + <xsd:element name="directoryCategory" type="typens:DirectoryCategory"/> + <xsd:element name="directoryTitle" type="xsd:string"/> + </xsd:all> + </xsd:complexType> + + <xsd:complexType name="ResultElementArray"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="DirectoryCategoryArray"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="DirectoryCategory"> + <xsd:all> + <xsd:element name="fullViewableName" type="xsd:string"/> + <xsd:element name="specialEncoding" type="xsd:string"/> + </xsd:all> + </xsd:complexType> + + </xsd:schema> + </types> + + <!-- Messages for Google Web APIs - cached page, search, spelling. --> + + <message name="doGetCachedPage"> + <part name="key" type="xsd:string"/> + <part name="url" type="xsd:string"/> + </message> + + <message name="doGetCachedPageResponse"> + <part name="return" type="xsd:base64Binary"/> + </message> + + <message name="doSpellingSuggestion"> + <part name="key" type="xsd:string"/> + <part name="phrase" type="xsd:string"/> + </message> + + <message name="doSpellingSuggestionResponse"> + <part name="return" type="xsd:string"/> + </message> + + <!-- note, ie and oe are ignored by server; all traffic is UTF-8. --> + + <message name="doGoogleSearch"> + <part name="key" type="xsd:string"/> + <part name="q" type="xsd:string"/> + <part name="start" type="xsd:int"/> + <part name="maxResults" type="xsd:int"/> + <part name="filter" type="xsd:boolean"/> + <part name="restrict" type="xsd:string"/> + <part name="safeSearch" type="xsd:boolean"/> + <part name="lr" type="xsd:string"/> + <part name="ie" type="xsd:string"/> + <part name="oe" type="xsd:string"/> + </message> + + <message name="doGoogleSearchResponse"> + <part name="return" type="typens:GoogleSearchResult"/> + </message> + + <!-- Port for Google Web APIs, "GoogleSearch" --> + + <portType name="GoogleSearchPort"> + + <operation name="doGetCachedPage"> + <input message="typens:doGetCachedPage"/> + <output message="typens:doGetCachedPageResponse"/> + </operation> + + <operation name="doSpellingSuggestion"> + <input message="typens:doSpellingSuggestion"/> + <output message="typens:doSpellingSuggestionResponse"/> + </operation> + + <operation name="doGoogleSearch"> + <input message="typens:doGoogleSearch"/> + <output message="typens:doGoogleSearchResponse"/> + </operation> + + </portType> + + + <!-- Binding for Google Web APIs - RPC, SOAP over HTTP --> + + <binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"> + <soap:binding style="rpc" + transport="http://schemas.xmlsoap.org/soap/http"/> + + <operation name="doGetCachedPage"> + <soap:operation soapAction="urn:GoogleSearchAction"/> + <input> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + <operation name="doSpellingSuggestion"> + <soap:operation soapAction="urn:GoogleSearchAction"/> + <input> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + <operation name="doGoogleSearch"> + <soap:operation soapAction="urn:GoogleSearchAction"/> + <input> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" + namespace="urn:GoogleSearch" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + + <!-- Endpoint for Google Web APIs --> + <service name="GoogleSearchService"> + <port name="GoogleSearchPort" binding="typens:GoogleSearchBinding"> + <soap:address location="http://api.google.com/search/beta2"/> + </port> + </service> + +</definitions> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallback.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallback.php @@ -0,0 +1,21 @@ +<?php +class MethodCallback +{ + public static function staticCallback() + { + $args = func_get_args(); + + if ($args == array('foo', 'bar')) { + return 'pass'; + } + } + + public function nonStaticCallback() + { + $args = func_get_args(); + + if ($args == array('foo', 'bar')) { + return 'pass'; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallbackByReference.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/MethodCallbackByReference.php @@ -0,0 +1,11 @@ +<?php +class MethodCallbackByReference +{ + public function bar($a, &$b, $c) { + Legacy::bar($a, $b, $c); + } + + public function callback($a, &$b, $c) { + $b = 1; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/Mockable.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/Mockable.php @@ -0,0 +1,28 @@ +<?php +class Mockable +{ + public $constructorArgs; + public $cloned; + + public function __construct($arg1 = NULL, $arg2 = NULL) + { + $this->constructorArgs = array($arg1, $arg2); + } + + public function mockableMethod() + { + // something different from NULL + return TRUE; + } + + public function anotherMockableMethod() + { + // something different from NULL + return TRUE; + } + + public function __clone() + { + $this->cloned = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/PartialMockTestClass.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/PartialMockTestClass.php @@ -0,0 +1,18 @@ +<?php +class PartialMockTestClass +{ + public $constructorCalled = FALSE; + + public function __construct() + { + $this->constructorCalled = TRUE; + } + + public function doSomething() + { + } + + public function doAnotherThing() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/SomeClass.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/SomeClass.php @@ -0,0 +1,13 @@ +<?php +class SomeClass +{ + public function doSomething($a, $b) + { + return NULL; + } + + public function doSomethingElse($c) + { + return NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/StaticMockTestClass.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/Tests/_files/StaticMockTestClass.php @@ -0,0 +1,12 @@ +<?php +class StaticMockTestClass +{ + public static function doSomething() + { + } + + public static function doSomethingElse() + { + return static::doSomething(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build.xml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="PHPUnit_MockObject" default="build"> + <property name="php" value="php"/> + <property name="phpunit" value="phpunit"/> + + <target name="build" + depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/> + + <target name="build-parallel" + depends="prepare,lint,tools-parallel,phpunit,phpcb"/> + + <target name="tools-parallel" + description="Run tools in parallel"> + <parallel threadCount="2"> + <sequential> + <antcall target="pdepend"/> + <antcall target="phpmd-ci"/> + </sequential> + <antcall target="phpcpd"/> + <antcall target="phpcs-ci"/> + <antcall target="phploc"/> + </parallel> + </target> + + <target name="clean" description="Cleanup build artifacts"> + <delete dir="${basedir}/build/api"/> + <delete dir="${basedir}/build/code-browser"/> + <delete dir="${basedir}/build/coverage"/> + <delete dir="${basedir}/build/logs"/> + <delete dir="${basedir}/build/pdepend"/> + </target> + + <target name="prepare" depends="clean,phpab" + description="Prepare for build"> + <mkdir dir="${basedir}/build/api"/> + <mkdir dir="${basedir}/build/code-browser"/> + <mkdir dir="${basedir}/build/coverage"/> + <mkdir dir="${basedir}/build/logs"/> + <mkdir dir="${basedir}/build/pdepend"/> + </target> + + <target name="phpab" description="Generate autoloader scripts"> + <exec executable="phpab"> + <arg value="--output" /> + <arg path="PHPUnit/Framework/MockObject/Autoload.php" /> + <arg value="--template" /> + <arg path="PHPUnit/Framework/MockObject/Autoload.php.in" /> + <arg value="--indent" /> + <arg value=" " /> + <arg path="PHPUnit" /> + </exec> + </target> + + <target name="lint"> + <apply executable="${php}" failonerror="true"> + <arg value="-l" /> + + <fileset dir="${basedir}/PHPUnit"> + <include name="**/*.php" /> + <modified /> + </fileset> + + <fileset dir="${basedir}/Tests"> + <include name="**/*.php" /> + <modified /> + </fileset> + </apply> + </target> + + <target name="phploc" description="Measure project size using PHPLOC"> + <exec executable="phploc"> + <arg value="--log-csv" /> + <arg value="${basedir}/build/logs/phploc.csv" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="pdepend" + description="Calculate software metrics using PHP_Depend"> + <exec executable="pdepend"> + <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /> + <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" /> + <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="phpmd" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHPUnit" /> + <arg value="text" /> + <arg value="${basedir}/build/phpmd.xml" /> + </exec> + </target> + + <target name="phpmd-ci" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHPUnit" /> + <arg value="xml" /> + <arg value="${basedir}/build/phpmd.xml" /> + <arg value="--reportfile" /> + <arg value="${basedir}/build/logs/pmd.xml" /> + </exec> + </target> + + <target name="phpcs" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs"> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHPUnit" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcs-ci" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs" output="/dev/null"> + <arg value="--report=checkstyle" /> + <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" /> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHPUnit" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcpd" description="Find duplicate code using PHPCPD"> + <exec executable="phpcpd"> + <arg value="--log-pmd" /> + <arg value="${basedir}/build/logs/pmd-cpd.xml" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="phpunit" description="Run unit tests with PHPUnit"> + <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}"> + <not> + <equals arg1="${phpunit}" arg2="phpunit" /> + </not> + </condition> + + <exec executable="${phpunit_cmd}" failonerror="true"/> + </target> + + <target name="phpcb" + description="Aggregate tool output with PHP_CodeBrowser"> + <exec executable="phpcb"> + <arg value="--log" /> + <arg path="${basedir}/build/logs" /> + <arg value="--source" /> + <arg path="${basedir}/PHPUnit" /> + <arg value="--output" /> + <arg path="${basedir}/build/code-browser" /> + </exec> + </target> +</project> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff +{ + public function __construct() + { + parent::__construct(true); + } + + protected function getPatterns() + { + return array( + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + '}EOLelse if (...) {EOL', + '}EOLelse {EOL', + 'do {EOL', + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_Whitespace_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff +{ + public function register() + { + return array(T_STRING_CONCAT); + } + + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE || + $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + + $phpcsFile->addError( + 'Concatenation operator must be surrounded by whitespace', + $stackPtr + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/ruleset.xml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/PHPCS/ruleset.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<ruleset name="Sebastian"> + <description>Sebastian Bergmann's coding standard</description> + + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> + + <rule ref="Generic.Commenting.Todo"/> + + <rule ref="Generic.ControlStructures.InlineControlStructure"/> + + <rule ref="Generic.Files.LineEndings"/> + + <rule ref="Generic.Formatting.DisallowMultipleStatements"/> + <rule ref="Generic.Formatting.NoSpaceAfterCast"/> + + <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/> + <rule ref="PEAR.Functions.ValidDefaultValue"/> + + <rule ref="Generic.NamingConventions.ConstructorName"/> + <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> + <rule ref="PEAR.NamingConventions.ValidClassName"/> + + <rule ref="Generic.PHP.DisallowShortOpenTag"/> + <rule ref="Generic.PHP.NoSilencedErrors"/> + <rule ref="Generic.PHP.UpperCaseConstant"/> + + <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> + <rule ref="Generic.WhiteSpace.ScopeIndent"/> + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/phpmd.xml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/phpmd.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> + +<ruleset name="Sebastian" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description>Sebastian Bergmann's ruleset</description> + + <rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> + <rule ref="rulesets/codesize.xml/NPathComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> + + <rule ref="rulesets/design.xml/EvalExpression" /> + <rule ref="rulesets/design.xml/ExitExpression" /> + <rule ref="rulesets/design.xml/GotoStatement" /> + + <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> + + <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> + <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/travis-ci.xml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/build/travis-ci.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + colors="true"> + <php> + <const name="PHPUNIT_TESTSUITE" value="true"/> + </php> + + <testsuites> + <testsuite name="PHPUnit Mock Objects"> + <directory suffix="Test.php">../Tests</directory> + <directory suffix=".phpt">../Tests</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-text" target="php://stdout"/> + </logging> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">../PHPUnit</directory> + <exclude> + <file>../PHPUnit/Framework/MockObject/Autoload.php</file> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/composer.json b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/composer.json @@ -0,0 +1,37 @@ +{ + "name": "phpunit/phpunit-mock-objects", + "description": "Mock Object library for PHPUnit", + "type": "library", + "keywords": [ + "xunit", + "mock" + ], + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-text-template": ">=1.1.1@stable" + }, + "suggest": { + "ext-soap": "*" + }, + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "include-path": [ + "" + ] +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/package.xml b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/package.xml @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.4.10" version="2.0" + xmlns="http://pear.php.net/dtd/package-2.0" + xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>PHPUnit_MockObject</name> + <channel>pear.phpunit.de</channel> + <summary>Mock Object library for PHPUnit</summary> + <description>Mock Object library for PHPUnit</description> + <lead> + <name>Sebastian Bergmann</name> + <user>sb</user> + <email>sb@sebastian-bergmann.de</email> + <active>yes</active> + </lead> + <date>2013-01-13</date> + <version> + <release>1.2.3</release> + <api>1.2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license>The BSD 3-Clause License</license> + <notes>http://github.com/sebastianbergmann/phpunit-mock-objects/blob/master/README.markdown</notes> + <contents> + <dir name="/"> + <dir name="PHPUnit"> + <dir name="Framework"> + <dir name="MockObject"> + <dir name="Builder"> + <file baseinstalldir="/" name="Identity.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvocationMocker.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Match.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="MethodNameMatch.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Namespace.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="ParametersMatch.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Stub.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <dir name="Generator"> + <file baseinstalldir="/" name="mocked_class.tpl.dist" role="php" /> + <file baseinstalldir="/" name="mocked_clone.tpl.dist" role="php" /> + <file baseinstalldir="/" name="mocked_object_method.tpl.dist" role="php" /> + <file baseinstalldir="/" name="mocked_static_method.tpl.dist" role="php" /> + <file baseinstalldir="/" name="trait_class.tpl.dist" role="php" /> + <file baseinstalldir="/" name="unmocked_clone.tpl.dist" role="php" /> + <file baseinstalldir="/" name="wsdl_class.tpl.dist" role="php" /> + <file baseinstalldir="/" name="wsdl_method.tpl.dist" role="php" /> + </dir> + <dir name="Invocation"> + <file baseinstalldir="/" name="Object.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Static.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <dir name="Matcher"> + <file baseinstalldir="/" name="AnyInvokedCount.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="AnyParameters.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Invocation.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvokedAtIndex.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvokedAtLeastOnce.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvokedCount.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvokedRecorder.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="MethodName.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Parameters.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="StatelessInvocation.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <dir name="Stub"> + <file baseinstalldir="/" name="ConsecutiveCalls.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Exception.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="MatcherCollection.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Return.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="ReturnArgument.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="ReturnCallback.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="ReturnSelf.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="ReturnValueMap.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + <file baseinstalldir="/" name="Autoload.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Generator.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="InvocationMocker.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Invocation.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Invokable.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Matcher.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="MockBuilder.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="MockObject.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Stub.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + <file baseinstalldir="/" name="Verifiable.php" role="php"> + <tasks:replace from="@package_version@" to="version" type="package-info" /> + </file> + </dir> + </dir> + </dir> + <file baseinstalldir="/" name="ChangeLog.markdown" role="doc"/> + <file baseinstalldir="/" name="LICENSE" role="doc"/> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.3.3</min> + </php> + <pearinstaller> + <min>1.9.4</min> + </pearinstaller> + <package> + <name>Text_Template</name> + <channel>pear.phpunit.de</channel> + <min>1.1.1</min> + </package> + </required> + <optional> + <extension> + <name>soap</name> + </extension> + </optional> + </dependencies> + <phprelease/> +</package> diff --git a/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/phpunit.xml.dist b/libs/php-ssh/vendor/phpunit/phpunit-mock-objects/phpunit.xml.dist @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false"> + <php> + <const name="PHPUNIT_TESTSUITE" value="true"/> + </php> + + <testsuites> + <testsuite name="PHPUnit Mock Objects"> + <directory suffix="Test.php">Tests</directory> + <directory suffix=".phpt">Tests</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-html" target="build/coverage" title="PHPUnit Mock Objects" + charset="UTF-8" yui="true" highlight="true" + lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="build/logs/clover.xml"/> + <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> + </logging> + + <filter> + <whitelist addUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">PHPUnit</directory> + <exclude> + <file>PHPUnit/Framework/MockObject/Autoload.php</file> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/.gitattributes b/libs/php-ssh/vendor/phpunit/phpunit/.gitattributes @@ -0,0 +1 @@ +*.php diff=php diff --git a/libs/php-ssh/vendor/phpunit/phpunit/.gitignore b/libs/php-ssh/vendor/phpunit/phpunit/.gitignore @@ -0,0 +1,20 @@ +build/api +build/code-browser +build/coverage +build/logs +build/pdepend +build/phar +build/phpdox +build/*.phar +Tests/TextUI/*.diff +Tests/TextUI/*.exp +Tests/TextUI/*.log +Tests/TextUI/*.out +Tests/TextUI/*.php +/bin +/vendor +/composer.lock +/composer.phar +phpunit.xml +cache.properties +.idea diff --git a/libs/php-ssh/vendor/phpunit/phpunit/.travis.yml b/libs/php-ssh/vendor/phpunit/phpunit/.travis.yml @@ -0,0 +1,29 @@ +language: php + +php: + - 5.3.3 + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - hhvm + +env: + - INSTALL_PHP_INVOKER=0 + - INSTALL_PHP_INVOKER=1 + +before_script: + - sh -c "if [ '$INSTALL_PHP_INVOKER' = '1' ]; then composer require --dev --prefer-source phpunit/php-invoker:\>=1.1.0,\<1.2.0; else composer install --dev --prefer-source; fi" + +script: ./phpunit.php --configuration ./build/travis-ci.xml + +matrix: + allow_failures: + - php: hhvm + +notifications: + email: false + irc: + channels: + - "irc.freenode.org#phpunit" + use_notice: true diff --git a/libs/php-ssh/vendor/phpunit/phpunit/CONTRIBUTING.md b/libs/php-ssh/vendor/phpunit/phpunit/CONTRIBUTING.md @@ -0,0 +1,29 @@ +Contributing to PHPUnit +======================= + +Contributions to PHPUnit, its related modules, and its documentation are always welcome. You make our lives easier by sending us your contributions through GitHub pull requests. + +Pull requests for bug fixes must be based on the current stable branch whereas pull requests for new features must be based on `master`. + +We are trying to keep backwards compatibility breaks in PHPUnit to an absolute minimum. Please take this into account when proposing changes. + +Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us here or on IRC if you feel that we forgot to respond. + +Using PHPUnit From a Git Checkout +--------------------------------- + +The following commands can be used to perform the initial checkout of PHPUnit: + + git clone git://github.com/sebastianbergmann/phpunit.git + cd phpunit + +To retrieve PHPUnit's dependencies, you can use [Composer](http://getcomposer.org/download/). If you do not have Composer installed, you can download the latest PHAR with the following command: + + curl -O http://getcomposer.org/composer.phar + +Once Composer is installed, you can fetch PHPUnit's dependencies with the following command: + + php composer.phar install --dev + +The `phpunit.php` script can be used to invoke the PHPUnit test runner. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/LICENSE b/libs/php-ssh/vendor/phpunit/phpunit/LICENSE @@ -0,0 +1,33 @@ +PHPUnit + +Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Sebastian Bergmann nor the names of his + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php @@ -0,0 +1,248 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +if (defined('PHPUNIT_COMPOSER_INSTALL')) { + return; +} + +$paths = array( + __DIR__ . '/../vendor', + __DIR__ . '/../../..' +); + +foreach ($paths as $path) { + if (@is_dir($path . '/composer') && + @is_file($path . '/autoload.php')) { + require_once $path . '/autoload.php'; + define('PHPUNIT_COMPOSER_INSTALL', $path . '/autoload.php'); + + return; + } +} + +require_once 'File/Iterator/Autoload.php'; +require_once 'PHP/CodeCoverage/Autoload.php'; +require_once 'PHP/Timer/Autoload.php'; +require_once 'PHPUnit/Framework/MockObject/Autoload.php'; +require_once 'Text/Template/Autoload.php'; + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + 'phpunit_extensions_grouptestsuite' => '/Extensions/GroupTestSuite.php', + 'phpunit_extensions_phpttestcase' => '/Extensions/PhptTestCase.php', + 'phpunit_extensions_phpttestcase_logger' => '/Extensions/PhptTestCase/Logger.php', + 'phpunit_extensions_phpttestsuite' => '/Extensions/PhptTestSuite.php', + 'phpunit_extensions_repeatedtest' => '/Extensions/RepeatedTest.php', + 'phpunit_extensions_testdecorator' => '/Extensions/TestDecorator.php', + 'phpunit_extensions_ticketlistener' => '/Extensions/TicketListener.php', + 'phpunit_framework_assert' => '/Framework/Assert.php', + 'phpunit_framework_assertionfailederror' => '/Framework/AssertionFailedError.php', + 'phpunit_framework_comparator' => '/Framework/Comparator.php', + 'phpunit_framework_comparator_array' => '/Framework/Comparator/Array.php', + 'phpunit_framework_comparator_domdocument' => '/Framework/Comparator/DOMDocument.php', + 'phpunit_framework_comparator_double' => '/Framework/Comparator/Double.php', + 'phpunit_framework_comparator_exception' => '/Framework/Comparator/Exception.php', + 'phpunit_framework_comparator_mockobject' => '/Framework/Comparator/MockObject.php', + 'phpunit_framework_comparator_numeric' => '/Framework/Comparator/Numeric.php', + 'phpunit_framework_comparator_object' => '/Framework/Comparator/Object.php', + 'phpunit_framework_comparator_resource' => '/Framework/Comparator/Resource.php', + 'phpunit_framework_comparator_scalar' => '/Framework/Comparator/Scalar.php', + 'phpunit_framework_comparator_splobjectstorage' => '/Framework/Comparator/SplObjectStorage.php', + 'phpunit_framework_comparator_type' => '/Framework/Comparator/Type.php', + 'phpunit_framework_comparatorfactory' => '/Framework/ComparatorFactory.php', + 'phpunit_framework_comparisonfailure' => '/Framework/ComparisonFailure.php', + 'phpunit_framework_constraint' => '/Framework/Constraint.php', + 'phpunit_framework_constraint_and' => '/Framework/Constraint/And.php', + 'phpunit_framework_constraint_arrayhaskey' => '/Framework/Constraint/ArrayHasKey.php', + 'phpunit_framework_constraint_attribute' => '/Framework/Constraint/Attribute.php', + 'phpunit_framework_constraint_callback' => '/Framework/Constraint/Callback.php', + 'phpunit_framework_constraint_classhasattribute' => '/Framework/Constraint/ClassHasAttribute.php', + 'phpunit_framework_constraint_classhasstaticattribute' => '/Framework/Constraint/ClassHasStaticAttribute.php', + 'phpunit_framework_constraint_composite' => '/Framework/Constraint/Composite.php', + 'phpunit_framework_constraint_count' => '/Framework/Constraint/Count.php', + 'phpunit_framework_constraint_exception' => '/Framework/Constraint/Exception.php', + 'phpunit_framework_constraint_exceptioncode' => '/Framework/Constraint/ExceptionCode.php', + 'phpunit_framework_constraint_exceptionmessage' => '/Framework/Constraint/ExceptionMessage.php', + 'phpunit_framework_constraint_fileexists' => '/Framework/Constraint/FileExists.php', + 'phpunit_framework_constraint_greaterthan' => '/Framework/Constraint/GreaterThan.php', + 'phpunit_framework_constraint_isanything' => '/Framework/Constraint/IsAnything.php', + 'phpunit_framework_constraint_isempty' => '/Framework/Constraint/IsEmpty.php', + 'phpunit_framework_constraint_isequal' => '/Framework/Constraint/IsEqual.php', + 'phpunit_framework_constraint_isfalse' => '/Framework/Constraint/IsFalse.php', + 'phpunit_framework_constraint_isidentical' => '/Framework/Constraint/IsIdentical.php', + 'phpunit_framework_constraint_isinstanceof' => '/Framework/Constraint/IsInstanceOf.php', + 'phpunit_framework_constraint_isjson' => '/Framework/Constraint/IsJson.php', + 'phpunit_framework_constraint_isnull' => '/Framework/Constraint/IsNull.php', + 'phpunit_framework_constraint_istrue' => '/Framework/Constraint/IsTrue.php', + 'phpunit_framework_constraint_istype' => '/Framework/Constraint/IsType.php', + 'phpunit_framework_constraint_jsonmatches' => '/Framework/Constraint/JsonMatches.php', + 'phpunit_framework_constraint_jsonmatches_errormessageprovider' => '/Framework/Constraint/JsonMatches/ErrorMessageProvider.php', + 'phpunit_framework_constraint_lessthan' => '/Framework/Constraint/LessThan.php', + 'phpunit_framework_constraint_not' => '/Framework/Constraint/Not.php', + 'phpunit_framework_constraint_objecthasattribute' => '/Framework/Constraint/ObjectHasAttribute.php', + 'phpunit_framework_constraint_or' => '/Framework/Constraint/Or.php', + 'phpunit_framework_constraint_pcrematch' => '/Framework/Constraint/PCREMatch.php', + 'phpunit_framework_constraint_samesize' => '/Framework/Constraint/SameSize.php', + 'phpunit_framework_constraint_stringcontains' => '/Framework/Constraint/StringContains.php', + 'phpunit_framework_constraint_stringendswith' => '/Framework/Constraint/StringEndsWith.php', + 'phpunit_framework_constraint_stringmatches' => '/Framework/Constraint/StringMatches.php', + 'phpunit_framework_constraint_stringstartswith' => '/Framework/Constraint/StringStartsWith.php', + 'phpunit_framework_constraint_traversablecontains' => '/Framework/Constraint/TraversableContains.php', + 'phpunit_framework_constraint_traversablecontainsonly' => '/Framework/Constraint/TraversableContainsOnly.php', + 'phpunit_framework_constraint_xor' => '/Framework/Constraint/Xor.php', + 'phpunit_framework_error' => '/Framework/Error.php', + 'phpunit_framework_error_deprecated' => '/Framework/Error/Deprecated.php', + 'phpunit_framework_error_notice' => '/Framework/Error/Notice.php', + 'phpunit_framework_error_warning' => '/Framework/Error/Warning.php', + 'phpunit_framework_exception' => '/Framework/Exception.php', + 'phpunit_framework_expectationfailedexception' => '/Framework/ExpectationFailedException.php', + 'phpunit_framework_incompletetest' => '/Framework/IncompleteTest.php', + 'phpunit_framework_incompletetesterror' => '/Framework/IncompleteTestError.php', + 'phpunit_framework_outputerror' => '/Framework/OutputError.php', + 'phpunit_framework_selfdescribing' => '/Framework/SelfDescribing.php', + 'phpunit_framework_skippedtest' => '/Framework/SkippedTest.php', + 'phpunit_framework_skippedtesterror' => '/Framework/SkippedTestError.php', + 'phpunit_framework_skippedtestsuiteerror' => '/Framework/SkippedTestSuiteError.php', + 'phpunit_framework_syntheticerror' => '/Framework/SyntheticError.php', + 'phpunit_framework_test' => '/Framework/Test.php', + 'phpunit_framework_testcase' => '/Framework/TestCase.php', + 'phpunit_framework_testfailure' => '/Framework/TestFailure.php', + 'phpunit_framework_testlistener' => '/Framework/TestListener.php', + 'phpunit_framework_testresult' => '/Framework/TestResult.php', + 'phpunit_framework_testsuite' => '/Framework/TestSuite.php', + 'phpunit_framework_testsuite_dataprovider' => '/Framework/TestSuite/DataProvider.php', + 'phpunit_framework_warning' => '/Framework/Warning.php', + 'phpunit_runner_basetestrunner' => '/Runner/BaseTestRunner.php', + 'phpunit_runner_standardtestsuiteloader' => '/Runner/StandardTestSuiteLoader.php', + 'phpunit_runner_testsuiteloader' => '/Runner/TestSuiteLoader.php', + 'phpunit_runner_version' => '/Runner/Version.php', + 'phpunit_textui_command' => '/TextUI/Command.php', + 'phpunit_textui_resultprinter' => '/TextUI/ResultPrinter.php', + 'phpunit_textui_testrunner' => '/TextUI/TestRunner.php', + 'phpunit_util_class' => '/Util/Class.php', + 'phpunit_util_configuration' => '/Util/Configuration.php', + 'phpunit_util_deprecatedfeature' => '/Util/DeprecatedFeature.php', + 'phpunit_util_deprecatedfeature_logger' => '/Util/DeprecatedFeature/Logger.php', + 'phpunit_util_diff' => '/Util/Diff.php', + 'phpunit_util_errorhandler' => '/Util/ErrorHandler.php', + 'phpunit_util_fileloader' => '/Util/Fileloader.php', + 'phpunit_util_filesystem' => '/Util/Filesystem.php', + 'phpunit_util_filter' => '/Util/Filter.php', + 'phpunit_util_getopt' => '/Util/Getopt.php', + 'phpunit_util_globalstate' => '/Util/GlobalState.php', + 'phpunit_util_invalidargumenthelper' => '/Util/InvalidArgumentHelper.php', + 'phpunit_util_log_json' => '/Util/Log/JSON.php', + 'phpunit_util_log_junit' => '/Util/Log/JUnit.php', + 'phpunit_util_log_tap' => '/Util/Log/TAP.php', + 'phpunit_util_php' => '/Util/PHP.php', + 'phpunit_util_php_default' => '/Util/PHP/Default.php', + 'phpunit_util_php_windows' => '/Util/PHP/Windows.php', + 'phpunit_util_printer' => '/Util/Printer.php', + 'phpunit_util_string' => '/Util/String.php', + 'phpunit_util_test' => '/Util/Test.php', + 'phpunit_util_testdox_nameprettifier' => '/Util/TestDox/NamePrettifier.php', + 'phpunit_util_testdox_resultprinter' => '/Util/TestDox/ResultPrinter.php', + 'phpunit_util_testdox_resultprinter_html' => '/Util/TestDox/ResultPrinter/HTML.php', + 'phpunit_util_testdox_resultprinter_text' => '/Util/TestDox/ResultPrinter/Text.php', + 'phpunit_util_testsuiteiterator' => '/Util/TestSuiteIterator.php', + 'phpunit_util_type' => '/Util/Type.php', + 'phpunit_util_xml' => '/Util/XML.php' + ); + + $path = dirname(__FILE__); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); + +// Symfony Yaml autoloader +spl_autoload_register( + function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { + $file = sprintf( + 'Symfony/Component/Yaml%s.php', + + substr( + str_replace('\\', '/', $class), + strlen('Symfony\Component\Yaml') + ) + ); + + if (stream_resolve_include_path($file)) { + require_once $file; + } + } + } +); + +if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) { + require_once 'PHP/Invoker/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) { + require_once 'PHPUnit/Extensions/Database/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumCommon/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumCommon/Autoload.php'; +} + +else if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumTestCase/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumTestCase/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/Story/Autoload.php')) { + require_once 'PHPUnit/Extensions/Story/Autoload.php'; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in @@ -0,0 +1,130 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +if (defined('PHPUNIT_COMPOSER_INSTALL')) { + return; +} + +$paths = array( + __DIR__ . '/../vendor', + __DIR__ . '/../../..' +); + +foreach ($paths as $path) { + if (@is_dir($path . '/composer') && + @is_file($path . '/autoload.php')) { + require_once $path . '/autoload.php'; + define('PHPUNIT_COMPOSER_INSTALL', $path . '/autoload.php'); + + return; + } +} + +require_once 'File/Iterator/Autoload.php'; +require_once 'PHP/CodeCoverage/Autoload.php'; +require_once 'PHP/Timer/Autoload.php'; +require_once 'PHPUnit/Framework/MockObject/Autoload.php'; +require_once 'Text/Template/Autoload.php'; + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + + $path = dirname(__FILE__); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); + +// Symfony Yaml autoloader +spl_autoload_register( + function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { + $file = sprintf( + 'Symfony/Component/Yaml%s.php', + + substr( + str_replace('\\', '/', $class), + strlen('Symfony\Component\Yaml') + ) + ); + + if (stream_resolve_include_path($file)) { + require_once $file; + } + } + } +); + +if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) { + require_once 'PHP/Invoker/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) { + require_once 'PHPUnit/Extensions/Database/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumCommon/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumCommon/Autoload.php'; +} + +else if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumTestCase/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumTestCase/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/Story/Autoload.php')) { + require_once 'PHPUnit/Extensions/Story/Autoload.php'; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php @@ -0,0 +1,99 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * We have a TestSuite object A. + * In TestSuite object A we have Tests tagged with @group. + * We want a TestSuite object B that contains TestSuite objects C, D, ... + * for the Tests tagged with @group C, @group D, ... + * Running the Tests from TestSuite object B results in Tests tagged with both + * @group C and @group D in TestSuite object A to be run twice . + * + * <code> + * $suite = new PHPUnit_Extensions_GroupTestSuite($A, array('C', 'D')); + * </code> + * + * @package PHPUnit + * @subpackage Extensions + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Extensions_GroupTestSuite extends PHPUnit_Framework_TestSuite +{ + public function __construct(PHPUnit_Framework_TestSuite $suite, array $groups) + { + $groupSuites = array(); + $name = $suite->getName(); + + foreach ($groups as $group) { + $groupSuites[$group] = new PHPUnit_Framework_TestSuite($name . ' - ' . $group); + $this->addTest($groupSuites[$group]); + } + + $tests = new RecursiveIteratorIterator( + new PHPUnit_Util_TestSuiteIterator($suite), + RecursiveIteratorIterator::LEAVES_ONLY + ); + + foreach ($tests as $test) { + if ($test instanceof PHPUnit_Framework_TestCase) { + $testGroups = PHPUnit_Util_Test::getGroups( + get_class($test), $test->getName(FALSE) + ); + + foreach ($groups as $group) { + foreach ($testGroups as $testGroup) { + if ($group == $testGroup) { + $groupSuites[$group]->addTest($test); + } + } + } + } + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php @@ -0,0 +1,269 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.4 + */ + +if (stream_resolve_include_path('PEAR/RunTest.php')) { + $currentErrorReporting = error_reporting(E_ERROR | E_WARNING | E_PARSE); + require_once 'PEAR/RunTest.php'; + error_reporting($currentErrorReporting); +} + +/** + * Wrapper to run .phpt test cases. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.4 + */ +class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing +{ + /** + * The filename of the .phpt file. + * + * @var string + */ + protected $filename; + + /** + * Options for PEAR_RunTest. + * + * @var array + */ + protected $options = array(); + + /** + * Constructs a test case with the given filename. + * + * @param string $filename + * @param array $options + */ + public function __construct($filename, array $options = array()) + { + if (!is_string($filename)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_file($filename)) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'File "%s" does not exist.', + $filename + ) + ); + } + + $this->filename = $filename; + $this->options = $options; + } + + /** + * Counts the number of test cases executed by run(TestResult result). + * + * @return integer + */ + public function count() + { + return 1; + } + + /** + * Runs a test and collects its result in a TestResult instance. + * + * @param PHPUnit_Framework_TestResult $result + * @param array $options + * @return PHPUnit_Framework_TestResult + */ + public function run(PHPUnit_Framework_TestResult $result = NULL, array $options = array()) + { + if (!class_exists('PEAR_RunTest', FALSE)) { + throw new PHPUnit_Framework_Exception('Class PEAR_RunTest not found.'); + } + + if (isset($GLOBALS['_PEAR_destructor_object_list']) && + is_array($GLOBALS['_PEAR_destructor_object_list']) && + !empty($GLOBALS['_PEAR_destructor_object_list'])) { + $pearDestructorObjectListCount = count($GLOBALS['_PEAR_destructor_object_list']); + } else { + $pearDestructorObjectListCount = 0; + } + + if ($result === NULL) { + $result = new PHPUnit_Framework_TestResult; + } + + $coverage = $result->getCollectCodeCoverageInformation(); + $options = array_merge($options, $this->options); + + if (!isset($options['include_path'])) { + $options['include_path'] = get_include_path(); + } + + if ($coverage) { + $options['coverage'] = TRUE; + } else { + $options['coverage'] = FALSE; + } + + $currentErrorReporting = error_reporting(E_ERROR | E_WARNING | E_PARSE); + $runner = new PEAR_RunTest(new PHPUnit_Extensions_PhptTestCase_Logger, $options); + + if ($coverage) { + $runner->xdebug_loaded = TRUE; + } else { + $runner->xdebug_loaded = FALSE; + } + + $result->startTest($this); + + PHP_Timer::start(); + + $buffer = $runner->run($this->filename, $options); + $time = PHP_Timer::stop(); + + error_reporting($currentErrorReporting); + + $base = basename($this->filename); + $path = dirname($this->filename); + $coverageFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.xdebug', $base + ); + $diffFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.diff', $base + ); + $expFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.exp', $base + ); + $logFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.log', $base + ); + $outFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.out', $base + ); + $phpFile = $path . DIRECTORY_SEPARATOR . str_replace( + '.phpt', '.php', $base + ); + + if (is_object($buffer) && $buffer instanceof PEAR_Error) { + $result->addError( + $this, + new PHPUnit_Framework_Exception($buffer->getMessage()), + $time + ); + } + + else if ($buffer == 'SKIPPED') { + $result->addFailure($this, new PHPUnit_Framework_SkippedTestError, 0); + } + + else if ($buffer != 'PASSED') { + $expContent = file_get_contents($expFile); + $outContent = file_get_contents($outFile); + + $result->addFailure( + $this, + new PHPUnit_Framework_ComparisonFailure( + $expContent, + $outContent, + $expContent, + $outContent + ), + $time + ); + } + + foreach (array($diffFile, $expFile, $logFile, $phpFile, $outFile) as $file) { + if (file_exists($file)) { + unlink($file); + } + } + + if ($coverage && file_exists($coverageFile)) { + eval('$coverageData = ' . file_get_contents($coverageFile) . ';'); + unset($coverageData[$phpFile]); + + $result->getCodeCoverage()->append($coverageData, $this); + unlink($coverageFile); + } + + $result->endTest($this, $time); + + // Do not invoke PEAR's destructor mechanism for PHP 4 + // as it raises an E_STRICT. + if ($pearDestructorObjectListCount == 0) { + unset($GLOBALS['_PEAR_destructor_object_list']); + } else { + $count = count($GLOBALS['_PEAR_destructor_object_list']) - $pearDestructorObjectListCount; + + for ($i = 0; $i < $count; $i++) { + array_pop($GLOBALS['_PEAR_destructor_object_list']); + } + } + + return $result; + } + + /** + * Returns the name of the test case. + * + * @return string + */ + public function getName() + { + return $this->toString(); + } + + /** + * Returns a string representation of the test case. + * + * @return string + */ + public function toString() + { + return $this->filename; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php @@ -0,0 +1,62 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.4 + */ + +/** + * Dummy logger for PEAR_RunTest. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.4 + */ +class PHPUnit_Extensions_PhptTestCase_Logger +{ + public function log($level, $msg, $append_crlf = TRUE) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php @@ -0,0 +1,82 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.4 + */ + +/** + * Suite for .phpt test cases. + * + * @package PHPUnit + * @subpackage Extensions_PhptTestCase + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.4 + */ +class PHPUnit_Extensions_PhptTestSuite extends PHPUnit_Framework_TestSuite +{ + /** + * Constructs a new TestSuite for .phpt test cases. + * + * @param string $directory + * @param array $options Array with ini settings for the php instance run, + * key being the name if the setting, value the ini value. + * @throws PHPUnit_Framework_Exception + */ + public function __construct($directory, array $options = array()) + { + if (is_string($directory) && is_dir($directory)) { + $this->setName($directory); + + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray($directory, '.phpt'); + + foreach ($files as $file) { + $this->addTestFile($file, $options); + } + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'directory name'); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php @@ -0,0 +1,155 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A Decorator that runs a test repeatedly. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator +{ + /** + * @var mixed + */ + protected $filter = FALSE; + + /** + * @var array + */ + protected $groups = array(); + + /** + * @var array + */ + protected $excludeGroups = array(); + + /** + * @var boolean + */ + protected $processIsolation = FALSE; + + /** + * @var integer + */ + protected $timesRepeat = 1; + + /** + * Constructor. + * + * @param PHPUnit_Framework_Test $test + * @param integer $timesRepeat + * @param mixed $filter + * @param array $groups + * @param array $excludeGroups + * @param boolean $processIsolation + * @throws PHPUnit_Framework_Exception + */ + public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1, $filter = FALSE, array $groups = array(), array $excludeGroups = array(), $processIsolation = FALSE) + { + parent::__construct($test); + + if (is_integer($timesRepeat) && + $timesRepeat >= 0) { + $this->timesRepeat = $timesRepeat; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'positive integer' + ); + } + + $this->filter = $filter; + $this->groups = $groups; + $this->excludeGroups = $excludeGroups; + $this->processIsolation = $processIsolation; + } + + /** + * Counts the number of test cases that + * will be run by this test. + * + * @return integer + */ + public function count() + { + return $this->timesRepeat * count($this->test); + } + + /** + * Runs the decorated test and collects the + * result in a TestResult. + * + * @param PHPUnit_Framework_TestResult $result + * @return PHPUnit_Framework_TestResult + * @throws PHPUnit_Framework_Exception + */ + public function run(PHPUnit_Framework_TestResult $result = NULL) + { + if ($result === NULL) { + $result = $this->createResult(); + } + + //@codingStandardsIgnoreStart + for ($i = 0; $i < $this->timesRepeat && !$result->shouldStop(); $i++) { + //@codingStandardsIgnoreEnd + if ($this->test instanceof PHPUnit_Framework_TestSuite) { + $this->test->run( + $result, + $this->filter, + $this->groups, + $this->excludeGroups, + $this->processIsolation + ); + } else { + $this->test->run($result); + } + } + + return $result; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php @@ -0,0 +1,149 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A Decorator for Tests. + * + * Use TestDecorator as the base class for defining new + * test decorators. Test decorator subclasses can be introduced + * to add behaviour before or after a test is run. + * + * @package PHPUnit + * @subpackage Extensions + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Extensions_TestDecorator extends PHPUnit_Framework_Assert implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing +{ + /** + * The Test to be decorated. + * + * @var object + */ + protected $test = NULL; + + /** + * Constructor. + * + * @param PHPUnit_Framework_Test $test + */ + public function __construct(PHPUnit_Framework_Test $test) + { + $this->test = $test; + } + + /** + * Returns a string representation of the test. + * + * @return string + */ + public function toString() + { + return $this->test->toString(); + } + + /** + * Runs the test and collects the + * result in a TestResult. + * + * @param PHPUnit_Framework_TestResult $result + */ + public function basicRun(PHPUnit_Framework_TestResult $result) + { + $this->test->run($result); + } + + /** + * Counts the number of test cases that + * will be run by this test. + * + * @return integer + */ + public function count() + { + return count($this->test); + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit_Framework_TestResult + */ + protected function createResult() + { + return new PHPUnit_Framework_TestResult; + } + + /** + * Returns the test to be run. + * + * @return PHPUnit_Framework_Test + */ + public function getTest() + { + return $this->test; + } + + /** + * Runs the decorated test and collects the + * result in a TestResult. + * + * @param PHPUnit_Framework_TestResult $result + * @return PHPUnit_Framework_TestResult + */ + public function run(PHPUnit_Framework_TestResult $result = NULL) + { + if ($result === NULL) { + $result = $this->createResult(); + } + + $this->basicRun($result); + + return $result; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php @@ -0,0 +1,224 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Extensions_TicketListener + * @author Sean Coates <sean@caedmon.net> + * @author Raphael Stolt <raphael.stolt@gmail.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Base class for test listeners that interact with an issue tracker. + * + * @package PHPUnit + * @subpackage Extensions_TicketListener + * @author Sean Coates <sean@caedmon.net> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_TestListener +{ + /** + * @var array + */ + protected $ticketCounts = array(); + + /** + * @var boolean + */ + protected $ran = FALSE; + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * A test suite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test suite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + if (!$test instanceof PHPUnit_Framework_Warning) { + if ($this->ran) { + return; + } + + $name = $test->getName(FALSE); + $tickets = PHPUnit_Util_Test::getTickets(get_class($test), $name); + + foreach ($tickets as $ticket) { + $this->ticketCounts[$ticket][$name] = 1; + } + + $this->ran = TRUE; + } + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if (!$test instanceof PHPUnit_Framework_Warning) { + if ($test->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED) { + $ifStatus = array('assigned', 'new', 'reopened'); + $newStatus = 'closed'; + $message = 'Automatically closed by PHPUnit (test passed).'; + $resolution = 'fixed'; + $cumulative = TRUE; + } + + else if ($test->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) { + $ifStatus = array('closed'); + $newStatus = 'reopened'; + $message = 'Automatically reopened by PHPUnit (test failed).'; + $resolution = ''; + $cumulative = FALSE; + } + + else { + return; + } + + $name = $test->getName(FALSE); + $tickets = PHPUnit_Util_Test::getTickets(get_class($test), $name); + + foreach ($tickets as $ticket) { + // Remove this test from the totals (if it passed). + if ($test->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED) { + unset($this->ticketCounts[$ticket][$name]); + } + + // Only close tickets if ALL referenced cases pass + // but reopen tickets if a single test fails. + if ($cumulative) { + // Determine number of to-pass tests: + if (count($this->ticketCounts[$ticket]) > 0) { + // There exist remaining test cases with this reference. + $adjustTicket = FALSE; + } else { + // No remaining tickets, go ahead and adjust. + $adjustTicket = TRUE; + } + } else { + $adjustTicket = TRUE; + } + + $ticketInfo = $this->getTicketInfo($ticket); + + if ($adjustTicket && in_array($ticketInfo['status'], $ifStatus)) { + $this->updateTicket($ticket, $newStatus, $message, $resolution); + } + } + } + } + + abstract protected function getTicketInfo($ticketId = NULL); + abstract protected function updateTicket($ticketId, $newStatus, $message, $resolution); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php @@ -0,0 +1,2847 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A set of assert methods. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +abstract class PHPUnit_Framework_Assert +{ + /** + * @var integer + */ + private static $count = 0; + + /** + * Asserts that an array has a specified key. + * + * @param mixed $key + * @param array|ArrayAccess $array + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertArrayHasKey($key, $array, $message = '') + { + if (!(is_integer($key) || is_string($key))) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'integer or string' + ); + } + if (!(is_array($array) || $array instanceof ArrayAccess)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array or ArrayAccess' + ); + } + + $constraint = new PHPUnit_Framework_Constraint_ArrayHasKey($key); + + self::assertThat($array, $constraint, $message); + } + + /** + * Asserts that an array does not have a specified key. + * + * @param mixed $key + * @param array|ArrayAccess $array + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertArrayNotHasKey($key, $array, $message = '') + { + if (!(is_integer($key) || is_string($key))) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'integer or string' + ); + } + if (!(is_array($array) || $array instanceof ArrayAccess)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array or ArrayAccess' + ); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_ArrayHasKey($key) + ); + + self::assertThat($array, $constraint, $message); + } + + /** + * Asserts that a haystack contains a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 2.1.0 + */ + public static function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) + { + if (is_array($haystack) || + is_object($haystack) && $haystack instanceof Traversable) { + $constraint = new PHPUnit_Framework_Constraint_TraversableContains( + $needle, $checkForObjectIdentity + ); + } + + else if (is_string($haystack)) { + $constraint = new PHPUnit_Framework_Constraint_StringContains( + $needle, $ignoreCase + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array, iterator or string' + ); + } + + self::assertThat($haystack, $constraint, $message); + } + + /** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object contains a needle. + * + * @param mixed $needle + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 3.0.0 + */ + public static function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) + { + self::assertContains( + $needle, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message, + $ignoreCase, + $checkForObjectIdentity + ); + } + + /** + * Asserts that a haystack does not contain a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 2.1.0 + */ + public static function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) + { + if (is_array($haystack) || + is_object($haystack) && $haystack instanceof Traversable) { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_TraversableContains( + $needle, $checkForObjectIdentity + ) + ); + } + + else if (is_string($haystack)) { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_StringContains( + $needle, $ignoreCase + ) + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array, iterator or string' + ); + } + + self::assertThat($haystack, $constraint, $message); + } + + /** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object does not contain a needle. + * + * @param mixed $needle + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 3.0.0 + */ + public static function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) + { + self::assertNotContains( + $needle, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message, + $ignoreCase, + $checkForObjectIdentity + ); + } + + /** + * Asserts that a haystack contains only values of a given type. + * + * @param string $type + * @param mixed $haystack + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ + public static function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') + { + if (!(is_array($haystack) || + is_object($haystack) && $haystack instanceof Traversable)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array or iterator' + ); + } + + if ($isNativeType == NULL) { + $isNativeType = PHPUnit_Util_Type::isType($type); + } + + self::assertThat( + $haystack, + new PHPUnit_Framework_Constraint_TraversableContainsOnly( + $type, $isNativeType + ), + $message + ); + } + + /** + * Asserts that a haystack contains only instances of a given classname + * + * @param string $classname + * @param array|Traversable $haystack + * @param string $message + */ + public static function assertContainsOnlyInstancesOf($classname, $haystack, $message = '') + { + if (!(is_array($haystack) || + is_object($haystack) && $haystack instanceof Traversable)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array or iterator' + ); + } + + self::assertThat( + $haystack, + new PHPUnit_Framework_Constraint_TraversableContainsOnly( + $classname, FALSE + ), + $message + ); + } + + /** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object contains only values of a given type. + * + * @param string $type + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ + public static function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '') + { + self::assertContainsOnly( + $type, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $isNativeType, + $message + ); + } + + /** + * Asserts that a haystack does not contain only values of a given type. + * + * @param string $type + * @param mixed $haystack + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ + public static function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') + { + if (!(is_array($haystack) || + is_object($haystack) && $haystack instanceof Traversable)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 2, 'array or iterator' + ); + } + + if ($isNativeType == NULL) { + $isNativeType = PHPUnit_Util_Type::isType($type); + } + + self::assertThat( + $haystack, + new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_TraversableContainsOnly( + $type, $isNativeType + ) + ), + $message + ); + } + + /** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object does not contain only values of a given + * type. + * + * @param string $type + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ + public static function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '') + { + self::assertNotContainsOnly( + $type, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $isNativeType, + $message + ); + } + + /** + * Asserts the number of elements of an array, Countable or Iterator. + * + * @param integer $expectedCount + * @param mixed $haystack + * @param string $message + */ + public static function assertCount($expectedCount, $haystack, $message = '') + { + if (!is_int($expectedCount)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer'); + } + + if (!$haystack instanceof Countable && + !$haystack instanceof Iterator && + !is_array($haystack)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable'); + } + + self::assertThat( + $haystack, + new PHPUnit_Framework_Constraint_Count($expectedCount), + $message + ); + } + + /** + * Asserts the number of elements of an array, Countable or Iterator + * that is stored in an attribute. + * + * @param integer $expectedCount + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.6.0 + */ + public static function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '') + { + self::assertCount( + $expectedCount, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message + ); + } + + /** + * Asserts the number of elements of an array, Countable or Iterator. + * + * @param integer $expectedCount + * @param mixed $haystack + * @param string $message + */ + public static function assertNotCount($expectedCount, $haystack, $message = '') + { + if (!is_int($expectedCount)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer'); + } + + if (!$haystack instanceof Countable && + !$haystack instanceof Iterator && + !is_array($haystack)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_Count($expectedCount) + ); + + self::assertThat($haystack, $constraint, $message); + } + + /** + * Asserts the number of elements of an array, Countable or Iterator + * that is stored in an attribute. + * + * @param integer $expectedCount + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.6.0 + */ + public static function assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '') + { + self::assertNotCount( + $expectedCount, + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message + ); + } + + /** + * Asserts that two variables are equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ + public static function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + $constraint = new PHPUnit_Framework_Constraint_IsEqual( + $expected, $delta, $maxDepth, $canonicalize, $ignoreCase + ); + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that a variable is equal to an attribute of an object. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ + public static function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertEquals( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message, + $delta, + $maxDepth, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that two variables are not equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 2.3.0 + */ + public static function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_IsEqual( + $expected, $delta, $maxDepth, $canonicalize, $ignoreCase + ) + ); + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that a variable is not equal to an attribute of an object. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ + public static function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertNotEquals( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message, + $delta, + $maxDepth, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that a variable is empty. + * + * @param mixed $actual + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ + public static function assertEmpty($actual, $message = '') + { + self::assertThat($actual, self::isEmpty(), $message); + } + + /** + * Asserts that a static attribute of a class or an attribute of an object + * is empty. + * + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '') + { + self::assertEmpty( + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message + ); + } + + /** + * Asserts that a variable is not empty. + * + * @param mixed $actual + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ + public static function assertNotEmpty($actual, $message = '') + { + self::assertThat($actual, self::logicalNot(self::isEmpty()), $message); + } + + /** + * Asserts that a static attribute of a class or an attribute of an object + * is not empty. + * + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '') + { + self::assertNotEmpty( + self::readAttribute($haystackClassOrObject, $haystackAttributeName), + $message + ); + } + + /** + * Asserts that a value is greater than another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertGreaterThan($expected, $actual, $message = '') + { + self::assertThat($actual, self::greaterThan($expected), $message); + } + + /** + * Asserts that an attribute is greater than another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertGreaterThan( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that a value is greater than or equal to another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertGreaterThanOrEqual($expected, $actual, $message = '') + { + self::assertThat( + $actual, self::greaterThanOrEqual($expected), $message + ); + } + + /** + * Asserts that an attribute is greater than or equal to another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertGreaterThanOrEqual( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that a value is smaller than another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertLessThan($expected, $actual, $message = '') + { + self::assertThat($actual, self::lessThan($expected), $message); + } + + /** + * Asserts that an attribute is smaller than another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertLessThan( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that a value is smaller than or equal to another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertLessThanOrEqual($expected, $actual, $message = '') + { + self::assertThat($actual, self::lessThanOrEqual($expected), $message); + } + + /** + * Asserts that an attribute is smaller than or equal to another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertLessThanOrEqual( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that the contents of one file is equal to the contents of another + * file. + * + * @param string $expected + * @param string $actual + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.2.14 + */ + public static function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertFileExists($expected, $message); + self::assertFileExists($actual, $message); + + self::assertEquals( + file_get_contents($expected), + file_get_contents($actual), + $message, + 0, + 10, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that the contents of one file is not equal to the contents of + * another file. + * + * @param string $expected + * @param string $actual + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.2.14 + */ + public static function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertFileExists($expected, $message); + self::assertFileExists($actual, $message); + + self::assertNotEquals( + file_get_contents($expected), + file_get_contents($actual), + $message, + 0, + 10, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that the contents of a string is equal + * to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.3.0 + */ + public static function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertFileExists($expectedFile, $message); + + self::assertEquals( + file_get_contents($expectedFile), + $actualString, + $message, + 0, + 10, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that the contents of a string is not equal + * to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.3.0 + */ + public static function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) + { + self::assertFileExists($expectedFile, $message); + + self::assertNotEquals( + file_get_contents($expectedFile), + $actualString, + $message, + 0, + 10, + $canonicalize, + $ignoreCase + ); + } + + /** + * Asserts that a file exists. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertFileExists($filename, $message = '') + { + if (!is_string($filename)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_FileExists; + + self::assertThat($filename, $constraint, $message); + } + + /** + * Asserts that a file does not exist. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertFileNotExists($filename, $message = '') + { + if (!is_string($filename)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_FileExists + ); + + self::assertThat($filename, $constraint, $message); + } + + /** + * Asserts that a condition is true. + * + * @param boolean $condition + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ + public static function assertTrue($condition, $message = '') + { + self::assertThat($condition, self::isTrue(), $message); + } + + /** + * Asserts that a condition is false. + * + * @param boolean $condition + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ + public static function assertFalse($condition, $message = '') + { + self::assertThat($condition, self::isFalse(), $message); + } + + /** + * Asserts that a variable is not NULL. + * + * @param mixed $actual + * @param string $message + */ + public static function assertNotNull($actual, $message = '') + { + self::assertThat($actual, self::logicalNot(self::isNull()), $message); + } + + /** + * Asserts that a variable is NULL. + * + * @param mixed $actual + * @param string $message + */ + public static function assertNull($actual, $message = '') + { + self::assertThat($actual, self::isNull(), $message); + } + + /** + * Asserts that a class has a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertClassHasAttribute($attributeName, $className, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($className) || !class_exists($className, FALSE)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'class name'); + } + + $constraint = new PHPUnit_Framework_Constraint_ClassHasAttribute( + $attributeName + ); + + self::assertThat($className, $constraint, $message); + } + + /** + * Asserts that a class does not have a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertClassNotHasAttribute($attributeName, $className, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($className) || !class_exists($className, FALSE)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'class name'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_ClassHasAttribute($attributeName) + ); + + self::assertThat($className, $constraint, $message); + } + + /** + * Asserts that a class has a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertClassHasStaticAttribute($attributeName, $className, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($className) || !class_exists($className, FALSE)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'class name'); + } + + $constraint = new PHPUnit_Framework_Constraint_ClassHasStaticAttribute( + $attributeName + ); + + self::assertThat($className, $constraint, $message); + } + + /** + * Asserts that a class does not have a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertClassNotHasStaticAttribute($attributeName, $className, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($className) || !class_exists($className, FALSE)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'class name'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_ClassHasStaticAttribute( + $attributeName + ) + ); + + self::assertThat($className, $constraint, $message); + } + + /** + * Asserts that an object has a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertObjectHasAttribute($attributeName, $object, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_object($object)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'object'); + } + + $constraint = new PHPUnit_Framework_Constraint_ObjectHasAttribute( + $attributeName + ); + + self::assertThat($object, $constraint, $message); + } + + /** + * Asserts that an object does not have a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertObjectNotHasAttribute($attributeName, $object, $message = '') + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_object($object)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'object'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_ObjectHasAttribute($attributeName) + ); + + self::assertThat($object, $constraint, $message); + } + + /** + * Asserts that two variables have the same type and value. + * Used on objects, it asserts that two variables reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + */ + public static function assertSame($expected, $actual, $message = '') + { + if (is_bool($expected) && is_bool($actual)) { + self::assertEquals($expected, $actual, $message); + } else { + $constraint = new PHPUnit_Framework_Constraint_IsIdentical( + $expected + ); + + self::assertThat($actual, $constraint, $message); + } + } + + /** + * Asserts that a variable and an attribute of an object have the same type + * and value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param object $actualClassOrObject + * @param string $message + */ + public static function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertSame( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that two variables do not have the same type and value. + * Used on objects, it asserts that two variables do not reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + */ + public static function assertNotSame($expected, $actual, $message = '') + { + if (is_bool($expected) && is_bool($actual)) { + self::assertNotEquals($expected, $actual, $message); + } else { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_IsIdentical($expected) + ); + + self::assertThat($actual, $constraint, $message); + } + } + + /** + * Asserts that a variable and an attribute of an object do not have the + * same type and value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param object $actualClassOrObject + * @param string $message + */ + public static function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '') + { + self::assertNotSame( + $expected, + self::readAttribute($actualClassOrObject, $actualAttributeName), + $message + ); + } + + /** + * Asserts that a variable is of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertInstanceOf($expected, $actual, $message = '') + { + if (is_string($expected)) { + if (class_exists($expected) || interface_exists($expected)) { + $constraint = new PHPUnit_Framework_Constraint_IsInstanceOf( + $expected + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class or interface name' + ); + } + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '') + { + self::assertInstanceOf( + $expected, + self::readAttribute($classOrObject, $attributeName), + $message + ); + } + + /** + * Asserts that a variable is not of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertNotInstanceOf($expected, $actual, $message = '') + { + if (is_string($expected)) { + if (class_exists($expected) || interface_exists($expected)) { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_IsInstanceOf($expected) + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class or interface name' + ); + } + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '') + { + self::assertNotInstanceOf( + $expected, + self::readAttribute($classOrObject, $attributeName), + $message + ); + } + + /** + * Asserts that a variable is of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertInternalType($expected, $actual, $message = '') + { + if (is_string($expected)) { + $constraint = new PHPUnit_Framework_Constraint_IsType( + $expected + ); + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '') + { + self::assertInternalType( + $expected, + self::readAttribute($classOrObject, $attributeName), + $message + ); + } + + /** + * Asserts that a variable is not of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertNotInternalType($expected, $actual, $message = '') + { + if (is_string($expected)) { + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_IsType($expected) + ); + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '') + { + self::assertNotInternalType( + $expected, + self::readAttribute($classOrObject, $attributeName), + $message + ); + } + + /** + * Asserts that a string matches a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + */ + public static function assertRegExp($pattern, $string, $message = '') + { + if (!is_string($pattern)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_PCREMatch($pattern); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string does not match a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @since Method available since Release 2.1.0 + */ + public static function assertNotRegExp($pattern, $string, $message = '') + { + if (!is_string($pattern)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_PCREMatch($pattern) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Assert that the size of two arrays (or `Countable` or `Iterator` objects) + * is the same. + * + * @param array|Countable|Iterator $expected + * @param array|Countable|Iterator $actual + * @param string $message + */ + public static function assertSameSize($expected, $actual, $message = '') + { + if (!$expected instanceof Countable && + !$expected instanceof Iterator && + !is_array($expected)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'countable'); + } + + if (!$actual instanceof Countable && + !$actual instanceof Iterator && + !is_array($actual)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable'); + } + + self::assertThat( + $actual, + new PHPUnit_Framework_Constraint_SameSize($expected), + $message + ); + } + + /** + * Assert that the size of two arrays (or `Countable` or `Iterator` objects) + * is not the same. + * + * @param array|Countable|Iterator $expected + * @param array|Countable|Iterator $actual + * @param string $message + */ + public static function assertNotSameSize($expected, $actual, $message = '') + { + if (!$expected instanceof Countable && + !$expected instanceof Iterator && + !is_array($expected)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'countable'); + } + + if (!$actual instanceof Countable && + !$actual instanceof Iterator && + !is_array($actual)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_SameSize($expected) + ); + + self::assertThat($actual, $constraint, $message); + } + + /** + * Asserts that a string matches a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertStringMatchesFormat($format, $string, $message = '') + { + if (!is_string($format)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_StringMatches($format); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string does not match a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertStringNotMatchesFormat($format, $string, $message = '') + { + if (!is_string($format)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_StringMatches($format) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string matches a given format file. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertStringMatchesFormatFile($formatFile, $string, $message = '') + { + self::assertFileExists($formatFile, $message); + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_StringMatches( + file_get_contents($formatFile) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string does not match a given format string. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ + public static function assertStringNotMatchesFormatFile($formatFile, $string, $message = '') + { + self::assertFileExists($formatFile, $message); + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_StringMatches( + file_get_contents($formatFile) + ) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string starts with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ + public static function assertStringStartsWith($prefix, $string, $message = '') + { + if (!is_string($prefix)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_StringStartsWith( + $prefix + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string starts not with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ + public static function assertStringStartsNotWith($prefix, $string, $message = '') + { + if (!is_string($prefix)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_StringStartsWith($prefix) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string ends with a given suffix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ + public static function assertStringEndsWith($suffix, $string, $message = '') + { + if (!is_string($suffix)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_StringEndsWith($suffix); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that a string ends not with a given suffix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ + public static function assertStringEndsNotWith($suffix, $string, $message = '') + { + if (!is_string($suffix)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!is_string($string)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $constraint = new PHPUnit_Framework_Constraint_Not( + new PHPUnit_Framework_Constraint_StringEndsWith($suffix) + ); + + self::assertThat($string, $constraint, $message); + } + + /** + * Asserts that two XML files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '') + { + self::assertFileExists($expectedFile); + self::assertFileExists($actualFile); + + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->load($expectedFile); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->load($actualFile); + + self::assertEquals($expected, $actual, $message); + } + + /** + * Asserts that two XML files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '') + { + self::assertFileExists($expectedFile); + self::assertFileExists($actualFile); + + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->load($expectedFile); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->load($actualFile); + + self::assertNotEquals($expected, $actual, $message); + } + + /** + * Asserts that two XML documents are equal. + * + * @param string $expectedFile + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.3.0 + */ + public static function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '') + { + self::assertFileExists($expectedFile); + + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->load($expectedFile); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->loadXML($actualXml); + + self::assertEquals($expected, $actual, $message); + } + + /** + * Asserts that two XML documents are not equal. + * + * @param string $expectedFile + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.3.0 + */ + public static function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '') + { + self::assertFileExists($expectedFile); + + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->load($expectedFile); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->loadXML($actualXml); + + self::assertNotEquals($expected, $actual, $message); + } + + /** + * Asserts that two XML documents are equal. + * + * @param string $expectedXml + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '') + { + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->loadXML($expectedXml); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->loadXML($actualXml); + + self::assertEquals($expected, $actual, $message); + } + + /** + * Asserts that two XML documents are not equal. + * + * @param string $expectedXml + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.1.0 + */ + public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '') + { + $expected = new DOMDocument; + $expected->preserveWhiteSpace = FALSE; + $expected->loadXML($expectedXml); + + $actual = new DOMDocument; + $actual->preserveWhiteSpace = FALSE; + $actual->loadXML($actualXml); + + self::assertNotEquals($expected, $actual, $message); + } + + /** + * Asserts that a hierarchy of DOMElements matches. + * + * @param DOMElement $expectedElement + * @param DOMElement $actualElement + * @param boolean $checkAttributes + * @param string $message + * @author Mattis Stordalen Flister <mattis@xait.no> + * @since Method available since Release 3.3.0 + */ + public static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = FALSE, $message = '') + { + $expectedElement = clone $expectedElement; + $actualElement = clone $actualElement; + + self::assertEquals( + $expectedElement->tagName, + $actualElement->tagName, + $message + ); + + if ($checkAttributes) { + self::assertEquals( + $expectedElement->attributes->length, + $actualElement->attributes->length, + sprintf( + '%s%sNumber of attributes on node "%s" does not match', + $message, + !empty($message) ? "\n" : '', + $expectedElement->tagName + ) + ); + + for ($i = 0 ; $i < $expectedElement->attributes->length; $i++) { + $expectedAttribute = $expectedElement->attributes->item($i); + $actualAttribute = $actualElement->attributes->getNamedItem( + $expectedAttribute->name + ); + + if (!$actualAttribute) { + self::fail( + sprintf( + '%s%sCould not find attribute "%s" on node "%s"', + $message, + !empty($message) ? "\n" : '', + $expectedAttribute->name, + $expectedElement->tagName + ) + ); + } + } + } + + PHPUnit_Util_XML::removeCharacterDataNodes($expectedElement); + PHPUnit_Util_XML::removeCharacterDataNodes($actualElement); + + self::assertEquals( + $expectedElement->childNodes->length, + $actualElement->childNodes->length, + sprintf( + '%s%sNumber of child nodes of "%s" differs', + $message, + !empty($message) ? "\n" : '', + $expectedElement->tagName + ) + ); + + for ($i = 0; $i < $expectedElement->childNodes->length; $i++) { + self::assertEqualXMLStructure( + $expectedElement->childNodes->item($i), + $actualElement->childNodes->item($i), + $checkAttributes, + $message + ); + } + } + + /** + * Assert the presence, absence, or count of elements in a document matching + * the CSS $selector, regardless of the contents of those elements. + * + * The first argument, $selector, is the CSS selector used to match + * the elements in the $actual document. + * + * The second argument, $count, can be either boolean or numeric. + * When boolean, it asserts for presence of elements matching the selector + * (TRUE) or absence of elements (FALSE). + * When numeric, it asserts the count of elements. + * + * assertSelectCount("#binder", true, $xml); // any? + * assertSelectCount(".binder", 3, $xml); // exactly 3? + * + * @param array $selector + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE) + { + self::assertSelectEquals( + $selector, TRUE, $count, $actual, $message, $isHtml + ); + } + + /** + * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any? + * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml); // 3? + * + * @param array $selector + * @param string $pattern + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE) + { + self::assertSelectEquals( + $selector, "regexp:$pattern", $count, $actual, $message, $isHtml + ); + } + + /** + * assertSelectEquals("#binder .name", "Chuck", true, $xml); // any? + * assertSelectEquals("#binder .name", "Chuck", false, $xml); // none? + * + * @param array $selector + * @param string $content + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE) + { + $tags = PHPUnit_Util_XML::cssSelect( + $selector, $content, $actual, $isHtml + ); + + // assert specific number of elements + if (is_numeric($count)) { + $counted = $tags ? count($tags) : 0; + self::assertEquals($count, $counted, $message); + } + + // assert any elements exist if true, assert no elements exist if false + else if (is_bool($count)) { + $any = count($tags) > 0 && $tags[0] instanceof DOMNode; + + if ($count) { + self::assertTrue($any, $message); + } else { + self::assertFalse($any, $message); + } + } + + // check for range number of elements + else if (is_array($count) && + (isset($count['>']) || isset($count['<']) || + isset($count['>=']) || isset($count['<=']))) { + $counted = $tags ? count($tags) : 0; + + if (isset($count['>'])) { + self::assertTrue($counted > $count['>'], $message); + } + + if (isset($count['>='])) { + self::assertTrue($counted >= $count['>='], $message); + } + + if (isset($count['<'])) { + self::assertTrue($counted < $count['<'], $message); + } + + if (isset($count['<='])) { + self::assertTrue($counted <= $count['<='], $message); + } + } else { + throw new PHPUnit_Framework_Exception; + } + } + + /** + * Evaluate an HTML or XML string and assert its structure and/or contents. + * + * The first argument ($matcher) is an associative array that specifies the + * match criteria for the assertion: + * + * - `id` : the node with the given id attribute must match the + * corresponding value. + * - `tag` : the node type must match the corresponding value. + * - `attributes` : a hash. The node's attributes must match the + * corresponding values in the hash. + * - `content` : The text content must match the given value. + * - `parent` : a hash. The node's parent must match the + * corresponding hash. + * - `child` : a hash. At least one of the node's immediate children + * must meet the criteria described by the hash. + * - `ancestor` : a hash. At least one of the node's ancestors must + * meet the criteria described by the hash. + * - `descendant` : a hash. At least one of the node's descendants must + * meet the criteria described by the hash. + * - `children` : a hash, for counting children of a node. + * Accepts the keys: + * - `count` : a number which must equal the number of children + * that match + * - `less_than` : the number of matching children must be greater + * than this number + * - `greater_than` : the number of matching children must be less than + * this number + * - `only` : another hash consisting of the keys to use to match + * on the children, and only matching children will be + * counted + * + * <code> + * // Matcher that asserts that there is an element with an id="my_id". + * $matcher = array('id' => 'my_id'); + * + * // Matcher that asserts that there is a "span" tag. + * $matcher = array('tag' => 'span'); + * + * // Matcher that asserts that there is a "span" tag with the content + * // "Hello World". + * $matcher = array('tag' => 'span', 'content' => 'Hello World'); + * + * // Matcher that asserts that there is a "span" tag with content matching + * // the regular expression pattern. + * $matcher = array('tag' => 'span', 'content' => 'regexp:/Try P(HP|ython)/'); + * + * // Matcher that asserts that there is a "span" with an "list" class + * // attribute. + * $matcher = array( + * 'tag' => 'span', + * 'attributes' => array('class' => 'list') + * ); + * + * // Matcher that asserts that there is a "span" inside of a "div". + * $matcher = array( + * 'tag' => 'span', + * 'parent' => array('tag' => 'div') + * ); + * + * // Matcher that asserts that there is a "span" somewhere inside a + * // "table". + * $matcher = array( + * 'tag' => 'span', + * 'ancestor' => array('tag' => 'table') + * ); + * + * // Matcher that asserts that there is a "span" with at least one "em" + * // child. + * $matcher = array( + * 'tag' => 'span', + * 'child' => array('tag' => 'em') + * ); + * + * // Matcher that asserts that there is a "span" containing a (possibly + * // nested) "strong" tag. + * $matcher = array( + * 'tag' => 'span', + * 'descendant' => array('tag' => 'strong') + * ); + * + * // Matcher that asserts that there is a "span" containing 5-10 "em" tags + * // as immediate children. + * $matcher = array( + * 'tag' => 'span', + * 'children' => array( + * 'less_than' => 11, + * 'greater_than' => 4, + * 'only' => array('tag' => 'em') + * ) + * ); + * + * // Matcher that asserts that there is a "div", with an "ul" ancestor and + * // a "li" parent (with class="enum"), and containing a "span" descendant + * // that contains an element with id="my_test" and the text "Hello World". + * $matcher = array( + * 'tag' => 'div', + * 'ancestor' => array('tag' => 'ul'), + * 'parent' => array( + * 'tag' => 'li', + * 'attributes' => array('class' => 'enum') + * ), + * 'descendant' => array( + * 'tag' => 'span', + * 'child' => array( + * 'id' => 'my_test', + * 'content' => 'Hello World' + * ) + * ) + * ); + * + * // Use assertTag() to apply a $matcher to a piece of $html. + * $this->assertTag($matcher, $html); + * + * // Use assertTag() to apply a $matcher to a piece of $xml. + * $this->assertTag($matcher, $xml, '', FALSE); + * </code> + * + * The second argument ($actual) is a string containing either HTML or + * XML text to be tested. + * + * The third argument ($message) is an optional message that will be + * used if the assertion fails. + * + * The fourth argument ($html) is an optional flag specifying whether + * to load the $actual string into a DOMDocument using the HTML or + * XML load strategy. It is TRUE by default, which assumes the HTML + * load strategy. In many cases, this will be acceptable for XML as well. + * + * @param array $matcher + * @param string $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertTag($matcher, $actual, $message = '', $isHtml = TRUE) + { + $dom = PHPUnit_Util_XML::load($actual, $isHtml); + $tags = PHPUnit_Util_XML::findNodes($dom, $matcher, $isHtml); + $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; + + self::assertTrue($matched, $message); + } + + /** + * This assertion is the exact opposite of assertTag(). + * + * Rather than asserting that $matcher results in a match, it asserts that + * $matcher does not match. + * + * @param array $matcher + * @param string $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE) + { + $dom = PHPUnit_Util_XML::load($actual, $isHtml); + $tags = PHPUnit_Util_XML::findNodes($dom, $matcher, $isHtml); + $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; + + self::assertFalse($matched, $message); + } + + /** + * Evaluates a PHPUnit_Framework_Constraint matcher object. + * + * @param mixed $value + * @param PHPUnit_Framework_Constraint $constraint + * @param string $message + * @since Method available since Release 3.0.0 + */ + public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '') + { + self::$count += count($constraint); + + $constraint->evaluate($value, $message); + } + + /** + * Asserts that a string is a valid JSON string. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.7.20 + */ + public static function assertJson($expectedJson, $message = '') + { + if (!is_string($expectedJson)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + self::assertThat($expectedJson, self::isJson(), $message); + } + + /** + * Asserts that two given JSON encoded objects or arrays are equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + */ + public static function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = '') + { + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + $expected = json_decode($expectedJson); + $actual = json_decode($actualJson); + + self::assertEquals($expected, $actual, $message); + } + + /** + * Asserts that two given JSON encoded objects or arrays are not equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + */ + public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = '') + { + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + $expected = json_decode($expectedJson); + $actual = json_decode($actualJson); + + self::assertNotEquals($expected, $actual, $message); + } + + /** + * Asserts that the generated JSON encoded object and the content of the given file are equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + */ + public static function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = '') + { + self::assertFileExists($expectedFile, $message); + $expectedJson = file_get_contents($expectedFile); + + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + // call constraint + $constraint = new PHPUnit_Framework_Constraint_JsonMatches( + $expectedJson + ); + + self::assertThat($actualJson, $constraint, $message); + } + + /** + * Asserts that the generated JSON encoded object and the content of the given file are not equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + */ + public static function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = '') + { + self::assertFileExists($expectedFile, $message); + $expectedJson = file_get_contents($expectedFile); + + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + // call constraint + $constraint = new PHPUnit_Framework_Constraint_JsonMatches( + $expectedJson + ); + + self::assertThat($actualJson, new PHPUnit_Framework_Constraint_Not($constraint), $message); + } + + /** + * Asserts that two JSON files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + */ + public static function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = '') + { + self::assertFileExists($expectedFile, $message); + self::assertFileExists($actualFile, $message); + + $actualJson = file_get_contents($actualFile); + $expectedJson = file_get_contents($expectedFile); + + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + // call constraint + $constraintExpected = new PHPUnit_Framework_Constraint_JsonMatches( + $expectedJson + ); + + $constraintActual = new PHPUnit_Framework_Constraint_JsonMatches($actualJson); + + self::assertThat($expectedJson, new PHPUnit_Framework_Constraint_Not($constraintActual), $message); + self::assertThat($actualJson, new PHPUnit_Framework_Constraint_Not($constraintExpected), $message); + } + + /** + * Asserts that two JSON files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + */ + public static function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = '') + { + self::assertFileExists($expectedFile, $message); + self::assertFileExists($actualFile, $message); + + $actualJson = file_get_contents($actualFile); + $expectedJson = file_get_contents($expectedFile); + + self::assertJson($expectedJson, $message); + self::assertJson($actualJson, $message); + + // call constraint + $constraintExpected = new PHPUnit_Framework_Constraint_JsonMatches( + $expectedJson + ); + + $constraintActual = new PHPUnit_Framework_Constraint_JsonMatches($actualJson); + + self::assertThat($expectedJson, $constraintActual, $message); + self::assertThat($actualJson, $constraintExpected, $message); + } + + /** + * Returns a PHPUnit_Framework_Constraint_And matcher object. + * + * @return PHPUnit_Framework_Constraint_And + * @since Method available since Release 3.0.0 + */ + public static function logicalAnd() + { + $constraints = func_get_args(); + + $constraint = new PHPUnit_Framework_Constraint_And; + $constraint->setConstraints($constraints); + + return $constraint; + } + + /** + * Returns a PHPUnit_Framework_Constraint_Or matcher object. + * + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.0.0 + */ + public static function logicalOr() + { + $constraints = func_get_args(); + + $constraint = new PHPUnit_Framework_Constraint_Or; + $constraint->setConstraints($constraints); + + return $constraint; + } + + /** + * Returns a PHPUnit_Framework_Constraint_Not matcher object. + * + * @param PHPUnit_Framework_Constraint $constraint + * @return PHPUnit_Framework_Constraint_Not + * @since Method available since Release 3.0.0 + */ + public static function logicalNot(PHPUnit_Framework_Constraint $constraint) + { + return new PHPUnit_Framework_Constraint_Not($constraint); + } + + /** + * Returns a PHPUnit_Framework_Constraint_Xor matcher object. + * + * @return PHPUnit_Framework_Constraint_Xor + * @since Method available since Release 3.0.0 + */ + public static function logicalXor() + { + $constraints = func_get_args(); + + $constraint = new PHPUnit_Framework_Constraint_Xor; + $constraint->setConstraints($constraints); + + return $constraint; + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsAnything matcher object. + * + * @return PHPUnit_Framework_Constraint_IsAnything + * @since Method available since Release 3.0.0 + */ + public static function anything() + { + return new PHPUnit_Framework_Constraint_IsAnything; + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object. + * + * @return PHPUnit_Framework_Constraint_IsTrue + * @since Method available since Release 3.3.0 + */ + public static function isTrue() + { + return new PHPUnit_Framework_Constraint_IsTrue; + } + + /** + * Returns a PHPUnit_Framework_Constraint_Callback matcher object. + * + * @param callable $callback + * @return PHPUnit_Framework_Constraint_Callback + */ + public static function callback($callback) + { + return new PHPUnit_Framework_Constraint_Callback($callback); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object. + * + * @return PHPUnit_Framework_Constraint_IsFalse + * @since Method available since Release 3.3.0 + */ + public static function isFalse() + { + return new PHPUnit_Framework_Constraint_IsFalse; + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsJson matcher object. + * + * @return PHPUnit_Framework_Constraint_IsJson + * @since Method available since Release 3.7.20 + */ + public static function isJson() + { + return new PHPUnit_Framework_Constraint_IsJson; + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsNull matcher object. + * + * @return PHPUnit_Framework_Constraint_IsNull + * @since Method available since Release 3.3.0 + */ + public static function isNull() + { + return new PHPUnit_Framework_Constraint_IsNull; + } + + /** + * Returns a PHPUnit_Framework_Constraint_Attribute matcher object. + * + * @param PHPUnit_Framework_Constraint $constraint + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_Attribute + * @since Method available since Release 3.1.0 + */ + public static function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName) + { + return new PHPUnit_Framework_Constraint_Attribute( + $constraint, $attributeName + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher + * object. + * + * @param mixed $value + * @param boolean $checkForObjectIdentity + * @return PHPUnit_Framework_Constraint_TraversableContains + * @since Method available since Release 3.0.0 + */ + public static function contains($value, $checkForObjectIdentity = TRUE) + { + return new PHPUnit_Framework_Constraint_TraversableContains($value, $checkForObjectIdentity); + } + + /** + * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher + * object. + * + * @param string $type + * @return PHPUnit_Framework_Constraint_TraversableContainsOnly + * @since Method available since Release 3.1.4 + */ + public static function containsOnly($type) + { + return new PHPUnit_Framework_Constraint_TraversableContainsOnly($type); + } + + /** + * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher + * object. + * + * @param string $classname + * @return PHPUnit_Framework_Constraint_TraversableContainsOnly + */ + public static function containsOnlyInstancesOf($classname) + { + return new PHPUnit_Framework_Constraint_TraversableContainsOnly($classname, FALSE); + } + + /** + * Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object. + * + * @param mixed $key + * @return PHPUnit_Framework_Constraint_ArrayHasKey + * @since Method available since Release 3.0.0 + */ + public static function arrayHasKey($key) + { + return new PHPUnit_Framework_Constraint_ArrayHasKey($key); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object. + * + * @param mixed $value + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @return PHPUnit_Framework_Constraint_IsEqual + * @since Method available since Release 3.0.0 + */ + public static function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + return new PHPUnit_Framework_Constraint_IsEqual( + $value, $delta, $maxDepth, $canonicalize, $ignoreCase + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object + * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher + * object. + * + * @param string $attributeName + * @param mixed $value + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @return PHPUnit_Framework_Constraint_Attribute + * @since Method available since Release 3.1.0 + */ + public static function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + return self::attribute( + self::equalTo( + $value, $delta, $maxDepth, $canonicalize, $ignoreCase + ), + $attributeName + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object. + * + * @return PHPUnit_Framework_Constraint_IsEmpty + * @since Method available since Release 3.5.0 + */ + public static function isEmpty() + { + return new PHPUnit_Framework_Constraint_IsEmpty; + } + + /** + * Returns a PHPUnit_Framework_Constraint_FileExists matcher object. + * + * @return PHPUnit_Framework_Constraint_FileExists + * @since Method available since Release 3.0.0 + */ + public static function fileExists() + { + return new PHPUnit_Framework_Constraint_FileExists; + } + + /** + * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_GreaterThan + * @since Method available since Release 3.0.0 + */ + public static function greaterThan($value) + { + return new PHPUnit_Framework_Constraint_GreaterThan($value); + } + + /** + * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps + * a PHPUnit_Framework_Constraint_IsEqual and a + * PHPUnit_Framework_Constraint_GreaterThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.1.0 + */ + public static function greaterThanOrEqual($value) + { + return self::logicalOr( + new PHPUnit_Framework_Constraint_IsEqual($value), + new PHPUnit_Framework_Constraint_GreaterThan($value) + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ClassHasAttribute + * @since Method available since Release 3.1.0 + */ + public static function classHasAttribute($attributeName) + { + return new PHPUnit_Framework_Constraint_ClassHasAttribute( + $attributeName + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher + * object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @since Method available since Release 3.1.0 + */ + public static function classHasStaticAttribute($attributeName) + { + return new PHPUnit_Framework_Constraint_ClassHasStaticAttribute( + $attributeName + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ObjectHasAttribute + * @since Method available since Release 3.0.0 + */ + public static function objectHasAttribute($attributeName) + { + return new PHPUnit_Framework_Constraint_ObjectHasAttribute( + $attributeName + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_IsIdentical + * @since Method available since Release 3.0.0 + */ + public static function identicalTo($value) + { + return new PHPUnit_Framework_Constraint_IsIdentical($value); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object. + * + * @param string $className + * @return PHPUnit_Framework_Constraint_IsInstanceOf + * @since Method available since Release 3.0.0 + */ + public static function isInstanceOf($className) + { + return new PHPUnit_Framework_Constraint_IsInstanceOf($className); + } + + /** + * Returns a PHPUnit_Framework_Constraint_IsType matcher object. + * + * @param string $type + * @return PHPUnit_Framework_Constraint_IsType + * @since Method available since Release 3.0.0 + */ + public static function isType($type) + { + return new PHPUnit_Framework_Constraint_IsType($type); + } + + /** + * Returns a PHPUnit_Framework_Constraint_LessThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_LessThan + * @since Method available since Release 3.0.0 + */ + public static function lessThan($value) + { + return new PHPUnit_Framework_Constraint_LessThan($value); + } + + /** + * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps + * a PHPUnit_Framework_Constraint_IsEqual and a + * PHPUnit_Framework_Constraint_LessThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.1.0 + */ + public static function lessThanOrEqual($value) + { + return self::logicalOr( + new PHPUnit_Framework_Constraint_IsEqual($value), + new PHPUnit_Framework_Constraint_LessThan($value) + ); + } + + /** + * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object. + * + * @param string $pattern + * @return PHPUnit_Framework_Constraint_PCREMatch + * @since Method available since Release 3.0.0 + */ + public static function matchesRegularExpression($pattern) + { + return new PHPUnit_Framework_Constraint_PCREMatch($pattern); + } + + /** + * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object. + * + * @param string $string + * @return PHPUnit_Framework_Constraint_StringMatches + * @since Method available since Release 3.5.0 + */ + public static function matches($string) + { + return new PHPUnit_Framework_Constraint_StringMatches($string); + } + + /** + * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object. + * + * @param mixed $prefix + * @return PHPUnit_Framework_Constraint_StringStartsWith + * @since Method available since Release 3.4.0 + */ + public static function stringStartsWith($prefix) + { + return new PHPUnit_Framework_Constraint_StringStartsWith($prefix); + } + + /** + * Returns a PHPUnit_Framework_Constraint_StringContains matcher object. + * + * @param string $string + * @param boolean $case + * @return PHPUnit_Framework_Constraint_StringContains + * @since Method available since Release 3.0.0 + */ + public static function stringContains($string, $case = TRUE) + { + return new PHPUnit_Framework_Constraint_StringContains($string, $case); + } + + /** + * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object. + * + * @param mixed $suffix + * @return PHPUnit_Framework_Constraint_StringEndsWith + * @since Method available since Release 3.4.0 + */ + public static function stringEndsWith($suffix) + { + return new PHPUnit_Framework_Constraint_StringEndsWith($suffix); + } + + /** + * Fails a test with the given message. + * + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ + public static function fail($message = '') + { + throw new PHPUnit_Framework_AssertionFailedError($message); + } + + /** + * Returns the value of an attribute of a class or an object. + * This also works for attributes that are declared protected or private. + * + * @param mixed $classOrObject + * @param string $attributeName + * @return mixed + * @throws PHPUnit_Framework_Exception + */ + public static function readAttribute($classOrObject, $attributeName) + { + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + if (is_string($classOrObject)) { + if (!class_exists($classOrObject)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class name' + ); + } + + return PHPUnit_Util_Class::getStaticAttribute( + $classOrObject, + $attributeName + ); + } + + else if (is_object($classOrObject)) { + return PHPUnit_Util_Class::getObjectAttribute( + $classOrObject, + $attributeName + ); + } + + else { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class name or object' + ); + } + } + + /** + * Mark the test as incomplete. + * + * @param string $message + * @throws PHPUnit_Framework_IncompleteTestError + * @since Method available since Release 3.0.0 + */ + public static function markTestIncomplete($message = '') + { + throw new PHPUnit_Framework_IncompleteTestError($message); + } + + /** + * Mark the test as skipped. + * + * @param string $message + * @throws PHPUnit_Framework_SkippedTestError + * @since Method available since Release 3.0.0 + */ + public static function markTestSkipped($message = '') + { + throw new PHPUnit_Framework_SkippedTestError($message); + } + + /** + * Return the current assertion count. + * + * @return integer + * @since Method available since Release 3.3.3 + */ + public static function getCount() + { + return self::$count; + } + + /** + * Reset the assertion counter. + * + * @since Method available since Release 3.3.3 + */ + public static function resetCount() + { + self::$count = 0; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php @@ -0,0 +1,2428 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +/** + * Returns a matcher that matches when the method it is evaluated for + * is executed zero or more times. + * + * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount + * @since Method available since Release 3.0.0 + */ +function any() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::any', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsAnything matcher object. + * + * @return PHPUnit_Framework_Constraint_IsAnything + * @since Method available since Release 3.0.0 + */ +function anything() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::anything', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object. + * + * @param mixed $key + * @return PHPUnit_Framework_Constraint_ArrayHasKey + * @since Method available since Release 3.0.0 + */ +function arrayHasKey($key) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::arrayHasKey', + func_get_args() + ); +} + +/** + * Asserts that an array has a specified key. + * + * @param mixed $key + * @param array|ArrayAccess $array + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertArrayHasKey($key, $array, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertArrayHasKey', + func_get_args() + ); +} + +/** + * Asserts that an array does not have a specified key. + * + * @param mixed $key + * @param array|ArrayAccess $array + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertArrayNotHasKey($key, $array, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertArrayNotHasKey', + func_get_args() + ); +} + +/** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object contains a needle. + * + * @param mixed $needle + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 3.0.0 + */ +function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeContains', + func_get_args() + ); +} + +/** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object contains only values of a given type. + * + * @param string $type + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ +function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeContainsOnly', + func_get_args() + ); +} + +/** + * Asserts the number of elements of an array, Countable or Iterator + * that is stored in an attribute. + * + * @param integer $expectedCount + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.6.0 + */ +function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeCount', + func_get_args() + ); +} + +/** + * Asserts that a static attribute of a class or an attribute of an object + * is empty. + * + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeEmpty', + func_get_args() + ); +} + +/** + * Asserts that a variable is equal to an attribute of an object. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ +function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeEquals', + func_get_args() + ); +} + +/** + * Asserts that an attribute is greater than another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeGreaterThan', + func_get_args() + ); +} + +/** + * Asserts that an attribute is greater than or equal to another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual', + func_get_args() + ); +} + +/** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeInstanceOf', + func_get_args() + ); +} + +/** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeInternalType', + func_get_args() + ); +} + +/** + * Asserts that an attribute is smaller than another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeLessThan', + func_get_args() + ); +} + +/** + * Asserts that an attribute is smaller than or equal to another value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual', + func_get_args() + ); +} + +/** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object does not contain a needle. + * + * @param mixed $needle + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 3.0.0 + */ +function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotContains', + func_get_args() + ); +} + +/** + * Asserts that a haystack that is stored in a static attribute of a class + * or an attribute of an object does not contain only values of a given + * type. + * + * @param string $type + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ +function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotContainsOnly', + func_get_args() + ); +} + +/** + * Asserts the number of elements of an array, Countable or Iterator + * that is stored in an attribute. + * + * @param integer $expectedCount + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.6.0 + */ +function assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotCount', + func_get_args() + ); +} + +/** + * Asserts that a static attribute of a class or an attribute of an object + * is not empty. + * + * @param string $haystackAttributeName + * @param mixed $haystackClassOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotEmpty', + func_get_args() + ); +} + +/** + * Asserts that a variable is not equal to an attribute of an object. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param string $actualClassOrObject + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ +function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotEquals', + func_get_args() + ); +} + +/** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotInstanceOf', + func_get_args() + ); +} + +/** + * Asserts that an attribute is of a given type. + * + * @param string $expected + * @param string $attributeName + * @param mixed $classOrObject + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotInternalType', + func_get_args() + ); +} + +/** + * Asserts that a variable and an attribute of an object do not have the + * same type and value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param object $actualClassOrObject + * @param string $message + */ +function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeNotSame', + func_get_args() + ); +} + +/** + * Asserts that a variable and an attribute of an object have the same type + * and value. + * + * @param mixed $expected + * @param string $actualAttributeName + * @param object $actualClassOrObject + * @param string $message + */ +function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertAttributeSame', + func_get_args() + ); +} + +/** + * Asserts that a class has a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertClassHasAttribute($attributeName, $className, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertClassHasAttribute', + func_get_args() + ); +} + +/** + * Asserts that a class has a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertClassHasStaticAttribute($attributeName, $className, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertClassHasStaticAttribute', + func_get_args() + ); +} + +/** + * Asserts that a class does not have a specified attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertClassNotHasAttribute($attributeName, $className, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertClassNotHasAttribute', + func_get_args() + ); +} + +/** + * Asserts that a class does not have a specified static attribute. + * + * @param string $attributeName + * @param string $className + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertClassNotHasStaticAttribute($attributeName, $className, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute', + func_get_args() + ); +} + +/** + * Asserts that a haystack contains a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 2.1.0 + */ +function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertContains', + func_get_args() + ); +} + +/** + * Asserts that a haystack contains only values of a given type. + * + * @param string $type + * @param mixed $haystack + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ +function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertContainsOnly', + func_get_args() + ); +} + +/** + * Asserts that a haystack contains only instances of a given classname + * + * @param string $classname + * @param array|Traversable $haystack + * @param string $message + */ +function assertContainsOnlyInstancesOf($classname, $haystack, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf', + func_get_args() + ); +} + +/** + * Asserts the number of elements of an array, Countable or Iterator. + * + * @param integer $expectedCount + * @param mixed $haystack + * @param string $message + */ +function assertCount($expectedCount, $haystack, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertCount', + func_get_args() + ); +} + +/** + * Asserts that a variable is empty. + * + * @param mixed $actual + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ +function assertEmpty($actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertEmpty', + func_get_args() + ); +} + +/** + * Asserts that a hierarchy of DOMElements matches. + * + * @param DOMElement $expectedElement + * @param DOMElement $actualElement + * @param boolean $checkAttributes + * @param string $message + * @author Mattis Stordalen Flister <mattis@xait.no> + * @since Method available since Release 3.3.0 + */ +function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = FALSE, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertEqualXMLStructure', + func_get_args() + ); +} + +/** + * Asserts that two variables are equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ +function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertEquals', + func_get_args() + ); +} + +/** + * Asserts that a condition is false. + * + * @param boolean $condition + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ +function assertFalse($condition, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertFalse', + func_get_args() + ); +} + +/** + * Asserts that the contents of one file is equal to the contents of another + * file. + * + * @param string $expected + * @param string $actual + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.2.14 + */ +function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertFileEquals', + func_get_args() + ); +} + +/** + * Asserts that a file exists. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertFileExists($filename, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertFileExists', + func_get_args() + ); +} + +/** + * Asserts that the contents of one file is not equal to the contents of + * another file. + * + * @param string $expected + * @param string $actual + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.2.14 + */ +function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertFileNotEquals', + func_get_args() + ); +} + +/** + * Asserts that a file does not exist. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertFileNotExists($filename, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertFileNotExists', + func_get_args() + ); +} + +/** + * Asserts that a value is greater than another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertGreaterThan($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertGreaterThan', + func_get_args() + ); +} + +/** + * Asserts that a value is greater than or equal to another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertGreaterThanOrEqual($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertGreaterThanOrEqual', + func_get_args() + ); +} + +/** + * Asserts that a variable is of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertInstanceOf($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertInstanceOf', + func_get_args() + ); +} + +/** + * Asserts that a variable is of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertInternalType($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertInternalType', + func_get_args() + ); +} + +/** + * Asserts that a string is a valid JSON string. + * + * @param string $filename + * @param string $message + * @since Method available since Release 3.7.20 + */ +function assertJson($expectedJson, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJson', + func_get_args() + ); +} + +/** + * Asserts that two JSON files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + */ +function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonFileEqualsJsonFile', + func_get_args() + ); +} + +/** + * Asserts that two JSON files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + */ +function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile', + func_get_args() + ); +} + +/** + * Asserts that the generated JSON encoded object and the content of the given file are equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + */ +function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile', + func_get_args() + ); +} + +/** + * Asserts that two given JSON encoded objects or arrays are equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + */ +function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString', + func_get_args() + ); +} + +/** + * Asserts that the generated JSON encoded object and the content of the given file are not equal. + * + * @param string $expectedFile + * @param string $actualJson + * @param string $message + */ +function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile', + func_get_args() + ); +} + +/** + * Asserts that two given JSON encoded objects or arrays are not equal. + * + * @param string $expectedJson + * @param string $actualJson + * @param string $message + */ +function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString', + func_get_args() + ); +} + +/** + * Asserts that a value is smaller than another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertLessThan($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertLessThan', + func_get_args() + ); +} + +/** + * Asserts that a value is smaller than or equal to another value. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertLessThanOrEqual($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertLessThanOrEqual', + func_get_args() + ); +} + +/** + * Asserts that a haystack does not contain a needle. + * + * @param mixed $needle + * @param mixed $haystack + * @param string $message + * @param boolean $ignoreCase + * @param boolean $checkForObjectIdentity + * @since Method available since Release 2.1.0 + */ +function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotContains', + func_get_args() + ); +} + +/** + * Asserts that a haystack does not contain only values of a given type. + * + * @param string $type + * @param mixed $haystack + * @param boolean $isNativeType + * @param string $message + * @since Method available since Release 3.1.4 + */ +function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotContainsOnly', + func_get_args() + ); +} + +/** + * Asserts the number of elements of an array, Countable or Iterator. + * + * @param integer $expectedCount + * @param mixed $haystack + * @param string $message + */ +function assertNotCount($expectedCount, $haystack, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotCount', + func_get_args() + ); +} + +/** + * Asserts that a variable is not empty. + * + * @param mixed $actual + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ +function assertNotEmpty($actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotEmpty', + func_get_args() + ); +} + +/** + * Asserts that two variables are not equal. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 2.3.0 + */ +function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotEquals', + func_get_args() + ); +} + +/** + * Asserts that a variable is not of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertNotInstanceOf($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotInstanceOf', + func_get_args() + ); +} + +/** + * Asserts that a variable is not of a given type. + * + * @param string $expected + * @param mixed $actual + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertNotInternalType($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotInternalType', + func_get_args() + ); +} + +/** + * Asserts that a variable is not NULL. + * + * @param mixed $actual + * @param string $message + */ +function assertNotNull($actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotNull', + func_get_args() + ); +} + +/** + * Asserts that a string does not match a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + * @since Method available since Release 2.1.0 + */ +function assertNotRegExp($pattern, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotRegExp', + func_get_args() + ); +} + +/** + * Asserts that two variables do not have the same type and value. + * Used on objects, it asserts that two variables do not reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + */ +function assertNotSame($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotSame', + func_get_args() + ); +} + +/** + * Assert that the size of two arrays (or `Countable` or `Iterator` objects) + * is not the same. + * + * @param array|Countable|Iterator $expected + * @param array|Countable|Iterator $actual + * @param string $message + */ +function assertNotSameSize($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotSameSize', + func_get_args() + ); +} + +/** + * This assertion is the exact opposite of assertTag(). + * + * Rather than asserting that $matcher results in a match, it asserts that + * $matcher does not match. + * + * @param array $matcher + * @param string $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ +function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNotTag', + func_get_args() + ); +} + +/** + * Asserts that a variable is NULL. + * + * @param mixed $actual + * @param string $message + */ +function assertNull($actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertNull', + func_get_args() + ); +} + +/** + * Asserts that an object has a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertObjectHasAttribute($attributeName, $object, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertObjectHasAttribute', + func_get_args() + ); +} + +/** + * Asserts that an object does not have a specified attribute. + * + * @param string $attributeName + * @param object $object + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertObjectNotHasAttribute($attributeName, $object, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertObjectNotHasAttribute', + func_get_args() + ); +} + +/** + * Asserts that a string matches a given regular expression. + * + * @param string $pattern + * @param string $string + * @param string $message + */ +function assertRegExp($pattern, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertRegExp', + func_get_args() + ); +} + +/** + * Asserts that two variables have the same type and value. + * Used on objects, it asserts that two variables reference + * the same object. + * + * @param mixed $expected + * @param mixed $actual + * @param string $message + */ +function assertSame($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertSame', + func_get_args() + ); +} + +/** + * Assert that the size of two arrays (or `Countable` or `Iterator` objects) + * is the same. + * + * @param array|Countable|Iterator $expected + * @param array|Countable|Iterator $actual + * @param string $message + */ +function assertSameSize($expected, $actual, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertSameSize', + func_get_args() + ); +} + +/** + * Assert the presence, absence, or count of elements in a document matching + * the CSS $selector, regardless of the contents of those elements. + * + * The first argument, $selector, is the CSS selector used to match + * the elements in the $actual document. + * + * The second argument, $count, can be either boolean or numeric. + * When boolean, it asserts for presence of elements matching the selector + * (TRUE) or absence of elements (FALSE). + * When numeric, it asserts the count of elements. + * + * assertSelectCount("#binder", true, $xml); // any? + * assertSelectCount(".binder", 3, $xml); // exactly 3? + * + * @param array $selector + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ +function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertSelectCount', + func_get_args() + ); +} + +/** + * assertSelectEquals("#binder .name", "Chuck", true, $xml); // any? + * assertSelectEquals("#binder .name", "Chuck", false, $xml); // none? + * + * @param array $selector + * @param string $content + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ +function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertSelectEquals', + func_get_args() + ); +} + +/** + * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any? + * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3? + * + * @param array $selector + * @param string $pattern + * @param integer $count + * @param mixed $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ +function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertSelectRegExp', + func_get_args() + ); +} + +/** + * Asserts that a string ends not with a given prefix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ +function assertStringEndsNotWith($suffix, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringEndsNotWith', + func_get_args() + ); +} + +/** + * Asserts that a string ends with a given prefix. + * + * @param string $suffix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ +function assertStringEndsWith($suffix, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringEndsWith', + func_get_args() + ); +} + +/** + * Asserts that the contents of a string is equal + * to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.3.0 + */ +function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringEqualsFile', + func_get_args() + ); +} + +/** + * Asserts that a string matches a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertStringMatchesFormat($format, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringMatchesFormat', + func_get_args() + ); +} + +/** + * Asserts that a string matches a given format file. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertStringMatchesFormatFile($formatFile, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringMatchesFormatFile', + func_get_args() + ); +} + +/** + * Asserts that the contents of a string is not equal + * to the contents of a file. + * + * @param string $expectedFile + * @param string $actualString + * @param string $message + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @since Method available since Release 3.3.0 + */ +function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringNotEqualsFile', + func_get_args() + ); +} + +/** + * Asserts that a string does not match a given format string. + * + * @param string $format + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertStringNotMatchesFormat($format, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringNotMatchesFormat', + func_get_args() + ); +} + +/** + * Asserts that a string does not match a given format string. + * + * @param string $formatFile + * @param string $string + * @param string $message + * @since Method available since Release 3.5.0 + */ +function assertStringNotMatchesFormatFile($formatFile, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile', + func_get_args() + ); +} + +/** + * Asserts that a string starts not with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ +function assertStringStartsNotWith($prefix, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringStartsNotWith', + func_get_args() + ); +} + +/** + * Asserts that a string starts with a given prefix. + * + * @param string $prefix + * @param string $string + * @param string $message + * @since Method available since Release 3.4.0 + */ +function assertStringStartsWith($prefix, $string, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertStringStartsWith', + func_get_args() + ); +} + +/** + * Evaluate an HTML or XML string and assert its structure and/or contents. + * + * The first argument ($matcher) is an associative array that specifies the + * match criteria for the assertion: + * + * - `id` : the node with the given id attribute must match the + * corresponding value. + * - `tag` : the node type must match the corresponding value. + * - `attributes` : a hash. The node's attributes must match the + * corresponding values in the hash. + * - `content` : The text content must match the given value. + * - `parent` : a hash. The node's parent must match the + * corresponding hash. + * - `child`: a hash. At least one of the node's immediate children + * must meet the criteria described by the hash. + * - `ancestor` : a hash. At least one of the node's ancestors must + * meet the criteria described by the hash. + * - `descendant` : a hash. At least one of the node's descendants must + * meet the criteria described by the hash. + * - `children` : a hash, for counting children of a node. + * Accepts the keys: + *- `count`: a number which must equal the number of children + * that match + *- `less_than`: the number of matching children must be greater + * than this number + *- `greater_than` : the number of matching children must be less than + * this number + *- `only` : another hash consisting of the keys to use to match + * on the children, and only matching children will be + * counted + * + * <code> + * // Matcher that asserts that there is an element with an id="my_id". + * $matcher = array('id' => 'my_id'); + * + * // Matcher that asserts that there is a "span" tag. + * $matcher = array('tag' => 'span'); + * + * // Matcher that asserts that there is a "span" tag with the content + * // "Hello World". + * $matcher = array('tag' => 'span', 'content' => 'Hello World'); + * + * // Matcher that asserts that there is a "span" tag with content matching + * // the regular expression pattern. + * $matcher = array('tag' => 'span', 'content' => 'regexp:/Try P(HP|ython)/'); + * + * // Matcher that asserts that there is a "span" with an "list" class + * // attribute. + * $matcher = array( + * 'tag'=> 'span', + * 'attributes' => array('class' => 'list') + * ); + * + * // Matcher that asserts that there is a "span" inside of a "div". + * $matcher = array( + * 'tag'=> 'span', + * 'parent' => array('tag' => 'div') + * ); + * + * // Matcher that asserts that there is a "span" somewhere inside a + * // "table". + * $matcher = array( + * 'tag' => 'span', + * 'ancestor' => array('tag' => 'table') + * ); + * + * // Matcher that asserts that there is a "span" with at least one "em" + * // child. + * $matcher = array( + * 'tag' => 'span', + * 'child' => array('tag' => 'em') + * ); + * + * // Matcher that asserts that there is a "span" containing a (possibly + * // nested) "strong" tag. + * $matcher = array( + * 'tag'=> 'span', + * 'descendant' => array('tag' => 'strong') + * ); + * + * // Matcher that asserts that there is a "span" containing 5-10 "em" tags + * // as immediate children. + * $matcher = array( + * 'tag' => 'span', + * 'children' => array( + * 'less_than'=> 11, + * 'greater_than' => 4, + * 'only' => array('tag' => 'em') + * ) + * ); + * + * // Matcher that asserts that there is a "div", with an "ul" ancestor and + * // a "li" parent (with class="enum"), and containing a "span" descendant + * // that contains an element with id="my_test" and the text "Hello World". + * $matcher = array( + * 'tag'=> 'div', + * 'ancestor' => array('tag' => 'ul'), + * 'parent' => array( + * 'tag'=> 'li', + * 'attributes' => array('class' => 'enum') + * ), + * 'descendant' => array( + * 'tag' => 'span', + * 'child' => array( + * 'id' => 'my_test', + * 'content' => 'Hello World' + * ) + * ) + * ); + * + * // Use assertTag() to apply a $matcher to a piece of $html. + * $this->assertTag($matcher, $html); + * + * // Use assertTag() to apply a $matcher to a piece of $xml. + * $this->assertTag($matcher, $xml, '', FALSE); + * </code> + * + * The second argument ($actual) is a string containing either HTML or + * XML text to be tested. + * + * The third argument ($message) is an optional message that will be + * used if the assertion fails. + * + * The fourth argument ($html) is an optional flag specifying whether + * to load the $actual string into a DOMDocument using the HTML or + * XML load strategy. It is TRUE by default, which assumes the HTML + * load strategy. In many cases, this will be acceptable for XML as well. + * + * @param array $matcher + * @param string $actual + * @param string $message + * @param boolean $isHtml + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ +function assertTag($matcher, $actual, $message = '', $isHtml = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertTag', + func_get_args() + ); +} + +/** + * Evaluates a PHPUnit_Framework_Constraint matcher object. + * + * @param mixed$value + * @param PHPUnit_Framework_Constraint $constraint + * @param string $message + * @since Method available since Release 3.0.0 + */ +function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertThat', + func_get_args() + ); +} + +/** + * Asserts that a condition is true. + * + * @param boolean $condition + * @param string $message + * @throws PHPUnit_Framework_AssertionFailedError + */ +function assertTrue($condition, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertTrue', + func_get_args() + ); +} + +/** + * Asserts that two XML files are equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile', + func_get_args() + ); +} + +/** + * Asserts that two XML files are not equal. + * + * @param string $expectedFile + * @param string $actualFile + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile', + func_get_args() + ); +} + +/** + * Asserts that two XML documents are equal. + * + * @param string $expectedFile + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.3.0 + */ +function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile', + func_get_args() + ); +} + +/** + * Asserts that two XML documents are equal. + * + * @param string $expectedXml + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString', + func_get_args() + ); +} + +/** + * Asserts that two XML documents are not equal. + * + * @param string $expectedFile + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.3.0 + */ +function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile', + func_get_args() + ); +} + +/** + * Asserts that two XML documents are not equal. + * + * @param string $expectedXml + * @param string $actualXml + * @param string $message + * @since Method available since Release 3.1.0 + */ +function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '') +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString', + func_get_args() + ); +} + +/** + * Returns a matcher that matches when the method it is evaluated for + * is invoked at the given $index. + * + * @param integer $index + * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex + * @since Method available since Release 3.0.0 + */ +function at($index) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::at', + func_get_args() + ); +} + +/** + * Returns a matcher that matches when the method it is evaluated for + * is executed at least once. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce + * @since Method available since Release 3.0.0 + */ +function atLeastOnce() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::atLeastOnce', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Attribute matcher object. + * + * @param PHPUnit_Framework_Constraint $constraint + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_Attribute + * @since Method available since Release 3.1.0 + */ +function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::attribute', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object + * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher + * object. + * + * @param string $attributeName + * @param mixed $value + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @return PHPUnit_Framework_Constraint_Attribute + * @since Method available since Release 3.1.0 + */ +function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::attributeEqualTo', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Callback matcher object. + * + * @param callable $callback + * @return PHPUnit_Framework_Constraint_Callback + */ +function callback($callback) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::callback', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ClassHasAttribute + * @since Method available since Release 3.1.0 + */ +function classHasAttribute($attributeName) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::classHasAttribute', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher + * object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @since Method available since Release 3.1.0 + */ +function classHasStaticAttribute($attributeName) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::classHasStaticAttribute', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher + * object. + * + * @param mixed $value + * @param boolean $checkForObjectIdentity + * @return PHPUnit_Framework_Constraint_TraversableContains + * @since Method available since Release 3.0.0 + */ +function contains($value, $checkForObjectIdentity = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::contains', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher + * object. + * + * @param string $type + * @return PHPUnit_Framework_Constraint_TraversableContainsOnly + * @since Method available since Release 3.1.4 + */ +function containsOnly($type) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::containsOnly', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher + * object. + * + * @param string $classname + * @return PHPUnit_Framework_Constraint_TraversableContainsOnly + */ +function containsOnlyInstancesOf($classname) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::containsOnlyInstancesOf', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object. + * + * @param mixed $value + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + * @return PHPUnit_Framework_Constraint_IsEqual + * @since Method available since Release 3.0.0 + */ +function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::equalTo', + func_get_args() + ); +} + +/** + * Returns a matcher that matches when the method it is evaluated for + * is executed exactly $count times. + * + * @param integer $count + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ +function exactly($count) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::exactly', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_FileExists matcher object. + * + * @return PHPUnit_Framework_Constraint_FileExists + * @since Method available since Release 3.0.0 + */ +function fileExists() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::fileExists', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_GreaterThan + * @since Method available since Release 3.0.0 + */ +function greaterThan($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::greaterThan', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps + * a PHPUnit_Framework_Constraint_IsEqual and a + * PHPUnit_Framework_Constraint_GreaterThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.1.0 + */ +function greaterThanOrEqual($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::greaterThanOrEqual', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_IsIdentical + * @since Method available since Release 3.0.0 + */ +function identicalTo($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::identicalTo', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object. + * + * @return PHPUnit_Framework_Constraint_IsEmpty + * @since Method available since Release 3.5.0 + */ +function isEmpty() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isEmpty', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object. + * + * @return PHPUnit_Framework_Constraint_IsFalse + * @since Method available since Release 3.3.0 + */ +function isFalse() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isFalse', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object. + * + * @param string $className + * @return PHPUnit_Framework_Constraint_IsInstanceOf + * @since Method available since Release 3.0.0 + */ +function isInstanceOf($className) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isInstanceOf', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsJson matcher object. + * + * @return PHPUnit_Framework_Constraint_IsJson + * @since Method available since Release 3.7.20 + */ +function isJson() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isJson', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsNull matcher object. + * + * @return PHPUnit_Framework_Constraint_IsNull + * @since Method available since Release 3.3.0 + */ +function isNull() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isNull', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object. + * + * @return PHPUnit_Framework_Constraint_IsTrue + * @since Method available since Release 3.3.0 + */ +function isTrue() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isTrue', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_IsType matcher object. + * + * @param string $type + * @return PHPUnit_Framework_Constraint_IsType + * @since Method available since Release 3.0.0 + */ +function isType($type) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::isType', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_LessThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_LessThan + * @since Method available since Release 3.0.0 + */ +function lessThan($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::lessThan', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps + * a PHPUnit_Framework_Constraint_IsEqual and a + * PHPUnit_Framework_Constraint_LessThan matcher object. + * + * @param mixed $value + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.1.0 + */ +function lessThanOrEqual($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::lessThanOrEqual', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_And matcher object. + * + * @return PHPUnit_Framework_Constraint_And + * @since Method available since Release 3.0.0 + */ +function logicalAnd() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::logicalAnd', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Not matcher object. + * + * @param PHPUnit_Framework_Constraint $constraint + * @return PHPUnit_Framework_Constraint_Not + * @since Method available since Release 3.0.0 + */ +function logicalNot(PHPUnit_Framework_Constraint $constraint) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::logicalNot', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Or matcher object. + * + * @return PHPUnit_Framework_Constraint_Or + * @since Method available since Release 3.0.0 + */ +function logicalOr() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::logicalOr', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_Xor matcher object. + * + * @return PHPUnit_Framework_Constraint_Xor + * @since Method available since Release 3.0.0 + */ +function logicalXor() +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::logicalXor', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object. + * + * @param string $string + * @return PHPUnit_Framework_Constraint_StringMatches + * @since Method available since Release 3.5.0 + */ +function matches($string) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::matches', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object. + * + * @param string $pattern + * @return PHPUnit_Framework_Constraint_PCREMatch + * @since Method available since Release 3.0.0 + */ +function matchesRegularExpression($pattern) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::matchesRegularExpression', + func_get_args() + ); +} + +/** + * Returns a matcher that matches when the method it is evaluated for + * is never executed. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ +function never() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::never', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object. + * + * @param string $attributeName + * @return PHPUnit_Framework_Constraint_ObjectHasAttribute + * @since Method available since Release 3.0.0 + */ +function objectHasAttribute($attributeName) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::objectHasAttribute', + func_get_args() + ); +} + +/** + * + * + * @param mixed $value, ... + * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls + * @since Method available since Release 3.0.0 + */ +function onConsecutiveCalls() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::onConsecutiveCalls', + func_get_args() + ); +} + +/** + * Returns a matcher that matches when the method it is evaluated for + * is executed exactly once. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ +function once() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::once', + func_get_args() + ); +} + +/** + * + * + * @param integer $argumentIndex + * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument + * @since Method available since Release 3.3.0 + */ +function returnArgument($argumentIndex) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::returnArgument', + func_get_args() + ); +} + +/** + * + * + * @param mixed $callback + * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback + * @since Method available since Release 3.3.0 + */ +function returnCallback($callback) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::returnCallback', + func_get_args() + ); +} + +/** + * Returns the current object. + * + * This method is useful when mocking a fluent interface. + * + * @return PHPUnit_Framework_MockObject_Stub_ReturnSelf + * @since Method available since Release 3.6.0 + */ +function returnSelf() +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::returnSelf', + func_get_args() + ); +} + +/** + * + * + * @param mixed $value + * @return PHPUnit_Framework_MockObject_Stub_Return + * @since Method available since Release 3.0.0 + */ +function returnValue($value) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::returnValue', + func_get_args() + ); +} + +/** + * + * + * @param array $valueMap + * @return PHPUnit_Framework_MockObject_Stub_ReturnValueMap + * @since Method available since Release 3.6.0 + */ +function returnValueMap(array $valueMap) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::returnValueMap', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_StringContains matcher object. + * + * @param string $string + * @param boolean $case + * @return PHPUnit_Framework_Constraint_StringContains + * @since Method available since Release 3.0.0 + */ +function stringContains($string, $case = TRUE) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::stringContains', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object. + * + * @param mixed $suffix + * @return PHPUnit_Framework_Constraint_StringEndsWith + * @since Method available since Release 3.4.0 + */ +function stringEndsWith($suffix) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::stringEndsWith', + func_get_args() + ); +} + +/** + * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object. + * + * @param mixed $prefix + * @return PHPUnit_Framework_Constraint_StringStartsWith + * @since Method available since Release 3.4.0 + */ +function stringStartsWith($prefix) +{ + return call_user_func_array( + 'PHPUnit_Framework_Assert::stringStartsWith', + func_get_args() + ); +} + +/** + * + * + * @param Exception $exception + * @return PHPUnit_Framework_MockObject_Stub_Exception + * @since Method available since Release 3.1.0 + */ +function throwException(Exception $exception) +{ + return call_user_func_array( + 'PHPUnit_Framework_TestCase::throwException', + func_get_args() + ); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in @@ -0,0 +1,44 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */{functions} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php @@ -0,0 +1,68 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Thrown when an assertion failed. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_AssertionFailedError extends PHPUnit_Framework_Exception implements PHPUnit_Framework_SelfDescribing +{ + /** + * Wrapper for getMessage() which is declared as final. + * + * @return string + */ + public function toString() + { + return $this->getMessage(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php @@ -0,0 +1,97 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Abstract base class for comparators which compare values for equality. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +abstract class PHPUnit_Framework_Comparator +{ + /** + * @var PHPUnit_Framework_ComparatorFactory + */ + protected $factory; + + /** + * @param PHPUnit_Framework_ComparatorFactory $factory + */ + public function setFactory(PHPUnit_Framework_ComparatorFactory $factory) + { + $this->factory = $factory; + } + + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + abstract public function accepts($expected, $actual); + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + abstract public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php @@ -0,0 +1,177 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares arrays for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Array extends PHPUnit_Framework_Comparator +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return is_array($expected) && is_array($actual); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE, array &$processed = array()) + { + if ($canonicalize) { + sort($expected); + sort($actual); + } + + $remaining = $actual; + $expString = $actString = "Array (\n"; + $equal = TRUE; + + foreach ($expected as $key => $value) { + unset($remaining[$key]); + + if (!array_key_exists($key, $actual)) { + $expString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + PHPUnit_Util_Type::shortenedExport($value) + ); + $equal = FALSE; + continue; + } + + try { + $this->factory->getComparatorFor($value, $actual[$key])->assertEquals($value, $actual[$key], $delta, $canonicalize, $ignoreCase, $processed); + $expString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + PHPUnit_Util_Type::shortenedExport($value) + ); + $actString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + PHPUnit_Util_Type::shortenedExport($actual[$key]) + ); + } + + catch (PHPUnit_Framework_ComparisonFailure $e) { + $expString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + $e->getExpectedAsString() + ? $this->indent($e->getExpectedAsString()) + : PHPUnit_Util_Type::shortenedExport($e->getExpected()) + ); + $actString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + $e->getActualAsString() + ? $this->indent($e->getActualAsString()) + : PHPUnit_Util_Type::shortenedExport($e->getActual()) + ); + $equal = FALSE; + } + } + + foreach ($remaining as $key => $value) { + $actString .= sprintf( + " %s => %s\n", + + PHPUnit_Util_Type::export($key), + PHPUnit_Util_Type::shortenedExport($value) + ); + $equal = FALSE; + } + + $expString .= ')'; + $actString .= ')'; + + if (!$equal) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + $expString, + $actString, + FALSE, + 'Failed asserting that two arrays are equal.' + ); + } + } + + protected function indent($lines) + { + return trim(str_replace("\n", "\n ", $lines)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php @@ -0,0 +1,114 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares DOMDocument instances for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_DOMDocument extends PHPUnit_Framework_Comparator_Object +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return $expected instanceof DOMDocument && $actual instanceof DOMDocument; + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if ($expected->C14N() !== $actual->C14N()) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + $this->domToText($expected), + $this->domToText($actual), + FALSE, + 'Failed asserting that two DOM documents are equal.' + ); + } + } + + /** + * Returns the normalized, whitespace-cleaned, and indented textual + * representation of a DOMDocument. + * + * @param DOMDocument $document + * @return string + */ + protected function domToText(DOMDocument $document) + { + $document->formatOutput = TRUE; + $document->normalizeDocument(); + + return $document->saveXML(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php @@ -0,0 +1,101 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares doubles for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Double extends PHPUnit_Framework_Comparator_Numeric +{ + /** + * Smallest value available in PHP. + * + * @var float + */ + const EPSILON = 0.0000000001; + + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return (is_double($expected) || is_double($actual)) && is_numeric($expected) && is_numeric($actual); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if ($delta == 0) { + $delta = self::EPSILON; + } + + parent::assertEquals($expected, $actual, $delta, $canonicalize, $ignoreCase); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php @@ -0,0 +1,92 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares Exception instances for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Exception extends PHPUnit_Framework_Comparator_Object +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return $expected instanceof Exception && $actual instanceof Exception; + } + + /** + * Converts an object to an array containing all of its private, protected + * and public properties. + * + * @param object $object + * @return array + */ + protected function toArray($object) + { + $array = parent::toArray($object); + + unset( + $array['file'], + $array['line'], + $array['trace'], + $array['string'], // some internal property of Exception + $array['xdebug_message'] // some internal property added by XDebug + ); + + return $array; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php @@ -0,0 +1,86 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares PHPUnit_Framework_MockObject_MockObject instances for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_MockObject extends PHPUnit_Framework_Comparator_Object +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return $expected instanceof PHPUnit_Framework_MockObject_MockObject && $actual instanceof PHPUnit_Framework_MockObject_MockObject; + } + + /** + * Converts an object to an array containing all of its private, protected + * and public properties. + * + * @param object $object + * @return array + */ + protected function toArray($object) + { + $array = parent::toArray($object); + + unset($array['__phpunit_invocationMocker']); + + return $array; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php @@ -0,0 +1,112 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares numerical values for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @author Alexander <iam.asm89@gmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Numeric extends PHPUnit_Framework_Comparator_Scalar +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + // all numerical values, but not if one of them is a double + return is_numeric($expected) && is_numeric($actual) && !(is_double($expected) || is_double($actual)); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if (is_infinite($actual) && is_infinite($expected)) { + return; + } + + if ((is_infinite($actual) XOR is_infinite($expected)) || + (is_nan($actual) OR is_nan($expected)) || + abs($actual - $expected) > $delta) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + '', + '', + FALSE, + sprintf( + 'Failed asserting that %s matches expected %s.', + + PHPUnit_Util_Type::export($actual), + PHPUnit_Util_Type::export($expected) + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php @@ -0,0 +1,145 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares objects for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Object extends PHPUnit_Framework_Comparator_Array +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return is_object($expected) && is_object($actual); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE, array &$processed = array()) + { + if (get_class($actual) !== get_class($expected)) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + PHPUnit_Util_Type::export($expected), + PHPUnit_Util_Type::export($actual), + FALSE, + sprintf( + '%s is not instance of expected class "%s".', + + PHPUnit_Util_Type::export($actual), + get_class($expected) + ) + ); + } + + // don't compare twice to allow for cyclic dependencies + if (in_array(array($actual, $expected), $processed, TRUE) || + in_array(array($expected, $actual), $processed, TRUE)) { + return; + } + + $processed[] = array($actual, $expected); + + // don't compare objects if they are identical + // this helps to avoid the error "maximum function nesting level reached" + // CAUTION: this conditional clause is not tested + if ($actual !== $expected) { + try { + parent::assertEquals($this->toArray($expected), $this->toArray($actual), $delta, $canonicalize, $ignoreCase, $processed); + } + + catch (PHPUnit_Framework_ComparisonFailure $e) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + // replace "Array" with "MyClass object" + substr_replace($e->getExpectedAsString(), get_class($expected) . ' Object', 0, 5), + substr_replace($e->getActualAsString(), get_class($actual) . ' Object', 0, 5), + FALSE, + 'Failed asserting that two objects are equal.' + ); + } + } + } + + /** + * Converts an object to an array containing all of its private, protected + * and public properties. + * + * @param object $object + * @return array + */ + protected function toArray($object) + { + return PHPUnit_Util_Type::toArray($object); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php @@ -0,0 +1,97 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares resources for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Resource extends PHPUnit_Framework_Comparator +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return is_resource($expected) && is_resource($actual); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if ($actual != $expected) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + PHPUnit_Util_Type::export($expected), + PHPUnit_Util_Type::export($actual) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php @@ -0,0 +1,136 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares scalar or NULL values for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Scalar extends PHPUnit_Framework_Comparator +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + * @since Method available since Release 3.6.0 + */ + public function accepts($expected, $actual) + { + return ((is_scalar($expected) XOR NULL === $expected) && + (is_scalar($actual) XOR NULL === $actual)) + // allow comparison between strings and objects featuring __toString() + || (is_string($expected) && is_object($actual) && method_exists($actual, '__toString')) + || (is_object($expected) && method_exists($expected, '__toString') && is_string($actual)); + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + $expectedToCompare = $expected; + $actualToCompare = $actual; + + // always compare as strings to avoid strange behaviour + // otherwise 0 == 'Foobar' + if (is_string($expected) || is_string($actual)) { + $expectedToCompare = (string)$expectedToCompare; + $actualToCompare = (string)$actualToCompare; + + if ($ignoreCase) { + $expectedToCompare = strtolower($expectedToCompare); + $actualToCompare = strtolower($actualToCompare); + } + } + + if ($expectedToCompare != $actualToCompare) { + if (is_string($expected) && is_string($actual)) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + PHPUnit_Util_Type::export($expected), + PHPUnit_Util_Type::export($actual), + FALSE, + 'Failed asserting that two strings are equal.' + ); + } + + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + // no diff is required + '', + '', + FALSE, + sprintf( + 'Failed asserting that %s matches expected %s.', + + PHPUnit_Util_Type::export($actual), + PHPUnit_Util_Type::export($expected) + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php @@ -0,0 +1,114 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares SplObjectStorage instances for equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_SplObjectStorage extends PHPUnit_Framework_Comparator +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return $expected instanceof SplObjectStorage && $actual instanceof SplObjectStorage; + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + foreach ($actual as $object) { + if (!$expected->contains($object)) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + PHPUnit_Util_Type::export($expected), + PHPUnit_Util_Type::export($actual), + FALSE, + 'Failed asserting that two objects are equal.' + ); + } + } + + foreach ($expected as $object) { + if (!$actual->contains($object)) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + PHPUnit_Util_Type::export($expected), + PHPUnit_Util_Type::export($actual), + FALSE, + 'Failed asserting that two objects are equal.' + ); + } + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php @@ -0,0 +1,105 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Compares values for type equality. + * + * @package PHPUnit + * @subpackage Framework_Comparator + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Comparator_Type extends PHPUnit_Framework_Comparator +{ + /** + * Returns whether the comparator can compare two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return boolean + */ + public function accepts($expected, $actual) + { + return TRUE; + } + + /** + * Asserts that two values are equal. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @param float $delta The allowed numerical distance between two values to + * consider them equal + * @param bool $canonicalize If set to TRUE, arrays are sorted before + * comparison + * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is + * ignored when comparing string values + * @throws PHPUnit_Framework_ComparisonFailure Thrown when the comparison + * fails. Contains information about the + * specific errors that lead to the failure. + */ + public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if (gettype($expected) != gettype($actual)) { + throw new PHPUnit_Framework_ComparisonFailure( + $expected, + $actual, + // we don't need a diff + '', + '', + FALSE, + sprintf( + '%s does not match expected type "%s".', + + PHPUnit_Util_Type::shortenedExport($actual), + gettype($expected) + ) + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php @@ -0,0 +1,156 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Factory for comparators which compare values for equality. + * + * @package PHPUnit + * @subpackage Framework + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_ComparatorFactory +{ + /** + * @var array + */ + protected $comparators = array(); + + /** + * @var PHPUnit_Framework_ComparatorFactory + */ + private static $defaultInstance = NULL; + + /** + * Constructs a new factory. + */ + public function __construct() + { + $this->register(new PHPUnit_Framework_Comparator_Type); + $this->register(new PHPUnit_Framework_Comparator_Scalar); + $this->register(new PHPUnit_Framework_Comparator_Numeric); + $this->register(new PHPUnit_Framework_Comparator_Double); + $this->register(new PHPUnit_Framework_Comparator_Array); + $this->register(new PHPUnit_Framework_Comparator_Resource); + $this->register(new PHPUnit_Framework_Comparator_Object); + $this->register(new PHPUnit_Framework_Comparator_Exception); + $this->register(new PHPUnit_Framework_Comparator_SplObjectStorage); + $this->register(new PHPUnit_Framework_Comparator_DOMDocument); + $this->register(new PHPUnit_Framework_Comparator_MockObject); + } + + /** + * Returns the default instance. + * + * @return PHPUnit_Framework_ComparatorFactory + */ + public static function getDefaultInstance() + { + if (self::$defaultInstance === NULL) { + self::$defaultInstance = new PHPUnit_Framework_ComparatorFactory; + } + + return self::$defaultInstance; + } + + /** + * Returns the correct comparator for comparing two values. + * + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * @return PHPUnit_Framework_Comparator + * @throws PHPUnit_Framework_Exception + */ + public function getComparatorFor($expected, $actual) + { + foreach ($this->comparators as $comparator) { + if ($comparator->accepts($expected, $actual)) { + return $comparator; + } + } + + throw new PHPUnit_Framework_Exception( + sprintf( + 'No comparator is registered for comparing the types "%s" and "%s"', + gettype($expected), gettype($actual) + ) + ); + } + + /** + * Registers a new comparator. + * + * This comparator will be returned by getInstance() if its accept() method + * returns TRUE for the compared values. It has higher priority than the + * existing comparators, meaning that its accept() method will be tested + * before those of the other comparators. + * + * @param PHPUnit_Framework_Comparator $comparator The registered comparator + */ + public function register(PHPUnit_Framework_Comparator $comparator) + { + array_unshift($this->comparators, $comparator); + $comparator->setFactory($this); + } + + /** + * Unregisters a comparator. + * + * This comparator will no longer be returned by getInstance(). + * + * @param PHPUnit_Framework_Comparator $comparator The unregistered comparator + */ + public function unregister(PHPUnit_Framework_Comparator $comparator) + { + foreach ($this->comparators as $key => $_comparator) { + if ($comparator === $_comparator) { + unset($this->comparators[$key]); + } + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php @@ -0,0 +1,166 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Thrown when an assertion for string equality failed. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_ComparisonFailure extends PHPUnit_Framework_AssertionFailedError +{ + /** + * Expected value of the retrieval which does not match $actual. + * @var mixed + */ + protected $expected; + + /** + * Actually retrieved value which does not match $expected. + * @var mixed + */ + protected $actual; + + /** + * The string representation of the expected value + * @var string + */ + protected $expectedAsString; + + /** + * The string representation of the actual value + * @var string + */ + protected $actualAsString; + + /** + * @var boolean + */ + protected $identical; + + /** + * Optional message which is placed in front of the first line + * returned by toString(). + * @var string + */ + protected $message; + + /** + * Initialises with the expected value and the actual value. + * + * @param mixed $expected Expected value retrieved. + * @param mixed $actual Actual value retrieved. + * @param string $expectedAsString + * @param string $actualAsString + * @param boolean $identical + * @param string $message A string which is prefixed on all returned lines + * in the difference output. + */ + public function __construct($expected, $actual, $expectedAsString, $actualAsString, $identical = FALSE, $message = '') + { + $this->expected = $expected; + $this->actual = $actual; + $this->expectedAsString = $expectedAsString; + $this->actualAsString = $actualAsString; + $this->message = $message; + } + + /** + * @return mixed + */ + public function getActual() + { + return $this->actual; + } + + /** + * @return mixed + */ + public function getExpected() + { + return $this->expected; + } + + /** + * @return string + */ + public function getActualAsString() + { + return $this->actualAsString; + } + + /** + * @return string + */ + public function getExpectedAsString() + { + return $this->expectedAsString; + } + + /** + * @return string + */ + public function getDiff() + { + return $this->actualAsString || $this->expectedAsString + ? PHPUnit_Util_Diff::diff($this->expectedAsString, $this->actualAsString) + : ''; + } + + /** + * @return string + */ + public function toString() + { + return $this->message . $this->getDiff(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php @@ -0,0 +1,180 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Abstract base class for constraints. which are placed upon any value. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 3.0.0 + */ +abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framework_SelfDescribing +{ + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = FALSE; + + if ($this->matches($other)) { + $success = TRUE; + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * This method can be overridden to implement the evaluation algorithm. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return FALSE; + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.4.0 + */ + public function count() + { + return 1; + } + + /** + * Throws an exception for the given compared value and test description + * + * @param mixed $other Evaluated value or object. + * @param string $description Additional information about the test + * @param PHPUnit_Framework_ComparisonFailure $comparisonFailure + * @throws PHPUnit_Framework_ExpectationFailedException + */ + protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) + { + $failureDescription = sprintf( + 'Failed asserting that %s.', + $this->failureDescription($other) + ); + + $additionalFailureDescription = $this->additionalFailureDescription($other); + if ($additionalFailureDescription) { + $failureDescription .= "\n" . $additionalFailureDescription; + } + + if (!empty($description)) { + $failureDescription = $description . "\n" . $failureDescription; + } + + throw new PHPUnit_Framework_ExpectationFailedException( + $failureDescription, + $comparisonFailure + ); + } + + /** + * Return additional failure description where needed + * + * The function can be overridden to provide additional failure + * information like a diff + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function additionalFailureDescription($other) + { + return ""; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * To provide additional failure information additionalFailureDescription + * can be used. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return PHPUnit_Util_Type::export($other) . ' ' . $this->toString(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php @@ -0,0 +1,164 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Logical AND. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_And extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint[] + */ + protected $constraints = array(); + + /** + * @var PHPUnit_Framework_Constraint + */ + protected $lastConstraint = NULL; + + /** + * @param PHPUnit_Framework_Constraint[] $constraints + * @throws PHPUnit_Framework_Exception + */ + public function setConstraints(array $constraints) + { + $this->constraints = array(); + + foreach ($constraints as $key => $constraint) { + if (!($constraint instanceof PHPUnit_Framework_Constraint)) { + throw new PHPUnit_Framework_Exception( + 'All parameters to ' . __CLASS__ . + ' must be a constraint object.' + ); + } + + $this->constraints[] = $constraint; + } + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = TRUE; + $constraint = NULL; + + foreach ($this->constraints as $constraint) { + if (!$constraint->evaluate($other, $description, TRUE)) { + $success = FALSE; + break; + } + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + $text = ''; + + foreach ($this->constraints as $key => $constraint) { + if ($key > 0) { + $text .= ' and '; + } + + $text .= $constraint->toString(); + } + + return $text; + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.4.0 + */ + public function count() + { + $count = 0; + + foreach ($this->constraints as $constraint) { + $count += count($constraint); + } + + return $count; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php @@ -0,0 +1,122 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the array it is evaluated for has a given key. + * + * Uses array_key_exists() to check if the key is found in the input array, if + * not found the evaluation fails. + * + * The array key is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_ArrayHasKey extends PHPUnit_Framework_Constraint +{ + /** + * @var integer|string + */ + protected $key; + + /** + * @param integer|string $key + */ + public function __construct($key) + { + $this->key = $key; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + if (is_array($other)) { + return array_key_exists($this->key, $other); + } + + if ($other instanceof ArrayAccess) { + return $other->offsetExists($this->key); + } + + return FALSE; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'has the key ' . PHPUnit_Util_Type::export($this->key); + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return 'an array ' . $this->toString(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php @@ -0,0 +1,129 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ + +class PHPUnit_Framework_Constraint_Attribute extends PHPUnit_Framework_Constraint_Composite +{ + /** + * @var string + */ + protected $attributeName; + + /** + * @param PHPUnit_Framework_Constraint $constraint + * @param string $attributeName + */ + public function __construct(PHPUnit_Framework_Constraint $constraint, $attributeName) + { + parent::__construct($constraint); + + $this->attributeName = $attributeName; + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + return parent::evaluate( + PHPUnit_Framework_Assert::readAttribute( + $other, $this->attributeName + ), + $description, + $returnResult + ); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'attribute "' . $this->attributeName . '" ' . + $this->innerConstraint->toString(); + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return $this->toString(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php @@ -0,0 +1,116 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + */ + +/** + * Constraint that evaluates against a specified closure. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Timon Rapp <timon@zaeda.net> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + */ +class PHPUnit_Framework_Constraint_Callback extends PHPUnit_Framework_Constraint +{ + private $callback; + + /** + * @param callable $callback + * @throws InvalidArgumentException + */ + public function __construct($callback) + { + if (!is_callable($callback)) { + throw new InvalidArgumentException( + sprintf( + 'Specified callback <%s> is not callable.', + $this->callbackToString($callback) + ) + ); + } + $this->callback = $callback; + } + + /** + * Evaluates the constraint for parameter $value. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $value Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return call_user_func($this->callback, $other); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is accepted by specified callback'; + } + + private function callbackToString($callback) + { + if (!is_array($callback)) { + return $callback; + } + if (empty($callback)) { + return "empty array"; + } + if (!isset($callback[0]) || !isset($callback[1])) { + return "array without indexes 0 and 1 set"; + } + if (is_object($callback[0])) { + $callback[0] = get_class($callback[0]); + } + return $callback[0] . '::' . $callback[1]; + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php @@ -0,0 +1,124 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * Constraint that asserts that the class it is evaluated for has a given + * attribute. + * + * The attribute name is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ +class PHPUnit_Framework_Constraint_ClassHasAttribute extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $attributeName; + + /** + * @param string $attributeName + */ + public function __construct($attributeName) + { + $this->attributeName = $attributeName; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + $class = new ReflectionClass($other); + + return $class->hasProperty($this->attributeName); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return sprintf( + 'has attribute "%s"', + + $this->attributeName + ); + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + '%sclass "%s" %s', + + is_object($other) ? 'object of ' : '', + is_object($other) ? get_class($other) : $other, + $this->toString() + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php @@ -0,0 +1,98 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * Constraint that asserts that the class it is evaluated for has a given + * static attribute. + * + * The attribute name is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ +class PHPUnit_Framework_Constraint_ClassHasStaticAttribute extends PHPUnit_Framework_Constraint_ClassHasAttribute +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + $class = new ReflectionClass($other); + + if ($class->hasProperty($this->attributeName)) { + $attribute = $class->getProperty($this->attributeName); + + return $attribute->isStatic(); + } else { + return FALSE; + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + * @since Method available since Release 3.3.0 + */ + public function toString() + { + return sprintf( + 'has static attribute "%s"', + + $this->attributeName + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php @@ -0,0 +1,114 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ + +abstract class PHPUnit_Framework_Constraint_Composite extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint + */ + protected $innerConstraint; + + /** + * @param PHPUnit_Framework_Constraint $innerConstraint + * @param string $attributeName + */ + public function __construct(PHPUnit_Framework_Constraint $innerConstraint) + { + $this->innerConstraint = $innerConstraint; + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + try { + return $this->innerConstraint->evaluate( + $other, + $description, + $returnResult + ); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->fail($other, $description); + } + } + + /** + * Counts the number of constraint elements. + * + * @return integer + */ + public function count() + { + return count($this->innerConstraint); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php @@ -0,0 +1,140 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Constraint_Count extends PHPUnit_Framework_Constraint +{ + /** + * @var integer + */ + protected $expectedCount = 0; + + /** + * @param integer $expected + */ + public function __construct($expected) + { + $this->expectedCount = $expected; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other + * @return boolean + */ + protected function matches($other) + { + return $this->expectedCount === $this->getCountOf($other); + } + + /** + * @param mixed $other + * @return boolean + */ + protected function getCountOf($other) + { + if ($other instanceof Countable || is_array($other)) { + return count($other); + } + + else if ($other instanceof Iterator) { + $key = $other->key(); + $count = iterator_count($other); + + // manually rewind $other to previous key, since iterator_count moves pointer + if ($key !== null) { + $other->rewind(); + while ($key !== $other->key()) { + $other->next(); + } + } + + return $count; + } + + } + + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + 'actual size %d matches expected size %d', + + $this->getCountOf($other), + $this->expectedCount + ); + } + + /** + * @return string + */ + public function toString() + { + return 'count matches '; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php @@ -0,0 +1,129 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.6 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.6 + */ +class PHPUnit_Framework_Constraint_Exception extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $className; + + /** + * @param string $className + */ + public function __construct($className) + { + $this->className = $className; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $other instanceof $this->className; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + if ($other !== NULL) { + $message = ''; + if ($other instanceof Exception && $other->getMessage()) { + $message = '. Message was: "' . $other->getMessage() . '"'; + } + return sprintf( + 'exception of type "%s" matches expected exception "%s"%s', + + get_class($other), + $this->className, + $message + ); + } + + return sprintf( + 'exception of type "%s" is thrown', + + $this->className + ); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return sprintf( + 'exception of type "%s"', + + $this->className + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php @@ -0,0 +1,109 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.6 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.6 + */ +class PHPUnit_Framework_Constraint_ExceptionCode extends PHPUnit_Framework_Constraint +{ + /** + * @var integer + */ + protected $expectedCode; + + /** + * @param integer $expected + */ + public function __construct($expected) + { + $this->expectedCode = $expected; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param Exception $other + * @return boolean + */ + protected function matches($other) + { + return (string)$other->getCode() == (string)$this->expectedCode; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + '%s is equal to expected exception code %s', + PHPUnit_Util_Type::export($other->getCode()), + PHPUnit_Util_Type::export($this->expectedCode) + ); + } + + /** + * @return string + */ + public function toString() + { + return 'exception code is '; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php @@ -0,0 +1,109 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.6 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.6 + */ +class PHPUnit_Framework_Constraint_ExceptionMessage extends PHPUnit_Framework_Constraint +{ + /** + * @var integer + */ + protected $expectedMessage; + + /** + * @param string $expected + */ + public function __construct($expected) + { + $this->expectedMessage = $expected; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param Exception $other + * @return boolean + */ + protected function matches($other) + { + return strpos($other->getMessage(), $this->expectedMessage) !== FALSE; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + "exception message '%s' contains '%s'", + $other->getMessage(), + $this->expectedMessage + ); + } + + /** + * @return string + */ + public function toString() + { + return 'exception message contains '; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php @@ -0,0 +1,102 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that checks if the file(name) that it is evaluated for exists. + * + * The file path to check is passed as $other in evaluate(). + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_FileExists extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return file_exists($other); + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + 'file "%s" exists', + + $other + ); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'file exists'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php @@ -0,0 +1,96 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the value it is evaluated for is greater + * than a given value. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_GreaterThan extends PHPUnit_Framework_Constraint +{ + /** + * @var numeric + */ + protected $value; + + /** + * @param numeric $value + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $this->value < $other; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is greater than ' . PHPUnit_Util_Type::export($this->value); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php @@ -0,0 +1,102 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that accepts any input value. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_IsAnything extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + return $returnResult ? TRUE : NULL; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is anything'; + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.5.0 + */ + public function count() + { + return 0; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php @@ -0,0 +1,104 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +/** + * Constraint that checks whether a variable is empty(). + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.0 + */ +class PHPUnit_Framework_Constraint_IsEmpty extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return empty($other); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is empty'; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + $type = gettype($other); + + return sprintf( + '%s %s %s', + + $type[0] == 'a' || $type[0] == 'o' ? 'an' : 'a', + $type, + $this->toString() + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php @@ -0,0 +1,215 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Kore Nordmann <kn@ez.no> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that checks if one value is equal to another. + * + * Equality is checked with PHP's == operator, the operator is explained in + * detail at {@url http://www.php.net/manual/en/types.comparisons.php}. + * Two values are equal if they have the same value disregarding type. + * + * The expected value is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Kore Nordmann <kn@ez.no> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_IsEqual extends PHPUnit_Framework_Constraint +{ + /** + * @var mixed + */ + protected $value; + + /** + * @var float + */ + protected $delta = 0; + + /** + * @var integer + */ + protected $maxDepth = 10; + + /** + * @var boolean + */ + protected $canonicalize = FALSE; + + /** + * @var boolean + */ + protected $ignoreCase = FALSE; + + /** + * @var PHPUnit_Framework_ComparisonFailure + */ + protected $lastFailure; + + /** + * @param mixed $value + * @param float $delta + * @param integer $maxDepth + * @param boolean $canonicalize + * @param boolean $ignoreCase + */ + public function __construct($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if (!is_numeric($delta)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'numeric'); + } + + if (!is_int($maxDepth)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'integer'); + } + + if (!is_bool($canonicalize)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean'); + } + + if (!is_bool($ignoreCase)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(5, 'boolean'); + } + + $this->value = $value; + $this->delta = $delta; + $this->maxDepth = $maxDepth; + $this->canonicalize = $canonicalize; + $this->ignoreCase = $ignoreCase; + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $comparatorFactory = PHPUnit_Framework_ComparatorFactory::getDefaultInstance(); + + try { + $comparator = $comparatorFactory->getComparatorFor( + $other, $this->value + ); + + $comparator->assertEquals( + $this->value, + $other, + $this->delta, + $this->canonicalize, + $this->ignoreCase + ); + } + + catch (PHPUnit_Framework_ComparisonFailure $f) { + if ($returnResult) { + return FALSE; + } + + throw new PHPUnit_Framework_ExpectationFailedException( + trim($description . "\n" . $f->getMessage()), + $f + ); + } + + return TRUE; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + $delta = ''; + + if (is_string($this->value)) { + if (strpos($this->value, "\n") !== FALSE) { + return 'is equal to <text>'; + } else { + return sprintf( + 'is equal to <string:%s>', + + $this->value + ); + } + } else { + if ($this->delta != 0) { + $delta = sprintf( + ' with delta <%F>', + + $this->delta + ); + } + + return sprintf( + 'is equal to %s%s', + + PHPUnit_Util_Type::export($this->value), + $delta + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php @@ -0,0 +1,82 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Constraint that accepts FALSE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Constraint_IsFalse extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $other === FALSE; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is false'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php @@ -0,0 +1,173 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that one value is identical to another. + * + * Identical check is performed with PHP's === operator, the operator is + * explained in detail at + * {@url http://www.php.net/manual/en/types.comparisons.php}. + * Two values are identical if they have the same value and are of the same + * type. + * + * The expected value is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_IsIdentical extends PHPUnit_Framework_Constraint +{ + /** + * @var double + */ + const EPSILON = 0.0000000001; + + /** + * @var mixed + */ + protected $value; + + /** + * @param mixed $value + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + if (is_double($this->value) && is_double($other) && + !is_infinite($this->value) && !is_infinite($other) && + !is_nan($this->value) && !is_nan($other)) { + $success = abs($this->value - $other) < self::EPSILON; + } + + else { + $success = $this->value === $other; + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $f = NULL; + + // if both values are strings, make sure a diff is generated + if (is_string($this->value) && is_string($other)) { + $f = new PHPUnit_Framework_ComparisonFailure( + $this->value, + $other, + $this->value, + $other + ); + } + + $this->fail($other, $description, $f); + } + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + if (is_object($this->value) && is_object($other)) { + return 'two variables reference the same object'; + } + + if (is_string($this->value) && is_string($other)) { + return 'two strings are identical'; + } + + return parent::failureDescription($other); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + if (is_object($this->value)) { + return 'is identical to an object of class "' . + get_class($this->value) . '"'; + } else { + return 'is identical to ' . + PHPUnit_Util_Type::export($this->value); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php @@ -0,0 +1,121 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the object it is evaluated for is an instance + * of a given class. + * + * The expected class name is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_IsInstanceOf extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $className; + + /** + * @param string $className + */ + public function __construct($className) + { + $this->className = $className; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return ($other instanceof $this->className); + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + '%s is an instance of class "%s"', + + PHPUnit_Util_Type::shortenedExport($other), + $this->className + ); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return sprintf( + 'is instance of class "%s"', + + $this->className + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php @@ -0,0 +1,109 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.20 + */ + +/** + * Constraint that asserts that a string is valid JSON. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.7.20 + */ +class PHPUnit_Framework_Constraint_IsJson extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + json_decode($other); + if (json_last_error()) { + return FALSE; + } + + return TRUE; + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + json_decode($other); + $error = PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::determineJsonError( + json_last_error() + ); + + return sprintf( + '%s is valid JSON (%s)', + + PHPUnit_Util_Type::shortenedExport($other), + $error + ); + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is valid JSON'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php @@ -0,0 +1,82 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Constraint that accepts NULL. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Constraint_IsNull extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $other === NULL; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is null'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php @@ -0,0 +1,82 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Constraint that accepts TRUE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Constraint_IsTrue extends PHPUnit_Framework_Constraint +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $other === TRUE; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is true'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php @@ -0,0 +1,190 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the value it is evaluated for is of a + * specified type. + * + * The expected value is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_IsType extends PHPUnit_Framework_Constraint +{ + const TYPE_ARRAY = 'array'; + const TYPE_BOOL = 'bool'; + const TYPE_FLOAT = 'float'; + const TYPE_INT = 'int'; + const TYPE_NULL = 'null'; + const TYPE_NUMERIC = 'numeric'; + const TYPE_OBJECT = 'object'; + const TYPE_RESOURCE = 'resource'; + const TYPE_STRING = 'string'; + const TYPE_SCALAR = 'scalar'; + const TYPE_CALLABLE = 'callable'; + + /** + * @var array + */ + protected $types = array( + 'array' => TRUE, + 'boolean' => TRUE, + 'bool' => TRUE, + 'float' => TRUE, + 'integer' => TRUE, + 'int' => TRUE, + 'null' => TRUE, + 'numeric' => TRUE, + 'object' => TRUE, + 'resource' => TRUE, + 'string' => TRUE, + 'scalar' => TRUE, + 'callable' => TRUE + ); + + /** + * @var string + */ + protected $type; + + /** + * @param string $type + * @throws PHPUnit_Framework_Exception + */ + public function __construct($type) + { + if (!isset($this->types[$type])) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Type specified for PHPUnit_Framework_Constraint_IsType <%s> ' . + 'is not a valid type.', + $type + ) + ); + } + + $this->type = $type; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + switch ($this->type) { + case 'numeric': { + return is_numeric($other); + } + + case 'integer': + case 'int': { + return is_integer($other); + } + + case 'float': { + return is_float($other); + } + + case 'string': { + return is_string($other); + } + + case 'boolean': + case 'bool': { + return is_bool($other); + } + + case 'null': { + return is_null($other); + } + + case 'array': { + return is_array($other); + } + + case 'object': { + return is_object($other); + } + + case 'resource': { + return is_resource($other); + } + + case 'scalar': { + return is_scalar($other); + } + + case 'callable': { + return is_callable($other); + } + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return sprintf( + 'is of type "%s"', + + $this->type + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php @@ -0,0 +1,110 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ + +/** + * Asserts whether or not two JSON objects are equal. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since Class available since Release 3.7.0 + */ +class PHPUnit_Framework_Constraint_JsonMatches extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $value; + + /** + * Creates a new constraint. + * + * @param string $value + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * This method can be overridden to implement the evaluation algorithm. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + $decodedOther = json_decode($other); + if (json_last_error()) { + return FALSE; + } + + $decodedValue = json_decode($this->value); + if (json_last_error()) { + return FALSE; + } + + return $decodedOther == $decodedValue; + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return sprintf( + 'matches JSON string "%s"', + $this->value + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php @@ -0,0 +1,106 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ + +/** + * Provides human readable messages for each JSON error. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since Class available since Release 3.7.0 + */ +class PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider +{ + /** + * Translates JSON error to a human readable string. + * + * @param string $error + * @return string + */ + public static function determineJsonError($error, $prefix = '') + { + switch ($error) { + case JSON_ERROR_NONE: + return; + case JSON_ERROR_DEPTH: + return $prefix . 'Maximum stack depth exceeded'; + case JSON_ERROR_STATE_MISMATCH: + return $prefix . 'Underflow or the modes mismatch'; + case JSON_ERROR_CTRL_CHAR: + return $prefix . 'Unexpected control character found'; + case JSON_ERROR_SYNTAX: + return $prefix . 'Syntax error, malformed JSON'; + case JSON_ERROR_UTF8: + return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded'; + default: + return $prefix . 'Unknown error'; + } + } + + /** + * Translates a given type to a human readable message prefix. + * + * @param string $type + * @return string + */ + public static function translateTypeToPrefix($type) + { + switch (strtolower($type)) { + case 'expected': + $prefix = 'Expected value JSON decode error - '; + break; + case 'actual': + $prefix = 'Actual value JSON decode error - '; + break; + default: + $prefix = ''; + break; + } + return $prefix; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php @@ -0,0 +1,96 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the value it is evaluated for is less than + * a given value. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_LessThan extends PHPUnit_Framework_Constraint +{ + /** + * @var numeric + */ + protected $value; + + /** + * @param numeric $value + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return $this->value > $other; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'is less than ' . PHPUnit_Util_Type::export($this->value); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php @@ -0,0 +1,203 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Logical NOT. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ + +class PHPUnit_Framework_Constraint_Not extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint + */ + protected $constraint; + + /** + * @param PHPUnit_Framework_Constraint $constraint + */ + public function __construct($constraint) + { + if (!($constraint instanceof PHPUnit_Framework_Constraint)) { + $constraint = new PHPUnit_Framework_Constraint_IsEqual($constraint); + } + + $this->constraint = $constraint; + } + + /** + * @param string $string + * @return string + */ + public static function negate($string) + { + return str_replace( + array( + 'contains ', + 'exists', + 'has ', + 'is ', + 'are ', + 'matches ', + 'starts with ', + 'ends with ', + 'reference ', + 'not not ' + ), + array( + 'does not contain ', + 'does not exist', + 'does not have ', + 'is not ', + 'are not ', + 'does not match ', + 'starts not with ', + 'ends not with ', + 'don\'t reference ', + 'not ' + ), + $string + ); + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = !$this->constraint->evaluate($other, $description, TRUE); + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + switch (get_class($this->constraint)) { + case 'PHPUnit_Framework_Constraint_And': + case 'PHPUnit_Framework_Constraint_Not': + case 'PHPUnit_Framework_Constraint_Or': { + return 'not( ' . $this->constraint->failureDescription($other) . ' )'; + } + break; + + default: { + return self::negate( + $this->constraint->failureDescription($other) + ); + } + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + switch (get_class($this->constraint)) { + case 'PHPUnit_Framework_Constraint_And': + case 'PHPUnit_Framework_Constraint_Not': + case 'PHPUnit_Framework_Constraint_Or': { + return 'not( ' . $this->constraint->toString() . ' )'; + } + break; + + default: { + return self::negate( + $this->constraint->toString() + ); + } + } + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.4.0 + */ + public function count() + { + return count($this->constraint); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php @@ -0,0 +1,77 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the object it is evaluated for has a given + * attribute. + * + * The attribute name is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_ObjectHasAttribute extends PHPUnit_Framework_Constraint_ClassHasAttribute +{ + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + $object = new ReflectionObject($other); + + return $object->hasProperty($this->attributeName); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php @@ -0,0 +1,157 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Logical OR. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_Or extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint[] + */ + protected $constraints = array(); + + /** + * @param PHPUnit_Framework_Constraint[] $constraints + */ + public function setConstraints(array $constraints) + { + $this->constraints = array(); + + foreach ($constraints as $key => $constraint) { + if (!($constraint instanceof PHPUnit_Framework_Constraint)) { + $constraint = new PHPUnit_Framework_Constraint_IsEqual( + $constraint + ); + } + + $this->constraints[] = $constraint; + } + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = FALSE; + $constraint = NULL; + + foreach ($this->constraints as $constraint) { + if ($constraint->evaluate($other, $description, TRUE)) { + $success = TRUE; + break; + } + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + $text = ''; + + foreach ($this->constraints as $key => $constraint) { + if ($key > 0) { + $text .= ' or '; + } + + $text .= $constraint->toString(); + } + + return $text; + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.4.0 + */ + public function count() + { + $count = 0; + + foreach ($this->constraints as $constraint) { + $count += count($constraint); + } + + return $count; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php @@ -0,0 +1,105 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the string it is evaluated for matches + * a regular expression. + * + * Checks a given value using the Perl Compatible Regular Expression extension + * in PHP. The pattern is matched by executing preg_match(). + * + * The pattern string passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_PCREMatch extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $pattern; + + /** + * @param string $pattern + */ + public function __construct($pattern) + { + $this->pattern = $pattern; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return preg_match($this->pattern, $other) > 0; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return sprintf( + 'matches PCRE pattern "%s"', + + $this->pattern + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php @@ -0,0 +1,73 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_Constraint_SameSize extends PHPUnit_Framework_Constraint_Count +{ + /** + * @var integer + */ + protected $expectedCount; + + /** + * @param integer $expected + */ + public function __construct($expected) + { + parent::__construct($this->getCountOf($expected)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php @@ -0,0 +1,122 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the string it is evaluated for contains + * a given string. + * + * Uses strpos() to find the position of the string in the input, if not found + * the evaluation fails. + * + * The sub-string is passed in the constructor. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_StringContains extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $string; + + /** + * @var boolean + */ + protected $ignoreCase; + + /** + * @param string $string + * @param boolean $ignoreCase + */ + public function __construct($string, $ignoreCase = FALSE) + { + $this->string = $string; + $this->ignoreCase = $ignoreCase; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + if ($this->ignoreCase) { + return stripos($other, $this->string) !== FALSE; + } else { + return strpos($other, $this->string) !== FALSE; + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + if ($this->ignoreCase) { + $string = strtolower($this->string); + } else { + $string = $this->string; + } + + return sprintf( + 'contains "%s"', + + $string + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php @@ -0,0 +1,96 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Constraint that asserts that the string it is evaluated for ends with a given + * suffix. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Framework_Constraint_StringEndsWith extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $suffix; + + /** + * @param string $suffix + */ + public function __construct($suffix) + { + $this->suffix = $suffix; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return substr($other, 0 - strlen($this->suffix)) == $this->suffix; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'ends with "' . $this->suffix . '"'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php @@ -0,0 +1,134 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +/** + * ... + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.0 + */ +class PHPUnit_Framework_Constraint_StringMatches extends PHPUnit_Framework_Constraint_PCREMatch +{ + /** + * @var string + */ + protected $string; + + /** + * @param string $string + */ + public function __construct($string) + { + $this->pattern = $this->createPatternFromFormat( + preg_replace('/\r\n/', "\n", $string) + ); + $this->string = $string; + } + + protected function failureDescription($other) + { + return "format description matches text"; + } + + protected function additionalFailureDescription($other) + { + $from = preg_split('(\r\n|\r|\n)', $this->string); + $to = preg_split('(\r\n|\r|\n)', $other); + foreach ($from as $index => $line) { + if (isset($to[$index]) && $line !== $to[$index]) { + $line = $this->createPatternFromFormat($line); + if (preg_match($line, $to[$index]) > 0) { + $from[$index] = $to[$index]; + } + } + } + $this->string = join("\n", $from); + $other = join("\n", $to); + return PHPUnit_Util_Diff::diff($this->string, $other); + } + + protected function createPatternFromFormat($string) + { + $string = str_replace( + array( + '%e', + '%s', + '%S', + '%a', + '%A', + '%w', + '%i', + '%d', + '%x', + '%f', + '%c' + ), + array( + '\\' . DIRECTORY_SEPARATOR, + '[^\r\n]+', + '[^\r\n]*', + '.+', + '.*', + '\s*', + '[+-]?\d+', + '\d+', + '[0-9a-fA-F]+', + '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', + '.' + ), + preg_quote($string, '/') + ); + return '/^' . $string . '$/s'; + } + +} + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php @@ -0,0 +1,96 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Constraint that asserts that the string it is evaluated for begins with a + * given prefix. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Framework_Constraint_StringStartsWith extends PHPUnit_Framework_Constraint +{ + /** + * @var string + */ + protected $prefix; + + /** + * @param string $prefix + */ + public function __construct($prefix) + { + $this->prefix = $prefix; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + return strpos($other, $this->prefix) === 0; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'starts with "' . $this->prefix . '"'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php @@ -0,0 +1,152 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Constraint that asserts that the Traversable it is applied to contains + * a given value. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_TraversableContains extends PHPUnit_Framework_Constraint +{ + /** + * @var boolean + */ + protected $checkForObjectIdentity; + + /** + * @var mixed + */ + protected $value; + + /** + * @param boolean $value + * @param mixed $checkForObjectIdentity + * @throws PHPUnit_Framework_Exception + */ + public function __construct($value, $checkForObjectIdentity = TRUE) + { + if (!is_bool($checkForObjectIdentity)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean'); + } + + $this->checkForObjectIdentity = $checkForObjectIdentity; + $this->value = $value; + } + + /** + * Evaluates the constraint for parameter $other. Returns TRUE if the + * constraint is met, FALSE otherwise. + * + * @param mixed $other Value or object to evaluate. + * @return bool + */ + protected function matches($other) + { + if ($other instanceof SplObjectStorage) { + return $other->contains($this->value); + } + + if (is_object($this->value)) { + foreach ($other as $element) { + if (($this->checkForObjectIdentity && + $element === $this->value) || + (!$this->checkForObjectIdentity && + $element == $this->value)) { + return TRUE; + } + } + } else { + foreach ($other as $element) { + if ($element == $this->value) { + return TRUE; + } + } + } + + return FALSE; + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + if (is_string($this->value) && strpos($this->value, "\n") !== FALSE) { + return 'contains "' . $this->value . '"'; + } else { + return 'contains ' . PHPUnit_Util_Type::export($this->value); + } + } + + /** + * Returns the description of the failure + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other Evaluated value or object. + * @return string + */ + protected function failureDescription($other) + { + return sprintf( + 'an %s %s', + + is_array($other) ? 'array' : 'iterator', + $this->toString() + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php @@ -0,0 +1,135 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.4 + */ + +/** + * Constraint that asserts that the Traversable it is applied to contains + * only values of a given type. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.4 + */ +class PHPUnit_Framework_Constraint_TraversableContainsOnly extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint + */ + protected $constraint; + + /** + * @var string + */ + protected $type; + + /** + * @param string $type + * @param boolean $isNativeType + */ + public function __construct($type, $isNativeType = TRUE) + { + if ($isNativeType) { + $this->constraint = new PHPUnit_Framework_Constraint_IsType($type); + } else { + $this->constraint = new PHPUnit_Framework_Constraint_IsInstanceOf( + $type + ); + } + + $this->type = $type; + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = TRUE; + $constraint = NULL; + + foreach ($other as $item) { + if (!$this->constraint->evaluate($item, '', TRUE)) { + $success = FALSE; + break; + } + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + return 'contains only values of type "' . $this->type . '"'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php @@ -0,0 +1,162 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Logical XOR. + * + * @package PHPUnit + * @subpackage Framework_Constraint + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_Constraint_Xor extends PHPUnit_Framework_Constraint +{ + /** + * @var PHPUnit_Framework_Constraint[] + */ + protected $constraints = array(); + + /** + * @param PHPUnit_Framework_Constraint[] $constraints + */ + public function setConstraints(array $constraints) + { + $this->constraints = array(); + + foreach ($constraints as $key => $constraint) { + if (!($constraint instanceof PHPUnit_Framework_Constraint)) { + $constraint = new PHPUnit_Framework_Constraint_IsEqual( + $constraint + ); + } + + $this->constraints[] = $constraint; + } + } + + /** + * Evaluates the constraint for parameter $other + * + * If $returnResult is set to FALSE (the default), an exception is thrown + * in case of a failure. NULL is returned otherwise. + * + * If $returnResult is TRUE, the result of the evaluation is returned as + * a boolean value instead: TRUE in case of success, FALSE in case of a + * failure. + * + * @param mixed $other Value or object to evaluate. + * @param string $description Additional information about the test + * @param bool $returnResult Whether to return a result or throw an exception + * @return mixed + * @throws PHPUnit_Framework_ExpectationFailedException + */ + public function evaluate($other, $description = '', $returnResult = FALSE) + { + $success = TRUE; + $lastResult = NULL; + $constraint = NULL; + + foreach ($this->constraints as $constraint) { + $result = $constraint->evaluate($other, $description, TRUE); + + if ($result === $lastResult) { + $success = FALSE; + break; + } + + $lastResult = $result; + } + + if ($returnResult) { + return $success; + } + + if (!$success) { + $this->fail($other, $description); + } + } + + /** + * Returns a string representation of the constraint. + * + * @return string + */ + public function toString() + { + $text = ''; + + foreach ($this->constraints as $key => $constraint) { + if ($key > 0) { + $text .= ' xor '; + } + + $text .= $constraint->toString(); + } + + return $text; + } + + /** + * Counts the number of constraint elements. + * + * @return integer + * @since Method available since Release 3.4.0 + */ + public function count() + { + $count = 0; + + foreach ($this->constraints as $constraint) { + $count += count($constraint); + } + + return $count; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php @@ -0,0 +1,75 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.2.0 + */ + +/** + * Wrapper for PHP errors. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.2.0 + */ +class PHPUnit_Framework_Error extends Exception +{ + /** + * Constructor. + * + * @param string $message + * @param integer $code + * @param string $file + * @param integer $line + * @param Exception $previous + */ + public function __construct($message, $code, $file, $line, Exception $previous = NULL) + { + parent::__construct($message, $code, $previous); + + $this->file = $file; + $this->line = $line; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Wrapper for PHP deprecated errors. + * You can disable deprecated-to-exception conversion by setting + * + * <code> + * PHPUnit_Framework_Error_Deprecated::$enabled = FALSE; + * </code> + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Error_Deprecated extends PHPUnit_Framework_Error +{ + public static $enabled = TRUE; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Wrapper for PHP notices. + * You can disable notice-to-exception conversion by setting + * + * <code> + * PHPUnit_Framework_Error_Notice::$enabled = FALSE; + * </code> + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Error_Notice extends PHPUnit_Framework_Error +{ + public static $enabled = TRUE; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * Wrapper for PHP warnings. + * You can disable notice-to-exception conversion by setting + * + * <code> + * PHPUnit_Framework_Error_Warning::$enabled = FALSE; + * </code> + * + * @package PHPUnit + * @subpackage Framework_Error + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Framework_Error_Warning extends PHPUnit_Framework_Error +{ + public static $enabled = TRUE; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php @@ -0,0 +1,59 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Exception for PHPUnit runtime errors. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Framework_Exception extends RuntimeException +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php @@ -0,0 +1,82 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Exception for expectations which failed their check. + * + * The exception contains the error message and optionally a + * PHPUnit_Framework_ComparisonFailure which is used to + * generate diff output of the failed expectations. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_AssertionFailedError +{ + /** + * @var PHPUnit_Framework_ComparisonFailure + */ + protected $comparisonFailure; + + public function __construct($message, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL, Exception $previous = NULL) + { + $this->comparisonFailure = $comparisonFailure; + + parent::__construct($message, 0, $previous); + } + + /** + * @return PHPUnit_Framework_ComparisonFailure + */ + public function getComparisonFailure() + { + return $this->comparisonFailure; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php @@ -0,0 +1,60 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A marker interface for marking any exception/error as result of an unit + * test as incomplete implementation or currently not implemented. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit_Framework_IncompleteTest +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php @@ -0,0 +1,60 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Extension to PHPUnit_Framework_AssertionFailedError to mark the special + * case of an incomplete test. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_IncompleteTestError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_IncompleteTest +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php @@ -0,0 +1,60 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * Extension to PHPUnit_Framework_AssertionFailedError to mark the special + * case of a test that printed output. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Framework_OutputError extends PHPUnit_Framework_AssertionFailedError +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Process/TestCaseMethod.tpl.dist b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Process/TestCaseMethod.tpl.dist @@ -0,0 +1,64 @@ +<?php +ini_set('display_errors', 'stderr'); +set_include_path('{include_path}'); + +$composerAutoload = {composerAutoload}; +$phar = {phar}; + +ob_start(); + +if ($composerAutoload) { + require_once $composerAutoload; + define('PHPUNIT_COMPOSER_INSTALL', $composerAutoload); +} else if ($phar) { + require $phar; +} else { + require 'PHPUnit/Autoload.php'; +} + +function __phpunit_run_isolated_test() +{ + if (!class_exists('{className}')) { + require_once '{filename}'; + } + + $result = new PHPUnit_Framework_TestResult; + + if ({collectCodeCoverageInformation}) { + $result->setCodeCoverage(new PHP_CodeCoverage); + } + + $result->strictMode({strict}); + + $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); + $test->setDependencyInput(unserialize('{dependencyInput}')); + $test->setInIsolation(TRUE); + + ob_end_clean(); + ob_start(); + $test->run($result); + $output = ob_get_clean(); + + print serialize( + array( + 'testResult' => $test->getResult(), + 'numAssertions' => $test->getNumAssertions(), + 'result' => $result, + 'output' => $output + ) + ); + + ob_start(); +} + +{constants} +{included_files} +{globals} + +if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { + require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; + unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); +} + +__phpunit_run_isolated_test(); +ob_end_clean(); diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Interface for classes that can return a description of itself. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 3.0.0 + */ +interface PHPUnit_Framework_SelfDescribing +{ + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString(); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php @@ -0,0 +1,59 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * A marker interface for marking a unit test as being skipped. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 3.0.0 + */ +interface PHPUnit_Framework_SkippedTest +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php @@ -0,0 +1,60 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Extension to PHPUnit_Framework_AssertionFailedError to mark the special + * case of a skipped test. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Framework_SkippedTestError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_SkippedTest +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php @@ -0,0 +1,60 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * Extension to PHPUnit_Framework_AssertionFailedError to mark the special + * case of a skipped test suite. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ +class PHPUnit_Framework_SkippedTestSuiteError extends PHPUnit_Framework_AssertionFailedError implements PHPUnit_Framework_SkippedTest +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php @@ -0,0 +1,121 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.0 + */ + +/** + * Creates a synthetic failed assertion. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.0 + */ +class PHPUnit_Framework_SyntheticError extends PHPUnit_Framework_AssertionFailedError +{ + /** + * The synthetic file. + * + * @var string + */ + protected $syntheticFile = ''; + + /** + * The synthetic line number. + * + * @var integer + */ + protected $syntheticLine = 0; + + /** + * The synthetic trace. + * + * @var array + */ + protected $syntheticTrace = array(); + + /** + * Constructor. + * + * @param string $message + * @param integer $code + * @param string $file + * @param integer $line + * @param array $trace + */ + public function __construct($message, $code, $file, $line, $trace) + { + parent::__construct($message, $code); + + $this->syntheticFile = $file; + $this->syntheticLine = $line; + $this->syntheticTrace = $trace; + } + + /** + * @return string + */ + public function getSyntheticFile() + { + return $this->syntheticFile; + } + + /** + * @return integer + */ + public function getSyntheticLine() + { + return $this->syntheticLine; + } + + /** + * @return array + */ + public function getSyntheticTrace() + { + return $this->syntheticTrace; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php @@ -0,0 +1,66 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A Test can be run and collect its results. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit_Framework_Test extends Countable +{ + /** + * Runs a test and collects its result in a TestResult instance. + * + * @param PHPUnit_Framework_TestResult $result + * @return PHPUnit_Framework_TestResult + */ + public function run(PHPUnit_Framework_TestResult $result = NULL); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php @@ -0,0 +1,1902 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A TestCase defines the fixture to run multiple tests. + * + * To define a TestCase + * + * 1) Implement a subclass of PHPUnit_Framework_TestCase. + * 2) Define instance variables that store the state of the fixture. + * 3) Initialize the fixture state by overriding setUp(). + * 4) Clean-up after a test by overriding tearDown(). + * + * Each test runs in its own fixture so there can be no side effects + * among test runs. + * + * Here is an example: + * + * <code> + * <?php + * class MathTest extends PHPUnit_Framework_TestCase + * { + * public $value1; + * public $value2; + * + * protected function setUp() + * { + * $this->value1 = 2; + * $this->value2 = 3; + * } + * } + * ?> + * </code> + * + * For each test implement a method which interacts with the fixture. + * Verify the expected results with assertions specified by calling + * assert with a boolean. + * + * <code> + * <?php + * public function testPass() + * { + * $this->assertTrue($this->value1 + $this->value2 == 5); + * } + * ?> + * </code> + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing +{ + /** + * Enable or disable the backup and restoration of the $GLOBALS array. + * Overwrite this attribute in a child class of TestCase. + * Setting this attribute in setUp() has no effect! + * + * @var boolean + */ + protected $backupGlobals = NULL; + + /** + * @var array + */ + protected $backupGlobalsBlacklist = array(); + + /** + * Enable or disable the backup and restoration of static attributes. + * Overwrite this attribute in a child class of TestCase. + * Setting this attribute in setUp() has no effect! + * + * @var boolean + */ + protected $backupStaticAttributes = NULL; + + /** + * @var array + */ + protected $backupStaticAttributesBlacklist = array(); + + /** + * Whether or not this test is to be run in a separate PHP process. + * + * @var boolean + */ + protected $runTestInSeparateProcess = NULL; + + /** + * Whether or not this test should preserve the global state when + * running in a separate PHP process. + * + * @var boolean + */ + protected $preserveGlobalState = TRUE; + + /** + * Whether or not this test is running in a separate PHP process. + * + * @var boolean + */ + private $inIsolation = FALSE; + + /** + * @var array + */ + private $data = array(); + + /** + * @var string + */ + private $dataName = ''; + + /** + * @var boolean + */ + private $useErrorHandler = NULL; + + /** + * @var boolean + */ + private $useOutputBuffering = NULL; + + /** + * The name of the expected Exception. + * + * @var mixed + */ + private $expectedException = NULL; + + /** + * The message of the expected Exception. + * + * @var string + */ + private $expectedExceptionMessage = ''; + + /** + * The code of the expected Exception. + * + * @var integer + */ + private $expectedExceptionCode; + + /** + * The required preconditions for a test. + * + * @var array + */ + private $required = array( + 'PHP' => NULL, + 'PHPUnit' => NULL, + 'functions' => array(), + 'extensions' => array() + ); + + /** + * The name of the test case. + * + * @var string + */ + private $name = NULL; + + /** + * @var array + */ + private $dependencies = array(); + + /** + * @var array + */ + private $dependencyInput = array(); + + /** + * @var array + */ + private $iniSettings = array(); + + /** + * @var array + */ + private $locale = array(); + + /** + * @var array + */ + private $mockObjects = array(); + + /** + * @var integer + */ + private $status; + + /** + * @var string + */ + private $statusMessage = ''; + + /** + * @var integer + */ + private $numAssertions = 0; + + /** + * @var PHPUnit_Framework_TestResult + */ + private $result; + + /** + * @var mixed + */ + private $testResult; + + /** + * @var string + */ + private $output = ''; + + /** + * @var string + */ + private $outputExpectedRegex = NULL; + + /** + * @var string + */ + private $outputExpectedString = NULL; + + /** + * @var bool + */ + private $hasPerformedExpectationsOnOutput = FALSE; + + /** + * @var mixed + */ + private $outputCallback = FALSE; + + /** + * @var boolean + */ + private $outputBufferingActive = FALSE; + + /** + * Constructs a test case with the given name. + * + * @param string $name + * @param array $data + * @param string $dataName + */ + public function __construct($name = NULL, array $data = array(), $dataName = '') + { + if ($name !== NULL) { + $this->setName($name); + } + + $this->data = $data; + $this->dataName = $dataName; + } + + /** + * Returns a string representation of the test case. + * + * @return string + */ + public function toString() + { + $class = new ReflectionClass($this); + + $buffer = sprintf( + '%s::%s', + + $class->name, + $this->getName(FALSE) + ); + + return $buffer . $this->getDataSetAsString(); + } + + /** + * Counts the number of test cases executed by run(TestResult result). + * + * @return integer + */ + public function count() + { + return 1; + } + + /** + * Returns the annotations for this test. + * + * @return array + * @since Method available since Release 3.4.0 + */ + public function getAnnotations() + { + return PHPUnit_Util_Test::parseTestMethodAnnotations( + get_class($this), $this->name + ); + } + + /** + * Gets the name of a TestCase. + * + * @param boolean $withDataSet + * @return string + */ + public function getName($withDataSet = TRUE) + { + if ($withDataSet) { + return $this->name . $this->getDataSetAsString(FALSE); + } else { + return $this->name; + } + } + + /** + * Returns the size of the test. + * + * @return integer + * @since Method available since Release 3.6.0 + */ + public function getSize() + { + return PHPUnit_Util_Test::getSize( + get_class($this), $this->getName(FALSE) + ); + } + + /** + * @return string + * @since Method available since Release 3.6.0 + */ + public function getActualOutput() + { + if (!$this->outputBufferingActive) { + return $this->output; + } else { + return ob_get_contents(); + } + } + + /** + * @return boolean + * @since Method available since Release 3.6.0 + */ + public function hasOutput() + { + if (strlen($this->output) === 0) { + return FALSE; + } + + if ($this->outputExpectedString !== NULL || + $this->outputExpectedRegex !== NULL || + $this->hasPerformedExpectationsOnOutput) { + return FALSE; + } + + return TRUE; + } + + /** + * @param string $expectedRegex + * @since Method available since Release 3.6.0 + */ + public function expectOutputRegex($expectedRegex) + { + if ($this->outputExpectedString !== NULL) { + throw new PHPUnit_Framework_Exception; + } + + if (is_string($expectedRegex) || is_null($expectedRegex)) { + $this->outputExpectedRegex = $expectedRegex; + } + } + + /** + * @param string $expectedString + * @since Method available since Release 3.6.0 + */ + public function expectOutputString($expectedString) + { + if ($this->outputExpectedRegex !== NULL) { + throw new PHPUnit_Framework_Exception; + } + + if (is_string($expectedString) || is_null($expectedString)) { + $this->outputExpectedString = $expectedString; + } + } + + /** + * @return bool + * @since Method available since Release 3.6.5 + */ + public function hasPerformedExpectationsOnOutput() + { + return $this->hasPerformedExpectationsOnOutput; + } + + /** + * @return string + * @since Method available since Release 3.2.0 + */ + public function getExpectedException() + { + return $this->expectedException; + } + + /** + * @param mixed $exceptionName + * @param string $exceptionMessage + * @param integer $exceptionCode + * @since Method available since Release 3.2.0 + */ + public function setExpectedException($exceptionName, $exceptionMessage = '', $exceptionCode = NULL) + { + $this->expectedException = $exceptionName; + $this->expectedExceptionMessage = $exceptionMessage; + $this->expectedExceptionCode = $exceptionCode; + } + + /** + * @since Method available since Release 3.4.0 + */ + protected function setExpectedExceptionFromAnnotation() + { + try { + $expectedException = PHPUnit_Util_Test::getExpectedException( + get_class($this), $this->name + ); + + if ($expectedException !== FALSE) { + $this->setExpectedException( + $expectedException['class'], + $expectedException['message'], + $expectedException['code'] + ); + } + } + + catch (ReflectionException $e) { + } + } + + /** + * @param boolean $useErrorHandler + * @since Method available since Release 3.4.0 + */ + public function setUseErrorHandler($useErrorHandler) + { + $this->useErrorHandler = $useErrorHandler; + } + + /** + * @since Method available since Release 3.4.0 + */ + protected function setUseErrorHandlerFromAnnotation() + { + try { + $useErrorHandler = PHPUnit_Util_Test::getErrorHandlerSettings( + get_class($this), $this->name + ); + + if ($useErrorHandler !== NULL) { + $this->setUseErrorHandler($useErrorHandler); + } + } + + catch (ReflectionException $e) { + } + } + + /** + * @param boolean $useOutputBuffering + * @since Method available since Release 3.4.0 + */ + public function setUseOutputBuffering($useOutputBuffering) + { + $this->useOutputBuffering = $useOutputBuffering; + } + + /** + * @since Method available since Release 3.4.0 + */ + protected function setUseOutputBufferingFromAnnotation() + { + try { + $useOutputBuffering = PHPUnit_Util_Test::getOutputBufferingSettings( + get_class($this), $this->name + ); + + if ($useOutputBuffering !== NULL) { + $this->setUseOutputBuffering($useOutputBuffering); + } + } + + catch (ReflectionException $e) { + } + } + + /** + * @since Method available since Release 3.6.0 + */ + protected function setRequirementsFromAnnotation() + { + try { + $requirements = PHPUnit_Util_Test::getRequirements( + get_class($this), $this->name + ); + + if (isset($requirements['PHP'])) { + $this->required['PHP'] = $requirements['PHP']; + } + + if (isset($requirements['PHPUnit'])) { + $this->required['PHPUnit'] = $requirements['PHPUnit']; + } + + if (isset($requirements['extensions'])) { + $this->required['extensions'] = $requirements['extensions']; + } + + if (isset($requirements['functions'])) { + $this->required['functions'] = $requirements['functions']; + } + } + + catch (ReflectionException $e) { + } + } + + /** + * @since Method available since Release 3.6.0 + */ + protected function checkRequirements() + { + $this->setRequirementsFromAnnotation(); + + $missingRequirements = array(); + + if ($this->required['PHP'] && + version_compare(PHP_VERSION, $this->required['PHP'], '<')) { + $missingRequirements[] = sprintf( + 'PHP %s (or later) is required.', + $this->required['PHP'] + ); + } + + $phpunitVersion = PHPUnit_Runner_Version::id(); + if ($this->required['PHPUnit'] && + version_compare($phpunitVersion, $this->required['PHPUnit'], '<')) { + $missingRequirements[] = sprintf( + 'PHPUnit %s (or later) is required.', + $this->required['PHPUnit'] + ); + } + + foreach ($this->required['functions'] as $requiredFunction) { + if (!function_exists($requiredFunction)) { + $missingRequirements[] = sprintf( + 'Function %s is required.', + $requiredFunction + ); + } + } + + foreach ($this->required['extensions'] as $requiredExtension) { + if (!extension_loaded($requiredExtension)) { + $missingRequirements[] = sprintf( + 'Extension %s is required.', + $requiredExtension + ); + } + } + + if ($missingRequirements) { + $this->markTestSkipped( + implode( + PHP_EOL, + $missingRequirements + ) + ); + } + } + + /** + * Returns the status of this test. + * + * @return integer + * @since Method available since Release 3.1.0 + */ + public function getStatus() + { + return $this->status; + } + + /** + * Returns the status message of this test. + * + * @return string + * @since Method available since Release 3.3.0 + */ + public function getStatusMessage() + { + return $this->statusMessage; + } + + /** + * Returns whether or not this test has failed. + * + * @return boolean + * @since Method available since Release 3.0.0 + */ + public function hasFailed() + { + $status = $this->getStatus(); + + return $status == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE || + $status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR; + } + + /** + * Runs the test case and collects the results in a TestResult object. + * If no TestResult object is passed a new one will be created. + * + * @param PHPUnit_Framework_TestResult $result + * @return PHPUnit_Framework_TestResult + * @throws PHPUnit_Framework_Exception + */ + public function run(PHPUnit_Framework_TestResult $result = NULL) + { + if ($result === NULL) { + $result = $this->createResult(); + } + + if (!$this instanceof PHPUnit_Framework_Warning) { + $this->setTestResultObject($result); + $this->setUseErrorHandlerFromAnnotation(); + $this->setUseOutputBufferingFromAnnotation(); + } + + if ($this->useErrorHandler !== NULL) { + $oldErrorHandlerSetting = $result->getConvertErrorsToExceptions(); + $result->convertErrorsToExceptions($this->useErrorHandler); + } + + if (!$this instanceof PHPUnit_Framework_Warning && !$this->handleDependencies()) { + return; + } + + if ($this->runTestInSeparateProcess === TRUE && + $this->inIsolation !== TRUE && + !$this instanceof PHPUnit_Extensions_SeleniumTestCase && + !$this instanceof PHPUnit_Extensions_PhptTestCase) { + $class = new ReflectionClass($this); + + $template = new Text_Template( + sprintf( + '%s%sProcess%sTestCaseMethod.tpl', + + __DIR__, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR + ) + ); + + if ($this->preserveGlobalState) { + $constants = PHPUnit_Util_GlobalState::getConstantsAsString(); + $globals = PHPUnit_Util_GlobalState::getGlobalsAsString(); + $includedFiles = PHPUnit_Util_GlobalState::getIncludedFilesAsString(); + } else { + $constants = ''; + $globals = ''; + $includedFiles = ''; + } + + if ($result->getCollectCodeCoverageInformation()) { + $coverage = 'TRUE'; + } else { + $coverage = 'FALSE'; + } + + if ($result->isStrict()) { + $strict = 'TRUE'; + } else { + $strict = 'FALSE'; + } + + if (defined('PHPUNIT_COMPOSER_INSTALL')) { + $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, TRUE); + } else { + $composerAutoload = '\'\''; + } + + if (defined('__PHPUNIT_PHAR__')) { + $phar = var_export(__PHPUNIT_PHAR__, TRUE); + } else { + $phar = '\'\''; + } + + $data = var_export(serialize($this->data), TRUE); + $dependencyInput = var_export(serialize($this->dependencyInput), TRUE); + $includePath = var_export(get_include_path(), TRUE); + // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC + // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences + $data = "'." . $data . ".'"; + $dependencyInput = "'." . $dependencyInput . ".'"; + $includePath = "'." . $includePath . ".'"; + + $template->setVar( + array( + 'composerAutoload' => $composerAutoload, + 'phar' => $phar, + 'filename' => $class->getFileName(), + 'className' => $class->getName(), + 'methodName' => $this->name, + 'collectCodeCoverageInformation' => $coverage, + 'data' => $data, + 'dataName' => $this->dataName, + 'dependencyInput' => $dependencyInput, + 'constants' => $constants, + 'globals' => $globals, + 'include_path' => $includePath, + 'included_files' => $includedFiles, + 'strict' => $strict + ) + ); + + $this->prepareTemplate($template); + + $php = PHPUnit_Util_PHP::factory(); + $php->runJob($template->render(), $this, $result); + } else { + $result->run($this); + } + + if ($this->useErrorHandler !== NULL) { + $result->convertErrorsToExceptions($oldErrorHandlerSetting); + } + + $this->result = NULL; + + return $result; + } + + /** + * Runs the bare test sequence. + */ + public function runBare() + { + $this->numAssertions = 0; + + // Backup the $GLOBALS array and static attributes. + if ($this->runTestInSeparateProcess !== TRUE && + $this->inIsolation !== TRUE) { + if ($this->backupGlobals === NULL || + $this->backupGlobals === TRUE) { + PHPUnit_Util_GlobalState::backupGlobals( + $this->backupGlobalsBlacklist + ); + } + + if ($this->backupStaticAttributes === TRUE) { + PHPUnit_Util_GlobalState::backupStaticAttributes( + $this->backupStaticAttributesBlacklist + ); + } + } + + // Start output buffering. + ob_start(); + $this->outputBufferingActive = TRUE; + + // Clean up stat cache. + clearstatcache(); + + // Backup the cwd + $currentWorkingDirectory = getcwd(); + + try { + if ($this->inIsolation) { + $this->setUpBeforeClass(); + } + + $this->setExpectedExceptionFromAnnotation(); + $this->setUp(); + $this->checkRequirements(); + $this->assertPreConditions(); + $this->testResult = $this->runTest(); + $this->verifyMockObjects(); + $this->assertPostConditions(); + $this->status = PHPUnit_Runner_BaseTestRunner::STATUS_PASSED; + } + + catch (PHPUnit_Framework_IncompleteTest $e) { + $this->status = PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE; + $this->statusMessage = $e->getMessage(); + } + + catch (PHPUnit_Framework_SkippedTest $e) { + $this->status = PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED; + $this->statusMessage = $e->getMessage(); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + $this->status = PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE; + $this->statusMessage = $e->getMessage(); + } + + catch (Exception $e) { + $this->status = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR; + $this->statusMessage = $e->getMessage(); + } + + // Clean up mock objects' internal state saved in static members. + foreach ($this->mockObjects as $mockObject) { + $mockObject->__phpunit_cleanup(); + } + + // Clean up the mock objects. + $this->mockObjects = array(); + + // Tear down the fixture. An exception raised in tearDown() will be + // caught and passed on when no exception was raised before. + try { + $this->tearDown(); + + if ($this->inIsolation) { + $this->tearDownAfterClass(); + } + } + + catch (Exception $_e) { + if (!isset($e)) { + $e = $_e; + } + } + + // Stop output buffering. + if ($this->outputCallback === FALSE) { + $this->output = ob_get_contents(); + } else { + $this->output = call_user_func_array( + $this->outputCallback, array(ob_get_contents()) + ); + } + + ob_end_clean(); + $this->outputBufferingActive = FALSE; + + // Clean up stat cache. + clearstatcache(); + + // Restore the cwd if it was changed by the test + if ($currentWorkingDirectory != getcwd()) { + chdir($currentWorkingDirectory); + } + + // Restore the $GLOBALS array and static attributes. + if ($this->runTestInSeparateProcess !== TRUE && + $this->inIsolation !== TRUE) { + if ($this->backupGlobals === NULL || + $this->backupGlobals === TRUE) { + PHPUnit_Util_GlobalState::restoreGlobals( + $this->backupGlobalsBlacklist + ); + } + + if ($this->backupStaticAttributes === TRUE) { + PHPUnit_Util_GlobalState::restoreStaticAttributes(); + } + } + + // Clean up INI settings. + foreach ($this->iniSettings as $varName => $oldValue) { + ini_set($varName, $oldValue); + } + + $this->iniSettings = array(); + + // Clean up locale settings. + foreach ($this->locale as $category => $locale) { + setlocale($category, $locale); + } + + // Perform assertion on output. + if (!isset($e)) { + try { + if ($this->outputExpectedRegex !== NULL) { + $this->hasPerformedExpectationsOnOutput = TRUE; + $this->assertRegExp($this->outputExpectedRegex, $this->output); + $this->outputExpectedRegex = NULL; + } + + else if ($this->outputExpectedString !== NULL) { + $this->hasPerformedExpectationsOnOutput = TRUE; + $this->assertEquals($this->outputExpectedString, $this->output); + $this->outputExpectedString = NULL; + } + } + + catch (Exception $_e) { + $e = $_e; + } + } + + // Workaround for missing "finally". + if (isset($e)) { + $this->onNotSuccessfulTest($e); + } + } + + /** + * Override to run the test and assert its state. + * + * @return mixed + * @throws PHPUnit_Framework_Exception + */ + protected function runTest() + { + if ($this->name === NULL) { + throw new PHPUnit_Framework_Exception( + 'PHPUnit_Framework_TestCase::$name must not be NULL.' + ); + } + + try { + $class = new ReflectionClass($this); + $method = $class->getMethod($this->name); + } + + catch (ReflectionException $e) { + $this->fail($e->getMessage()); + } + + try { + $testResult = $method->invokeArgs( + $this, array_merge($this->data, $this->dependencyInput) + ); + } + + catch (Exception $e) { + $checkException = FALSE; + + if (is_string($this->expectedException)) { + $checkException = TRUE; + + if ($e instanceof PHPUnit_Framework_Exception) { + $checkException = FALSE; + } + + $reflector = new ReflectionClass($this->expectedException); + + if ($this->expectedException == 'PHPUnit_Framework_Exception' || + $reflector->isSubclassOf('PHPUnit_Framework_Exception')) { + $checkException = TRUE; + } + } + + if ($checkException) { + $this->assertThat( + $e, + new PHPUnit_Framework_Constraint_Exception( + $this->expectedException + ) + ); + + if (is_string($this->expectedExceptionMessage) && + !empty($this->expectedExceptionMessage)) { + $this->assertThat( + $e, + new PHPUnit_Framework_Constraint_ExceptionMessage( + $this->expectedExceptionMessage + ) + ); + } + + if ($this->expectedExceptionCode !== NULL) { + $this->assertThat( + $e, + new PHPUnit_Framework_Constraint_ExceptionCode( + $this->expectedExceptionCode + ) + ); + } + + return; + } else { + throw $e; + } + } + + if ($this->expectedException !== NULL) { + $this->assertThat( + NULL, + new PHPUnit_Framework_Constraint_Exception( + $this->expectedException + ) + ); + } + + return $testResult; + } + + /** + * Verifies the mock object expectations. + * + * @since Method available since Release 3.5.0 + */ + protected function verifyMockObjects() + { + foreach ($this->mockObjects as $mockObject) { + if ($mockObject->__phpunit_hasMatchers()) { + $this->numAssertions++; + } + + $mockObject->__phpunit_verify(); + $mockObject->__phpunit_cleanup(); + } + } + + /** + * Sets the name of a TestCase. + * + * @param string + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Sets the dependencies of a TestCase. + * + * @param array $dependencies + * @since Method available since Release 3.4.0 + */ + public function setDependencies(array $dependencies) + { + $this->dependencies = $dependencies; + } + + /** + * Sets + * + * @param array $dependencyInput + * @since Method available since Release 3.4.0 + */ + public function setDependencyInput(array $dependencyInput) + { + $this->dependencyInput = $dependencyInput; + } + + /** + * Calling this method in setUp() has no effect! + * + * @param boolean $backupGlobals + * @since Method available since Release 3.3.0 + */ + public function setBackupGlobals($backupGlobals) + { + if (is_null($this->backupGlobals) && is_bool($backupGlobals)) { + $this->backupGlobals = $backupGlobals; + } + } + + /** + * Calling this method in setUp() has no effect! + * + * @param boolean $backupStaticAttributes + * @since Method available since Release 3.4.0 + */ + public function setBackupStaticAttributes($backupStaticAttributes) + { + if (is_null($this->backupStaticAttributes) && + is_bool($backupStaticAttributes)) { + $this->backupStaticAttributes = $backupStaticAttributes; + } + } + + /** + * @param boolean $runTestInSeparateProcess + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.4.0 + */ + public function setRunTestInSeparateProcess($runTestInSeparateProcess) + { + if (is_bool($runTestInSeparateProcess)) { + if ($this->runTestInSeparateProcess === NULL) { + $this->runTestInSeparateProcess = $runTestInSeparateProcess; + } + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * @param boolean $preserveGlobalState + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.4.0 + */ + public function setPreserveGlobalState($preserveGlobalState) + { + if (is_bool($preserveGlobalState)) { + $this->preserveGlobalState = $preserveGlobalState; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * @param boolean $inIsolation + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.4.0 + */ + public function setInIsolation($inIsolation) + { + if (is_bool($inIsolation)) { + $this->inIsolation = $inIsolation; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * @return mixed + * @since Method available since Release 3.4.0 + */ + public function getResult() + { + return $this->testResult; + } + + /** + * @param mixed $result + * @since Method available since Release 3.4.0 + */ + public function setResult($result) + { + $this->testResult = $result; + } + + /** + * @param callable $callback + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.6.0 + */ + public function setOutputCallback($callback) + { + if (!is_callable($callback)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'callback'); + } + + $this->outputCallback = $callback; + } + + /** + * @return PHPUnit_Framework_TestResult + * @since Method available since Release 3.5.7 + */ + public function getTestResultObject() + { + return $this->result; + } + + /** + * @param PHPUnit_Framework_TestResult $result + * @since Method available since Release 3.6.0 + */ + public function setTestResultObject(PHPUnit_Framework_TestResult $result) + { + $this->result = $result; + } + + /** + * This method is a wrapper for the ini_set() function that automatically + * resets the modified php.ini setting to its original value after the + * test is run. + * + * @param string $varName + * @param string $newValue + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.0.0 + */ + protected function iniSet($varName, $newValue) + { + if (!is_string($varName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + $currentValue = ini_set($varName, $newValue); + + if ($currentValue !== FALSE) { + $this->iniSettings[$varName] = $currentValue; + } else { + throw new PHPUnit_Framework_Exception( + sprintf( + 'INI setting "%s" could not be set to "%s".', + $varName, + $newValue + ) + ); + } + } + + /** + * This method is a wrapper for the setlocale() function that automatically + * resets the locale to its original value after the test is run. + * + * @param integer $category + * @param string $locale + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.1.0 + */ + protected function setLocale() + { + $args = func_get_args(); + + if (count($args) < 2) { + throw new PHPUnit_Framework_Exception; + } + + $category = $args[0]; + $locale = $args[1]; + + $categories = array( + LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME + ); + + if (defined('LC_MESSAGES')) { + $categories[] = LC_MESSAGES; + } + + if (!in_array($category, $categories)) { + throw new PHPUnit_Framework_Exception; + } + + if (!is_array($locale) && !is_string($locale)) { + throw new PHPUnit_Framework_Exception; + } + + $this->locale[$category] = setlocale($category, NULL); + + $result = call_user_func_array( 'setlocale', $args ); + + if ($result === FALSE) { + throw new PHPUnit_Framework_Exception( + 'The locale functionality is not implemented on your platform, ' . + 'the specified locale does not exist or the category name is ' . + 'invalid.' + ); + } + } + + /** + * Returns a mock object for the specified class. + * + * @param string $originalClassName Name of the class to mock. + * @param array|null $methods When provided, only methods whose names are in the array + * are replaced with a configurable test double. The behavior + * of the other methods is not changed. + * Providing null means that no methods will be replaced. + * @param array $arguments Parameters to pass to the original class' constructor. + * @param string $mockClassName Class name for the generated test double class. + * @param boolean $callOriginalConstructor Can be used to disable the call to the original class' constructor. + * @param boolean $callOriginalClone Can be used to disable the call to the original class' clone constructor. + * @param boolean $callAutoload Can be used to disable __autoload() during the generation of the test double class. + * @param boolean $cloneArguments + * @return PHPUnit_Framework_MockObject_MockObject + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.0.0 + */ + public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = FALSE) + { + $mockObject = PHPUnit_Framework_MockObject_Generator::getMock( + $originalClassName, + $methods, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + + $this->mockObjects[] = $mockObject; + + return $mockObject; + } + + /** + * Returns a builder object to create mock objects using a fluent interface. + * + * @param string $className + * @return PHPUnit_Framework_MockObject_MockBuilder + * @since Method available since Release 3.5.0 + */ + public function getMockBuilder($className) + { + return new PHPUnit_Framework_MockObject_MockBuilder( + $this, $className + ); + } + + /** + * Mocks the specified class and returns the name of the mocked class. + * + * @param string $originalClassName + * @param array $methods + * @param array $arguments + * @param string $mockClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param boolean $cloneArguments + * @return string + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.5.0 + */ + protected function getMockClass($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = FALSE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = FALSE) + { + $mock = $this->getMock( + $originalClassName, + $methods, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + + return get_class($mock); + } + + /** + * Returns a mock object for the specified abstract class with all abstract + * methods of the class mocked. Concrete methods to mock can be specified with + * the last parameter + * + * @param string $originalClassName + * @param array $arguments + * @param string $mockClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param array $mockedMethods + * @param boolean $cloneArguments + * @return PHPUnit_Framework_MockObject_MockObject + * @since Method available since Release 3.4.0 + * @throws PHPUnit_Framework_Exception + */ + public function getMockForAbstractClass($originalClassName, array $arguments = array(), $mockClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $mockedMethods = array(), $cloneArguments = FALSE) + { + $mockObject = PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass( + $originalClassName, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $mockedMethods, + $cloneArguments + ); + + $this->mockObjects[] = $mockObject; + + return $mockObject; + } + + /** + * Returns a mock object based on the given WSDL file. + * + * @param string $wsdlFile + * @param string $originalClassName + * @param string $mockClassName + * @param array $methods + * @param boolean $callOriginalConstructor + * @return PHPUnit_Framework_MockObject_MockObject + * @since Method available since Release 3.4.0 + */ + protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = TRUE) + { + if ($originalClassName === '') { + $originalClassName = str_replace( + '.wsdl', '', basename($wsdlFile) + ); + } + + if (!class_exists($originalClassName)) { + eval( + PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl( + $wsdlFile, $originalClassName, $methods + ) + ); + } + + return $this->getMock( + $originalClassName, + $methods, + array('', array()), + $mockClassName, + $callOriginalConstructor, + FALSE, + FALSE + ); + } + + /** + * Returns an object for the specified trait. + * + * @param string $traitName + * @param array $arguments + * @param string $traitClassName + * @param boolean $callOriginalConstructor + * @param boolean $callOriginalClone + * @param boolean $callAutoload + * @param boolean $cloneArguments + * @return object + * @since Method available since Release 3.6.0 + * @throws PHPUnit_Framework_Exception + */ + protected function getObjectForTrait($traitName, array $arguments = array(), $traitClassName = '', $callOriginalConstructor = TRUE, $callOriginalClone = TRUE, $callAutoload = TRUE, $cloneArguments = FALSE) + { + return PHPUnit_Framework_MockObject_Generator::getObjectForTrait( + $traitName, + $arguments, + $traitClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $cloneArguments + ); + } + + /** + * Adds a value to the assertion counter. + * + * @param integer $count + * @since Method available since Release 3.3.3 + */ + public function addToAssertionCount($count) + { + $this->numAssertions += $count; + } + + /** + * Returns the number of assertions performed by this test. + * + * @return integer + * @since Method available since Release 3.3.0 + */ + public function getNumAssertions() + { + return $this->numAssertions; + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is executed zero or more times. + * + * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount + * @since Method available since Release 3.0.0 + */ + public static function any() + { + return new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount; + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is never executed. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ + public static function never() + { + return new PHPUnit_Framework_MockObject_Matcher_InvokedCount(0); + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is executed at least once. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce + * @since Method available since Release 3.0.0 + */ + public static function atLeastOnce() + { + return new PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce; + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is executed exactly once. + * + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ + public static function once() + { + return new PHPUnit_Framework_MockObject_Matcher_InvokedCount(1); + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is executed exactly $count times. + * + * @param integer $count + * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount + * @since Method available since Release 3.0.0 + */ + public static function exactly($count) + { + return new PHPUnit_Framework_MockObject_Matcher_InvokedCount($count); + } + + /** + * Returns a matcher that matches when the method it is evaluated for + * is invoked at the given $index. + * + * @param integer $index + * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex + * @since Method available since Release 3.0.0 + */ + public static function at($index) + { + return new PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex($index); + } + + /** + * + * + * @param mixed $value + * @return PHPUnit_Framework_MockObject_Stub_Return + * @since Method available since Release 3.0.0 + */ + public static function returnValue($value) + { + return new PHPUnit_Framework_MockObject_Stub_Return($value); + } + + /** + * + * + * @param array $valueMap + * @return PHPUnit_Framework_MockObject_Stub_ReturnValueMap + * @since Method available since Release 3.6.0 + */ + public static function returnValueMap(array $valueMap) + { + return new PHPUnit_Framework_MockObject_Stub_ReturnValueMap($valueMap); + } + + /** + * + * + * @param integer $argumentIndex + * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument + * @since Method available since Release 3.3.0 + */ + public static function returnArgument($argumentIndex) + { + return new PHPUnit_Framework_MockObject_Stub_ReturnArgument( + $argumentIndex + ); + } + + /** + * + * + * @param mixed $callback + * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback + * @since Method available since Release 3.3.0 + */ + public static function returnCallback($callback) + { + return new PHPUnit_Framework_MockObject_Stub_ReturnCallback($callback); + } + + /** + * Returns the current object. + * + * This method is useful when mocking a fluent interface. + * + * @return PHPUnit_Framework_MockObject_Stub_ReturnSelf + * @since Method available since Release 3.6.0 + */ + public static function returnSelf() + { + return new PHPUnit_Framework_MockObject_Stub_ReturnSelf(); + } + + /** + * + * + * @param Exception $exception + * @return PHPUnit_Framework_MockObject_Stub_Exception + * @since Method available since Release 3.1.0 + */ + public static function throwException(Exception $exception) + { + return new PHPUnit_Framework_MockObject_Stub_Exception($exception); + } + + /** + * + * + * @param mixed $value, ... + * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls + * @since Method available since Release 3.0.0 + */ + public static function onConsecutiveCalls() + { + $args = func_get_args(); + + return new PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls($args); + } + + /** + * @param mixed $data + * @return string + * @since Method available since Release 3.2.1 + */ + protected function dataToString($data) + { + $result = array(); + + // There seems to be no other way to check arrays for recursion + // http://www.php.net/manual/en/language.types.array.php#73936 + preg_match_all('/\n \[(\w+)\] => Array\s+\*RECURSION\*/', print_r($data, TRUE), $matches); + $recursiveKeys = array_unique($matches[1]); + + // Convert to valid array keys + // Numeric integer strings are automatically converted to integers + // by PHP + foreach ($recursiveKeys as $key => $recursiveKey) { + if ((string)(integer)$recursiveKey === $recursiveKey) { + $recursiveKeys[$key] = (integer)$recursiveKey; + } + } + + foreach ($data as $key => $_data) { + if (in_array($key, $recursiveKeys, TRUE)) { + $result[] = '*RECURSION*'; + } + + else if (is_array($_data)) { + $result[] = 'array(' . $this->dataToString($_data) . ')'; + } + + else if (is_object($_data)) { + $object = new ReflectionObject($_data); + + if ($object->hasMethod('__toString')) { + $result[] = (string)$_data; + } else { + $result[] = get_class($_data); + } + } + + else if (is_resource($_data)) { + $result[] = '<resource>'; + } + + else { + $result[] = var_export($_data, TRUE); + } + } + + return join(', ', $result); + } + + /** + * Gets the data set description of a TestCase. + * + * @param boolean $includeData + * @return string + * @since Method available since Release 3.3.0 + */ + protected function getDataSetAsString($includeData = TRUE) + { + $buffer = ''; + + if (!empty($this->data)) { + if (is_int($this->dataName)) { + $buffer .= sprintf(' with data set #%d', $this->dataName); + } else { + $buffer .= sprintf(' with data set "%s"', $this->dataName); + } + + if ($includeData) { + $buffer .= sprintf(' (%s)', $this->dataToString($this->data)); + } + } + + return $buffer; + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit_Framework_TestResult + */ + protected function createResult() + { + return new PHPUnit_Framework_TestResult; + } + + /** + * @since Method available since Release 3.5.4 + */ + protected function handleDependencies() + { + if (!empty($this->dependencies) && !$this->inIsolation) { + $className = get_class($this); + $passed = $this->result->passed(); + $passedKeys = array_keys($passed); + $numKeys = count($passedKeys); + + for ($i = 0; $i < $numKeys; $i++) { + $pos = strpos($passedKeys[$i], ' with data set'); + + if ($pos !== FALSE) { + $passedKeys[$i] = substr($passedKeys[$i], 0, $pos); + } + } + + $passedKeys = array_flip(array_unique($passedKeys)); + + foreach ($this->dependencies as $dependency) { + if (strpos($dependency, '::') === FALSE) { + $dependency = $className . '::' . $dependency; + } + + if (!isset($passedKeys[$dependency])) { + $this->result->addError( + $this, + new PHPUnit_Framework_SkippedTestError( + sprintf( + 'This test depends on "%s" to pass.', $dependency + ) + ), + 0 + ); + + return FALSE; + } + + if (isset($passed[$dependency])) { + if ($passed[$dependency]['size'] > $this->getSize()) { + $this->result->addError( + $this, + new PHPUnit_Framework_SkippedTestError( + 'This test depends on a test that is larger than itself.' + ), + 0 + ); + + return FALSE; + } + + $this->dependencyInput[] = $passed[$dependency]['result']; + } else { + $this->dependencyInput[] = NULL; + } + } + } + + return TRUE; + } + + /** + * This method is called before the first test of this test class is run. + * + * @since Method available since Release 3.4.0 + */ + public static function setUpBeforeClass() + { + } + + /** + * Sets up the fixture, for example, open a network connection. + * This method is called before a test is executed. + * + */ + protected function setUp() + { + } + + /** + * Performs assertions shared by all tests of a test case. + * + * This method is called before the execution of a test starts + * and after setUp() is called. + * + * @since Method available since Release 3.2.8 + */ + protected function assertPreConditions() + { + } + + /** + * Performs assertions shared by all tests of a test case. + * + * This method is called before the execution of a test ends + * and before tearDown() is called. + * + * @since Method available since Release 3.2.8 + */ + protected function assertPostConditions() + { + } + + /** + * Tears down the fixture, for example, close a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * This method is called after the last test of this test class is run. + * + * @since Method available since Release 3.4.0 + */ + public static function tearDownAfterClass() + { + } + + /** + * This method is called when a test method did not execute successfully. + * + * @param Exception $e + * @since Method available since Release 3.4.0 + */ + protected function onNotSuccessfulTest(Exception $e) + { + throw $e; + } + + /** + * Performs custom preparations on the process isolation template. + * + * @param Text_Template $template + * @since Method available since Release 3.4.0 + */ + protected function prepareTemplate(Text_Template $template) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php @@ -0,0 +1,179 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A TestFailure collects a failed test together with the caught exception. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_TestFailure +{ + /** + * @var PHPUnit_Framework_Test + */ + protected $failedTest; + + /** + * @var Exception + */ + protected $thrownException; + + /** + * Constructs a TestFailure with the given test and exception. + * + * @param PHPUnit_Framework_Test $failedTest + * @param Exception $thrownException + */ + public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException) + { + $this->failedTest = $failedTest; + $this->thrownException = $thrownException; + } + + /** + * Returns a short description of the failure. + * + * @return string + */ + public function toString() + { + return sprintf( + '%s: %s', + + $this->failedTest->toString(), + $this->thrownException->getMessage() + ); + } + + /** + * Returns a description for the thrown exception. + * + * @return string + * @since Method available since Release 3.4.0 + */ + public function getExceptionAsString() + { + return self::exceptionToString($this->thrownException); + } + + /** + * Returns a description for an exception. + * + * @param Exception $e + * @return string + * @since Method available since Release 3.2.0 + */ + public static function exceptionToString(Exception $e) + { + if ($e instanceof PHPUnit_Framework_SelfDescribing) { + $buffer = $e->toString(); + + if ($e instanceof PHPUnit_Framework_ExpectationFailedException && $e->getComparisonFailure()) { + $buffer = $buffer . "\n" . $e->getComparisonFailure()->getDiff(); + } + + if (!empty($buffer)) { + $buffer = trim($buffer) . "\n"; + } + } + + else if ($e instanceof PHPUnit_Framework_Error) { + $buffer = $e->getMessage() . "\n"; + } + + else { + $buffer = get_class($e) . ': ' . $e->getMessage() . "\n"; + } + + return $buffer; + } + + /** + * Gets the failed test. + * + * @return Test + */ + public function failedTest() + { + return $this->failedTest; + } + + /** + * Gets the thrown exception. + * + * @return Exception + */ + public function thrownException() + { + return $this->thrownException; + } + + /** + * Returns the exception's message. + * + * @return string + */ + public function exceptionMessage() + { + return $this->thrownException()->getMessage(); + } + + /** + * Returns TRUE if the thrown exception + * is of type AssertionFailedError. + * + * @return boolean + */ + public function isFailure() + { + return ($this->thrownException() instanceof PHPUnit_Framework_AssertionFailedError); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php @@ -0,0 +1,126 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A Listener for test progress. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit_Framework_TestListener +{ + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time); + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time); + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time); + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time); + + /** + * A test suite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite); + + /** + * A test suite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite); + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test); + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php @@ -0,0 +1,956 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A TestResult collects the results of executing a test case. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_TestResult implements Countable +{ + /** + * @var boolean + */ + protected static $xdebugLoaded = NULL; + + /** + * @var boolean + */ + protected static $useXdebug = NULL; + + /** + * @var array + */ + protected $passed = array(); + + /** + * @var array + */ + protected $errors = array(); + + /** + * @var array + */ + protected $deprecatedFeatures = array(); + + /** + * @var array + */ + protected $failures = array(); + + /** + * @var array + */ + protected $notImplemented = array(); + + /** + * @var array + */ + protected $skipped = array(); + + /** + * @var array + */ + protected $listeners = array(); + + /** + * @var integer + */ + protected $runTests = 0; + + /** + * @var float + */ + protected $time = 0; + + /** + * @var PHPUnit_Framework_TestSuite + */ + protected $topTestSuite = NULL; + + /** + * Code Coverage information. + * + * @var PHP_CodeCoverage + */ + protected $codeCoverage; + + /** + * @var boolean + */ + protected $convertErrorsToExceptions = TRUE; + + /** + * @var boolean + */ + protected $stop = FALSE; + + /** + * @var boolean + */ + protected $stopOnError = FALSE; + + /** + * @var boolean + */ + protected $stopOnFailure = FALSE; + + /** + * @var boolean + */ + protected $strictMode = FALSE; + + /** + * @var boolean + */ + protected $stopOnIncomplete = FALSE; + + /** + * @var boolean + */ + protected $stopOnSkipped = FALSE; + + /** + * @var boolean + */ + protected $lastTestFailed = FALSE; + + /** + * @var integer + */ + protected $timeoutForSmallTests = 1; + + /** + * @var integer + */ + protected $timeoutForMediumTests = 10; + + /** + * @var integer + */ + protected $timeoutForLargeTests = 60; + + /** + * Registers a TestListener. + * + * @param PHPUnit_Framework_TestListener + */ + public function addListener(PHPUnit_Framework_TestListener $listener) + { + $this->listeners[] = $listener; + } + + /** + * Unregisters a TestListener. + * + * @param PHPUnit_Framework_TestListener $listener + */ + public function removeListener(PHPUnit_Framework_TestListener $listener) + { + foreach ($this->listeners as $key => $_listener) { + if ($listener === $_listener) { + unset($this->listeners[$key]); + } + } + } + + /** + * Flushes all flushable TestListeners. + * + * @since Method available since Release 3.0.0 + */ + public function flushListeners() + { + foreach ($this->listeners as $listener) { + if ($listener instanceof PHPUnit_Util_Printer) { + $listener->flush(); + } + } + } + + /** + * Adds an error to the list of errors. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($e instanceof PHPUnit_Framework_IncompleteTest) { + $this->notImplemented[] = new PHPUnit_Framework_TestFailure( + $test, $e + ); + + $notifyMethod = 'addIncompleteTest'; + + if ($this->stopOnIncomplete) { + $this->stop(); + } + } + + else if ($e instanceof PHPUnit_Framework_SkippedTest) { + $this->skipped[] = new PHPUnit_Framework_TestFailure($test, $e); + $notifyMethod = 'addSkippedTest'; + + if ($this->stopOnSkipped) { + $this->stop(); + } + } + + else { + $this->errors[] = new PHPUnit_Framework_TestFailure($test, $e); + $notifyMethod = 'addError'; + + if ($this->stopOnError || $this->stopOnFailure) { + $this->stop(); + } + } + + foreach ($this->listeners as $listener) { + $listener->$notifyMethod($test, $e, $time); + } + + $this->lastTestFailed = TRUE; + $this->time += $time; + } + + /** + * Adds a failure to the list of failures. + * The passed in exception caused the failure. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + if ($e instanceof PHPUnit_Framework_IncompleteTest) { + $this->notImplemented[] = new PHPUnit_Framework_TestFailure( + $test, $e + ); + + $notifyMethod = 'addIncompleteTest'; + + if ($this->stopOnIncomplete) { + $this->stop(); + } + } + + else if ($e instanceof PHPUnit_Framework_SkippedTest) { + $this->skipped[] = new PHPUnit_Framework_TestFailure($test, $e); + $notifyMethod = 'addSkippedTest'; + + if ($this->stopOnSkipped) { + $this->stop(); + } + } + + else { + $this->failures[] = new PHPUnit_Framework_TestFailure($test, $e); + $notifyMethod = 'addFailure'; + + if ($this->stopOnFailure) { + $this->stop(); + } + } + + foreach ($this->listeners as $listener) { + $listener->$notifyMethod($test, $e, $time); + } + + $this->lastTestFailed = TRUE; + $this->time += $time; + } + + /** + * Adds a deprecated feature notice to the list of deprecated features used during run + * + * @param PHPUnit_Util_DeprecatedFeature $deprecatedFeature + */ + public function addDeprecatedFeature(PHPUnit_Util_DeprecatedFeature $deprecatedFeature) + { + $this->deprecatedFeatures[] = $deprecatedFeature; + } + + /** + * Informs the result that a testsuite will be started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + if ($this->topTestSuite === NULL) { + $this->topTestSuite = $suite; + } + + foreach ($this->listeners as $listener) { + $listener->startTestSuite($suite); + } + } + + /** + * Informs the result that a testsuite was completed. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + foreach ($this->listeners as $listener) { + $listener->endTestSuite($suite); + } + } + + /** + * Informs the result that a test will be started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + $this->lastTestFailed = FALSE; + $this->runTests += count($test); + + foreach ($this->listeners as $listener) { + $listener->startTest($test); + } + } + + /** + * Informs the result that a test was completed. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + foreach ($this->listeners as $listener) { + $listener->endTest($test, $time); + } + + if (!$this->lastTestFailed && $test instanceof PHPUnit_Framework_TestCase) { + $class = get_class($test); + $key = $class . '::' . $test->getName(); + + $this->passed[$key] = array( + 'result' => $test->getResult(), + 'size' => PHPUnit_Util_Test::getSize( + $class, $test->getName(FALSE) + ) + ); + + $this->time += $time; + } + } + + /** + * Returns TRUE if no incomplete test occurred. + * + * @return boolean + */ + public function allCompletelyImplemented() + { + return $this->notImplementedCount() == 0; + } + + /** + * Gets the number of incomplete tests. + * + * @return integer + */ + public function notImplementedCount() + { + return count($this->notImplemented); + } + + /** + * Returns an Enumeration for the incomplete tests. + * + * @return array + */ + public function notImplemented() + { + return $this->notImplemented; + } + + /** + * Returns TRUE if no test has been skipped. + * + * @return boolean + * @since Method available since Release 3.0.0 + */ + public function noneSkipped() + { + return $this->skippedCount() == 0; + } + + /** + * Gets the number of skipped tests. + * + * @return integer + * @since Method available since Release 3.0.0 + */ + public function skippedCount() + { + return count($this->skipped); + } + + /** + * Returns an Enumeration for the skipped tests. + * + * @return array + * @since Method available since Release 3.0.0 + */ + public function skipped() + { + return $this->skipped; + } + + /** + * Gets the number of detected errors. + * + * @return integer + */ + public function errorCount() + { + return count($this->errors); + } + + /** + * Returns an Enumeration for the errors. + * + * @return array + */ + public function errors() + { + return $this->errors; + } + + /** + * Returns an Enumeration for the deprecated features used. + * + * @return array + * @since Method available since Release 3.5.7 + */ + public function deprecatedFeatures() + { + return $this->deprecatedFeatures; + } + + /** + * Returns an Enumeration for the deprecated features used. + * + * @return array + * @since Method available since Release 3.5.7 + */ + public function deprecatedFeaturesCount() + { + return count($this->deprecatedFeatures); + } + + /** + * Gets the number of detected failures. + * + * @return integer + */ + public function failureCount() + { + return count($this->failures); + } + + /** + * Returns an Enumeration for the failures. + * + * @return array + */ + public function failures() + { + return $this->failures; + } + + /** + * Returns the names of the tests that have passed. + * + * @return array + * @since Method available since Release 3.4.0 + */ + public function passed() + { + return $this->passed; + } + + /** + * Returns the (top) test suite. + * + * @return PHPUnit_Framework_TestSuite + * @since Method available since Release 3.0.0 + */ + public function topTestSuite() + { + return $this->topTestSuite; + } + + /** + * Returns whether code coverage information should be collected. + * + * @return boolean If code coverage should be collected + * @since Method available since Release 3.2.0 + */ + public function getCollectCodeCoverageInformation() + { + return $this->codeCoverage !== NULL; + } + + /** + * Returns the strict mode configuration option + * + * @return boolean + */ + public function isStrict() + { + return $this->strictMode; + } + + /** + * Runs a TestCase. + * + * @param PHPUnit_Framework_Test $test + */ + public function run(PHPUnit_Framework_Test $test) + { + PHPUnit_Framework_Assert::resetCount(); + + $error = FALSE; + $failure = FALSE; + $incomplete = FALSE; + $skipped = FALSE; + + $this->startTest($test); + + $errorHandlerSet = FALSE; + + if ($this->convertErrorsToExceptions) { + $oldErrorHandler = set_error_handler( + array('PHPUnit_Util_ErrorHandler', 'handleError'), + E_ALL | E_STRICT + ); + + if ($oldErrorHandler === NULL) { + $errorHandlerSet = TRUE; + } else { + restore_error_handler(); + } + } + + if (self::$xdebugLoaded === NULL) { + self::$xdebugLoaded = extension_loaded('xdebug'); + self::$useXdebug = self::$xdebugLoaded; + } + + $useXdebug = self::$useXdebug && + $this->codeCoverage !== NULL && + !$test instanceof PHPUnit_Extensions_SeleniumTestCase && + !$test instanceof PHPUnit_Framework_Warning; + + if ($useXdebug) { + // We need to blacklist test source files when no whitelist is used. + if (!$this->codeCoverage->filter()->hasWhitelist()) { + $classes = PHPUnit_Util_Class::getHierarchy( + get_class($test), TRUE + ); + + foreach ($classes as $class) { + $this->codeCoverage->filter()->addFileToBlacklist( + $class->getFileName() + ); + } + } + + $this->codeCoverage->start($test); + } + + PHP_Timer::start(); + + try { + if (!$test instanceof PHPUnit_Framework_Warning && + $this->strictMode && + extension_loaded('pcntl') && class_exists('PHP_Invoker')) { + switch ($test->getSize()) { + case PHPUnit_Util_Test::SMALL: { + $_timeout = $this->timeoutForSmallTests; + } + break; + + case PHPUnit_Util_Test::MEDIUM: { + $_timeout = $this->timeoutForMediumTests; + } + break; + + case PHPUnit_Util_Test::LARGE: { + $_timeout = $this->timeoutForLargeTests; + } + break; + } + + $invoker = new PHP_Invoker; + $invoker->invoke(array($test, 'runBare'), array(), $_timeout); + } else { + $test->runBare(); + } + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + $failure = TRUE; + + if ($e instanceof PHPUnit_Framework_IncompleteTestError) { + $incomplete = TRUE; + } + + else if ($e instanceof PHPUnit_Framework_SkippedTestError) { + $skipped = TRUE; + } + } + + catch (Exception $e) { + $error = TRUE; + } + + $time = PHP_Timer::stop(); + $test->addToAssertionCount(PHPUnit_Framework_Assert::getCount()); + + if ($this->strictMode && $test->getNumAssertions() == 0) { + $incomplete = TRUE; + } + + if ($useXdebug) { + try { + $this->codeCoverage->stop(!$incomplete && !$skipped); + } + + catch (PHP_CodeCoverage_Exception $cce) { + $error = TRUE; + + if (!isset($e)) { + $e = $cce; + } + } + } + + if ($errorHandlerSet === TRUE) { + restore_error_handler(); + } + + if ($error === TRUE) { + $this->addError($test, $e, $time); + } + + else if ($failure === TRUE) { + $this->addFailure($test, $e, $time); + } + + else if ($this->strictMode && $test->getNumAssertions() == 0) { + $this->addFailure( + $test, + new PHPUnit_Framework_IncompleteTestError( + 'This test did not perform any assertions' + ), + $time + ); + } + + else if ($this->strictMode && $test->hasOutput()) { + $this->addFailure( + $test, + new PHPUnit_Framework_OutputError( + sprintf( + 'This test printed output: %s', + $test->getActualOutput() + ) + ), + $time + ); + } + + $this->endTest($test, $time); + } + + /** + * Gets the number of run tests. + * + * @return integer + */ + public function count() + { + return $this->runTests; + } + + /** + * Checks whether the test run should stop. + * + * @return boolean + */ + public function shouldStop() + { + return $this->stop; + } + + /** + * Marks that the test run should stop. + * + */ + public function stop() + { + $this->stop = TRUE; + } + + /** + * Returns the PHP_CodeCoverage object. + * + * @return PHP_CodeCoverage + * @since Method available since Release 3.5.0 + */ + public function getCodeCoverage() + { + return $this->codeCoverage; + } + + /** + * Returns the PHP_CodeCoverage object. + * + * @return PHP_CodeCoverage + * @since Method available since Release 3.6.0 + */ + public function setCodeCoverage(PHP_CodeCoverage $codeCoverage) + { + $this->codeCoverage = $codeCoverage; + } + + /** + * Enables or disables the error-to-exception conversion. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.2.14 + */ + public function convertErrorsToExceptions($flag) + { + if (is_bool($flag)) { + $this->convertErrorsToExceptions = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Returns the error-to-exception conversion setting. + * + * @return boolean + * @since Method available since Release 3.4.0 + */ + public function getConvertErrorsToExceptions() + { + return $this->convertErrorsToExceptions; + } + + /** + * Enables or disables the stopping when an error occurs. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.5.0 + */ + public function stopOnError($flag) + { + if (is_bool($flag)) { + $this->stopOnError = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Enables or disables the stopping when a failure occurs. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.1.0 + */ + public function stopOnFailure($flag) + { + if (is_bool($flag)) { + $this->stopOnFailure = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Enables or disables the strict mode. + * + * When active + * * Tests that do not assert anything will be marked as incomplete. + * * Tests that are incomplete or skipped yield no code coverage. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.5.2 + */ + public function strictMode($flag) + { + if (is_bool($flag)) { + $this->strictMode = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Enables or disables the stopping for incomplete tests. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.5.0 + */ + public function stopOnIncomplete($flag) + { + if (is_bool($flag)) { + $this->stopOnIncomplete = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Enables or disables the stopping for skipped tests. + * + * @param boolean $flag + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.1.0 + */ + public function stopOnSkipped($flag) + { + if (is_bool($flag)) { + $this->stopOnSkipped = $flag; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } + + /** + * Returns the time spent running the tests. + * + * @return float + */ + public function time() + { + return $this->time; + } + + /** + * Returns whether the entire test was successful or not. + * + * @return boolean + */ + public function wasSuccessful() + { + return empty($this->errors) && empty($this->failures); + } + + /** + * Sets the timeout for small tests. + * + * @param integer $timeout + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.6.0 + */ + public function setTimeoutForSmallTests($timeout) + { + if (is_integer($timeout)) { + $this->timeoutForSmallTests = $timeout; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer'); + } + } + + /** + * Sets the timeout for medium tests. + * + * @param integer $timeout + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.6.0 + */ + public function setTimeoutForMediumTests($timeout) + { + if (is_integer($timeout)) { + $this->timeoutForMediumTests = $timeout; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer'); + } + } + + /** + * Sets the timeout for large tests. + * + * @param integer $timeout + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.6.0 + */ + public function setTimeoutForLargeTests($timeout) + { + if (is_integer($timeout)) { + $this->timeoutForLargeTests = $timeout; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer'); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php @@ -0,0 +1,954 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A TestSuite is a composite of Tests. It runs a collection of test cases. + * + * Here is an example using the dynamic test definition. + * + * <code> + * <?php + * $suite = new PHPUnit_Framework_TestSuite; + * $suite->addTest(new MathTest('testPass')); + * ?> + * </code> + * + * Alternatively, a TestSuite can extract the tests to be run automatically. + * To do so you pass a ReflectionClass instance for your + * PHPUnit_Framework_TestCase class to the PHPUnit_Framework_TestSuite + * constructor. + * + * <code> + * <?php + * $suite = new PHPUnit_Framework_TestSuite( + * new ReflectionClass('MathTest') + * ); + * ?> + * </code> + * + * This constructor creates a suite with all the methods starting with + * "test" that take no arguments. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing, IteratorAggregate +{ + /** + * Enable or disable the backup and restoration of the $GLOBALS array. + * + * @var boolean + */ + protected $backupGlobals = NULL; + + /** + * Enable or disable the backup and restoration of static attributes. + * + * @var boolean + */ + protected $backupStaticAttributes = NULL; + + /** + * The name of the test suite. + * + * @var string + */ + protected $name = ''; + + /** + * The test groups of the test suite. + * + * @var array + */ + protected $groups = array(); + + /** + * The tests in the test suite. + * + * @var array + */ + protected $tests = array(); + + /** + * The number of tests in the test suite. + * + * @var integer + */ + protected $numTests = -1; + + /** + * @var boolean + */ + protected $testCase = FALSE; + + /** + * Constructs a new TestSuite: + * + * - PHPUnit_Framework_TestSuite() constructs an empty TestSuite. + * + * - PHPUnit_Framework_TestSuite(ReflectionClass) constructs a + * TestSuite from the given class. + * + * - PHPUnit_Framework_TestSuite(ReflectionClass, String) + * constructs a TestSuite from the given class with the given + * name. + * + * - PHPUnit_Framework_TestSuite(String) either constructs a + * TestSuite from the given class (if the passed string is the + * name of an existing class) or constructs an empty TestSuite + * with the given name. + * + * @param mixed $theClass + * @param string $name + * @throws PHPUnit_Framework_Exception + */ + public function __construct($theClass = '', $name = '') + { + $argumentsValid = FALSE; + + if (is_object($theClass) && + $theClass instanceof ReflectionClass) { + $argumentsValid = TRUE; + } + + else if (is_string($theClass) && + $theClass !== '' && + class_exists($theClass, FALSE)) { + $argumentsValid = TRUE; + + if ($name == '') { + $name = $theClass; + } + + $theClass = new ReflectionClass($theClass); + } + + else if (is_string($theClass)) { + $this->setName($theClass); + return; + } + + if (!$argumentsValid) { + throw new PHPUnit_Framework_Exception; + } + + if (!$theClass->isSubclassOf('PHPUnit_Framework_TestCase')) { + throw new PHPUnit_Framework_Exception( + 'Class "' . $theClass->name . '" does not extend PHPUnit_Framework_TestCase.' + ); + } + + if ($name != '') { + $this->setName($name); + } else { + $this->setName($theClass->getName()); + } + + $constructor = $theClass->getConstructor(); + + if ($constructor !== NULL && + !$constructor->isPublic()) { + $this->addTest( + self::warning( + sprintf( + 'Class "%s" has no public constructor.', + + $theClass->getName() + ) + ) + ); + + return; + } + + foreach ($theClass->getMethods() as $method) { + $this->addTestMethod($theClass, $method); + } + + if (empty($this->tests)) { + $this->addTest( + self::warning( + sprintf( + 'No tests found in class "%s".', + + $theClass->getName() + ) + ) + ); + } + + $this->testCase = TRUE; + } + + /** + * Returns a string representation of the test suite. + * + * @return string + */ + public function toString() + { + return $this->getName(); + } + + /** + * Adds a test to the suite. + * + * @param PHPUnit_Framework_Test $test + * @param array $groups + */ + public function addTest(PHPUnit_Framework_Test $test, $groups = array()) + { + $class = new ReflectionClass($test); + + if (!$class->isAbstract()) { + $this->tests[] = $test; + $this->numTests = -1; + + if ($test instanceof PHPUnit_Framework_TestSuite && + empty($groups)) { + $groups = $test->getGroups(); + } + + if (empty($groups)) { + $groups = array('__nogroup__'); + } + + foreach ($groups as $group) { + if (!isset($this->groups[$group])) { + $this->groups[$group] = array($test); + } else { + $this->groups[$group][] = $test; + } + } + } + } + + /** + * Adds the tests from the given class to the suite. + * + * @param mixed $testClass + * @throws PHPUnit_Framework_Exception + */ + public function addTestSuite($testClass) + { + if (is_string($testClass) && class_exists($testClass)) { + $testClass = new ReflectionClass($testClass); + } + + if (!is_object($testClass)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'class name or object' + ); + } + + if ($testClass instanceof PHPUnit_Framework_TestSuite) { + $this->addTest($testClass); + } + + else if ($testClass instanceof ReflectionClass) { + $suiteMethod = FALSE; + + if (!$testClass->isAbstract()) { + if ($testClass->hasMethod(PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME)) { + $method = $testClass->getMethod( + PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME + ); + + if ($method->isStatic()) { + $this->addTest( + $method->invoke(NULL, $testClass->getName()) + ); + + $suiteMethod = TRUE; + } + } + } + + if (!$suiteMethod && !$testClass->isAbstract()) { + $this->addTest(new PHPUnit_Framework_TestSuite($testClass)); + } + } + + else { + throw new PHPUnit_Framework_Exception; + } + } + + /** + * Wraps both <code>addTest()</code> and <code>addTestSuite</code> + * as well as the separate import statements for the user's convenience. + * + * If the named file cannot be read or there are no new tests that can be + * added, a <code>PHPUnit_Framework_Warning</code> will be created instead, + * leaving the current test run untouched. + * + * @param string $filename + * @param array $phptOptions Array with ini settings for the php instance + * run, key being the name if the setting, + * value the ini value. + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 2.3.0 + * @author Stefano F. Rausch <stefano@rausch-e.net> + */ + public function addTestFile($filename, $phptOptions = array()) + { + if (!is_string($filename)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (file_exists($filename) && substr($filename, -5) == '.phpt') { + $this->addTest( + new PHPUnit_Extensions_PhptTestCase($filename, $phptOptions) + ); + + return; + } + + PHPUnit_Util_Class::collectStart(); + $filename = PHPUnit_Util_Fileloader::checkAndLoad($filename); + $newClasses = PHPUnit_Util_Class::collectEnd(); + $baseName = str_replace('.php', '', basename($filename)); + + foreach ($newClasses as $className) { + if (substr($className, 0 - strlen($baseName)) == $baseName) { + $class = new ReflectionClass($className); + + if ($class->getFileName() == $filename) { + $newClasses = array($className); + break; + } + } + } + + $testsFound = FALSE; + + foreach ($newClasses as $className) { + $class = new ReflectionClass($className); + + if (!$class->isAbstract()) { + if ($class->hasMethod(PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME)) { + $method = $class->getMethod( + PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME + ); + + if ($method->isStatic()) { + $this->addTest($method->invoke(NULL, $className)); + + $testsFound = TRUE; + } + } + + else if ($class->implementsInterface('PHPUnit_Framework_Test')) { + $this->addTestSuite($class); + + $testsFound = TRUE; + } + } + } + + $this->numTests = -1; + } + + /** + * Wrapper for addTestFile() that adds multiple test files. + * + * @param array|Iterator $filenames + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 2.3.0 + */ + public function addTestFiles($filenames) + { + if (!(is_array($filenames) || + (is_object($filenames) && $filenames instanceof Iterator))) { + throw PHPUnit_Util_InvalidArgumentHelper::factory( + 1, 'array or iterator' + ); + } + + foreach ($filenames as $filename) { + $this->addTestFile((string)$filename); + } + } + + /** + * Counts the number of test cases that will be run by this test. + * + * @return integer + */ + public function count() + { + if ($this->numTests > -1) { + return $this->numTests; + } + + $this->numTests = 0; + + foreach ($this->tests as $test) { + $this->numTests += count($test); + } + + return $this->numTests; + } + + /** + * @param ReflectionClass $theClass + * @param string $name + * @return PHPUnit_Framework_Test + * @throws PHPUnit_Framework_Exception + */ + public static function createTest(ReflectionClass $theClass, $name) + { + $className = $theClass->getName(); + + if (!$theClass->isInstantiable()) { + return self::warning( + sprintf('Cannot instantiate class "%s".', $className) + ); + } + + $backupSettings = PHPUnit_Util_Test::getBackupSettings( + $className, $name + ); + $preserveGlobalState = PHPUnit_Util_Test::getPreserveGlobalStateSettings( + $className, $name + ); + $runTestInSeparateProcess = PHPUnit_Util_Test::getProcessIsolationSettings( + $className, $name + ); + + $constructor = $theClass->getConstructor(); + + if ($constructor !== NULL) { + $parameters = $constructor->getParameters(); + + // TestCase() or TestCase($name) + if (count($parameters) < 2) { + $test = new $className; + } + + // TestCase($name, $data) + else { + try { + $data = PHPUnit_Util_Test::getProvidedData( + $className, $name + ); + } + + catch (Exception $e) { + $message = sprintf( + 'The data provider specified for %s::%s is invalid.', + $className, + $name + ); + + $_message = $e->getMessage(); + + if (!empty($_message)) { + $message .= "\n" . $_message; + } + + $data = self::warning($message); + } + + // Test method with @dataProvider. + if (isset($data)) { + $test = new PHPUnit_Framework_TestSuite_DataProvider( + $className . '::' . $name + ); + + if (empty($data)) { + $data = self::warning( + sprintf( + 'No tests found in suite "%s".', + $test->getName() + ) + ); + } + + $groups = PHPUnit_Util_Test::getGroups($className, $name); + + if ($data instanceof PHPUnit_Framework_Warning) { + $test->addTest($data, $groups); + } + + else { + foreach ($data as $_dataName => $_data) { + $_test = new $className($name, $_data, $_dataName); + + if ($runTestInSeparateProcess) { + $_test->setRunTestInSeparateProcess(TRUE); + + if ($preserveGlobalState !== NULL) { + $_test->setPreserveGlobalState($preserveGlobalState); + } + } + + if ($backupSettings['backupGlobals'] !== NULL) { + $_test->setBackupGlobals( + $backupSettings['backupGlobals'] + ); + } + + if ($backupSettings['backupStaticAttributes'] !== NULL) { + $_test->setBackupStaticAttributes( + $backupSettings['backupStaticAttributes'] + ); + } + + $test->addTest($_test, $groups); + } + } + } + + else { + $test = new $className; + } + } + } + + if (!isset($test)) { + throw new PHPUnit_Framework_Exception('No valid test provided.'); + } + + if ($test instanceof PHPUnit_Framework_TestCase) { + $test->setName($name); + + if ($runTestInSeparateProcess) { + $test->setRunTestInSeparateProcess(TRUE); + + if ($preserveGlobalState !== NULL) { + $test->setPreserveGlobalState($preserveGlobalState); + } + } + + if ($backupSettings['backupGlobals'] !== NULL) { + $test->setBackupGlobals($backupSettings['backupGlobals']); + } + + if ($backupSettings['backupStaticAttributes'] !== NULL) { + $test->setBackupStaticAttributes( + $backupSettings['backupStaticAttributes'] + ); + } + } + + return $test; + } + + /** + * Creates a default TestResult object. + * + * @return PHPUnit_Framework_TestResult + */ + protected function createResult() + { + return new PHPUnit_Framework_TestResult; + } + + /** + * Returns the name of the suite. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Returns the test groups of the suite. + * + * @return array + * @since Method available since Release 3.2.0 + */ + public function getGroups() + { + return array_keys($this->groups); + } + + /** + * Runs the tests and collects their result in a TestResult. + * + * @param PHPUnit_Framework_TestResult $result + * @param mixed $filter + * @param array $groups + * @param array $excludeGroups + * @param boolean $processIsolation + * @return PHPUnit_Framework_TestResult + * @throws PHPUnit_Framework_Exception + */ + public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE, array $groups = array(), array $excludeGroups = array(), $processIsolation = FALSE) + { + if ($result === NULL) { + $result = $this->createResult(); + } + + $result->startTestSuite($this); + + $doSetup = TRUE; + + if (!empty($excludeGroups)) { + foreach ($this->groups as $_group => $_tests) { + if (in_array($_group, $excludeGroups) && + count($_tests) == count($this->tests)) { + $doSetup = FALSE; + } + } + } + + if ($doSetup) { + try { + $this->setUp(); + + if ($this->testCase && + // Some extensions use test names that are not classes; + // The method_exists() triggers an autoload call that causes issues with die()ing autoloaders. + class_exists($this->name, false) && + method_exists($this->name, 'setUpBeforeClass')) { + call_user_func(array($this->name, 'setUpBeforeClass')); + } + } + + catch (PHPUnit_Framework_SkippedTestSuiteError $e) { + $numTests = count($this); + + for ($i = 0; $i < $numTests; $i++) { + $result->addFailure($this, $e, 0); + } + + $result->endTestSuite($this); + + return $result; + } + + catch (Exception $e) { + $numTests = count($this); + + for ($i = 0; $i < $numTests; $i++) { + $result->addError($this, $e, 0); + } + + $result->endTestSuite($this); + + return $result; + } + } + + if (empty($groups)) { + $tests = $this->tests; + } else { + $tests = new SplObjectStorage; + + foreach ($groups as $group) { + if (isset($this->groups[$group])) { + foreach ($this->groups[$group] as $test) { + $tests->attach($test); + } + } + } + } + + foreach ($tests as $test) { + if ($result->shouldStop()) { + break; + } + + if ($test instanceof PHPUnit_Framework_TestSuite) { + $test->setBackupGlobals($this->backupGlobals); + $test->setBackupStaticAttributes($this->backupStaticAttributes); + + $test->run( + $result, $filter, $groups, $excludeGroups, $processIsolation + ); + } else { + $runTest = TRUE; + + if ($filter !== FALSE ) { + $tmp = PHPUnit_Util_Test::describe($test, FALSE); + + if ($tmp[0] != '') { + $name = join('::', $tmp); + } else { + $name = $tmp[1]; + } + + if (preg_match($filter, $name) == 0) { + $runTest = FALSE; + } + } + + if ($runTest && !empty($excludeGroups)) { + foreach ($this->groups as $_group => $_tests) { + if (in_array($_group, $excludeGroups)) { + foreach ($_tests as $_test) { + if ($test === $_test) { + $runTest = FALSE; + break 2; + } + } + } + } + } + + if ($runTest) { + if ($test instanceof PHPUnit_Framework_TestCase) { + $test->setBackupGlobals($this->backupGlobals); + $test->setBackupStaticAttributes( + $this->backupStaticAttributes + ); + $test->setRunTestInSeparateProcess($processIsolation); + } + + $this->runTest($test, $result); + } + } + } + + if ($doSetup) { + if ($this->testCase && + // Some extensions use test names that are not classes; + // The method_exists() triggers an autoload call that causes issues with die()ing autoloaders. + class_exists($this->name, false) && + method_exists($this->name, 'tearDownAfterClass')) { + call_user_func(array($this->name, 'tearDownAfterClass')); + } + + $this->tearDown(); + } + + $result->endTestSuite($this); + + return $result; + } + + /** + * Runs a test. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_TestResult $result + */ + public function runTest(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result) + { + $test->run($result); + } + + /** + * Sets the name of the suite. + * + * @param string + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Returns the test at the given index. + * + * @param integer + * @return PHPUnit_Framework_Test + */ + public function testAt($index) + { + if (isset($this->tests[$index])) { + return $this->tests[$index]; + } else { + return FALSE; + } + } + + /** + * Returns the tests as an enumeration. + * + * @return array + */ + public function tests() + { + return $this->tests; + } + + /** + * Mark the test suite as skipped. + * + * @param string $message + * @throws PHPUnit_Framework_SkippedTestSuiteError + * @since Method available since Release 3.0.0 + */ + public function markTestSuiteSkipped($message = '') + { + throw new PHPUnit_Framework_SkippedTestSuiteError($message); + } + + /** + * @param ReflectionClass $class + * @param ReflectionMethod $method + */ + protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method) + { + $name = $method->getName(); + + if ($this->isPublicTestMethod($method)) { + $test = self::createTest($class, $name); + + if ($test instanceof PHPUnit_Framework_TestCase || + $test instanceof PHPUnit_Framework_TestSuite_DataProvider) { + $test->setDependencies( + PHPUnit_Util_Test::getDependencies($class->getName(), $name) + ); + } + + $this->addTest($test, PHPUnit_Util_Test::getGroups( + $class->getName(), $name) + ); + } + + else if ($this->isTestMethod($method)) { + $this->addTest( + self::warning( + sprintf( + 'Test method "%s" in test class "%s" is not public.', + $name, + $class->getName() + ) + ) + ); + } + } + + /** + * @param ReflectionMethod $method + * @return boolean + */ + public static function isPublicTestMethod(ReflectionMethod $method) + { + return (self::isTestMethod($method) && $method->isPublic()); + } + + /** + * @param ReflectionMethod $method + * @return boolean + */ + public static function isTestMethod(ReflectionMethod $method) + { + if (strpos($method->name, 'test') === 0) { + return TRUE; + } + + // @scenario on TestCase::testMethod() + // @test on TestCase::testMethod() + return strpos($method->getDocComment(), '@test') !== FALSE || + strpos($method->getDocComment(), '@scenario') !== FALSE; + } + + /** + * @param string $message + * @return PHPUnit_Framework_Warning + */ + protected static function warning($message) + { + return new PHPUnit_Framework_Warning($message); + } + + /** + * @param boolean $backupGlobals + * @since Method available since Release 3.3.0 + */ + public function setBackupGlobals($backupGlobals) + { + if (is_null($this->backupGlobals) && is_bool($backupGlobals)) { + $this->backupGlobals = $backupGlobals; + } + } + + /** + * @param boolean $backupStaticAttributes + * @since Method available since Release 3.4.0 + */ + public function setBackupStaticAttributes($backupStaticAttributes) + { + if (is_null($this->backupStaticAttributes) && + is_bool($backupStaticAttributes)) { + $this->backupStaticAttributes = $backupStaticAttributes; + } + } + + /** + * Returns an iterator for this test suite. + * + * @return RecursiveIteratorIterator + * @since Method available since Release 3.1.0 + */ + public function getIterator() + { + return new RecursiveIteratorIterator( + new PHPUnit_Util_TestSuiteIterator($this) + ); + } + + /** + * Template Method that is called before the tests + * of this test suite are run. + * + * @since Method available since Release 3.1.0 + */ + protected function setUp() + { + } + + /** + * Template Method that is called after the tests + * of this test suite have finished running. + * + * @since Method available since Release 3.1.0 + */ + protected function tearDown() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php @@ -0,0 +1,70 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework_TestSuite + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Framework_TestSuite + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Framework_TestSuite_DataProvider extends PHPUnit_Framework_TestSuite +{ + /** + * Sets the dependencies of a TestCase. + * + * @param array $dependencies + */ + public function setDependencies(array $dependencies) + { + foreach ($this->tests as $test) { + $test->setDependencies($dependencies); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php @@ -0,0 +1,125 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A warning. + * + * @package PHPUnit + * @subpackage Framework + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Framework_Warning extends PHPUnit_Framework_TestCase +{ + /** + * @var string + */ + protected $message = ''; + + /** + * @var boolean + */ + protected $backupGlobals = FALSE; + + /** + * @var boolean + */ + protected $backupStaticAttributes = FALSE; + + /** + * @var boolean + */ + protected $runTestInSeparateProcess = FALSE; + + /** + * @var boolean + */ + protected $useErrorHandler = FALSE; + + /** + * @var boolean + */ + protected $useOutputBuffering = FALSE; + + /** + * @param string $message + */ + public function __construct($message = '') + { + $this->message = $message; + parent::__construct('Warning'); + } + + /** + * @throws PHPUnit_Framework_Exception + */ + protected function runTest() + { + $this->fail($this->message); + } + + /** + * @return string + * @since Method available since Release 3.0.0 + */ + public function getMessage() + { + return $this->message; + } + + /** + * Returns a string representation of the test case. + * + * @return string + * @since Method available since Release 3.4.0 + */ + public function toString() + { + return 'Warning'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php @@ -0,0 +1,189 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Base class for all test runners. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +abstract class PHPUnit_Runner_BaseTestRunner +{ + const STATUS_PASSED = 0; + const STATUS_SKIPPED = 1; + const STATUS_INCOMPLETE = 2; + const STATUS_FAILURE = 3; + const STATUS_ERROR = 4; + const SUITE_METHODNAME = 'suite'; + + /** + * Returns the loader to be used. + * + * @return PHPUnit_Runner_TestSuiteLoader + */ + public function getLoader() + { + return new PHPUnit_Runner_StandardTestSuiteLoader; + } + + /** + * Returns the Test corresponding to the given suite. + * This is a template method, subclasses override + * the runFailed() and clearStatus() methods. + * + * @param string $suiteClassName + * @param string $suiteClassFile + * @param mixed $suffixes + * @return PHPUnit_Framework_Test + */ + public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '') + { + if (is_dir($suiteClassName) && + !is_file($suiteClassName . '.php') && empty($suiteClassFile)) { + $facade = new File_Iterator_Facade; + $files = $facade->getFilesAsArray( + $suiteClassName, $suffixes + ); + + $suite = new PHPUnit_Framework_TestSuite($suiteClassName); + $suite->addTestFiles($files); + + return $suite; + } + + try { + $testClass = $this->loadSuiteClass( + $suiteClassName, $suiteClassFile + ); + } + + catch (Exception $e) { + $this->runFailed($e->getMessage()); + return NULL; + } + + try { + $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME); + + if (!$suiteMethod->isStatic()) { + $this->runFailed( + 'suite() method must be static.' + ); + + return NULL; + } + + try { + $test = $suiteMethod->invoke(NULL, $testClass->getName()); + } + + catch (ReflectionException $e) { + $this->runFailed( + sprintf( + "Failed to invoke suite() method.\n%s", + + $e->getMessage() + ) + ); + + return NULL; + } + } + + catch (ReflectionException $e) { + try { + $test = new PHPUnit_Framework_TestSuite($testClass); + } + + catch (PHPUnit_Framework_Exception $e) { + $test = new PHPUnit_Framework_TestSuite; + $test->setName($suiteClassName); + } + } + + $this->clearStatus(); + + return $test; + } + + /** + * Returns the loaded ReflectionClass for a suite name. + * + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + */ + protected function loadSuiteClass($suiteClassName, $suiteClassFile = '') + { + $loader = $this->getLoader(); + + if ($loader instanceof PHPUnit_Runner_StandardTestSuiteLoader) { + return $loader->load($suiteClassName, $suiteClassFile); + } else { + return $loader->load($suiteClassName, $suiteClassFile); + } + } + + /** + * Clears the status message. + * + */ + protected function clearStatus() + { + } + + /** + * Override to define how to handle a failed loading of + * a test suite. + * + * @param string $message + */ + abstract protected function runFailed($message); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php @@ -0,0 +1,153 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * The standard test suite loader. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Runner_StandardTestSuiteLoader implements PHPUnit_Runner_TestSuiteLoader +{ + /** + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + * @throws PHPUnit_Framework_Exception + */ + public function load($suiteClassName, $suiteClassFile = '') + { + $suiteClassName = str_replace('.php', '', $suiteClassName); + + if (empty($suiteClassFile)) { + $suiteClassFile = PHPUnit_Util_Filesystem::classNameToFilename( + $suiteClassName + ); + } + + if (!class_exists($suiteClassName, FALSE)) { + PHPUnit_Util_Class::collectStart(); + $filename = PHPUnit_Util_Fileloader::checkAndLoad($suiteClassFile); + $loadedClasses = PHPUnit_Util_Class::collectEnd(); + } + + if (!class_exists($suiteClassName, FALSE) && !empty($loadedClasses)) { + $offset = 0 - strlen($suiteClassName); + + foreach ($loadedClasses as $loadedClass) { + $class = new ReflectionClass($loadedClass); + if (substr($loadedClass, $offset) === $suiteClassName && + $class->getFileName() == $filename) { + $suiteClassName = $loadedClass; + break; + } + } + } + + if (!class_exists($suiteClassName, FALSE) && !empty($loadedClasses)) { + $testCaseClass = 'PHPUnit_Framework_TestCase'; + + foreach ($loadedClasses as $loadedClass) { + $class = new ReflectionClass($loadedClass); + $classFile = $class->getFileName(); + + if ($class->isSubclassOf($testCaseClass) && + !$class->isAbstract()) { + $suiteClassName = $loadedClass; + $testCaseClass = $loadedClass; + + if ($classFile == realpath($suiteClassFile)) { + break; + } + } + + if ($class->hasMethod('suite')) { + $method = $class->getMethod('suite'); + + if (!$method->isAbstract() && + $method->isPublic() && + $method->isStatic()) { + $suiteClassName = $loadedClass; + + if ($classFile == realpath($suiteClassFile)) { + break; + } + } + } + } + } + + if (class_exists($suiteClassName, FALSE)) { + $class = new ReflectionClass($suiteClassName); + + if ($class->getFileName() == realpath($suiteClassFile)) { + return $class; + } + } + + throw new PHPUnit_Framework_Exception( + sprintf( + "Class '%s' could not be found in '%s'.", + + $suiteClassName, + $suiteClassFile + ) + ); + } + + /** + * @param ReflectionClass $aClass + * @return ReflectionClass + */ + public function reload(ReflectionClass $aClass) + { + return $aClass; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php @@ -0,0 +1,71 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * An interface to define how a test suite should be loaded. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 2.0.0 + */ +interface PHPUnit_Runner_TestSuiteLoader +{ + /** + * @param string $suiteClassName + * @param string $suiteClassFile + * @return ReflectionClass + */ + public function load($suiteClassName, $suiteClassFile = ''); + + /** + * @param ReflectionClass $aClass + * @return ReflectionClass + */ + public function reload(ReflectionClass $aClass); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php @@ -0,0 +1,102 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * This class defines the current version of PHPUnit. + * + * @package PHPUnit + * @subpackage Runner + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Runner_Version +{ + const VERSION = '3.7.38'; + protected static $version; + + /** + * Returns the current version of PHPUnit. + * + * @return string + */ + public static function id() + { + if (self::$version === NULL) { + self::$version = self::VERSION; + + if (is_dir(dirname(dirname(__DIR__)) . '/.git')) { + $dir = getcwd(); + chdir(__DIR__); + $version = exec('git describe --tags 2>&1', $output, $returnCode); + chdir($dir); + + if ($version && $returnCode === 0) { + if (count(explode('.', self::VERSION)) == 3) { + self::$version = $version; + } else { + $version = explode('-', $version); + + self::$version = self::VERSION . '-' . $version[2]; + } + } else { + self::$version = self::VERSION . '-dev'; + } + } + } + + return self::$version; + } + + /** + * @return string + */ + public static function getVersionString() + { + return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann.'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php @@ -0,0 +1,897 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * A TestRunner for the Command Line Interface (CLI) + * PHP SAPI Module. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_TextUI_Command +{ + /** + * @var array + */ + protected $arguments = array( + 'listGroups' => FALSE, + 'loader' => NULL, + 'useDefaultConfiguration' => TRUE + ); + + /** + * @var array + */ + protected $options = array(); + + /** + * @var array + */ + protected $longOptions = array( + 'colors' => NULL, + 'bootstrap=' => NULL, + 'configuration=' => NULL, + 'coverage-html=' => NULL, + 'coverage-clover=' => NULL, + 'coverage-php=' => NULL, + 'coverage-text==' => NULL, + 'debug' => NULL, + 'exclude-group=' => NULL, + 'filter=' => NULL, + 'testsuite=' => NULL, + 'group=' => NULL, + 'help' => NULL, + 'include-path=' => NULL, + 'list-groups' => NULL, + 'loader=' => NULL, + 'log-json=' => NULL, + 'log-junit=' => NULL, + 'log-tap=' => NULL, + 'process-isolation' => NULL, + 'repeat=' => NULL, + 'stderr' => NULL, + 'stop-on-error' => NULL, + 'stop-on-failure' => NULL, + 'stop-on-incomplete' => NULL, + 'stop-on-skipped' => NULL, + 'strict' => NULL, + 'tap' => NULL, + 'testdox' => NULL, + 'testdox-html=' => NULL, + 'testdox-text=' => NULL, + 'test-suffix=' => NULL, + 'no-configuration' => NULL, + 'no-globals-backup' => NULL, + 'printer=' => NULL, + 'static-backup' => NULL, + 'verbose' => NULL, + 'version' => NULL + ); + + /** + * @var array + */ + protected $missingExtensions = array(); + + /** + * @param boolean $exit + */ + public static function main($exit = TRUE) + { + $command = new PHPUnit_TextUI_Command; + return $command->run($_SERVER['argv'], $exit); + } + + /** + * @param array $argv + * @param boolean $exit + */ + public function run(array $argv, $exit = TRUE) + { + $this->handleArguments($argv); + + $runner = $this->createRunner(); + + if (is_object($this->arguments['test']) && + $this->arguments['test'] instanceof PHPUnit_Framework_Test) { + $suite = $this->arguments['test']; + } else { + $suite = $runner->getTest( + $this->arguments['test'], + $this->arguments['testFile'], + $this->arguments['testSuffixes'] + ); + } + + if ($this->arguments['listGroups']) { + PHPUnit_TextUI_TestRunner::printVersionString(); + + print "Available test group(s):\n"; + + $groups = $suite->getGroups(); + sort($groups); + + foreach ($groups as $group) { + print " - $group\n"; + } + + if ($exit) { + exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT); + } else { + return PHPUnit_TextUI_TestRunner::SUCCESS_EXIT; + } + } + + unset($this->arguments['test']); + unset($this->arguments['testFile']); + + try { + $result = $runner->doRun($suite, $this->arguments); + } + + catch (PHPUnit_Framework_Exception $e) { + print $e->getMessage() . "\n"; + } + + $ret = PHPUnit_TextUI_TestRunner::FAILURE_EXIT; + + if (isset($result) && $result->wasSuccessful()) { + $ret = PHPUnit_TextUI_TestRunner::SUCCESS_EXIT; + } + + else if (!isset($result) || $result->errorCount() > 0) { + $ret = PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT; + } + + if ($exit) { + exit($ret); + } else { + return $ret; + } + } + + /** + * Create a TestRunner, override in subclasses. + * + * @return PHPUnit_TextUI_TestRunner + * @since Method available since Release 3.6.0 + */ + protected function createRunner() + { + return new PHPUnit_TextUI_TestRunner($this->arguments['loader']); + } + + /** + * Handles the command-line arguments. + * + * A child class of PHPUnit_TextUI_Command can hook into the argument + * parsing by adding the switch(es) to the $longOptions array and point to a + * callback method that handles the switch(es) in the child class like this + * + * <code> + * <?php + * class MyCommand extends PHPUnit_TextUI_Command + * { + * public function __construct() + * { + * $this->longOptions['--my-switch'] = 'myHandler'; + * } + * + * // --my-switch foo -> myHandler('foo') + * protected function myHandler($value) + * { + * } + * } + * </code> + * + * @param array $argv + */ + protected function handleArguments(array $argv) + { + try { + $this->options = PHPUnit_Util_Getopt::getopt( + $argv, + 'd:c:hv', + array_keys($this->longOptions) + ); + } + + catch (PHPUnit_Framework_Exception $e) { + PHPUnit_TextUI_TestRunner::showError($e->getMessage()); + } + + foreach ($this->options[0] as $option) { + switch ($option[0]) { + case '--colors': { + $this->arguments['colors'] = TRUE; + } + break; + + case '--bootstrap': { + $this->arguments['bootstrap'] = $option[1]; + } + break; + + case 'c': + case '--configuration': { + $this->arguments['configuration'] = $option[1]; + } + break; + + case '--coverage-clover': + case '--coverage-html': + case '--coverage-php': + case '--coverage-text': { + if (!extension_loaded('tokenizer')) { + $this->showExtensionNotLoadedMessage( + 'tokenizer', 'No code coverage will be generated.' + ); + + continue; + } + + if (!extension_loaded('xdebug')) { + $this->showExtensionNotLoadedMessage( + 'Xdebug', 'No code coverage will be generated.' + ); + + continue; + } + + switch ($option[0]) { + case '--coverage-clover': { + $this->arguments['coverageClover'] = $option[1]; + } + break; + + case '--coverage-html': { + $this->arguments['reportDirectory'] = $option[1]; + } + break; + + case '--coverage-php': { + $this->arguments['coveragePHP'] = $option[1]; + } + break; + + case '--coverage-text': { + if ($option[1] === NULL) { + $option[1] = 'php://stdout'; + } + + $this->arguments['coverageText'] = $option[1]; + $this->arguments['coverageTextShowUncoveredFiles'] = FALSE; + } + break; + } + } + break; + + case 'd': { + $ini = explode('=', $option[1]); + + if (isset($ini[0])) { + if (isset($ini[1])) { + ini_set($ini[0], $ini[1]); + } else { + ini_set($ini[0], TRUE); + } + } + } + break; + + case '--debug': { + $this->arguments['debug'] = TRUE; + } + break; + + case 'h': + case '--help': { + $this->showHelp(); + exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT); + } + break; + + case '--filter': { + $this->arguments['filter'] = $option[1]; + } + break; + + case '--testsuite': { + $this->arguments['testsuite'] = $option[1]; + } + break; + + case '--group': { + $this->arguments['groups'] = explode(',', $option[1]); + } + break; + + case '--exclude-group': { + $this->arguments['excludeGroups'] = explode( + ',', $option[1] + ); + } + break; + + case '--test-suffix': { + $this->arguments['testSuffixes'] = explode( + ',', $option[1] + ); + } + break; + + case '--include-path': { + $includePath = $option[1]; + } + break; + + case '--list-groups': { + $this->arguments['listGroups'] = TRUE; + } + break; + + case '--printer': { + $this->arguments['printer'] = $option[1]; + } + break; + + case '--loader': { + $this->arguments['loader'] = $option[1]; + } + break; + + case '--log-json': { + $this->arguments['jsonLogfile'] = $option[1]; + } + break; + + case '--log-junit': { + $this->arguments['junitLogfile'] = $option[1]; + } + break; + + case '--log-tap': { + $this->arguments['tapLogfile'] = $option[1]; + } + break; + + case '--process-isolation': { + $this->arguments['processIsolation'] = TRUE; + } + break; + + case '--repeat': { + $this->arguments['repeat'] = (int)$option[1]; + } + break; + + case '--stderr': { + $this->arguments['printer'] = new PHPUnit_TextUI_ResultPrinter( + 'php://stderr', + isset($this->arguments['verbose']) ? $this->arguments['verbose'] : FALSE + ); + } + break; + + case '--stop-on-error': { + $this->arguments['stopOnError'] = TRUE; + } + break; + + case '--stop-on-failure': { + $this->arguments['stopOnFailure'] = TRUE; + } + break; + + case '--stop-on-incomplete': { + $this->arguments['stopOnIncomplete'] = TRUE; + } + break; + + case '--stop-on-skipped': { + $this->arguments['stopOnSkipped'] = TRUE; + } + break; + + case '--tap': { + $this->arguments['printer'] = new PHPUnit_Util_Log_TAP; + } + break; + + case '--testdox': { + $this->arguments['printer'] = new PHPUnit_Util_TestDox_ResultPrinter_Text; + } + break; + + case '--testdox-html': { + $this->arguments['testdoxHTMLFile'] = $option[1]; + } + break; + + case '--testdox-text': { + $this->arguments['testdoxTextFile'] = $option[1]; + } + break; + + case '--no-configuration': { + $this->arguments['useDefaultConfiguration'] = FALSE; + } + break; + + case '--no-globals-backup': { + $this->arguments['backupGlobals'] = FALSE; + } + break; + + case '--static-backup': { + $this->arguments['backupStaticAttributes'] = TRUE; + } + break; + + case 'v': + case '--verbose': { + $this->arguments['verbose'] = TRUE; + } + break; + + case '--version': { + PHPUnit_TextUI_TestRunner::printVersionString(); + exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT); + } + break; + + case '--strict': { + $this->arguments['strict'] = TRUE; + } + break; + + default: { + $optionName = str_replace('--', '', $option[0]); + + if (isset($this->longOptions[$optionName])) { + $handler = $this->longOptions[$optionName]; + } + + else if (isset($this->longOptions[$optionName . '='])) { + $handler = $this->longOptions[$optionName . '=']; + } + + if (isset($handler) && is_callable(array($this, $handler))) { + $this->$handler($option[1]); + } + } + } + } + + $this->handleCustomTestSuite(); + + if (!isset($this->arguments['test'])) { + + if (isset($this->options[1][0])) { + $this->arguments['test'] = $this->options[1][0]; + } + + if (isset($this->options[1][1])) { + $this->arguments['testFile'] = $this->options[1][1]; + } else { + $this->arguments['testFile'] = ''; + } + + if (isset($this->arguments['test']) && + is_file($this->arguments['test']) && + substr($this->arguments['test'], -5, 5) != '.phpt') { + $this->arguments['testFile'] = realpath($this->arguments['test']); + $this->arguments['test'] = substr($this->arguments['test'], 0, strrpos($this->arguments['test'], '.')); + } + } + + if (!isset($this->arguments['testSuffixes'])) { + $this->arguments['testSuffixes'] = array('Test.php', '.phpt'); + } + + if (isset($includePath)) { + ini_set( + 'include_path', + $includePath . PATH_SEPARATOR . ini_get('include_path') + ); + } + + if (isset($this->arguments['bootstrap'])) { + $this->handleBootstrap($this->arguments['bootstrap']); + } + + if (isset($this->arguments['printer']) && + is_string($this->arguments['printer'])) { + $this->arguments['printer'] = $this->handlePrinter($this->arguments['printer']); + } + + if ($this->arguments['loader'] !== NULL) { + $this->arguments['loader'] = $this->handleLoader($this->arguments['loader']); + } + + if (isset($this->arguments['configuration']) && + is_dir($this->arguments['configuration'])) { + $configurationFile = $this->arguments['configuration'] . + '/phpunit.xml'; + + if (file_exists($configurationFile)) { + $this->arguments['configuration'] = realpath( + $configurationFile + ); + } + + else if (file_exists($configurationFile . '.dist')) { + $this->arguments['configuration'] = realpath( + $configurationFile . '.dist' + ); + } + } + + else if (!isset($this->arguments['configuration']) && + $this->arguments['useDefaultConfiguration']) { + if (file_exists('phpunit.xml')) { + $this->arguments['configuration'] = realpath('phpunit.xml'); + } else if (file_exists('phpunit.xml.dist')) { + $this->arguments['configuration'] = realpath( + 'phpunit.xml.dist' + ); + } + } + + if (isset($this->arguments['configuration'])) { + try { + $configuration = PHPUnit_Util_Configuration::getInstance( + $this->arguments['configuration'] + ); + } + + catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); + } + + $phpunit = $configuration->getPHPUnitConfiguration(); + + $configuration->handlePHPConfiguration(); + + if (!isset($this->arguments['bootstrap']) && isset($phpunit['bootstrap'])) { + $this->handleBootstrap($phpunit['bootstrap']); + } + + if (isset($phpunit['printerClass'])) { + if (isset($phpunit['printerFile'])) { + $file = $phpunit['printerFile']; + } else { + $file = ''; + } + + $this->arguments['printer'] = $this->handlePrinter( + $phpunit['printerClass'], $file + ); + } + + if (isset($phpunit['testSuiteLoaderClass'])) { + if (isset($phpunit['testSuiteLoaderFile'])) { + $file = $phpunit['testSuiteLoaderFile']; + } else { + $file = ''; + } + + $this->arguments['loader'] = $this->handleLoader( + $phpunit['testSuiteLoaderClass'], $file + ); + } + + $logging = $configuration->getLoggingConfiguration(); + + if (isset($logging['coverage-html']) || isset($logging['coverage-clover']) || isset($logging['coverage-text']) ) { + if (!extension_loaded('tokenizer')) { + $this->showExtensionNotLoadedMessage( + 'tokenizer', 'No code coverage will be generated.' + ); + } + + else if (!extension_loaded('Xdebug')) { + $this->showExtensionNotLoadedMessage( + 'Xdebug', 'No code coverage will be generated.' + ); + } + } + + $browsers = $configuration->getSeleniumBrowserConfiguration(); + + if (!empty($browsers) && + class_exists('PHPUnit_Extensions_SeleniumTestCase')) { + PHPUnit_Extensions_SeleniumTestCase::$browsers = $browsers; + } + + if (!isset($this->arguments['test'])) { + $testSuite = $configuration->getTestSuiteConfiguration(isset($this->arguments['testsuite']) ? $this->arguments['testsuite'] : null); + + if ($testSuite !== NULL) { + $this->arguments['test'] = $testSuite; + } + } + } + + if (isset($this->arguments['test']) && is_string($this->arguments['test']) && substr($this->arguments['test'], -5, 5) == '.phpt') { + $test = new PHPUnit_Extensions_PhptTestCase($this->arguments['test']); + + $this->arguments['test'] = new PHPUnit_Framework_TestSuite; + $this->arguments['test']->addTest($test); + } + + if (!isset($this->arguments['test']) || + (isset($this->arguments['testDatabaseLogRevision']) && !isset($this->arguments['testDatabaseDSN']))) { + $this->showHelp(); + exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); + } + } + + /** + * Handles the loading of the PHPUnit_Runner_TestSuiteLoader implementation. + * + * @param string $loaderClass + * @param string $loaderFile + * @return PHPUnit_Runner_TestSuiteLoader + */ + protected function handleLoader($loaderClass, $loaderFile = '') + { + if (!class_exists($loaderClass, FALSE)) { + if ($loaderFile == '') { + $loaderFile = PHPUnit_Util_Filesystem::classNameToFilename( + $loaderClass + ); + } + + $loaderFile = stream_resolve_include_path($loaderFile); + + if ($loaderFile) { + require $loaderFile; + } + } + + if (class_exists($loaderClass, FALSE)) { + $class = new ReflectionClass($loaderClass); + + if ($class->implementsInterface('PHPUnit_Runner_TestSuiteLoader') && + $class->isInstantiable()) { + $loader = $class->newInstance(); + } + } + + if (!isset($loader)) { + PHPUnit_TextUI_TestRunner::showError( + sprintf( + 'Could not use "%s" as loader.', + + $loaderClass + ) + ); + } + + return $loader; + } + + /** + * Handles the loading of the PHPUnit_Util_Printer implementation. + * + * @param string $printerClass + * @param string $printerFile + * @return PHPUnit_Util_Printer + */ + protected function handlePrinter($printerClass, $printerFile = '') + { + if (!class_exists($printerClass, FALSE)) { + if ($printerFile == '') { + $printerFile = PHPUnit_Util_Filesystem::classNameToFilename( + $printerClass + ); + } + + $printerFile = stream_resolve_include_path($printerFile); + + if ($printerFile) { + require $printerFile; + } + } + + if (class_exists($printerClass, FALSE)) { + $class = new ReflectionClass($printerClass); + + if ($class->implementsInterface('PHPUnit_Framework_TestListener') && + $class->isSubclassOf('PHPUnit_Util_Printer') && + $class->isInstantiable()) { + $printer = $class->newInstance(); + } + } + + if (!isset($printer)) { + PHPUnit_TextUI_TestRunner::showError( + sprintf( + 'Could not use "%s" as printer.', + + $printerClass + ) + ); + } + + return $printer; + } + + /** + * Loads a bootstrap file. + * + * @param string $filename + */ + protected function handleBootstrap($filename) + { + try { + PHPUnit_Util_Fileloader::checkAndLoad($filename); + } + + catch (PHPUnit_Framework_Exception $e) { + PHPUnit_TextUI_TestRunner::showError($e->getMessage()); + } + } + + /** + * @param string $message + * @since Method available since Release 3.6.0 + */ + protected function showExtensionNotLoadedMessage($extension, $message = '') + { + if (isset($this->missingExtensions[$extension])) { + return; + } + + if (!empty($message)) { + $message = ' ' . $message; + } + + $this->showMessage( + 'The ' . $extension . ' extension is not loaded.' . $message . "\n", + FALSE + ); + + $this->missingExtensions[$extension] = TRUE; + } + + /** + * Shows a message. + * + * @param string $message + * @param boolean $exit + */ + protected function showMessage($message, $exit = TRUE) + { + PHPUnit_TextUI_TestRunner::printVersionString(); + print $message . "\n"; + + if ($exit) { + exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); + } else { + print "\n"; + } + } + + /** + * Show the help message. + */ + protected function showHelp() + { + PHPUnit_TextUI_TestRunner::printVersionString(); + + print <<<EOT +Usage: phpunit [options] UnitTest [UnitTest.php] + phpunit [options] <directory> + + --log-junit <file> Log test execution in JUnit XML format to file. + --log-tap <file> Log test execution in TAP format to file. + --log-json <file> Log test execution in JSON format. + + --coverage-clover <file> Generate code coverage report in Clover XML format. + --coverage-html <dir> Generate code coverage report in HTML format. + --coverage-php <file> Serialize PHP_CodeCoverage object to file. + --coverage-text=<file> Generate code coverage report in text format. + Default to writing to the standard output. + + --testdox-html <file> Write agile documentation in HTML format to file. + --testdox-text <file> Write agile documentation in Text format to file. + + --filter <pattern> Filter which tests to run. + --testsuite <pattern> Filter which testsuite to run. + --group ... Only runs tests from the specified group(s). + --exclude-group ... Exclude tests from the specified group(s). + --list-groups List available test groups. + --test-suffix ... Only search for test in files with specified + suffix(es). Default: Test.php,.phpt + + --loader <loader> TestSuiteLoader implementation to use. + --printer <printer> TestSuiteListener implementation to use. + --repeat <times> Runs the test(s) repeatedly. + + --tap Report test execution progress in TAP format. + --testdox Report test execution progress in TestDox format. + + --colors Use colors in output. + --stderr Write to STDERR instead of STDOUT. + --stop-on-error Stop execution upon first error. + --stop-on-failure Stop execution upon first error or failure. + --stop-on-skipped Stop execution upon first skipped test. + --stop-on-incomplete Stop execution upon first incomplete test. + --strict Run tests in strict mode. + -v|--verbose Output more verbose information. + --debug Display debugging information during test execution. + + --process-isolation Run each test in a separate PHP process. + --no-globals-backup Do not backup and restore \$GLOBALS for each test. + --static-backup Backup and restore static attributes for each test. + + --bootstrap <file> A "bootstrap" PHP file that is run before the tests. + -c|--configuration <file> Read configuration from XML file. + --no-configuration Ignore default configuration file (phpunit.xml). + --include-path <path(s)> Prepend PHP's include_path with given path(s). + -d key[=value] Sets a php.ini value. + + -h|--help Prints this usage information. + --version Prints the version and exits. + +EOT; + } + + /** + * Custom callback for test suite discovery. + */ + protected function handleCustomTestSuite() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php @@ -0,0 +1,664 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Prints the result of a TextUI TestRunner run. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener +{ + const EVENT_TEST_START = 0; + const EVENT_TEST_END = 1; + const EVENT_TESTSUITE_START = 2; + const EVENT_TESTSUITE_END = 3; + + /** + * @var integer + */ + protected $column = 0; + + /** + * @var integer + */ + protected $maxColumn; + + /** + * @var boolean + */ + protected $lastTestFailed = FALSE; + + /** + * @var integer + */ + protected $numAssertions = 0; + + /** + * @var integer + */ + protected $numTests = -1; + + /** + * @var integer + */ + protected $numTestsRun = 0; + + /** + * @var integer + */ + protected $numTestsWidth; + + /** + * @var boolean + */ + protected $colors = FALSE; + + /** + * @var boolean + */ + protected $debug = FALSE; + + /** + * @var boolean + */ + protected $verbose = FALSE; + + /** + * Constructor. + * + * @param mixed $out + * @param boolean $verbose + * @param boolean $colors + * @param boolean $debug + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.0.0 + */ + public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $debug = FALSE) + { + parent::__construct($out); + + if (is_bool($verbose)) { + $this->verbose = $verbose; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean'); + } + + if (is_bool($colors)) { + $this->colors = $colors; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'boolean'); + } + + if (is_bool($debug)) { + $this->debug = $debug; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean'); + } + } + + /** + * @param PHPUnit_Framework_TestResult $result + */ + public function printResult(PHPUnit_Framework_TestResult $result) + { + $this->printHeader(); + + if ($result->errorCount() > 0) { + $this->printErrors($result); + } + + if ($result->failureCount() > 0) { + if ($result->errorCount() > 0) { + print "\n--\n\n"; + } + + $this->printFailures($result); + } + + if ($this->verbose) { + if ($result->deprecatedFeaturesCount() > 0) { + if ($result->failureCount() > 0) { + print "\n--\n\nDeprecated PHPUnit features are being used"; + } + + foreach ($result->deprecatedFeatures() as $deprecatedFeature) { + $this->write($deprecatedFeature . "\n\n"); + } + } + + if ($result->notImplementedCount() > 0) { + if ($result->failureCount() > 0) { + print "\n--\n\n"; + } + + $this->printIncompletes($result); + } + + if ($result->skippedCount() > 0) { + if ($result->notImplementedCount() > 0) { + print "\n--\n\n"; + } + + $this->printSkipped($result); + } + } + + $this->printFooter($result); + } + + /** + * @param array $defects + * @param integer $count + * @param string $type + */ + protected function printDefects(array $defects, $count, $type) + { + static $called = FALSE; + + if ($count == 0) { + return; + } + + $this->write( + sprintf( + "%sThere %s %d %s%s:\n", + + $called ? "\n" : '', + ($count == 1) ? 'was' : 'were', + $count, + $type, + ($count == 1) ? '' : 's' + ) + ); + + $i = 1; + + foreach ($defects as $defect) { + $this->printDefect($defect, $i++); + } + + $called = TRUE; + } + + /** + * @param PHPUnit_Framework_TestFailure $defect + * @param integer $count + */ + protected function printDefect(PHPUnit_Framework_TestFailure $defect, $count) + { + $this->printDefectHeader($defect, $count); + $this->printDefectTrace($defect); + } + + /** + * @param PHPUnit_Framework_TestFailure $defect + * @param integer $count + */ + protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count) + { + $failedTest = $defect->failedTest(); + + if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) { + $testName = $failedTest->toString(); + } else { + $testName = get_class($failedTest); + } + + $this->write( + sprintf( + "\n%d) %s\n", + + $count, + $testName + ) + ); + } + + /** + * @param PHPUnit_Framework_TestFailure $defect + */ + protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect) + { + $this->write( + $defect->getExceptionAsString() . "\n" . + PHPUnit_Util_Filter::getFilteredStacktrace( + $defect->thrownException() + ) + ); + + $e = $defect->thrownException()->getPrevious(); + + while ($e) { + $this->write( + "\nCaused by\n" . + PHPUnit_Framework_TestFailure::exceptionToString($e). "\n" . + PHPUnit_Util_Filter::getFilteredStacktrace($e) + ); + + $e = $e->getPrevious(); + } + } + + /** + * @param PHPUnit_Framework_TestResult $result + */ + protected function printErrors(PHPUnit_Framework_TestResult $result) + { + $this->printDefects($result->errors(), $result->errorCount(), 'error'); + } + + /** + * @param PHPUnit_Framework_TestResult $result + */ + protected function printFailures(PHPUnit_Framework_TestResult $result) + { + $this->printDefects( + $result->failures(), + $result->failureCount(), + 'failure' + ); + } + + /** + * @param PHPUnit_Framework_TestResult $result + */ + protected function printIncompletes(PHPUnit_Framework_TestResult $result) + { + $this->printDefects( + $result->notImplemented(), + $result->notImplementedCount(), + 'incomplete test' + ); + } + + /** + * @param PHPUnit_Framework_TestResult $result + * @since Method available since Release 3.0.0 + */ + protected function printSkipped(PHPUnit_Framework_TestResult $result) + { + $this->printDefects( + $result->skipped(), + $result->skippedCount(), + 'skipped test' + ); + } + + protected function printHeader() + { + $this->write("\n\n" . PHP_Timer::resourceUsage() . "\n\n"); + } + + /** + * @param PHPUnit_Framework_TestResult $result + */ + protected function printFooter(PHPUnit_Framework_TestResult $result) + { + if (count($result) === 0) { + if ($this->colors) { + $this->write("\x1b[30;43m\x1b[2K"); + } + + $this->write( + "No tests executed!\n" + ); + + if ($this->colors) { + $this->write("\x1b[0m\x1b[2K"); + } + } + + else if ($result->wasSuccessful() && + $result->allCompletelyImplemented() && + $result->noneSkipped()) { + if ($this->colors) { + $this->write("\x1b[30;42m\x1b[2K"); + } + + $this->write( + sprintf( + "OK (%d test%s, %d assertion%s)\n", + + count($result), + (count($result) == 1) ? '' : 's', + $this->numAssertions, + ($this->numAssertions == 1) ? '' : 's' + ) + ); + + if ($this->colors) { + $this->write("\x1b[0m\x1b[2K"); + } + } + + else if ((!$result->allCompletelyImplemented() || + !$result->noneSkipped()) && + $result->wasSuccessful()) { + if ($this->colors) { + $this->write( + "\x1b[30;43m\x1b[2KOK, but incomplete or skipped tests!\n" . + "\x1b[0m\x1b[30;43m\x1b[2K" + ); + } else { + $this->write("OK, but incomplete or skipped tests!\n"); + } + + $this->write( + sprintf( + "Tests: %d, Assertions: %d%s%s.\n", + + count($result), + $this->numAssertions, + $this->getCountString( + $result->notImplementedCount(), 'Incomplete' + ), + $this->getCountString( + $result->skippedCount(), 'Skipped' + ) + ) + ); + + if ($this->colors) { + $this->write("\x1b[0m\x1b[2K"); + } + } + + else { + $this->write("\n"); + + if ($this->colors) { + $this->write( + "\x1b[37;41m\x1b[2KFAILURES!\n\x1b[0m\x1b[37;41m\x1b[2K" + ); + } else { + $this->write("FAILURES!\n"); + } + + $this->write( + sprintf( + "Tests: %d, Assertions: %s%s%s%s%s.\n", + + count($result), + $this->numAssertions, + $this->getCountString($result->failureCount(), 'Failures'), + $this->getCountString($result->errorCount(), 'Errors'), + $this->getCountString( + $result->notImplementedCount(), 'Incomplete' + ), + $this->getCountString($result->skippedCount(), 'Skipped') + ) + ); + + if ($this->colors) { + $this->write("\x1b[0m\x1b[2K"); + } + } + + if (!$this->verbose && + $result->deprecatedFeaturesCount() > 0) { + $message = sprintf( + "Warning: Deprecated PHPUnit features are being used %s times!\n" . + "Use --verbose for more information.\n", + $result->deprecatedFeaturesCount() + ); + + if ($this->colors) { + $message = "\x1b[37;41m\x1b[2K" . $message . + "\x1b[0m"; + } + + $this->write("\n" . $message); + } + } + + /** + * @param integer $count + * @param string $name + * @return string + * @since Method available since Release 3.0.0 + */ + protected function getCountString($count, $name) + { + $string = ''; + + if ($count > 0) { + $string = sprintf( + ', %s: %d', + + $name, + $count + ); + } + + return $string; + } + + /** + */ + public function printWaitPrompt() + { + $this->write("\n<RETURN> to continue\n"); + } + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->colors) { + $this->writeProgress("\x1b[31;1mE\x1b[0m"); + } else { + $this->writeProgress('E'); + } + + $this->lastTestFailed = TRUE; + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + if ($this->colors) { + $this->writeProgress("\x1b[41;37mF\x1b[0m"); + } else { + $this->writeProgress('F'); + } + + $this->lastTestFailed = TRUE; + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->colors) { + $this->writeProgress("\x1b[33;1mI\x1b[0m"); + } else { + $this->writeProgress('I'); + } + + $this->lastTestFailed = TRUE; + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->colors) { + $this->writeProgress("\x1b[36;1mS\x1b[0m"); + } else { + $this->writeProgress('S'); + } + + $this->lastTestFailed = TRUE; + } + + /** + * A testsuite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + if ($this->numTests == -1) { + $this->numTests = count($suite); + $this->numTestsWidth = strlen((string)$this->numTests); + $this->maxColumn = 69 - (2 * $this->numTestsWidth); + } + } + + /** + * A testsuite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + if ($this->debug) { + $this->write( + sprintf( + "\nStarting test '%s'.\n", PHPUnit_Util_Test::describe($test) + ) + ); + } + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if (!$this->lastTestFailed) { + $this->writeProgress('.'); + } + + if ($test instanceof PHPUnit_Framework_TestCase) { + $this->numAssertions += $test->getNumAssertions(); + } + + else if ($test instanceof PHPUnit_Extensions_PhptTestCase) { + $this->numAssertions++; + } + + $this->lastTestFailed = FALSE; + + if ($test instanceof PHPUnit_Framework_TestCase) { + if (!$test->hasPerformedExpectationsOnOutput()) { + $this->write($test->getActualOutput()); + } + } + } + + /** + * @param string $progress + */ + protected function writeProgress($progress) + { + $this->write($progress); + $this->column++; + $this->numTestsRun++; + + if ($this->column == $this->maxColumn) { + $this->write( + sprintf( + ' %' . $this->numTestsWidth . 'd / %' . + $this->numTestsWidth . 'd (%3s%%)', + + $this->numTestsRun, + $this->numTests, + floor(($this->numTestsRun / $this->numTests) * 100) + ) + ); + + $this->writeNewLine(); + } + } + + protected function writeNewLine() + { + $this->column = 0; + $this->write("\n"); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php @@ -0,0 +1,818 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * A TestRunner for the Command Line Interface (CLI) + * PHP SAPI Module. + * + * @package PHPUnit + * @subpackage TextUI + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner +{ + const SUCCESS_EXIT = 0; + const FAILURE_EXIT = 1; + const EXCEPTION_EXIT = 2; + + /** + * @var PHP_CodeCoverage_Filter + */ + protected $codeCoverageFilter; + + /** + * @var PHPUnit_Runner_TestSuiteLoader + */ + protected $loader = NULL; + + /** + * @var PHPUnit_TextUI_ResultPrinter + */ + protected $printer = NULL; + + /** + * @var boolean + */ + protected static $versionStringPrinted = FALSE; + + /** + * @param PHPUnit_Runner_TestSuiteLoader $loader + * @param PHP_CodeCoverage_Filter $filter + * @since Method available since Release 3.4.0 + */ + public function __construct(PHPUnit_Runner_TestSuiteLoader $loader = NULL, PHP_CodeCoverage_Filter $filter = NULL) + { + if ($filter === NULL) { + $filter = new PHP_CodeCoverage_Filter; + } + + $this->codeCoverageFilter = $filter; + $this->loader = $loader; + } + + /** + * @param mixed $test + * @param array $arguments + * @throws PHPUnit_Framework_Exception + */ + public static function run($test, array $arguments = array()) + { + if ($test instanceof ReflectionClass) { + $test = new PHPUnit_Framework_TestSuite($test); + } + + if ($test instanceof PHPUnit_Framework_Test) { + $aTestRunner = new PHPUnit_TextUI_TestRunner; + + return $aTestRunner->doRun( + $test, + $arguments + ); + } else { + throw new PHPUnit_Framework_Exception( + 'No test case or test suite found.' + ); + } + } + + /** + * @return PHPUnit_Framework_TestResult + */ + protected function createTestResult() + { + return new PHPUnit_Framework_TestResult; + } + + /** + * @param PHPUnit_Framework_Test $suite + * @param array $arguments + * @return PHPUnit_Framework_TestResult + */ + public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array()) + { + $this->handleConfiguration($arguments); + + if (isset($arguments['bootstrap'])) { + $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap']; + } + + if ($arguments['backupGlobals'] === FALSE) { + $suite->setBackupGlobals(FALSE); + } + + if ($arguments['backupStaticAttributes'] === TRUE) { + $suite->setBackupStaticAttributes(TRUE); + } + + if (is_integer($arguments['repeat'])) { + $test = new PHPUnit_Extensions_RepeatedTest( + $suite, + $arguments['repeat'], + $arguments['filter'], + $arguments['groups'], + $arguments['excludeGroups'], + $arguments['processIsolation'] + ); + + $suite = new PHPUnit_Framework_TestSuite(); + $suite->addTest($test); + } + + $result = $this->createTestResult(); + + if (!$arguments['convertErrorsToExceptions']) { + $result->convertErrorsToExceptions(FALSE); + } + + if (!$arguments['convertNoticesToExceptions']) { + PHPUnit_Framework_Error_Notice::$enabled = FALSE; + } + + if (!$arguments['convertWarningsToExceptions']) { + PHPUnit_Framework_Error_Warning::$enabled = FALSE; + } + + if ($arguments['stopOnError']) { + $result->stopOnError(TRUE); + } + + if ($arguments['stopOnFailure']) { + $result->stopOnFailure(TRUE); + } + + if ($arguments['stopOnIncomplete']) { + $result->stopOnIncomplete(TRUE); + } + + if ($arguments['stopOnSkipped']) { + $result->stopOnSkipped(TRUE); + } + + if ($this->printer === NULL) { + if (isset($arguments['printer']) && + $arguments['printer'] instanceof PHPUnit_Util_Printer) { + $this->printer = $arguments['printer']; + } else { + $this->printer = new PHPUnit_TextUI_ResultPrinter( + NULL, + $arguments['verbose'], + $arguments['colors'], + $arguments['debug'] + ); + } + } + + if (!$this->printer instanceof PHPUnit_Util_Log_TAP) { + $this->printer->write( + PHPUnit_Runner_Version::getVersionString() . "\n\n" + ); + + self::$versionStringPrinted = TRUE; + + if (isset($arguments['configuration'])) { + $this->printer->write( + sprintf( + "Configuration read from %s\n\n", + $arguments['configuration']->getFilename() + ) + ); + } + } + + foreach ($arguments['listeners'] as $listener) { + $result->addListener($listener); + } + + $result->addListener($this->printer); + + if ($this->printer instanceof PHPUnit_TextUI_ResultPrinter) { + $result->addListener(new PHPUnit_Util_DeprecatedFeature_Logger); + } + + if (isset($arguments['testdoxHTMLFile'])) { + $result->addListener( + new PHPUnit_Util_TestDox_ResultPrinter_HTML( + $arguments['testdoxHTMLFile'] + ) + ); + } + + if (isset($arguments['testdoxTextFile'])) { + $result->addListener( + new PHPUnit_Util_TestDox_ResultPrinter_Text( + $arguments['testdoxTextFile'] + ) + ); + } + + $codeCoverageReports = 0; + + if (extension_loaded('xdebug')) { + if (isset($arguments['coverageClover'])) { + $codeCoverageReports++; + } + + if (isset($arguments['reportDirectory'])) { + $codeCoverageReports++; + } + + if (isset($arguments['coveragePHP'])) { + $codeCoverageReports++; + } + + if (isset($arguments['coverageText'])) { + $codeCoverageReports++; + } + } + + if ($codeCoverageReports > 0) { + $codeCoverage = new PHP_CodeCoverage( + NULL, $this->codeCoverageFilter + ); + + $codeCoverage->setAddUncoveredFilesFromWhitelist( + $arguments['addUncoveredFilesFromWhitelist'] + ); + + $codeCoverage->setProcessUncoveredFilesFromWhitelist( + $arguments['processUncoveredFilesFromWhitelist'] + ); + + if (isset($arguments['forceCoversAnnotation'])) { + $codeCoverage->setForceCoversAnnotation( + $arguments['forceCoversAnnotation'] + ); + } + + if (isset($arguments['mapTestClassNameToCoveredClassName'])) { + $codeCoverage->setMapTestClassNameToCoveredClassName( + $arguments['mapTestClassNameToCoveredClassName'] + ); + } + + $result->setCodeCoverage($codeCoverage); + } + + if ($codeCoverageReports > 1) { + if (isset($arguments['cacheTokens'])) { + $codeCoverage->setCacheTokens($arguments['cacheTokens']); + } + } + + if (isset($arguments['jsonLogfile'])) { + $result->addListener( + new PHPUnit_Util_Log_JSON($arguments['jsonLogfile']) + ); + } + + if (isset($arguments['tapLogfile'])) { + $result->addListener( + new PHPUnit_Util_Log_TAP($arguments['tapLogfile']) + ); + } + + if (isset($arguments['junitLogfile'])) { + $result->addListener( + new PHPUnit_Util_Log_JUnit( + $arguments['junitLogfile'], $arguments['logIncompleteSkipped'] + ) + ); + } + + if ($arguments['strict']) { + $result->strictMode(TRUE); + + $result->setTimeoutForSmallTests( + $arguments['timeoutForSmallTests'] + ); + + $result->setTimeoutForMediumTests( + $arguments['timeoutForMediumTests'] + ); + + $result->setTimeoutForLargeTests( + $arguments['timeoutForLargeTests'] + ); + } + + $suite->run( + $result, + $arguments['filter'], + $arguments['groups'], + $arguments['excludeGroups'], + $arguments['processIsolation'] + ); + + unset($suite); + $result->flushListeners(); + + if ($this->printer instanceof PHPUnit_TextUI_ResultPrinter) { + $this->printer->printResult($result); + } + + if (isset($codeCoverage)) { + if (isset($arguments['coverageClover'])) { + $this->printer->write( + "\nGenerating code coverage report in Clover XML format ..." + ); + + $writer = new PHP_CodeCoverage_Report_Clover; + $writer->process($codeCoverage, $arguments['coverageClover']); + + $this->printer->write(" done\n"); + unset($writer); + } + + if (isset($arguments['reportDirectory'])) { + $this->printer->write( + "\nGenerating code coverage report in HTML format ..." + ); + + $writer = new PHP_CodeCoverage_Report_HTML( + $arguments['reportCharset'], + $arguments['reportHighlight'], + $arguments['reportLowUpperBound'], + $arguments['reportHighLowerBound'], + sprintf( + ' and <a href="http://phpunit.de/">PHPUnit %s</a>', + PHPUnit_Runner_Version::id() + ) + ); + + $writer->process($codeCoverage, $arguments['reportDirectory']); + + $this->printer->write(" done\n"); + unset($writer); + } + + if (isset($arguments['coveragePHP'])) { + $this->printer->write( + "\nGenerating code coverage report in PHP format ..." + ); + + $writer = new PHP_CodeCoverage_Report_PHP; + $writer->process($codeCoverage, $arguments['coveragePHP']); + + $this->printer->write(" done\n"); + unset($writer); + } + + if (isset($arguments['coverageText'])) { + if ($arguments['coverageText'] == 'php://stdout') { + $outputStream = $this->printer; + $colors = (bool)$arguments['colors']; + } else { + $outputStream = new PHPUnit_Util_Printer($arguments['coverageText']); + $colors = FALSE; + } + + $writer = new PHP_CodeCoverage_Report_Text( + $outputStream, + $arguments['reportLowUpperBound'], + $arguments['reportHighLowerBound'], + $arguments['coverageTextShowUncoveredFiles'] + ); + + $writer->process($codeCoverage, $colors); + } + } + + return $result; + } + + /** + * @param PHPUnit_TextUI_ResultPrinter $resultPrinter + */ + public function setPrinter(PHPUnit_TextUI_ResultPrinter $resultPrinter) + { + $this->printer = $resultPrinter; + } + + /** + * Override to define how to handle a failed loading of + * a test suite. + * + * @param string $message + */ + protected function runFailed($message) + { + self::printVersionString(); + self::write($message . PHP_EOL); + exit(self::FAILURE_EXIT); + } + + /** + * @param string $buffer + * @since Method available since Release 3.1.0 + */ + protected static function write($buffer) + { + if (PHP_SAPI != 'cli') { + $buffer = htmlspecialchars($buffer); + } + + print $buffer; + } + + /** + * Returns the loader to be used. + * + * @return PHPUnit_Runner_TestSuiteLoader + * @since Method available since Release 2.2.0 + */ + public function getLoader() + { + if ($this->loader === NULL) { + $this->loader = new PHPUnit_Runner_StandardTestSuiteLoader; + } + + return $this->loader; + } + + /** + */ + public static function showError($message) + { + self::printVersionString(); + self::write($message . "\n"); + + exit(self::FAILURE_EXIT); + } + + /** + */ + public static function printVersionString() + { + if (!self::$versionStringPrinted) { + self::write(PHPUnit_Runner_Version::getVersionString() . "\n\n"); + self::$versionStringPrinted = TRUE; + } + } + + /** + * @param array $arguments + * @since Method available since Release 3.2.1 + */ + protected function handleConfiguration(array &$arguments) + { + if (isset($arguments['configuration']) && + !$arguments['configuration'] instanceof PHPUnit_Util_Configuration) { + $arguments['configuration'] = PHPUnit_Util_Configuration::getInstance( + $arguments['configuration'] + ); + } + + $arguments['debug'] = isset($arguments['debug']) ? $arguments['debug'] : FALSE; + $arguments['filter'] = isset($arguments['filter']) ? $arguments['filter'] : FALSE; + $arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array(); + + if (isset($arguments['configuration'])) { + $arguments['configuration']->handlePHPConfiguration(); + + $phpunitConfiguration = $arguments['configuration']->getPHPUnitConfiguration(); + + if (isset($phpunitConfiguration['backupGlobals']) && + !isset($arguments['backupGlobals'])) { + $arguments['backupGlobals'] = $phpunitConfiguration['backupGlobals']; + } + + if (isset($phpunitConfiguration['backupStaticAttributes']) && + !isset($arguments['backupStaticAttributes'])) { + $arguments['backupStaticAttributes'] = $phpunitConfiguration['backupStaticAttributes']; + } + + if (isset($phpunitConfiguration['bootstrap']) && + !isset($arguments['bootstrap'])) { + $arguments['bootstrap'] = $phpunitConfiguration['bootstrap']; + } + + if (isset($phpunitConfiguration['cacheTokens']) && + !isset($arguments['cacheTokens'])) { + $arguments['cacheTokens'] = $phpunitConfiguration['cacheTokens']; + } + + if (isset($phpunitConfiguration['colors']) && + !isset($arguments['colors'])) { + $arguments['colors'] = $phpunitConfiguration['colors']; + } + + if (isset($phpunitConfiguration['convertErrorsToExceptions']) && + !isset($arguments['convertErrorsToExceptions'])) { + $arguments['convertErrorsToExceptions'] = $phpunitConfiguration['convertErrorsToExceptions']; + } + + if (isset($phpunitConfiguration['convertNoticesToExceptions']) && + !isset($arguments['convertNoticesToExceptions'])) { + $arguments['convertNoticesToExceptions'] = $phpunitConfiguration['convertNoticesToExceptions']; + } + + if (isset($phpunitConfiguration['convertWarningsToExceptions']) && + !isset($arguments['convertWarningsToExceptions'])) { + $arguments['convertWarningsToExceptions'] = $phpunitConfiguration['convertWarningsToExceptions']; + } + + if (isset($phpunitConfiguration['processIsolation']) && + !isset($arguments['processIsolation'])) { + $arguments['processIsolation'] = $phpunitConfiguration['processIsolation']; + } + + if (isset($phpunitConfiguration['stopOnFailure']) && + !isset($arguments['stopOnFailure'])) { + $arguments['stopOnFailure'] = $phpunitConfiguration['stopOnFailure']; + } + + if (isset($phpunitConfiguration['timeoutForSmallTests']) && + !isset($arguments['timeoutForSmallTests'])) { + $arguments['timeoutForSmallTests'] = $phpunitConfiguration['timeoutForSmallTests']; + } + + if (isset($phpunitConfiguration['timeoutForMediumTests']) && + !isset($arguments['timeoutForMediumTests'])) { + $arguments['timeoutForMediumTests'] = $phpunitConfiguration['timeoutForMediumTests']; + } + + if (isset($phpunitConfiguration['timeoutForLargeTests']) && + !isset($arguments['timeoutForLargeTests'])) { + $arguments['timeoutForLargeTests'] = $phpunitConfiguration['timeoutForLargeTests']; + } + + if (isset($phpunitConfiguration['strict']) && + !isset($arguments['strict'])) { + $arguments['strict'] = $phpunitConfiguration['strict']; + } + + if (isset($phpunitConfiguration['verbose']) && + !isset($arguments['verbose'])) { + $arguments['verbose'] = $phpunitConfiguration['verbose']; + } + + if (isset($phpunitConfiguration['forceCoversAnnotation']) && + !isset($arguments['forceCoversAnnotation'])) { + $arguments['forceCoversAnnotation'] = $phpunitConfiguration['forceCoversAnnotation']; + } + + if (isset($phpunitConfiguration['mapTestClassNameToCoveredClassName']) && + !isset($arguments['mapTestClassNameToCoveredClassName'])) { + $arguments['mapTestClassNameToCoveredClassName'] = $phpunitConfiguration['mapTestClassNameToCoveredClassName']; + } + + $groupCliArgs = array(); + if (!empty($arguments['groups'])) { + $groupCliArgs = $arguments['groups']; + } + + $groupConfiguration = $arguments['configuration']->getGroupConfiguration(); + + if (!empty($groupConfiguration['include']) && + !isset($arguments['groups'])) { + $arguments['groups'] = $groupConfiguration['include']; + } + + if (!empty($groupConfiguration['exclude']) && + !isset($arguments['excludeGroups'])) { + $arguments['excludeGroups'] = array_diff($groupConfiguration['exclude'], $groupCliArgs); + } + + foreach ($arguments['configuration']->getListenerConfiguration() as $listener) { + if (!class_exists($listener['class'], FALSE) && + $listener['file'] !== '') { + require_once $listener['file']; + } + + if (class_exists($listener['class'])) { + if (count($listener['arguments']) == 0) { + $listener = new $listener['class']; + } else { + $listenerClass = new ReflectionClass( + $listener['class'] + ); + $listener = $listenerClass->newInstanceArgs( + $listener['arguments'] + ); + } + + if ($listener instanceof PHPUnit_Framework_TestListener) { + $arguments['listeners'][] = $listener; + } + } + } + + $loggingConfiguration = $arguments['configuration']->getLoggingConfiguration(); + + if (isset($loggingConfiguration['coverage-html']) && + !isset($arguments['reportDirectory'])) { + if (isset($loggingConfiguration['charset']) && + !isset($arguments['reportCharset'])) { + $arguments['reportCharset'] = $loggingConfiguration['charset']; + } + + if (isset($loggingConfiguration['highlight']) && + !isset($arguments['reportHighlight'])) { + $arguments['reportHighlight'] = $loggingConfiguration['highlight']; + } + + if (isset($loggingConfiguration['lowUpperBound']) && + !isset($arguments['reportLowUpperBound'])) { + $arguments['reportLowUpperBound'] = $loggingConfiguration['lowUpperBound']; + } + + if (isset($loggingConfiguration['highLowerBound']) && + !isset($arguments['reportHighLowerBound'])) { + $arguments['reportHighLowerBound'] = $loggingConfiguration['highLowerBound']; + } + + $arguments['reportDirectory'] = $loggingConfiguration['coverage-html']; + } + + if (isset($loggingConfiguration['coverage-clover']) && + !isset($arguments['coverageClover'])) { + $arguments['coverageClover'] = $loggingConfiguration['coverage-clover']; + } + + if (isset($loggingConfiguration['coverage-php']) && + !isset($arguments['coveragePHP'])) { + $arguments['coveragePHP'] = $loggingConfiguration['coverage-php']; + } + + if (isset($loggingConfiguration['coverage-text']) && + !isset($arguments['coverageText'])) { + $arguments['coverageText'] = $loggingConfiguration['coverage-text']; + if (isset($loggingConfiguration['coverageTextShowUncoveredFiles'])) { + $arguments['coverageTextShowUncoveredFiles'] = $loggingConfiguration['coverageTextShowUncoveredFiles']; + } else { + $arguments['coverageTextShowUncoveredFiles'] = FALSE; + } + } + + if (isset($loggingConfiguration['json']) && + !isset($arguments['jsonLogfile'])) { + $arguments['jsonLogfile'] = $loggingConfiguration['json']; + } + + if (isset($loggingConfiguration['plain'])) { + $arguments['listeners'][] = new PHPUnit_TextUI_ResultPrinter( + $loggingConfiguration['plain'], TRUE + ); + } + + if (isset($loggingConfiguration['tap']) && + !isset($arguments['tapLogfile'])) { + $arguments['tapLogfile'] = $loggingConfiguration['tap']; + } + + if (isset($loggingConfiguration['junit']) && + !isset($arguments['junitLogfile'])) { + $arguments['junitLogfile'] = $loggingConfiguration['junit']; + + if (isset($loggingConfiguration['logIncompleteSkipped']) && + !isset($arguments['logIncompleteSkipped'])) { + $arguments['logIncompleteSkipped'] = $loggingConfiguration['logIncompleteSkipped']; + } + } + + if (isset($loggingConfiguration['testdox-html']) && + !isset($arguments['testdoxHTMLFile'])) { + $arguments['testdoxHTMLFile'] = $loggingConfiguration['testdox-html']; + } + + if (isset($loggingConfiguration['testdox-text']) && + !isset($arguments['testdoxTextFile'])) { + $arguments['testdoxTextFile'] = $loggingConfiguration['testdox-text']; + } + + if ((isset($arguments['coverageClover']) || + isset($arguments['reportDirectory']) || + isset($arguments['coveragePHP']) || + isset($arguments['coverageText'])) && + extension_loaded('xdebug')) { + + $filterConfiguration = $arguments['configuration']->getFilterConfiguration(); + $arguments['addUncoveredFilesFromWhitelist'] = $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist']; + $arguments['processUncoveredFilesFromWhitelist'] = $filterConfiguration['whitelist']['processUncoveredFilesFromWhitelist']; + + foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) { + $this->codeCoverageFilter->addDirectoryToBlacklist( + $dir['path'], $dir['suffix'], $dir['prefix'], $dir['group'] + ); + } + + foreach ($filterConfiguration['blacklist']['include']['file'] as $file) { + $this->codeCoverageFilter->addFileToBlacklist($file); + } + + foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) { + $this->codeCoverageFilter->removeDirectoryFromBlacklist( + $dir['path'], $dir['suffix'], $dir['prefix'], $dir['group'] + ); + } + + foreach ($filterConfiguration['blacklist']['exclude']['file'] as $file) { + $this->codeCoverageFilter->removeFileFromBlacklist($file); + } + + foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) { + $this->codeCoverageFilter->addDirectoryToWhitelist( + $dir['path'], $dir['suffix'], $dir['prefix'] + ); + } + + foreach ($filterConfiguration['whitelist']['include']['file'] as $file) { + $this->codeCoverageFilter->addFileToWhitelist($file); + } + + foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) { + $this->codeCoverageFilter->removeDirectoryFromWhitelist( + $dir['path'], $dir['suffix'], $dir['prefix'] + ); + } + + foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) { + $this->codeCoverageFilter->removeFileFromWhitelist($file); + } + } + } + + $arguments['addUncoveredFilesFromWhitelist'] = isset($arguments['addUncoveredFilesFromWhitelist']) ? $arguments['addUncoveredFilesFromWhitelist'] : TRUE; + $arguments['processUncoveredFilesFromWhitelist'] = isset($arguments['processUncoveredFilesFromWhitelist']) ? $arguments['processUncoveredFilesFromWhitelist'] : FALSE; + $arguments['backupGlobals'] = isset($arguments['backupGlobals']) ? $arguments['backupGlobals'] : NULL; + $arguments['backupStaticAttributes'] = isset($arguments['backupStaticAttributes']) ? $arguments['backupStaticAttributes'] : NULL; + $arguments['cacheTokens'] = isset($arguments['cacheTokens']) ? $arguments['cacheTokens'] : FALSE; + $arguments['colors'] = isset($arguments['colors']) ? $arguments['colors'] : FALSE; + $arguments['convertErrorsToExceptions'] = isset($arguments['convertErrorsToExceptions']) ? $arguments['convertErrorsToExceptions'] : TRUE; + $arguments['convertNoticesToExceptions'] = isset($arguments['convertNoticesToExceptions']) ? $arguments['convertNoticesToExceptions'] : TRUE; + $arguments['convertWarningsToExceptions'] = isset($arguments['convertWarningsToExceptions']) ? $arguments['convertWarningsToExceptions'] : TRUE; + $arguments['excludeGroups'] = isset($arguments['excludeGroups']) ? $arguments['excludeGroups'] : array(); + $arguments['groups'] = isset($arguments['groups']) ? $arguments['groups'] : array(); + $arguments['logIncompleteSkipped'] = isset($arguments['logIncompleteSkipped']) ? $arguments['logIncompleteSkipped'] : FALSE; + $arguments['processIsolation'] = isset($arguments['processIsolation']) ? $arguments['processIsolation'] : FALSE; + $arguments['repeat'] = isset($arguments['repeat']) ? $arguments['repeat'] : FALSE; + $arguments['reportCharset'] = isset($arguments['reportCharset']) ? $arguments['reportCharset'] : 'UTF-8'; + $arguments['reportHighlight'] = isset($arguments['reportHighlight']) ? $arguments['reportHighlight'] : FALSE; + $arguments['reportHighLowerBound'] = isset($arguments['reportHighLowerBound']) ? $arguments['reportHighLowerBound'] : 70; + $arguments['reportLowUpperBound'] = isset($arguments['reportLowUpperBound']) ? $arguments['reportLowUpperBound'] : 35; + $arguments['stopOnError'] = isset($arguments['stopOnError']) ? $arguments['stopOnError'] : FALSE; + $arguments['stopOnFailure'] = isset($arguments['stopOnFailure']) ? $arguments['stopOnFailure'] : FALSE; + $arguments['stopOnIncomplete'] = isset($arguments['stopOnIncomplete']) ? $arguments['stopOnIncomplete'] : FALSE; + $arguments['stopOnSkipped'] = isset($arguments['stopOnSkipped']) ? $arguments['stopOnSkipped'] : FALSE; + $arguments['timeoutForSmallTests'] = isset($arguments['timeoutForSmallTests']) ? $arguments['timeoutForSmallTests'] : 1; + $arguments['timeoutForMediumTests'] = isset($arguments['timeoutForMediumTests']) ? $arguments['timeoutForMediumTests'] : 10; + $arguments['timeoutForLargeTests'] = isset($arguments['timeoutForLargeTests']) ? $arguments['timeoutForLargeTests'] : 60; + $arguments['strict'] = isset($arguments['strict']) ? $arguments['strict'] : FALSE; + $arguments['verbose'] = isset($arguments['verbose']) ? $arguments['verbose'] : FALSE; + + if ($arguments['filter'] !== FALSE && + preg_match('/^[a-zA-Z0-9_]/', $arguments['filter'])) { + // Escape delimiters in regular expression. Do NOT use preg_quote, + // to keep magic characters. + $arguments['filter'] = '/' . str_replace( + '/', '\\/', $arguments['filter'] + ) . '/'; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Class.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Class.php @@ -0,0 +1,363 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * Class helpers. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ +class PHPUnit_Util_Class +{ + protected static $buffer = array(); + + /** + * Starts the collection of loaded classes. + * + */ + public static function collectStart() + { + self::$buffer = get_declared_classes(); + } + + /** + * Stops the collection of loaded classes and + * returns the names of the loaded classes. + * + * @return array + */ + public static function collectEnd() + { + return array_values( + array_diff(get_declared_classes(), self::$buffer) + ); + } + + /** + * Returns the class hierarchy for a given class. + * + * @param string $className + * @param boolean $asReflectionObjects + * @return array + */ + public static function getHierarchy($className, $asReflectionObjects = FALSE) + { + if ($asReflectionObjects) { + $classes = array(new ReflectionClass($className)); + } else { + $classes = array($className); + } + + $done = FALSE; + + while (!$done) { + if ($asReflectionObjects) { + $class = new ReflectionClass( + $classes[count($classes)-1]->getName() + ); + } else { + $class = new ReflectionClass($classes[count($classes)-1]); + } + + $parent = $class->getParentClass(); + + if ($parent !== FALSE) { + if ($asReflectionObjects) { + $classes[] = $parent; + } else { + $classes[] = $parent->getName(); + } + } else { + $done = TRUE; + } + } + + return $classes; + } + + /** + * Returns the parameters of a function or method. + * + * @param ReflectionFunction|ReflectionMethod $method + * @param boolean $forCall + * @return string + * @since Method available since Release 3.2.0 + */ + public static function getMethodParameters($method, $forCall = FALSE) + { + $parameters = array(); + + foreach ($method->getParameters() as $i => $parameter) { + $name = '$' . $parameter->getName(); + + /* Note: PHP extensions may use empty names for reference arguments + * or "..." for methods taking a variable number of arguments. + */ + if ($name === '$' || $name === '$...') { + $name = '$arg' . $i; + } + + $default = ''; + $reference = ''; + $typeHint = ''; + + if (!$forCall) { + if ($parameter->isArray()) { + $typeHint = 'array '; + } + + else if (version_compare(PHP_VERSION, '5.4', '>') && + $parameter->isCallable()) { + $typeHint = 'callable '; + } + + else { + try { + $class = $parameter->getClass(); + } + + catch (ReflectionException $e) { + $class = FALSE; + } + + if ($class) { + $typeHint = $class->getName() . ' '; + } + } + + if ($parameter->isDefaultValueAvailable()) { + $value = $parameter->getDefaultValue(); + $default = ' = ' . var_export($value, TRUE); + } + + else if ($parameter->isOptional()) { + $default = ' = null'; + } + } + + if ($parameter->isPassedByReference()) { + $reference = '&'; + } + + $parameters[] = $typeHint . $reference . $name . $default; + } + + return join(', ', $parameters); + } + + /** + * Returns the package information of a user-defined class. + * + * @param string $className + * @param string $docComment + * @return array + */ + public static function getPackageInformation($className, $docComment) + { + $result = array( + 'namespace' => '', + 'fullPackage' => '', + 'category' => '', + 'package' => '', + 'subpackage' => '' + ); + + if (strpos($className, '\\') !== FALSE) { + $result['namespace'] = self::arrayToName( + explode('\\', $className) + ); + } + + if (preg_match('/@category[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['category'] = $matches[1]; + } + + if (preg_match('/@package[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['package'] = $matches[1]; + $result['fullPackage'] = $matches[1]; + } + + if (preg_match('/@subpackage[\s]+([\.\w]+)/', $docComment, $matches)) { + $result['subpackage'] = $matches[1]; + $result['fullPackage'] .= '.' . $matches[1]; + } + + if (empty($result['fullPackage'])) { + $result['fullPackage'] = self::arrayToName( + explode('_', str_replace('\\', '_', $className)), '.' + ); + } + + return $result; + } + + /** + * Returns the value of a static attribute. + * This also works for attributes that are declared protected or private. + * + * @param string $className + * @param string $attributeName + * @return mixed + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.4.0 + */ + public static function getStaticAttribute($className, $attributeName) + { + if (!is_string($className)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); + } + + if (!class_exists($className)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'class name'); + } + + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + $class = new ReflectionClass($className); + + while ($class) { + $attributes = $class->getStaticProperties(); + + if (array_key_exists($attributeName, $attributes)) { + return $attributes[$attributeName]; + } + + $class = $class->getParentClass(); + } + + throw new PHPUnit_Framework_Exception( + sprintf( + 'Attribute "%s" not found in class.', + + $attributeName + ) + ); + } + + /** + * Returns the value of an object's attribute. + * This also works for attributes that are declared protected or private. + * + * @param object $object + * @param string $attributeName + * @return mixed + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.4.0 + */ + public static function getObjectAttribute($object, $attributeName) + { + if (!is_object($object)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'object'); + } + + if (!is_string($attributeName)) { + throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string'); + } + + try { + $attribute = new ReflectionProperty($object, $attributeName); + } + + catch (ReflectionException $e) { + $reflector = new ReflectionObject($object); + + while ($reflector = $reflector->getParentClass()) { + try { + $attribute = $reflector->getProperty($attributeName); + break; + } + + catch(ReflectionException $e) { + } + } + } + + if (isset($attribute)) { + if (!$attribute || $attribute->isPublic()) { + return $object->$attributeName; + } + $attribute->setAccessible(TRUE); + $value = $attribute->getValue($object); + $attribute->setAccessible(FALSE); + + return $value; + } + + throw new PHPUnit_Framework_Exception( + sprintf( + 'Attribute "%s" not found in object.', + $attributeName + ) + ); + } + + /** + * Returns the package information of a user-defined class. + * + * @param array $parts + * @param string $join + * @return string + * @since Method available since Release 3.2.12 + */ + protected static function arrayToName(array $parts, $join = '\\') + { + $result = ''; + + if (count($parts) > 1) { + array_pop($parts); + + $result = join($join, $parts); + } + + return $result; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php @@ -0,0 +1,1039 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.2.0 + */ + +/** + * Wrapper for the PHPUnit XML configuration file. + * + * Example XML configuration file: + * <code> + * <?xml version="1.0" encoding="utf-8" ?> + * + * <phpunit backupGlobals="true" + * backupStaticAttributes="false" + * bootstrap="/path/to/bootstrap.php" + * cacheTokens="false" + * colors="false" + * convertErrorsToExceptions="true" + * convertNoticesToExceptions="true" + * convertWarningsToExceptions="true" + * forceCoversAnnotation="false" + * mapTestClassNameToCoveredClassName="false" + * printerClass="PHPUnit_TextUI_ResultPrinter" + * processIsolation="false" + * stopOnError="false" + * stopOnFailure="false" + * stopOnIncomplete="false" + * stopOnSkipped="false" + * testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" + * timeoutForSmallTests="1" + * timeoutForMediumTests="10" + * timeoutForLargeTests="60" + * strict="false" + * verbose="false"> + * <testsuites> + * <testsuite name="My Test Suite"> + * <directory suffix="Test.php" phpVersion="5.3.0" phpVersionOperator=">=">/path/to/files</directory> + * <file phpVersion="5.3.0" phpVersionOperator=">=">/path/to/MyTest.php</file> + * <exclude>/path/to/files/exclude</exclude> + * </testsuite> + * </testsuites> + * + * <groups> + * <include> + * <group>name</group> + * </include> + * <exclude> + * <group>name</group> + * </exclude> + * </groups> + * + * <filter> + * <blacklist> + * <directory suffix=".php">/path/to/files</directory> + * <file>/path/to/file</file> + * <exclude> + * <directory suffix=".php">/path/to/files</directory> + * <file>/path/to/file</file> + * </exclude> + * </blacklist> + * <whitelist addUncoveredFilesFromWhitelist="true" + * processUncoveredFilesFromWhitelist="false"> + * <directory suffix=".php">/path/to/files</directory> + * <file>/path/to/file</file> + * <exclude> + * <directory suffix=".php">/path/to/files</directory> + * <file>/path/to/file</file> + * </exclude> + * </whitelist> + * </filter> + * + * <listeners> + * <listener class="MyListener" file="/optional/path/to/MyListener.php"> + * <arguments> + * <array> + * <element key="0"> + * <string>Sebastian</string> + * </element> + * </array> + * <integer>22</integer> + * <string>April</string> + * <double>19.78</double> + * <null/> + * <object class="stdClass"/> + * <file>MyRelativeFile.php</file> + * <directory>MyRelativeDir</directory> + * </arguments> + * </listener> + * </listeners> + * + * <logging> + * <log type="coverage-html" target="/tmp/report" + charset="UTF-8" highlight="false" + * lowUpperBound="35" highLowerBound="70"/> + * <log type="coverage-clover" target="/tmp/clover.xml"/> + * <log type="json" target="/tmp/logfile.json"/> + * <log type="plain" target="/tmp/logfile.txt"/> + * <log type="tap" target="/tmp/logfile.tap"/> + * <log type="junit" target="/tmp/logfile.xml" logIncompleteSkipped="false"/> + * <log type="testdox-html" target="/tmp/testdox.html"/> + * <log type="testdox-text" target="/tmp/testdox.txt"/> + * </logging> + * + * <php> + * <includePath>.</includePath> + * <ini name="foo" value="bar"/> + * <const name="foo" value="bar"/> + * <var name="foo" value="bar"/> + * <env name="foo" value="bar"/> + * <post name="foo" value="bar"/> + * <get name="foo" value="bar"/> + * <cookie name="foo" value="bar"/> + * <server name="foo" value="bar"/> + * <files name="foo" value="bar"/> + * <request name="foo" value="bar"/> + * </php> + * + * <selenium> + * <browser name="Firefox on Linux" + * browser="*firefox /usr/lib/firefox/firefox-bin" + * host="my.linux.box" + * port="4444" + * timeout="30000"/> + * </selenium> + * </phpunit> + * </code> + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.2.0 + */ +class PHPUnit_Util_Configuration +{ + private static $instances = array(); + + protected $document; + protected $xpath; + protected $filename; + + /** + * Loads a PHPUnit configuration file. + * + * @param string $filename + */ + protected function __construct($filename) + { + $this->filename = $filename; + $this->document = PHPUnit_Util_XML::loadFile($filename, FALSE, TRUE); + $this->xpath = new DOMXPath($this->document); + } + + /** + * @since Method available since Release 3.4.0 + */ + private final function __clone() + { + } + + /** + * Returns a PHPUnit configuration object. + * + * @param string $filename + * @return PHPUnit_Util_Configuration + * @since Method available since Release 3.4.0 + */ + public static function getInstance($filename) + { + $realpath = realpath($filename); + + if ($realpath === FALSE) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Could not read "%s".', + $filename + ) + ); + } + + if (!isset(self::$instances[$realpath])) { + self::$instances[$realpath] = new PHPUnit_Util_Configuration($realpath); + } + + return self::$instances[$realpath]; + } + + /** + * Returns the realpath to the configuration file. + * + * @return string + * @since Method available since Release 3.6.0 + */ + public function getFilename() + { + return $this->filename; + } + + /** + * Returns the configuration for SUT filtering. + * + * @return array + * @since Method available since Release 3.2.1 + */ + public function getFilterConfiguration() + { + $addUncoveredFilesFromWhitelist = TRUE; + $processUncoveredFilesFromWhitelist = FALSE; + + $tmp = $this->xpath->query('filter/whitelist'); + + if ($tmp->length == 1) { + if ($tmp->item(0)->hasAttribute('addUncoveredFilesFromWhitelist')) { + $addUncoveredFilesFromWhitelist = $this->getBoolean( + (string)$tmp->item(0)->getAttribute( + 'addUncoveredFilesFromWhitelist' + ), + TRUE + ); + } + + if ($tmp->item(0)->hasAttribute('processUncoveredFilesFromWhitelist')) { + $processUncoveredFilesFromWhitelist = $this->getBoolean( + (string)$tmp->item(0)->getAttribute( + 'processUncoveredFilesFromWhitelist' + ), + FALSE + ); + } + } + + return array( + 'blacklist' => array( + 'include' => array( + 'directory' => $this->readFilterDirectories( + 'filter/blacklist/directory' + ), + 'file' => $this->readFilterFiles( + 'filter/blacklist/file' + ) + ), + 'exclude' => array( + 'directory' => $this->readFilterDirectories( + 'filter/blacklist/exclude/directory' + ), + 'file' => $this->readFilterFiles( + 'filter/blacklist/exclude/file' + ) + ) + ), + 'whitelist' => array( + 'addUncoveredFilesFromWhitelist' => $addUncoveredFilesFromWhitelist, + 'processUncoveredFilesFromWhitelist' => $processUncoveredFilesFromWhitelist, + 'include' => array( + 'directory' => $this->readFilterDirectories( + 'filter/whitelist/directory' + ), + 'file' => $this->readFilterFiles( + 'filter/whitelist/file' + ) + ), + 'exclude' => array( + 'directory' => $this->readFilterDirectories( + 'filter/whitelist/exclude/directory' + ), + 'file' => $this->readFilterFiles( + 'filter/whitelist/exclude/file' + ) + ) + ) + ); + } + + /** + * Returns the configuration for groups. + * + * @return array + * @since Method available since Release 3.2.1 + */ + public function getGroupConfiguration() + { + $groups = array( + 'include' => array(), + 'exclude' => array() + ); + + foreach ($this->xpath->query('groups/include/group') as $group) { + $groups['include'][] = (string)$group->nodeValue; + } + + foreach ($this->xpath->query('groups/exclude/group') as $group) { + $groups['exclude'][] = (string)$group->nodeValue; + } + + return $groups; + } + + /** + * Returns the configuration for listeners. + * + * @return array + * @since Method available since Release 3.4.0 + */ + public function getListenerConfiguration() + { + $result = array(); + + foreach ($this->xpath->query('listeners/listener') as $listener) { + $class = (string)$listener->getAttribute('class'); + $file = ''; + $arguments = array(); + + if ($listener->hasAttribute('file')) { + $file = $this->toAbsolutePath( + (string)$listener->getAttribute('file'), TRUE + ); + } + + foreach ($listener->childNodes as $node) { + if ($node instanceof DOMElement && $node->tagName == 'arguments') { + foreach ($node->childNodes as $argument) { + if ($argument instanceof DOMElement) { + if ($argument->tagName == 'file' || + $argument->tagName == 'directory') { + $arguments[] = $this->toAbsolutePath((string)$argument->nodeValue); + } else { + $arguments[] = PHPUnit_Util_XML::xmlToVariable($argument); + } + } + } + } + } + + $result[] = array( + 'class' => $class, + 'file' => $file, + 'arguments' => $arguments + ); + } + + return $result; + } + + /** + * Returns the logging configuration. + * + * @return array + */ + public function getLoggingConfiguration() + { + $result = array(); + + foreach ($this->xpath->query('logging/log') as $log) { + $type = (string)$log->getAttribute('type'); + + $target = $this->toAbsolutePath( + (string)$log->getAttribute('target') + ); + + if ($type == 'coverage-html') { + if ($log->hasAttribute('title')) { + $result['title'] = (string)$log->getAttribute('title'); + } + + if ($log->hasAttribute('charset')) { + $result['charset'] = (string)$log->getAttribute('charset'); + } + + if ($log->hasAttribute('lowUpperBound')) { + $result['lowUpperBound'] = (string)$log->getAttribute('lowUpperBound'); + } + + if ($log->hasAttribute('highLowerBound')) { + $result['highLowerBound'] = (string)$log->getAttribute('highLowerBound'); + } + + if ($log->hasAttribute('highlight')) { + $result['highlight'] = $this->getBoolean( + (string)$log->getAttribute('highlight'), + FALSE + ); + } + } + + else if ($type == 'junit') { + if ($log->hasAttribute('logIncompleteSkipped')) { + $result['logIncompleteSkipped'] = $this->getBoolean( + (string)$log->getAttribute('logIncompleteSkipped'), + FALSE + ); + } + } + + else if ($type == 'coverage-text') { + if ($log->hasAttribute('showUncoveredFiles')) { + $result['coverageTextShowUncoveredFiles'] = $this->getBoolean( + (string)$log->getAttribute('showUncoveredFiles'), + FALSE + ); + } + } + + $result[$type] = $target; + } + + return $result; + } + + /** + * Returns the PHP configuration. + * + * @return array + * @since Method available since Release 3.2.1 + */ + public function getPHPConfiguration() + { + $result = array( + 'include_path' => array(), + 'ini' => array(), + 'const' => array(), + 'var' => array(), + 'env' => array(), + 'post' => array(), + 'get' => array(), + 'cookie' => array(), + 'server' => array(), + 'files' => array(), + 'request' => array() + ); + + foreach ($this->xpath->query('php/includePath') as $includePath) { + $path = (string)$includePath->nodeValue; + + $result['include_path'][] = $this->toAbsolutePath($path); + } + + foreach ($this->xpath->query('php/ini') as $ini) { + $name = (string)$ini->getAttribute('name'); + $value = (string)$ini->getAttribute('value'); + + $result['ini'][$name] = $value; + } + + foreach ($this->xpath->query('php/const') as $const) { + $name = (string)$const->getAttribute('name'); + $value = (string)$const->getAttribute('value'); + + $result['const'][$name] = $this->getBoolean($value, $value); + } + + foreach (array('var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request') as $array) { + foreach ($this->xpath->query('php/' . $array) as $var) { + $name = (string)$var->getAttribute('name'); + $value = (string)$var->getAttribute('value'); + + $result[$array][$name] = $this->getBoolean($value, $value); + } + } + + return $result; + } + + /** + * Handles the PHP configuration. + * + * @since Method available since Release 3.2.20 + */ + public function handlePHPConfiguration() + { + $configuration = $this->getPHPConfiguration(); + + if (! empty($configuration['include_path'])) { + ini_set( + 'include_path', + implode(PATH_SEPARATOR, $configuration['include_path']) . + PATH_SEPARATOR . + ini_get('include_path') + ); + } + + foreach ($configuration['ini'] as $name => $value) { + if (defined($value)) { + $value = constant($value); + } + + ini_set($name, $value); + } + + foreach ($configuration['const'] as $name => $value) { + if (!defined($name)) { + define($name, $value); + } + } + + foreach (array('var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request') as $array) { + // See https://github.com/sebastianbergmann/phpunit/issues/277 + switch ($array) { + case 'var': + $target = &$GLOBALS; + break; + + case 'env': + $target = &$_ENV; + break; + + case 'server': + $target = &$_SERVER; + break; + + default: + $target = &$GLOBALS['_' . strtoupper($array)]; + break; + } + + foreach ($configuration[$array] as $name => $value) { + $target[$name] = $value; + } + } + + foreach ($configuration['env'] as $name => $value) { + putenv("$name=$value"); + } + } + + /** + * Returns the PHPUnit configuration. + * + * @return array + * @since Method available since Release 3.2.14 + */ + public function getPHPUnitConfiguration() + { + $result = array(); + $root = $this->document->documentElement; + + if ($root->hasAttribute('cacheTokens')) { + $result['cacheTokens'] = $this->getBoolean( + (string)$root->getAttribute('cacheTokens'), FALSE + ); + } + + if ($root->hasAttribute('colors')) { + $result['colors'] = $this->getBoolean( + (string)$root->getAttribute('colors'), FALSE + ); + } + + if ($root->hasAttribute('backupGlobals')) { + $result['backupGlobals'] = $this->getBoolean( + (string)$root->getAttribute('backupGlobals'), TRUE + ); + } + + if ($root->hasAttribute('backupStaticAttributes')) { + $result['backupStaticAttributes'] = $this->getBoolean( + (string)$root->getAttribute('backupStaticAttributes'), FALSE + ); + } + + if ($root->hasAttribute('bootstrap')) { + $result['bootstrap'] = $this->toAbsolutePath( + (string)$root->getAttribute('bootstrap') + ); + } + + if ($root->hasAttribute('convertErrorsToExceptions')) { + $result['convertErrorsToExceptions'] = $this->getBoolean( + (string)$root->getAttribute('convertErrorsToExceptions'), TRUE + ); + } + + if ($root->hasAttribute('convertNoticesToExceptions')) { + $result['convertNoticesToExceptions'] = $this->getBoolean( + (string)$root->getAttribute('convertNoticesToExceptions'), TRUE + ); + } + + if ($root->hasAttribute('convertWarningsToExceptions')) { + $result['convertWarningsToExceptions'] = $this->getBoolean( + (string)$root->getAttribute('convertWarningsToExceptions'), TRUE + ); + } + + if ($root->hasAttribute('forceCoversAnnotation')) { + $result['forceCoversAnnotation'] = $this->getBoolean( + (string)$root->getAttribute('forceCoversAnnotation'), FALSE + ); + } + + if ($root->hasAttribute('mapTestClassNameToCoveredClassName')) { + $result['mapTestClassNameToCoveredClassName'] = $this->getBoolean( + (string)$root->getAttribute('mapTestClassNameToCoveredClassName'), + FALSE + ); + } + + if ($root->hasAttribute('processIsolation')) { + $result['processIsolation'] = $this->getBoolean( + (string)$root->getAttribute('processIsolation'), FALSE + ); + } + + if ($root->hasAttribute('stopOnError')) { + $result['stopOnError'] = $this->getBoolean( + (string)$root->getAttribute('stopOnError'), FALSE + ); + } + + if ($root->hasAttribute('stopOnFailure')) { + $result['stopOnFailure'] = $this->getBoolean( + (string)$root->getAttribute('stopOnFailure'), FALSE + ); + } + + if ($root->hasAttribute('stopOnIncomplete')) { + $result['stopOnIncomplete'] = $this->getBoolean( + (string)$root->getAttribute('stopOnIncomplete'), FALSE + ); + } + + if ($root->hasAttribute('stopOnSkipped')) { + $result['stopOnSkipped'] = $this->getBoolean( + (string)$root->getAttribute('stopOnSkipped'), FALSE + ); + } + + if ($root->hasAttribute('testSuiteLoaderClass')) { + $result['testSuiteLoaderClass'] = (string)$root->getAttribute( + 'testSuiteLoaderClass' + ); + } + + if ($root->hasAttribute('testSuiteLoaderFile')) { + $result['testSuiteLoaderFile'] = (string)$root->getAttribute( + 'testSuiteLoaderFile' + ); + } + + if ($root->hasAttribute('printerClass')) { + $result['printerClass'] = (string)$root->getAttribute( + 'printerClass' + ); + } + + if ($root->hasAttribute('printerFile')) { + $result['printerFile'] = (string)$root->getAttribute( + 'printerFile' + ); + } + + if ($root->hasAttribute('timeoutForSmallTests')) { + $result['timeoutForSmallTests'] = $this->getInteger( + (string)$root->getAttribute('timeoutForSmallTests'), 1 + ); + } + + if ($root->hasAttribute('timeoutForMediumTests')) { + $result['timeoutForMediumTests'] = $this->getInteger( + (string)$root->getAttribute('timeoutForMediumTests'), 10 + ); + } + + if ($root->hasAttribute('timeoutForLargeTests')) { + $result['timeoutForLargeTests'] = $this->getInteger( + (string)$root->getAttribute('timeoutForLargeTests'), 60 + ); + } + + if ($root->hasAttribute('strict')) { + $result['strict'] = $this->getBoolean( + (string)$root->getAttribute('strict'), FALSE + ); + } + + if ($root->hasAttribute('verbose')) { + $result['verbose'] = $this->getBoolean( + (string)$root->getAttribute('verbose'), FALSE + ); + } + + return $result; + } + + /** + * Returns the SeleniumTestCase browser configuration. + * + * @return array + * @since Method available since Release 3.2.9 + */ + public function getSeleniumBrowserConfiguration() + { + $result = array(); + + foreach ($this->xpath->query('selenium/browser') as $config) { + $name = (string)$config->getAttribute('name'); + $browser = (string)$config->getAttribute('browser'); + + if ($config->hasAttribute('host')) { + $host = (string)$config->getAttribute('host'); + } else { + $host = 'localhost'; + } + + if ($config->hasAttribute('port')) { + $port = $this->getInteger( + (string)$config->getAttribute('port'), 4444 + ); + } else { + $port = 4444; + } + + if ($config->hasAttribute('timeout')) { + $timeout = $this->getInteger( + (string)$config->getAttribute('timeout'), 30000 + ); + } else { + $timeout = 30000; + } + + $result[] = array( + 'name' => $name, + 'browser' => $browser, + 'host' => $host, + 'port' => $port, + 'timeout' => $timeout + ); + } + + return $result; + } + + /** + * Returns the test suite configuration. + * + * @return PHPUnit_Framework_TestSuite + * @since Method available since Release 3.2.1 + */ + public function getTestSuiteConfiguration($testSuiteFilter=null) + { + $testSuiteNodes = $this->xpath->query('testsuites/testsuite'); + + if ($testSuiteNodes->length == 0) { + $testSuiteNodes = $this->xpath->query('testsuite'); + } + + if ($testSuiteNodes->length == 1) { + return $this->getTestSuite($testSuiteNodes->item(0), $testSuiteFilter); + } + + if ($testSuiteNodes->length > 1) { + $suite = new PHPUnit_Framework_TestSuite; + + foreach ($testSuiteNodes as $testSuiteNode) { + $suite->addTestSuite( + $this->getTestSuite($testSuiteNode, $testSuiteFilter) + ); + } + + return $suite; + } + } + + /** + * @param DOMElement $testSuiteNode + * @return PHPUnit_Framework_TestSuite + * @since Method available since Release 3.4.0 + */ + protected function getTestSuite(DOMElement $testSuiteNode, $testSuiteFilter=null) + { + if ($testSuiteNode->hasAttribute('name')) { + $suite = new PHPUnit_Framework_TestSuite( + (string)$testSuiteNode->getAttribute('name') + ); + } else { + $suite = new PHPUnit_Framework_TestSuite; + } + + $exclude = array(); + + foreach ($testSuiteNode->getElementsByTagName('exclude') as $excludeNode) { + $exclude[] = (string)$excludeNode->nodeValue; + } + + $fileIteratorFacade = new File_Iterator_Facade; + + foreach ($testSuiteNode->getElementsByTagName('directory') as $directoryNode) { + if ($testSuiteFilter && $directoryNode->parentNode->getAttribute('name') != $testSuiteFilter) { + continue; + } + + $directory = (string)$directoryNode->nodeValue; + + if (empty($directory)) { + continue; + } + + if ($directoryNode->hasAttribute('phpVersion')) { + $phpVersion = (string)$directoryNode->getAttribute('phpVersion'); + } else { + $phpVersion = PHP_VERSION; + } + + if ($directoryNode->hasAttribute('phpVersionOperator')) { + $phpVersionOperator = (string)$directoryNode->getAttribute('phpVersionOperator'); + } else { + $phpVersionOperator = '>='; + } + + if (!version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) { + continue; + } + + if ($directoryNode->hasAttribute('prefix')) { + $prefix = (string)$directoryNode->getAttribute('prefix'); + } else { + $prefix = ''; + } + + if ($directoryNode->hasAttribute('suffix')) { + $suffix = (string)$directoryNode->getAttribute('suffix'); + } else { + $suffix = 'Test.php'; + } + + $files = $fileIteratorFacade->getFilesAsArray( + $this->toAbsolutePath($directory), + $suffix, + $prefix, + $exclude + ); + $suite->addTestFiles($files); + } + + foreach ($testSuiteNode->getElementsByTagName('file') as $fileNode) { + if ($testSuiteFilter && $fileNode->parentNode->getAttribute('name') != $testSuiteFilter) { + continue; + } + + $file = (string)$fileNode->nodeValue; + + if (empty($file)) { + continue; + } + + // Get the absolute path to the file + $file = $fileIteratorFacade->getFilesAsArray($file); + + if (!isset($file[0])) { + continue; + } + + $file = $file[0]; + + if ($fileNode->hasAttribute('phpVersion')) { + $phpVersion = (string)$fileNode->getAttribute('phpVersion'); + } else { + $phpVersion = PHP_VERSION; + } + + if ($fileNode->hasAttribute('phpVersionOperator')) { + $phpVersionOperator = (string)$fileNode->getAttribute('phpVersionOperator'); + } else { + $phpVersionOperator = '>='; + } + + if (!version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) { + continue; + } + + $suite->addTestFile($file); + } + + return $suite; + } + + /** + * @param string $value + * @param boolean $default + * @return boolean + * @since Method available since Release 3.2.3 + */ + protected function getBoolean($value, $default) + { + if (strtolower($value) == 'false') { + return FALSE; + } + + else if (strtolower($value) == 'true') { + return TRUE; + } + + return $default; + } + + /** + * @param string $value + * @param boolean $default + * @return boolean + * @since Method available since Release 3.6.0 + */ + protected function getInteger($value, $default) + { + if (is_numeric($value)) { + return (int)$value; + } + + return $default; + } + + /** + * @param string $query + * @return array + * @since Method available since Release 3.2.3 + */ + protected function readFilterDirectories($query) + { + $directories = array(); + + foreach ($this->xpath->query($query) as $directory) { + if ($directory->hasAttribute('prefix')) { + $prefix = (string)$directory->getAttribute('prefix'); + } else { + $prefix = ''; + } + + if ($directory->hasAttribute('suffix')) { + $suffix = (string)$directory->getAttribute('suffix'); + } else { + $suffix = '.php'; + } + + if ($directory->hasAttribute('group')) { + $group = (string)$directory->getAttribute('group'); + } else { + $group = 'DEFAULT'; + } + + $directories[] = array( + 'path' => $this->toAbsolutePath((string)$directory->nodeValue), + 'prefix' => $prefix, + 'suffix' => $suffix, + 'group' => $group + ); + } + + return $directories; + } + + /** + * @param string $query + * @return array + * @since Method available since Release 3.2.3 + */ + protected function readFilterFiles($query) + { + $files = array(); + + foreach ($this->xpath->query($query) as $file) { + $files[] = $this->toAbsolutePath((string)$file->nodeValue); + } + + return $files; + } + + /** + * @param string $path + * @param boolean $useIncludePath + * @return string + * @since Method available since Release 3.5.0 + */ + protected function toAbsolutePath($path, $useIncludePath = FALSE) + { + // Check whether the path is already absolute. + if ($path[0] === '/' || $path[0] === '\\' || + (strlen($path) > 3 && ctype_alpha($path[0]) && + $path[1] === ':' && ($path[2] === '\\' || $path[2] === '/'))) { + return $path; + } + + // Check whether a stream is used. + if (strpos($path, '://') !== FALSE) { + return $path; + } + + $file = dirname($this->filename) . DIRECTORY_SEPARATOR . $path; + + if ($useIncludePath && !file_exists($file)) { + $includePathFile = stream_resolve_include_path($path); + + if ($includePathFile) { + $file = $includePathFile; + } + } + + return $file; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php @@ -0,0 +1,102 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Ralph Schindler <ralph.schindler@zend.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.7 + */ + +/** + * Class to hold the information about a deprecated feature that was used + * + * @package PHPUnit + * @subpackage Framework + * @author Ralph Schindler <ralph.schindler@zend.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Interface available since Release 3.5.7 + */ +class PHPUnit_Util_DeprecatedFeature +{ + /** + * @var array + */ + protected $traceInfo = array(); + + /** + * @var string + */ + protected $message = NULL; + + /** + * @param string $message + * @param array $traceInfo + */ + public function __construct($message, array $traceInfo = array()) + { + $this->message = $message; + $this->traceInfo = $traceInfo; + } + + /** + * Build a string representation of the deprecated feature that was raised + * + * @return string + */ + public function __toString() + { + $string = ''; + + if (isset($this->traceInfo['file'])) { + $string .= $this->traceInfo['file']; + + if (isset($this->traceInfo['line'])) { + $string .= ':' . $this->traceInfo['line'] . ' - '; + } + } + + $string .= $this->message; + + return $string; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php @@ -0,0 +1,201 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Framework + * @author Ralph Schindler <ralph.schindler@zend.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.7 + */ + +/** + * Test Listener that tracks the usage of deprecated features. + * + * @package PHPUnit + * @subpackage Framework + * @author Ralph Schindler <ralph.schindler@zend.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.7 + */ +class PHPUnit_Util_DeprecatedFeature_Logger implements PHPUnit_Framework_TestListener +{ + /** + * @var PHPUnit_Framework_TestCase + */ + protected static $currentTest = NULL; + + /** + * This is the publicly accessible API for notifying the system that a + * deprecated feature has been used. + * + * If it is run via a TestRunner and the test extends + * PHPUnit_Framework_TestCase, then this will inject the result into the + * test runner for display, if not, it will throw the notice to STDERR. + * + * @param string $message + * @param int|bool $backtraceDepth + */ + public static function log($message, $backtraceDepth = 2) + { + if ($backtraceDepth !== FALSE) { + $trace = debug_backtrace(FALSE); + + if (is_int($backtraceDepth)) { + $traceItem = $trace[$backtraceDepth]; + } + + if (!isset($traceItem['file'])) { + $reflectionClass = new ReflectionClass($traceItem['class']); + $traceItem['file'] = $reflectionClass->getFileName(); + } + + if (!isset($traceItem['line']) && + isset($traceItem['class']) && + isset($traceItem['function'])) { + if (!isset($reflectionClass)) { + $reflectionClass = new ReflectionClass($traceItem['class']); + } + + $method = $reflectionClass->getMethod($traceItem['function']); + $traceItem['line'] = '(between ' . $method->getStartLine() . + ' and ' . $method->getEndLine() . ')'; + } + } + + $deprecatedFeature = new PHPUnit_Util_DeprecatedFeature( + $message, $traceItem + ); + + if (self::$currentTest instanceof PHPUnit_Framework_TestCase) { + $result = self::$currentTest->getTestResultObject(); + $result->addDeprecatedFeature($deprecatedFeature); + } else { + file_put_contents('php://stderr', $deprecatedFeature); + } + } + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + } + + /** + * A test suite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test suite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + self::$currentTest = $test; + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + self::$currentTest = NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php @@ -0,0 +1,292 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Kore Nordmann <mail@kore-nordmann.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Diff implementation. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Kore Nordmann <mail@kore-nordmann.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Util_Diff +{ + /** + * Returns the diff between two arrays or strings as string. + * + * @param array|string $from + * @param array|string $to + * @return string + */ + public static function diff($from, $to) + { + $buffer= "--- Expected\n+++ Actual\n"; + $diff = self::diffToArray($from,$to); + + $inOld = FALSE; + $i = 0; + $old = array(); + + foreach ($diff as $line) { + if ($line[1] === 0 /* OLD */) { + if ($inOld === FALSE) { + $inOld = $i; + } + } + + else if ($inOld !== FALSE) { + if (($i - $inOld) > 5) { + $old[$inOld] = $i - 1; + } + + $inOld = FALSE; + } + + ++$i; + } + + $start = isset($old[0]) ? $old[0] : 0; + $end = count($diff); + $i = 0; + + if ($tmp = array_search($end, $old)) { + $end = $tmp; + } + + $newChunk = TRUE; + + for ($i = $start; $i < $end; $i++) { + if (isset($old[$i])) { + $buffer .= "\n"; + $newChunk = TRUE; + $i = $old[$i]; + } + + if ($newChunk) { + $buffer .= "@@ @@\n"; + $newChunk = FALSE; + } + + if ($diff[$i][1] === 1 /* ADDED */) { + $buffer .= '+' . $diff[$i][0] . "\n"; + } + + else if ($diff[$i][1] === 2 /* REMOVED */) { + $buffer .= '-' . $diff[$i][0] . "\n"; + } + + else { + $buffer .= ' ' . $diff[$i][0] . "\n"; + } + } + + return $buffer; + } + + /** + * Returns the diff between two arrays or strings as array. + * + * every array-entry contains two elements: + * - [0] => string $token + * - [1] => 2|1|0 + * + * - 2: REMOVED: $token was removed from $from + * - 1: ADDED: $token was added to $from + * - 0: OLD: $token is not changed in $to + * + * @param array|string $from + * @param array|string $to + * @return array + */ + public static function diffToArray($from, $to) + { + preg_match_all('(\r\n|\r|\n)', $from, $fromMatches); + preg_match_all('(\r\n|\r|\n)', $to, $toMatches); + + if (is_string($from)) { + $from = preg_split('(\r\n|\r|\n)', $from); + } + + if (is_string($to)) { + $to = preg_split('(\r\n|\r|\n)', $to); + } + + $start = array(); + $end = array(); + $fromLength = count($from); + $toLength = count($to); + $length = min($fromLength, $toLength); + + for ($i = 0; $i < $length; ++$i) { + if ($from[$i] === $to[$i]) { + $start[] = $from[$i]; + unset($from[$i], $to[$i]); + } else { + break; + } + } + + $length -= $i; + + for ($i = 1; $i < $length; ++$i) { + if ($from[$fromLength - $i] === $to[$toLength - $i]) { + array_unshift($end, $from[$fromLength - $i]); + unset($from[$fromLength - $i], $to[$toLength - $i]); + } else { + break; + } + } + + $common = self::longestCommonSubsequence( + array_values($from), array_values($to) + ); + + $diff = array(); + $line = 0; + + if (isset($fromMatches[0]) && $toMatches[0] && + count($fromMatches[0]) === count($toMatches[0]) && + $fromMatches[0] !== $toMatches[0]) { + $diff[] = array( + '#Warning: Strings contain different line endings!', 0 + ); + } + + foreach ($start as $token) { + $diff[] = array($token, 0 /* OLD */); + } + + reset($from); + reset($to); + + foreach ($common as $token) { + while ((($fromToken = reset($from)) !== $token)) { + $diff[] = array(array_shift($from), 2 /* REMOVED */); + } + + while ((($toToken = reset($to)) !== $token)) { + $diff[] = array(array_shift($to), 1 /* ADDED */); + } + + $diff[] = array($token, 0 /* OLD */); + + array_shift($from); + array_shift($to); + } + + while (($token = array_shift($from)) !== NULL) { + $diff[] = array($token, 2 /* REMOVED */); + } + + while (($token = array_shift($to)) !== NULL) { + $diff[] = array($token, 1 /* ADDED */); + } + + foreach ($end as $token) { + $diff[] = array($token, 0 /* OLD */); + } + + return $diff; + } + + /** + * Calculates the longest common subsequence of two arrays. + * + * @param array $from + * @param array $to + * @return array + */ + protected static function longestCommonSubsequence(array $from, array $to) + { + $common = array(); + $matrix = array(); + $fromLength = count($from); + $toLength = count($to); + + for ($i = 0; $i <= $fromLength; ++$i) { + $matrix[$i][0] = 0; + } + + for ($j = 0; $j <= $toLength; ++$j) { + $matrix[0][$j] = 0; + } + + for ($i = 1; $i <= $fromLength; ++$i) { + for ($j = 1; $j <= $toLength; ++$j) { + $matrix[$i][$j] = max( + $matrix[$i-1][$j], + $matrix[$i][$j-1], + $from[$i-1] === $to[$j-1] ? $matrix[$i-1][$j-1] + 1 : 0 + ); + } + } + + $i = $fromLength; + $j = $toLength; + + while ($i > 0 && $j > 0) { + if ($from[$i-1] === $to[$j-1]) { + array_unshift($common, $from[$i-1]); + --$i; + --$j; + } + + else if ($matrix[$i][$j-1] > $matrix[$i-1][$j]) { + --$j; + } + + else { + --$i; + } + } + + return $common; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php @@ -0,0 +1,132 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +// Workaround for http://bugs.php.net/bug.php?id=47987, +// see https://github.com/sebastianbergmann/phpunit/issues#issue/125 for details +require_once __DIR__ . '/../Framework/Error.php'; +require_once __DIR__ . '/../Framework/Error/Notice.php'; +require_once __DIR__ . '/../Framework/Error/Warning.php'; +require_once __DIR__ . '/../Framework/Error/Deprecated.php'; + +/** + * Error handler that converts PHP errors and warnings to exceptions. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class PHPUnit_Util_ErrorHandler +{ + protected static $errorStack = array(); + + /** + * Returns the error stack. + * + * @return array + */ + public static function getErrorStack() + { + return self::$errorStack; + } + + /** + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + * @throws PHPUnit_Framework_Error + */ + public static function handleError($errno, $errstr, $errfile, $errline) + { + if (!($errno & error_reporting())) { + return FALSE; + } + + self::$errorStack[] = array($errno, $errstr, $errfile, $errline); + + $trace = debug_backtrace(FALSE); + array_shift($trace); + + foreach ($trace as $frame) { + if ($frame['function'] == '__toString') { + return FALSE; + } + } + + if ($errno == E_NOTICE || $errno == E_USER_NOTICE || $errno == E_STRICT) { + if (PHPUnit_Framework_Error_Notice::$enabled !== TRUE) { + return FALSE; + } + + $exception = 'PHPUnit_Framework_Error_Notice'; + } + + else if ($errno == E_WARNING || $errno == E_USER_WARNING) { + if (PHPUnit_Framework_Error_Warning::$enabled !== TRUE) { + return FALSE; + } + + $exception = 'PHPUnit_Framework_Error_Warning'; + } + + else if ($errno == E_DEPRECATED || $errno == E_USER_DEPRECATED) { + if (PHPUnit_Framework_Error_Deprecated::$enabled !== TRUE) { + return FALSE; + } + + $exception = 'PHPUnit_Framework_Error_Deprecated'; + } + + else { + $exception = 'PHPUnit_Framework_Error'; + } + + throw new $exception($errstr, $errno, $errfile, $errline); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php @@ -0,0 +1,107 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * Utility methods to load PHP sourcefiles. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.3.0 + */ +class PHPUnit_Util_Fileloader +{ + /** + * Checks if a PHP sourcefile is readable. + * The sourcefile is loaded through the load() method. + * + * @param string $filename + * @throws PHPUnit_Framework_Exception + */ + public static function checkAndLoad($filename) + { + $includePathFilename = stream_resolve_include_path($filename); + + if (!$includePathFilename || !is_readable($includePathFilename)) { + throw new PHPUnit_Framework_Exception( + sprintf('Cannot open file "%s".' . "\n", $filename) + ); + } + + self::load($includePathFilename); + + return $includePathFilename; + } + + /** + * Loads a PHP sourcefile. + * + * @param string $filename + * @return mixed + * @since Method available since Release 3.0.0 + */ + public static function load($filename) + { + $oldVariableNames = array_keys(get_defined_vars()); + + include_once $filename; + + $newVariables = get_defined_vars(); + $newVariableNames = array_diff( + array_keys($newVariables), $oldVariableNames + ); + + foreach ($newVariableNames as $variableName) { + if ($variableName != 'oldVariableNames') { + $GLOBALS[$variableName] = $newVariables[$variableName]; + } + } + + return $filename; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php @@ -0,0 +1,81 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Filesystem helpers. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Filesystem +{ + /** + * @var array + */ + protected static $buffer = array(); + + /** + * Maps class names to source file names: + * - PEAR CS: Foo_Bar_Baz -> Foo/Bar/Baz.php + * - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php + * + * @param string $className + * @return string + * @since Method available since Release 3.4.0 + */ + public static function classNameToFilename($className) + { + return str_replace( + array('_', '\\'), + DIRECTORY_SEPARATOR, + $className + ) . '.php'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php @@ -0,0 +1,146 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Utility class for code filtering. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Util_Filter +{ + /** + * Filters stack frames from PHPUnit classes. + * + * @param Exception $e + * @param boolean $asString + * @return string + */ + public static function getFilteredStacktrace(Exception $e, $asString = TRUE) + { + $prefix = FALSE; + $script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']); + + if (defined('__PHPUNIT_PHAR__')) { + $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/'; + } + + if (!defined('PHPUNIT_TESTSUITE')) { + $blacklist = PHPUnit_Util_GlobalState::phpunitFiles(); + } else { + $blacklist = array(); + } + + if ($asString === TRUE) { + $filteredStacktrace = ''; + } else { + $filteredStacktrace = array(); + } + + if ($e instanceof PHPUnit_Framework_SyntheticError) { + $eTrace = $e->getSyntheticTrace(); + $eFile = $e->getSyntheticFile(); + $eLine = $e->getSyntheticLine(); + } else { + if ($e->getPrevious()) { + $eTrace = $e->getPrevious()->getTrace(); + } else { + $eTrace = $e->getTrace(); + } + $eFile = $e->getFile(); + $eLine = $e->getLine(); + } + + if (!self::frameExists($eTrace, $eFile, $eLine)) { + array_unshift( + $eTrace, array('file' => $eFile, 'line' => $eLine) + ); + } + + foreach ($eTrace as $frame) { + if (isset($frame['file']) && is_file($frame['file']) && + !isset($blacklist[$frame['file']]) && + ($prefix === FALSE || strpos($frame['file'], $prefix) !== 0) && + $frame['file'] !== $script) { + if ($asString === TRUE) { + $filteredStacktrace .= sprintf( + "%s:%s\n", + + $frame['file'], + isset($frame['line']) ? $frame['line'] : '?' + ); + } else { + $filteredStacktrace[] = $frame; + } + } + } + + return $filteredStacktrace; + } + + /** + * @param array $trace + * @param string $file + * @param int $line + * @return boolean + * @since Method available since Release 3.3.2 + */ + public static function frameExists(array $trace, $file, $line) + { + foreach ($trace as $frame) { + if (isset($frame['file']) && $frame['file'] == $file && + isset($frame['line']) && $frame['line'] == $line) { + return TRUE; + } + } + + return FALSE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php @@ -0,0 +1,207 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Command-line options parsing class. + * + * @package PHPUnit + * @subpackage Util + * @author Andrei Zmievski <andrei@php.net> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Getopt +{ + public static function getopt(array $args, $short_options, $long_options = NULL) + { + if (empty($args)) { + return array(array(), array()); + } + + $opts = array(); + $non_opts = array(); + + if ($long_options) { + sort($long_options); + } + + if (isset($args[0][0]) && $args[0][0] != '-') { + array_shift($args); + } + + reset($args); + array_map('trim', $args); + + while (list($i, $arg) = each($args)) { + if ($arg == '') { + continue; + } + + if ($arg == '--') { + $non_opts = array_merge($non_opts, array_slice($args, $i + 1)); + break; + } + + if ($arg[0] != '-' || + (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) { + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } + + elseif (strlen($arg) > 1 && $arg[1] == '-') { + self::parseLongOption( + substr($arg, 2), $long_options, $opts, $args + ); + } + + else { + self::parseShortOption( + substr($arg, 1), $short_options, $opts, $args + ); + } + } + + return array($opts, $non_opts); + } + + protected static function parseShortOption($arg, $short_options, &$opts, &$args) + { + $argLen = strlen($arg); + + for ($i = 0; $i < $argLen; $i++) { + $opt = $arg[$i]; + $opt_arg = NULL; + + if (($spec = strstr($short_options, $opt)) === FALSE || + $arg[$i] == ':') { + throw new PHPUnit_Framework_Exception( + "unrecognized option -- $opt" + ); + } + + if (strlen($spec) > 1 && $spec[1] == ':') { + if (strlen($spec) > 2 && $spec[2] == ':') { + if ($i + 1 < $argLen) { + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } + } else { + if ($i + 1 < $argLen) { + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } + + else if (list(, $opt_arg) = each($args)) { + } + + else { + throw new PHPUnit_Framework_Exception( + "option requires an argument -- $opt" + ); + } + } + } + + $opts[] = array($opt, $opt_arg); + } + } + + protected static function parseLongOption($arg, $long_options, &$opts, &$args) + { + $count = count($long_options); + $list = explode('=', $arg); + $opt = $list[0]; + $opt_arg = NULL; + + if (count($list) > 1) { + $opt_arg = $list[1]; + } + + $opt_len = strlen($opt); + + for ($i = 0; $i < $count; $i++) { + $long_opt = $long_options[$i]; + $opt_start = substr($long_opt, 0, $opt_len); + + if ($opt_start != $opt) { + continue; + } + + $opt_rest = substr($long_opt, $opt_len); + + if ($opt_rest != '' && $opt[0] != '=' && $i + 1 < $count && + $opt == substr($long_options[$i+1], 0, $opt_len)) { + throw new PHPUnit_Framework_Exception( + "option --$opt is ambiguous" + ); + } + + if (substr($long_opt, -1) == '=') { + if (substr($long_opt, -2) != '==') { + if (!strlen($opt_arg) && + !(list(, $opt_arg) = each($args))) { + throw new PHPUnit_Framework_Exception( + "option --$opt requires an argument" + ); + } + } + } + + else if ($opt_arg) { + throw new PHPUnit_Framework_Exception( + "option --$opt doesn't allow an argument" + ); + } + + $opts[] = array('--' . $opt, $opt_arg); + return; + } + + throw new PHPUnit_Framework_Exception("unrecognized option --$opt"); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php @@ -0,0 +1,427 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Util_GlobalState +{ + /** + * @var array + */ + protected static $globals = array(); + + /** + * @var array + */ + protected static $staticAttributes = array(); + + /** + * @var array + */ + protected static $superGlobalArrays = array( + '_ENV', + '_POST', + '_GET', + '_COOKIE', + '_SERVER', + '_FILES', + '_REQUEST' + ); + + /** + * @var array + */ + protected static $superGlobalArraysLong = array( + 'HTTP_ENV_VARS', + 'HTTP_POST_VARS', + 'HTTP_GET_VARS', + 'HTTP_COOKIE_VARS', + 'HTTP_SERVER_VARS', + 'HTTP_POST_FILES' + ); + + /** + * @var array + */ + protected static $phpunitFiles; + + public static function backupGlobals(array $blacklist) + { + self::$globals = array(); + $superGlobalArrays = self::getSuperGlobalArrays(); + + foreach ($superGlobalArrays as $superGlobalArray) { + if (!in_array($superGlobalArray, $blacklist)) { + self::backupSuperGlobalArray($superGlobalArray); + } + } + + foreach (array_keys($GLOBALS) as $key) { + if ($key != 'GLOBALS' && + !in_array($key, $superGlobalArrays) && + !in_array($key, $blacklist) && + !$GLOBALS[$key] instanceof Closure) { + self::$globals['GLOBALS'][$key] = serialize($GLOBALS[$key]); + } + } + } + + public static function restoreGlobals(array $blacklist) + { + if (ini_get('register_long_arrays') == '1') { + $superGlobalArrays = array_merge( + self::$superGlobalArrays, self::$superGlobalArraysLong + ); + } else { + $superGlobalArrays = self::$superGlobalArrays; + } + + foreach ($superGlobalArrays as $superGlobalArray) { + if (!in_array($superGlobalArray, $blacklist)) { + self::restoreSuperGlobalArray($superGlobalArray); + } + } + + foreach (array_keys($GLOBALS) as $key) { + if ($key != 'GLOBALS' && + !in_array($key, $superGlobalArrays) && + !in_array($key, $blacklist)) { + if (isset(self::$globals['GLOBALS'][$key])) { + $GLOBALS[$key] = unserialize( + self::$globals['GLOBALS'][$key] + ); + } else { + unset($GLOBALS[$key]); + } + } + } + + self::$globals = array(); + } + + protected static function backupSuperGlobalArray($superGlobalArray) + { + self::$globals[$superGlobalArray] = array(); + + if (isset($GLOBALS[$superGlobalArray]) && + is_array($GLOBALS[$superGlobalArray])) { + foreach ($GLOBALS[$superGlobalArray] as $key => $value) { + self::$globals[$superGlobalArray][$key] = serialize($value); + } + } + } + + protected static function restoreSuperGlobalArray($superGlobalArray) + { + if (isset($GLOBALS[$superGlobalArray]) && + is_array($GLOBALS[$superGlobalArray]) && + isset(self::$globals[$superGlobalArray])) { + $keys = array_keys( + array_merge( + $GLOBALS[$superGlobalArray], self::$globals[$superGlobalArray] + ) + ); + + foreach ($keys as $key) { + if (isset(self::$globals[$superGlobalArray][$key])) { + $GLOBALS[$superGlobalArray][$key] = unserialize( + self::$globals[$superGlobalArray][$key] + ); + } else { + unset($GLOBALS[$superGlobalArray][$key]); + } + } + } + + self::$globals[$superGlobalArray] = array(); + } + + public static function getIncludedFilesAsString() + { + $blacklist = self::phpunitFiles(); + $files = get_included_files(); + $prefix = FALSE; + $result = ''; + + if (defined('__PHPUNIT_PHAR__')) { + $prefix = 'phar://' . __PHPUNIT_PHAR__ . '/'; + } + + for ($i = count($files) - 1; $i > 0; $i--) { + $file = $files[$i]; + + if ($prefix !== FALSE && strpos($file, $prefix) === 0) { + continue; + } + + if (!isset($blacklist[$file]) && is_file($file)) { + $result = 'require_once \'' . $file . "';\n" . $result; + } + } + + return $result; + } + + public static function getConstantsAsString() + { + $constants = get_defined_constants(TRUE); + $result = ''; + + if (isset($constants['user'])) { + foreach ($constants['user'] as $name => $value) { + $result .= sprintf( + 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", + $name, + $name, + self::exportVariable($value) + ); + } + } + + return $result; + } + + public static function getGlobalsAsString() + { + $result = ''; + $superGlobalArrays = self::getSuperGlobalArrays(); + + foreach ($superGlobalArrays as $superGlobalArray) { + if (isset($GLOBALS[$superGlobalArray]) && + is_array($GLOBALS[$superGlobalArray])) { + foreach (array_keys($GLOBALS[$superGlobalArray]) as $key) { + if ($GLOBALS[$superGlobalArray][$key] instanceof Closure) { + continue; + } + + $result .= sprintf( + '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", + $superGlobalArray, + $key, + self::exportVariable($GLOBALS[$superGlobalArray][$key]) + ); + } + } + } + + $blacklist = $superGlobalArrays; + $blacklist[] = 'GLOBALS'; + $blacklist[] = '_PEAR_Config_instance'; + + foreach (array_keys($GLOBALS) as $key) { + if (!in_array($key, $blacklist) && !$GLOBALS[$key] instanceof Closure) { + $result .= sprintf( + '$GLOBALS[\'%s\'] = %s;' . "\n", + $key, + self::exportVariable($GLOBALS[$key]) + ); + } + } + + return $result; + } + + protected static function getSuperGlobalArrays() + { + if (ini_get('register_long_arrays') == '1') { + return array_merge( + self::$superGlobalArrays, self::$superGlobalArraysLong + ); + } else { + return self::$superGlobalArrays; + } + } + + public static function backupStaticAttributes(array $blacklist) + { + self::$staticAttributes = array(); + $declaredClasses = get_declared_classes(); + $declaredClassesNum = count($declaredClasses); + + for ($i = $declaredClassesNum - 1; $i >= 0; $i--) { + if (strpos($declaredClasses[$i], 'PHPUnit') !== 0 && + strpos($declaredClasses[$i], 'File_Iterator') !== 0 && + strpos($declaredClasses[$i], 'PHP_CodeCoverage') !== 0 && + strpos($declaredClasses[$i], 'PHP_Invoker') !== 0 && + strpos($declaredClasses[$i], 'PHP_Timer') !== 0 && + strpos($declaredClasses[$i], 'PHP_Token_Stream') !== 0 && + strpos($declaredClasses[$i], 'Symfony') !== 0 && + strpos($declaredClasses[$i], 'Text_Template') !== 0 && + !$declaredClasses[$i] instanceof PHPUnit_Framework_Test) { + $class = new ReflectionClass($declaredClasses[$i]); + + if (!$class->isUserDefined()) { + break; + } + + $backup = array(); + + foreach ($class->getProperties() as $attribute) { + if ($attribute->isStatic()) { + $name = $attribute->getName(); + + if (!isset($blacklist[$declaredClasses[$i]]) || + !in_array($name, $blacklist[$declaredClasses[$i]])) { + $attribute->setAccessible(TRUE); + $value = $attribute->getValue(); + + if (!$value instanceof Closure) { + $backup[$name] = serialize($value); + } + } + } + } + + if (!empty($backup)) { + self::$staticAttributes[$declaredClasses[$i]] = $backup; + } + } + } + } + + public static function restoreStaticAttributes() + { + foreach (self::$staticAttributes as $className => $staticAttributes) { + foreach ($staticAttributes as $name => $value) { + $reflector = new ReflectionProperty($className, $name); + $reflector->setAccessible(TRUE); + $reflector->setValue(unserialize($value)); + } + } + + self::$staticAttributes = array(); + } + + protected static function exportVariable($variable) + { + if (is_scalar($variable) || is_null($variable) || + (is_array($variable) && self::arrayOnlyContainsScalars($variable))) { + return var_export($variable, TRUE); + } + + return 'unserialize(\'' . + str_replace("'", "\'", serialize($variable)) . + '\')'; + } + + protected static function arrayOnlyContainsScalars(array $array) + { + $result = TRUE; + + foreach ($array as $element) { + if (is_array($element)) { + $result = self::arrayOnlyContainsScalars($element); + } + + else if (!is_scalar($element) && !is_null($element)) { + $result = FALSE; + } + + if ($result === FALSE) { + break; + } + } + + return $result; + } + + /** + * @return array + * @since Method available since Release 3.6.0 + */ + public static function phpunitFiles() + { + if (self::$phpunitFiles === NULL) { + self::$phpunitFiles = array(); + self::addDirectoryContainingClassToPHPUnitFilesList('File_Iterator'); + self::addDirectoryContainingClassToPHPUnitFilesList('PHP_CodeCoverage'); + self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Invoker'); + self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Timer'); + self::addDirectoryContainingClassToPHPUnitFilesList('PHP_Token'); + self::addDirectoryContainingClassToPHPUnitFilesList('PHPUnit_Framework_TestCase', 2); + self::addDirectoryContainingClassToPHPUnitFilesList('PHPUnit_Extensions_Database_TestCase', 2); + self::addDirectoryContainingClassToPHPUnitFilesList('PHPUnit_Framework_MockObject_Generator', 2); + self::addDirectoryContainingClassToPHPUnitFilesList('PHPUnit_Extensions_SeleniumTestCase', 2); + self::addDirectoryContainingClassToPHPUnitFilesList('PHPUnit_Extensions_Story_TestCase', 2); + self::addDirectoryContainingClassToPHPUnitFilesList('Text_Template'); + } + + return self::$phpunitFiles; + } + + /** + * @param string $className + * @param integer $parent + * @since Method available since Release 3.7.2 + */ + protected static function addDirectoryContainingClassToPHPUnitFilesList($className, $parent = 1) + { + if (!class_exists($className)) { + return; + } + + $reflector = new ReflectionClass($className); + $directory = $reflector->getFileName(); + + for ($i = 0; $i < $parent; $i++) { + $directory = dirname($directory); + } + + $facade = new File_Iterator_Facade; + + foreach ($facade->getFilesAsArray($directory, '.php') as $file) { + self::$phpunitFiles[$file] = TRUE; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php @@ -0,0 +1,80 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Factory for PHPUnit_Framework_Exception objects that are used to describe + * invalid arguments passed to a function or method. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +class PHPUnit_Util_InvalidArgumentHelper +{ + /** + * @param integer $argument + * @param string $type + * @param mixed $value + */ + public static function factory($argument, $type, $value = NULL) + { + $stack = debug_backtrace(FALSE); + + return new PHPUnit_Framework_Exception( + sprintf( + 'Argument #%d%sof %s::%s() must be a %s', + $argument, + $value !== NULL ? ' (' . $value . ')' : ' ', + $stack[1]['class'], + $stack[1]['function'], + $type + ) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php @@ -0,0 +1,261 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * A TestListener that generates JSON messages. + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Log_JSON extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener +{ + /** + * @var string + */ + protected $currentTestSuiteName = ''; + + /** + * @var string + */ + protected $currentTestName = ''; + + /** + * @var boolean + * @access private + */ + protected $currentTestPass = TRUE; + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->writeCase( + 'error', + $time, + PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE), + $e->getMessage(), + $test + ); + + $this->currentTestPass = FALSE; + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + $this->writeCase( + 'fail', + $time, + PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE), + $e->getMessage(), + $test + ); + + $this->currentTestPass = FALSE; + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->writeCase( + 'error', + $time, + PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE), + 'Incomplete Test: ' . $e->getMessage(), + $test + ); + + $this->currentTestPass = FALSE; + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->writeCase( + 'error', + $time, + PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE), + 'Skipped Test: ' . $e->getMessage(), + $test + ); + + $this->currentTestPass = FALSE; + } + + /** + * A testsuite started. + * + * @param PHPUnit_Framework_TestSuite $suite + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $this->currentTestSuiteName = $suite->getName(); + $this->currentTestName = ''; + + $this->write( + array( + 'event' => 'suiteStart', + 'suite' => $this->currentTestSuiteName, + 'tests' => count($suite) + ) + ); + } + + /** + * A testsuite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $this->currentTestSuiteName = ''; + $this->currentTestName = ''; + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + $this->currentTestName = PHPUnit_Util_Test::describe($test); + $this->currentTestPass = TRUE; + + $this->write( + array( + 'event' => 'testStart', + 'suite' => $this->currentTestSuiteName, + 'test' => $this->currentTestName + ) + ); + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if ($this->currentTestPass) { + $this->writeCase('pass', $time, array(), '', $test); + } + } + + /** + * @param string $status + * @param float $time + * @param array $trace + * @param string $message + */ + protected function writeCase($status, $time, array $trace = array(), $message = '', $test = NULL) + { + $output = ''; + // take care of TestSuite producing error (e.g. by running into exception) as TestSuite doesn't have hasOutput + if ($test !== NULL && method_exists($test, 'hasOutput') && $test->hasOutput()) { + $output = $test->getActualOutput(); + } + $this->write( + array( + 'event' => 'test', + 'suite' => $this->currentTestSuiteName, + 'test' => $this->currentTestName, + 'status' => $status, + 'time' => $time, + 'trace' => $trace, + 'message' => PHPUnit_Util_String::convertToUtf8($message), + 'output' => $output, + ) + ); + } + + /** + * @param string $buffer + */ + public function write($buffer) + { + array_walk_recursive($buffer, function(&$input) { + if (is_string($input)) { + $input = PHPUnit_Util_String::convertToUtf8($input); + } + }); + + if (defined('JSON_PRETTY_PRINT')) { + parent::write(json_encode($buffer, JSON_PRETTY_PRINT)); + } else { + parent::write(json_encode($buffer)); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php @@ -0,0 +1,482 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * A TestListener that generates a logfile of the test execution in XML markup. + * + * The XML markup used is the same as the one that is used by the JUnit Ant task. + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +class PHPUnit_Util_Log_JUnit extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener +{ + /** + * @var DOMDocument + */ + protected $document; + + /** + * @var DOMElement + */ + protected $root; + + /** + * @var boolean + */ + protected $logIncompleteSkipped = FALSE; + + /** + * @var boolean + */ + protected $writeDocument = TRUE; + + /** + * @var DOMElement[] + */ + protected $testSuites = array(); + + /** + * @var integer[] + */ + protected $testSuiteTests = array(0); + + /** + * @var integer[] + */ + protected $testSuiteAssertions = array(0); + + /** + * @var integer[] + */ + protected $testSuiteErrors = array(0); + + /** + * @var integer[] + */ + protected $testSuiteFailures = array(0); + + /** + * @var integer[] + */ + protected $testSuiteTimes = array(0); + + /** + * @var integer + */ + protected $testSuiteLevel = 0; + + /** + * @var DOMElement + */ + protected $currentTestCase = NULL; + + /** + * @var boolean + */ + protected $attachCurrentTestCase = TRUE; + + /** + * Constructor. + * + * @param mixed $out + * @param boolean $logIncompleteSkipped + */ + public function __construct($out = NULL, $logIncompleteSkipped = FALSE) + { + $this->document = new DOMDocument('1.0', 'UTF-8'); + $this->document->formatOutput = TRUE; + + $this->root = $this->document->createElement('testsuites'); + $this->document->appendChild($this->root); + + parent::__construct($out); + + $this->logIncompleteSkipped = $logIncompleteSkipped; + } + + /** + * Flush buffer and close output. + * + */ + public function flush() + { + if ($this->writeDocument === TRUE) { + $this->write($this->getXML()); + } + + parent::flush(); + } + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->currentTestCase !== NULL) { + if ($test instanceof PHPUnit_Framework_SelfDescribing) { + $buffer = $test->toString() . "\n"; + } else { + $buffer = ''; + } + + $buffer .= PHPUnit_Framework_TestFailure::exceptionToString($e) . + "\n" . + PHPUnit_Util_Filter::getFilteredStacktrace($e); + + $error = $this->document->createElement( + 'error', PHPUnit_Util_XML::prepareString($buffer) + ); + + $error->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($error); + + $this->testSuiteErrors[$this->testSuiteLevel]++; + } + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + if ($this->currentTestCase !== NULL) { + if (!$test instanceof PHPUnit_Framework_Warning) { + if ($test instanceof PHPUnit_Framework_SelfDescribing) { + $buffer = $test->toString() . "\n"; + } else { + $buffer = ''; + } + + $buffer .= PHPUnit_Framework_TestFailure::exceptionToString($e) . + "\n" . + PHPUnit_Util_Filter::getFilteredStacktrace($e); + + $failure = $this->document->createElement( + 'failure', PHPUnit_Util_XML::prepareString($buffer) + ); + + $failure->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($failure); + + $this->testSuiteFailures[$this->testSuiteLevel]++; + } + } + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->logIncompleteSkipped && $this->currentTestCase !== NULL) { + $error = $this->document->createElement( + 'error', + PHPUnit_Util_XML::prepareString( + "Incomplete Test\n" . + PHPUnit_Util_Filter::getFilteredStacktrace($e) + ) + ); + + $error->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($error); + + $this->testSuiteErrors[$this->testSuiteLevel]++; + } else { + $this->attachCurrentTestCase = FALSE; + } + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($this->logIncompleteSkipped && $this->currentTestCase !== NULL) { + $error = $this->document->createElement( + 'error', + PHPUnit_Util_XML::prepareString( + "Skipped Test\n" . + PHPUnit_Util_Filter::getFilteredStacktrace($e) + ) + ); + + $error->setAttribute('type', get_class($e)); + + $this->currentTestCase->appendChild($error); + + $this->testSuiteErrors[$this->testSuiteLevel]++; + } else { + $this->attachCurrentTestCase = FALSE; + } + } + + /** + * A testsuite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $testSuite = $this->document->createElement('testsuite'); + $testSuite->setAttribute('name', $suite->getName()); + + if (class_exists($suite->getName(), FALSE)) { + try { + $class = new ReflectionClass($suite->getName()); + + $testSuite->setAttribute('file', $class->getFileName()); + + $packageInformation = PHPUnit_Util_Class::getPackageInformation( + $suite->getName(), $class->getDocComment() + ); + + if (!empty($packageInformation['namespace'])) { + $testSuite->setAttribute( + 'namespace', $packageInformation['namespace'] + ); + } + + if (!empty($packageInformation['fullPackage'])) { + $testSuite->setAttribute( + 'fullPackage', $packageInformation['fullPackage'] + ); + } + + if (!empty($packageInformation['category'])) { + $testSuite->setAttribute( + 'category', $packageInformation['category'] + ); + } + + if (!empty($packageInformation['package'])) { + $testSuite->setAttribute( + 'package', $packageInformation['package'] + ); + } + + if (!empty($packageInformation['subpackage'])) { + $testSuite->setAttribute( + 'subpackage', $packageInformation['subpackage'] + ); + } + } + + catch (ReflectionException $e) { + } + } + + if ($this->testSuiteLevel > 0) { + $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); + } else { + $this->root->appendChild($testSuite); + } + + $this->testSuiteLevel++; + $this->testSuites[$this->testSuiteLevel] = $testSuite; + $this->testSuiteTests[$this->testSuiteLevel] = 0; + $this->testSuiteAssertions[$this->testSuiteLevel] = 0; + $this->testSuiteErrors[$this->testSuiteLevel] = 0; + $this->testSuiteFailures[$this->testSuiteLevel] = 0; + $this->testSuiteTimes[$this->testSuiteLevel] = 0; + } + + /** + * A testsuite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'tests', $this->testSuiteTests[$this->testSuiteLevel] + ); + + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'assertions', $this->testSuiteAssertions[$this->testSuiteLevel] + ); + + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'failures', $this->testSuiteFailures[$this->testSuiteLevel] + ); + + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'errors', $this->testSuiteErrors[$this->testSuiteLevel] + ); + + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'time', sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) + ); + + if ($this->testSuiteLevel > 1) { + $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; + $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; + $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; + $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; + $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; + } + + $this->testSuiteLevel--; + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + if (!$test instanceof PHPUnit_Framework_Warning) { + $testCase = $this->document->createElement('testcase'); + $testCase->setAttribute('name', $test->getName()); + + if ($test instanceof PHPUnit_Framework_TestCase) { + $class = new ReflectionClass($test); + $methodName = $test->getName(); + + if ($class->hasMethod($methodName)) { + $method = $class->getMethod($test->getName()); + + $testCase->setAttribute('class', $class->getName()); + $testCase->setAttribute('file', $class->getFileName()); + $testCase->setAttribute('line', $method->getStartLine()); + } + } + + $this->currentTestCase = $testCase; + } + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if (!$test instanceof PHPUnit_Framework_Warning) { + if ($this->attachCurrentTestCase) { + if ($test instanceof PHPUnit_Framework_TestCase) { + $numAssertions = $test->getNumAssertions(); + $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions; + + $this->currentTestCase->setAttribute( + 'assertions', $numAssertions + ); + } + + $this->currentTestCase->setAttribute( + 'time', sprintf('%F', $time) + ); + + $this->testSuites[$this->testSuiteLevel]->appendChild( + $this->currentTestCase + ); + + $this->testSuiteTests[$this->testSuiteLevel]++; + $this->testSuiteTimes[$this->testSuiteLevel] += $time; + } + } + + $this->attachCurrentTestCase = TRUE; + $this->currentTestCase = NULL; + } + + /** + * Returns the XML as a string. + * + * @return string + * @since Method available since Release 2.2.0 + */ + public function getXML() + { + return $this->document->saveXML(); + } + + /** + * Enables or disables the writing of the document + * in flush(). + * + * This is a "hack" needed for the integration of + * PHPUnit with Phing. + * + * @return string + * @since Method available since Release 2.2.0 + */ + public function setWriteDocument($flag) + { + if (is_bool($flag)) { + $this->writeDocument = $flag; + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php @@ -0,0 +1,250 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * A TestListener that generates a logfile of the + * test execution using the Test Anything Protocol (TAP). + * + * @package PHPUnit + * @subpackage Util_Log + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Log_TAP extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener +{ + /** + * @var integer + */ + protected $testNumber = 0; + + /** + * @var integer + */ + protected $testSuiteLevel = 0; + + /** + * @var boolean + */ + protected $testSuccessful = TRUE; + + /** + * Constructor. + * + * @param mixed $out + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.3.4 + */ + public function __construct($out = NULL) + { + parent::__construct($out); + $this->write("TAP version 13\n"); + } + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->writeNotOk($test, 'Error'); + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + $this->writeNotOk($test, 'Failure'); + + $message = explode( + "\n", PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + $diagnostic = array( + 'message' => $message[0], + 'severity' => 'fail' + ); + + if ($e instanceof PHPUnit_Framework_ExpectationFailedException) { + $cf = $e->getComparisonFailure(); + + if ($cf !== NULL) { + $diagnostic['data'] = array( + 'got' => $cf->getActual(), + 'expected' => $cf->getExpected() + ); + } + } + + $yaml = new Symfony\Component\Yaml\Dumper; + + $this->write( + sprintf( + " ---\n%s ...\n", + $yaml->dump($diagnostic, 2, 2) + ) + ); + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->writeNotOk($test, '', 'TODO Incomplete Test'); + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->write( + sprintf( + "ok %d - # SKIP%s\n", + + $this->testNumber, + $e->getMessage() != '' ? ' ' . $e->getMessage() : '' + ) + ); + + $this->testSuccessful = FALSE; + } + + /** + * A testsuite started. + * + * @param PHPUnit_Framework_TestSuite $suite + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $this->testSuiteLevel++; + } + + /** + * A testsuite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $this->testSuiteLevel--; + + if ($this->testSuiteLevel == 0) { + $this->write(sprintf("1..%d\n", $this->testNumber)); + } + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + $this->testNumber++; + $this->testSuccessful = TRUE; + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if ($this->testSuccessful === TRUE) { + $this->write( + sprintf( + "ok %d - %s\n", + + $this->testNumber, + PHPUnit_Util_Test::describe($test) + ) + ); + } + } + + /** + * @param PHPUnit_Framework_Test $test + * @param string $prefix + * @param string $directive + */ + protected function writeNotOk(PHPUnit_Framework_Test $test, $prefix = '', $directive = '') + { + $this->write( + sprintf( + "not ok %d - %s%s%s\n", + + $this->testNumber, + $prefix != '' ? $prefix . ': ' : '', + PHPUnit_Util_Test::describe($test), + $directive != '' ? ' # ' . $directive : '' + ) + ); + + $this->testSuccessful = FALSE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php @@ -0,0 +1,339 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.4.0 + */ + +/** + * Utility methods for PHP sub-processes. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.4.0 + */ +abstract class PHPUnit_Util_PHP +{ + /** + * @var string $phpBinary + */ + protected $phpBinary; + + /** + * Returns the path to a PHP interpreter. + * + * PHPUnit_Util_PHP::$phpBinary contains the path to the PHP + * interpreter. + * + * When not set, the following assumptions will be made: + * + * 1. When PHPUnit is run using the CLI SAPI and the $_SERVER['_'] + * variable does not contain the string "PHPUnit", $_SERVER['_'] + * is assumed to contain the path to the current PHP interpreter + * and that will be used. + * + * 2. When PHPUnit is run using the CLI SAPI and the $_SERVER['_'] + * variable contains the string "PHPUnit", the file that $_SERVER['_'] + * points to is assumed to be the PHPUnit TextUI CLI wrapper script + * "phpunit" and the binary set up using #! on that file's first + * line of code is assumed to contain the path to the current PHP + * interpreter and that will be used. + * + * 3. When the PHP CLI/CGI binary configured with the PEAR Installer + * (php_bin configuration value) is readable, it will be used. + * + * 4. The current PHP interpreter is assumed to be in the $PATH and + * to be invokable through "php". + * + * @return string + */ + protected function getPhpBinary() + { + if ($this->phpBinary === NULL) { + if (($e = getenv("PHP_BINARY")) !== false) { + $this->phpBinary = $e; + } + else if (defined("PHP_BINARY")) { + $this->phpBinary = PHP_BINARY; + } else if (PHP_SAPI == 'cli' && isset($_SERVER['_'])) { + if (strpos($_SERVER['_'], 'phpunit') !== FALSE) { + $file = file($_SERVER['_']); + + if (strpos($file[0], ' ') !== FALSE) { + $tmp = explode(' ', $file[0]); + $this->phpBinary = trim($tmp[1]); + } else { + $this->phpBinary = ltrim(trim($file[0]), '#!'); + } + } else if (strpos(basename($_SERVER['_']), 'php') !== FALSE) { + $this->phpBinary = $_SERVER['_']; + } + } + + if ($this->phpBinary === NULL) { + $possibleBinaryLocations = array( + PHP_BINDIR . '/php', + PHP_BINDIR . '/php-cli.exe', + PHP_BINDIR . '/php.exe', + '@php_bin@', + ); + foreach ($possibleBinaryLocations as $binary) { + if (is_readable($binary)) { + $this->phpBinary = $binary; + break; + } + } + } + + if (!is_readable($this->phpBinary)) { + $this->phpBinary = 'php'; + } else { + $this->phpBinary = escapeshellarg($this->phpBinary); + } + } + + return $this->phpBinary; + } + + /** + * @return PHPUnit_Util_PHP + * @since Method available since Release 3.5.12 + */ + public static function factory() + { + if (DIRECTORY_SEPARATOR == '\\') { + return new PHPUnit_Util_PHP_Windows; + } + + return new PHPUnit_Util_PHP_Default; + } + + /** + * Runs a single job (PHP code) using a separate PHP process. + * + * @param string $job + * @param PHPUnit_Framework_TestCase $test + * @param PHPUnit_Framework_TestResult $result + * @return array|null + * @throws PHPUnit_Framework_Exception + */ + public function runJob($job, PHPUnit_Framework_Test $test = NULL, PHPUnit_Framework_TestResult $result = NULL) + { + $process = proc_open( + $this->getPhpBinary(), + array( + 0 => array('pipe', 'r'), + 1 => array('pipe', 'w'), + 2 => array('pipe', 'w') + ), + $pipes + ); + + if (!is_resource($process)) { + throw new PHPUnit_Framework_Exception( + 'Unable to create process for process isolation.' + ); + } + + if ($result !== NULL) { + $result->startTest($test); + } + + $this->process($pipes[0], $job); + fclose($pipes[0]); + + $stdout = stream_get_contents($pipes[1]); + fclose($pipes[1]); + + $stderr = stream_get_contents($pipes[2]); + fclose($pipes[2]); + + proc_close($process); + $this->cleanup(); + + if ($result !== NULL) { + $this->processChildResult($test, $result, $stdout, $stderr); + } else { + return array('stdout' => $stdout, 'stderr' => $stderr); + } + } + + /** + * @param resource $pipe + * @param string $job + * @since Method available since Release 3.5.12 + */ + abstract protected function process($pipe, $job); + + /** + * @since Method available since Release 3.5.12 + */ + protected function cleanup() + { + } + + /** + * Processes the TestResult object from an isolated process. + * + * @param PHPUnit_Framework_TestCase $test + * @param PHPUnit_Framework_TestResult $result + * @param string $stdout + * @param string $stderr + * @since Method available since Release 3.5.0 + */ + protected function processChildResult(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result, $stdout, $stderr) + { + $time = 0; + + if (!empty($stderr)) { + $result->addError( + $test, + new PHPUnit_Framework_Exception(trim($stderr)), $time + ); + } else { + set_error_handler(function($errno, $errstr, $errfile, $errline) { + throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); + }); + try { + if (strpos($stdout, "#!/usr/bin/env php\n") === 0) { + $stdout = substr($stdout, 19); + } + + $childResult = unserialize(str_replace("#!/usr/bin/env php\n", '', $stdout)); + restore_error_handler(); + } catch (ErrorException $e) { + restore_error_handler(); + $childResult = FALSE; + + $result->addError( + $test, new PHPUnit_Framework_Exception(trim($stdout), 0, $e), $time + ); + } + + if ($childResult !== FALSE) { + if (!empty($childResult['output'])) { + print $childResult['output']; + } + + $test->setResult($childResult['testResult']); + $test->addToAssertionCount($childResult['numAssertions']); + + $childResult = $childResult['result']; + + if ($result->getCollectCodeCoverageInformation()) { + $result->getCodeCoverage()->merge( + $childResult->getCodeCoverage() + ); + } + + $time = $childResult->time(); + $notImplemented = $childResult->notImplemented(); + $skipped = $childResult->skipped(); + $errors = $childResult->errors(); + $failures = $childResult->failures(); + + if (!empty($notImplemented)) { + $result->addError( + $test, $this->getException($notImplemented[0]), $time + ); + } + + else if (!empty($skipped)) { + $result->addError( + $test, $this->getException($skipped[0]), $time + ); + } + + else if (!empty($errors)) { + $result->addError( + $test, $this->getException($errors[0]), $time + ); + } + + else if (!empty($failures)) { + $result->addFailure( + $test, $this->getException($failures[0]), $time + ); + } + } + } + + $result->endTest($test, $time); + } + + /** + * Gets the thrown exception from a PHPUnit_Framework_TestFailure. + * + * @param PHPUnit_Framework_TestFailure $error + * @since Method available since Release 3.6.0 + * @see https://github.com/sebastianbergmann/phpunit/issues/74 + */ + protected function getException(PHPUnit_Framework_TestFailure $error) + { + $exception = $error->thrownException(); + + if ($exception instanceof __PHP_Incomplete_Class) { + $exceptionArray = array(); + foreach ((array)$exception as $key => $value) { + $key = substr($key, strrpos($key, "\0") + 1); + $exceptionArray[$key] = $value; + } + + $exception = new PHPUnit_Framework_SyntheticError( + sprintf( + '%s: %s', + $exceptionArray['_PHP_Incomplete_Class_Name'], + $exceptionArray['message'] + ), + $exceptionArray['code'], + $exceptionArray['file'], + $exceptionArray['line'], + $exceptionArray['trace'] + ); + } + + return $exception; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php @@ -0,0 +1,67 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.12 + */ + +/** + * Default utility for PHP sub-processes. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.12 + */ +class PHPUnit_Util_PHP_Default extends PHPUnit_Util_PHP +{ + /** + * @param resource $pipe + * @since Method available since Release 3.5.12 + */ + protected function process($pipe, $job) + { + fwrite($pipe, $job); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php @@ -0,0 +1,90 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.12 + */ + +/** + * Windows utility for PHP sub-processes. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.12 + */ +class PHPUnit_Util_PHP_Windows extends PHPUnit_Util_PHP +{ + /** + * @var string + */ + protected $tempFile; + + /** + * @param resource $pipe + * @since Method available since Release 3.5.12 + */ + protected function process($pipe, $job) + { + if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || + file_put_contents($this->tempFile, $job) === FALSE) { + throw new PHPUnit_Framework_Exception( + 'Unable to write temporary files for process isolation.' + ); + } + + fwrite( + $pipe, + "<?php require_once " . var_export($this->tempFile, TRUE) . "; ?>" + ); + } + + /** + * @since Method available since Release 3.5.12 + */ + protected function cleanup() + { + unlink($this->tempFile); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php @@ -0,0 +1,208 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +/** + * Utility class that can print to STDOUT or write to a file. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class PHPUnit_Util_Printer +{ + /** + * If TRUE, flush output after every write. + * + * @var boolean + */ + protected $autoFlush = FALSE; + + /** + * @var resource + */ + protected $out; + + /** + * @var string + */ + protected $outTarget; + + /** + * @var boolean + */ + protected $printsHTML = FALSE; + + /** + * Constructor. + * + * @param mixed $out + * @throws PHPUnit_Framework_Exception + */ + public function __construct($out = NULL) + { + if ($out !== NULL) { + if (is_string($out)) { + if (strpos($out, 'socket://') === 0) { + $out = explode(':', str_replace('socket://', '', $out)); + + if (sizeof($out) != 2) { + throw new PHPUnit_Framework_Exception; + } + + $this->out = fsockopen($out[0], $out[1]); + } else { + if (strpos($out, 'php://') === FALSE && + !is_dir(dirname($out))) { + mkdir(dirname($out), 0777, TRUE); + } + + $this->out = fopen($out, 'wt'); + } + + $this->outTarget = $out; + } else { + $this->out = $out; + } + } + } + + /** + * Flush buffer, optionally tidy up HTML, and close output if it's not to a php stream + */ + public function flush() + { + if ($this->out && strncmp($this->outTarget, 'php://', 6) !== 0) { + fclose($this->out); + } + + if ($this->printsHTML === TRUE && + $this->outTarget !== NULL && + strpos($this->outTarget, 'php://') !== 0 && + strpos($this->outTarget, 'socket://') !== 0 && + extension_loaded('tidy')) { + file_put_contents( + $this->outTarget, + tidy_repair_file( + $this->outTarget, array('indent' => TRUE, 'wrap' => 0), 'utf8' + ) + ); + } + } + + /** + * Performs a safe, incremental flush. + * + * Do not confuse this function with the flush() function of this class, + * since the flush() function may close the file being written to, rendering + * the current object no longer usable. + * + * @since Method available since Release 3.3.0 + */ + public function incrementalFlush() + { + if ($this->out) { + fflush($this->out); + } else { + flush(); + } + } + + /** + * @param string $buffer + */ + public function write($buffer) + { + if ($this->out) { + fwrite($this->out, $buffer); + + if ($this->autoFlush) { + $this->incrementalFlush(); + } + } else { + if (PHP_SAPI != 'cli') { + $buffer = htmlspecialchars($buffer); + } + + print $buffer; + + if ($this->autoFlush) { + $this->incrementalFlush(); + } + } + } + + /** + * Check auto-flush mode. + * + * @return boolean + * @since Method available since Release 3.3.0 + */ + public function getAutoFlush() + { + return $this->autoFlush; + } + + /** + * Set auto-flushing mode. + * + * If set, *incremental* flushes will be done after each write. This should + * not be confused with the different effects of this class' flush() method. + * + * @param boolean $autoFlush + * @since Method available since Release 3.3.0 + */ + public function setAutoFlush($autoFlush) + { + if (is_bool($autoFlush)) { + $this->autoFlush = $autoFlush; + } else { + throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean'); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/String.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/String.php @@ -0,0 +1,118 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * String helpers. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class PHPUnit_Util_String +{ + /** + * Converts a string to UTF-8 encoding. + * + * @param string $string + * @return string + */ + public static function convertToUtf8($string) + { + if (!self::isUtf8($string)) { + if (function_exists('mb_convert_encoding')) { + $string = mb_convert_encoding($string, 'UTF-8'); + } else { + $string = utf8_encode($string); + } + } + + return $string; + } + + /** + * Checks a string for UTF-8 encoding. + * + * @param string $string + * @return boolean + */ + protected static function isUtf8($string) + { + $length = strlen($string); + + for ($i = 0; $i < $length; $i++) { + if (ord($string[$i]) < 0x80) { + $n = 0; + } + + else if ((ord($string[$i]) & 0xE0) == 0xC0) { + $n = 1; + } + + else if ((ord($string[$i]) & 0xF0) == 0xE0) { + $n = 2; + } + + else if ((ord($string[$i]) & 0xF0) == 0xF0) { + $n = 3; + } + + else { + return FALSE; + } + + for ($j = 0; $j < $n; $j++) { + if ((++$i == $length) || ((ord($string[$i]) & 0xC0) != 0x80)) { + return FALSE; + } + } + } + + return TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Test.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Test.php @@ -0,0 +1,610 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Test helpers. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Test +{ + const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; + const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'; + const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<value>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; + const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^ ]+?))[ \t]*\r?$/m'; + + const SMALL = 0; + const MEDIUM = 1; + const LARGE = 2; + + private static $annotationCache = array(); + + protected static $templateMethods = array( + 'setUp', 'assertPreConditions', 'assertPostConditions', 'tearDown' + ); + + /** + * @param PHPUnit_Framework_Test $test + * @param boolean $asString + * @return mixed + */ + public static function describe(PHPUnit_Framework_Test $test, $asString = TRUE) + { + if ($asString) { + if ($test instanceof PHPUnit_Framework_SelfDescribing) { + return $test->toString(); + } else { + return get_class($test); + } + } else { + if ($test instanceof PHPUnit_Framework_TestCase) { + return array( + get_class($test), $test->getName() + ); + } + + else if ($test instanceof PHPUnit_Framework_SelfDescribing) { + return array('', $test->toString()); + } + + else { + return array('', get_class($test)); + } + } + } + + /** + * Returns the requirements for a test. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.6.0 + */ + public static function getRequirements($className, $methodName) + { + $reflector = new ReflectionClass($className); + $docComment = $reflector->getDocComment(); + $reflector = new ReflectionMethod($className, $methodName); + $docComment .= "\n" . $reflector->getDocComment(); + $requires = array(); + + if ($count = preg_match_all(self::REGEX_REQUIRES_VERSION, $docComment, $matches)) { + for ($i = 0; $i < $count; $i++) { + $requires[$matches['name'][$i]] = $matches['value'][$i]; + } + } + + // https://bugs.php.net/bug.php?id=63055 + $matches = array(); + + if ($count = preg_match_all(self::REGEX_REQUIRES, $docComment, $matches)) { + for ($i = 0; $i < $count; $i++) { + $name = $matches['name'][$i] . 's'; + if (!isset($requires[$name])) { + $requires[$name] = array(); + } + $requires[$name][] = $matches['value'][$i]; + } + } + + return $requires; + } + + /** + * Returns the expected exception for a test. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.3.6 + */ + public static function getExpectedException($className, $methodName) + { + $reflector = new ReflectionMethod($className, $methodName); + $docComment = $reflector->getDocComment(); + $docComment = substr($docComment, 3, -2); + + if (preg_match(self::REGEX_EXPECTED_EXCEPTION, $docComment, $matches)) { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + $class = $matches[1]; + $code = NULL; + $message = ''; + + if (isset($matches[2])) { + $message = trim($matches[2]); + } + + else if (isset($annotations['method']['expectedExceptionMessage'])) { + $message = self::_parseAnnotationContent( + $annotations['method']['expectedExceptionMessage'][0] + ); + } + + if (isset($matches[3])) { + $code = $matches[3]; + } + + else if (isset($annotations['method']['expectedExceptionCode'])) { + $code = self::_parseAnnotationContent( + $annotations['method']['expectedExceptionCode'][0] + ); + } + + if (is_numeric($code)) { + $code = (int)$code; + } + + else if (is_string($code) && defined($code)) { + $code = (int)constant($code); + } + + return array( + 'class' => $class, 'code' => $code, 'message' => $message + ); + } + + return FALSE; + } + + /** + * Parse annotation content to use constant/class constant values + * + * Constants are specified using a starting '@'. For example: @ClassName::CONST_NAME + * + * If the constant is not found the string is used as is to ensure maximum BC. + * + * @param string $message + * @return string + */ + protected static function _parseAnnotationContent($message) + { + if (strpos($message, '::') !== FALSE && count(explode('::', $message) == 2)) { + if (defined($message)) { + $message = constant($message); + } + } + return $message; + } + + /** + * Returns the provided data for a method. + * + * @param string $className + * @param string $methodName + * @param string $docComment + * @return mixed array|Iterator when a data provider is specified and exists + * false when a data provider is specified and does not exist + * null when no data provider is specified + * @since Method available since Release 3.2.0 + */ + public static function getProvidedData($className, $methodName) + { + $reflector = new ReflectionMethod($className, $methodName); + $docComment = $reflector->getDocComment(); + $data = NULL; + + if (preg_match(self::REGEX_DATA_PROVIDER, $docComment, $matches)) { + $dataProviderMethodNameNamespace = explode('\\', $matches[1]); + $leaf = explode('::', array_pop($dataProviderMethodNameNamespace)); + $dataProviderMethodName = array_pop($leaf); + + if (!empty($dataProviderMethodNameNamespace)) { + $dataProviderMethodNameNamespace = join('\\', $dataProviderMethodNameNamespace) . '\\'; + } else { + $dataProviderMethodNameNamespace = ''; + } + + if (!empty($leaf)) { + $dataProviderClassName = $dataProviderMethodNameNamespace . array_pop($leaf); + } else { + $dataProviderClassName = $className; + } + + $dataProviderClass = new ReflectionClass($dataProviderClassName); + $dataProviderMethod = $dataProviderClass->getMethod( + $dataProviderMethodName + ); + + if ($dataProviderMethod->isStatic()) { + $object = NULL; + } else { + $object = $dataProviderClass->newInstance(); + } + + if ($dataProviderMethod->getNumberOfParameters() == 0) { + $data = $dataProviderMethod->invoke($object); + } else { + $data = $dataProviderMethod->invoke($object, $methodName); + } + } + + if ($data !== NULL) { + if (is_object($data)) { + $data = iterator_to_array($data); + } + + foreach ($data as $key => $value) { + if (!is_array($value)) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Data set %s is invalid.', + is_int($key) ? '#' . $key : '"' . $key . '"' + ) + ); + } + } + } + + return $data; + } + + /** + * @param string $className + * @param string $methodName + * @return array + * @throws ReflectionException + * @since Method available since Release 3.4.0 + */ + public static function parseTestMethodAnnotations($className, $methodName = '') + { + if (!isset(self::$annotationCache[$className])) { + $class = new ReflectionClass($className); + self::$annotationCache[$className] = self::parseAnnotations($class->getDocComment()); + } + + if (!empty($methodName) && !isset(self::$annotationCache[$className . '::' . $methodName])) { + try { + $method = new ReflectionMethod($className, $methodName); + $annotations = self::parseAnnotations($method->getDocComment()); + } catch (ReflectionException $e) { + $annotations = array(); + } + self::$annotationCache[$className . '::' . $methodName] = $annotations; + } + + return array( + 'class' => self::$annotationCache[$className], + 'method' => !empty($methodName) ? self::$annotationCache[$className . '::' . $methodName] : array() + ); + } + + /** + * @param string $docblock + * @return array + * @since Method available since Release 3.4.0 + */ + private static function parseAnnotations($docblock) + { + $annotations = array(); + // Strip away the docblock header and footer to ease parsing of one line annotations + $docblock = substr($docblock, 3, -2); + + if (preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m', $docblock, $matches)) { + $numMatches = count($matches[0]); + + for ($i = 0; $i < $numMatches; ++$i) { + $annotations[$matches['name'][$i]][] = $matches['value'][$i]; + } + } + + return $annotations; + } + + /** + * Returns the backup settings for a test. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.4.0 + */ + public static function getBackupSettings($className, $methodName) + { + return array( + 'backupGlobals' => self::getBooleanAnnotationSetting( + $className, $methodName, 'backupGlobals' + ), + 'backupStaticAttributes' => self::getBooleanAnnotationSetting( + $className, $methodName, 'backupStaticAttributes' + ) + ); + } + + /** + * Returns the dependencies for a test class or method. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.4.0 + */ + public static function getDependencies($className, $methodName) + { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + $dependencies = array(); + + if (isset($annotations['class']['depends'])) { + $dependencies = $annotations['class']['depends']; + } + + if (isset($annotations['method']['depends'])) { + $dependencies = array_merge( + $dependencies, $annotations['method']['depends'] + ); + } + + return array_unique($dependencies); + } + + /** + * Returns the error handler settings for a test. + * + * @param string $className + * @param string $methodName + * @return boolean + * @since Method available since Release 3.4.0 + */ + public static function getErrorHandlerSettings($className, $methodName) + { + return self::getBooleanAnnotationSetting( + $className, $methodName, 'errorHandler' + ); + } + + /** + * Returns the groups for a test class or method. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.2.0 + */ + public static function getGroups($className, $methodName = '') + { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + $groups = array(); + + if (isset($annotations['method']['author'])) { + $groups = $annotations['method']['author']; + } + + else if (isset($annotations['class']['author'])) { + $groups = $annotations['class']['author']; + } + + if (isset($annotations['class']['group'])) { + $groups = array_merge($groups, $annotations['class']['group']); + } + + if (isset($annotations['method']['group'])) { + $groups = array_merge($groups, $annotations['method']['group']); + } + + if (isset($annotations['class']['ticket'])) { + $groups = array_merge($groups, $annotations['class']['ticket']); + } + + if (isset($annotations['method']['ticket'])) { + $groups = array_merge($groups, $annotations['method']['ticket']); + } + + foreach (array('small', 'medium', 'large') as $size) { + if (isset($annotations['method'][$size])) { + $groups[] = $size; + } + + else if (isset($annotations['class'][$size])) { + $groups[] = $size; + } + } + + return array_unique($groups); + } + + /** + * Returns the size of the test. + * + * @param string $className + * @param string $methodName + * @return integer + * @since Method available since Release 3.6.0 + */ + public static function getSize($className, $methodName) + { + $groups = array_flip(self::getGroups($className, $methodName)); + $size = self::SMALL; + $class = new ReflectionClass($className); + + if ((class_exists('PHPUnit_Extensions_Database_TestCase', FALSE) && + $class->isSubclassOf('PHPUnit_Extensions_Database_TestCase')) || + (class_exists('PHPUnit_Extensions_SeleniumTestCase', FALSE) && + $class->isSubclassOf('PHPUnit_Extensions_SeleniumTestCase'))) { + $size = self::LARGE; + } + + else if (isset($groups['medium'])) { + $size = self::MEDIUM; + } + + else if (isset($groups['large'])) { + $size = self::LARGE; + } + + return $size; + } + + /** + * Returns the tickets for a test class or method. + * + * @param string $className + * @param string $methodName + * @return array + * @since Method available since Release 3.4.0 + */ + public static function getTickets($className, $methodName) + { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + $tickets = array(); + + if (isset($annotations['class']['ticket'])) { + $tickets = $annotations['class']['ticket']; + } + + if (isset($annotations['method']['ticket'])) { + $tickets = array_merge($tickets, $annotations['method']['ticket']); + } + + return array_unique($tickets); + } + + /** + * Returns the output buffering settings for a test. + * + * @param string $className + * @param string $methodName + * @return boolean + * @since Method available since Release 3.4.0 + */ + public static function getOutputBufferingSettings($className, $methodName) + { + return self::getBooleanAnnotationSetting( + $className, $methodName, 'outputBuffering' + ); + } + + /** + * Returns the process isolation settings for a test. + * + * @param string $className + * @param string $methodName + * @return boolean + * @since Method available since Release 3.4.1 + */ + public static function getProcessIsolationSettings($className, $methodName) + { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + if (isset($annotations['class']['runTestsInSeparateProcesses']) || + isset($annotations['method']['runInSeparateProcess'])) { + return TRUE; + } else { + return FALSE; + } + } + + /** + * Returns the preserve global state settings for a test. + * + * @param string $className + * @param string $methodName + * @return boolean + * @since Method available since Release 3.4.0 + */ + public static function getPreserveGlobalStateSettings($className, $methodName) + { + return self::getBooleanAnnotationSetting( + $className, $methodName, 'preserveGlobalState' + ); + } + + /** + * @param string $className + * @param string $methodName + * @param string $settingName + * @return boolean + * @since Method available since Release 3.4.0 + */ + private static function getBooleanAnnotationSetting($className, $methodName, $settingName) + { + $annotations = self::parseTestMethodAnnotations( + $className, $methodName + ); + + $result = NULL; + + if (isset($annotations['class'][$settingName])) { + if ($annotations['class'][$settingName][0] == 'enabled') { + $result = TRUE; + } + + else if ($annotations['class'][$settingName][0] == 'disabled') { + $result = FALSE; + } + } + + if (isset($annotations['method'][$settingName])) { + if ($annotations['method'][$settingName][0] == 'enabled') { + $result = TRUE; + } + + else if ($annotations['method'][$settingName][0] == 'disabled') { + $result = FALSE; + } + } + + return $result; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php @@ -0,0 +1,177 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * Prettifies class and method names for use in TestDox documentation. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +class PHPUnit_Util_TestDox_NamePrettifier +{ + /** + * @var string + */ + protected $prefix = 'Test'; + + /** + * @var string + */ + protected $suffix = 'Test'; + + /** + * @var array + */ + protected $strings = array(); + + /** + * Prettifies the name of a test class. + * + * @param string $name + * @return string + */ + public function prettifyTestClass($name) + { + $title = $name; + + if ($this->suffix !== NULL && + $this->suffix == substr($name, -1 * strlen($this->suffix))) { + $title = substr($title, 0, strripos($title, $this->suffix)); + } + + if ($this->prefix !== NULL && + $this->prefix == substr($name, 0, strlen($this->prefix))) { + $title = substr($title, strlen($this->prefix)); + } + + return $title; + } + + /** + * Prettifies the name of a test method. + * + * @param string $name + * @return string + */ + public function prettifyTestMethod($name) + { + $buffer = ''; + + if (!is_string($name) || strlen($name) == 0) { + return $buffer; + } + + $string = preg_replace('#\d+$#', '', $name, -1, $count); + + if (in_array($string, $this->strings)) { + $name = $string; + } else if ($count == 0) { + $this->strings[] = $string; + } + + if (strpos($name, '_') !== FALSE) { + return str_replace('_', ' ', $name); + } + + $max = strlen($name); + + if (substr($name, 0, 4) == 'test') { + $offset = 4; + } else { + $offset = 0; + $name[0] = strtoupper($name[0]); + } + + $wasNumeric = FALSE; + + for ($i = $offset; $i < $max; $i++) { + if ($i > $offset && + ord($name[$i]) >= 65 && + ord($name[$i]) <= 90) { + $buffer .= ' ' . strtolower($name[$i]); + } else { + $isNumeric = is_numeric($name[$i]); + + if (!$wasNumeric && $isNumeric) { + $buffer .= ' '; + $wasNumeric = TRUE; + } + + if ($wasNumeric && !$isNumeric) { + $wasNumeric = FALSE; + } + + $buffer .= $name[$i]; + } + } + + return $buffer; + } + + /** + * Sets the prefix of test names. + * + * @param string $prefix + */ + public function setPrefix($prefix) + { + $this->prefix = $prefix; + } + + /** + * Sets the suffix of test names. + * + * @param string $prefix + */ + public function setSuffix($suffix) + { + $this->suffix = $suffix; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php @@ -0,0 +1,347 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * Base class for printers of TestDox documentation. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +abstract class PHPUnit_Util_TestDox_ResultPrinter extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener +{ + /** + * @var PHPUnit_Util_TestDox_NamePrettifier + */ + protected $prettifier; + + /** + * @var string + */ + protected $testClass = ''; + + /** + * @var integer + */ + protected $testStatus = FALSE; + + /** + * @var array + */ + protected $tests = array(); + + /** + * @var integer + */ + protected $successful = 0; + + /** + * @var integer + */ + protected $failed = 0; + + /** + * @var integer + */ + protected $skipped = 0; + + /** + * @var integer + */ + protected $incomplete = 0; + + /** + * @var string + */ + protected $testTypeOfInterest = 'PHPUnit_Framework_TestCase'; + + /** + * @var string + */ + protected $currentTestClassPrettified; + + /** + * @var string + */ + protected $currentTestMethodPrettified; + + /** + * Constructor. + * + * @param resource $out + */ + public function __construct($out = NULL) + { + parent::__construct($out); + + $this->prettifier = new PHPUnit_Util_TestDox_NamePrettifier; + $this->startRun(); + } + + /** + * Flush buffer and close output. + * + */ + public function flush() + { + $this->doEndClass(); + $this->endRun(); + + parent::flush(); + } + + /** + * An error occurred. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR; + $this->failed++; + } + } + + /** + * A failure occurred. + * + * @param PHPUnit_Framework_Test $test + * @param PHPUnit_Framework_AssertionFailedError $e + * @param float $time + */ + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE; + $this->failed++; + } + } + + /** + * Incomplete test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + */ + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE; + $this->incomplete++; + } + } + + /** + * Skipped test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.0.0 + */ + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED; + $this->skipped++; + } + } + + /** + * A testsuite started. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A testsuite ended. + * + * @param PHPUnit_Framework_TestSuite $suite + * @since Method available since Release 2.2.0 + */ + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + /** + * A test started. + * + * @param PHPUnit_Framework_Test $test + */ + public function startTest(PHPUnit_Framework_Test $test) + { + if ($test instanceof $this->testTypeOfInterest) { + $class = get_class($test); + + if ($this->testClass != $class) { + if ($this->testClass != '') { + $this->doEndClass(); + } + + $this->currentTestClassPrettified = $this->prettifier->prettifyTestClass($class); + $this->startClass($class); + + $this->testClass = $class; + $this->tests = array(); + } + + $prettified = FALSE; + + if ($test instanceof PHPUnit_Framework_TestCase && + !$test instanceof PHPUnit_Framework_Warning) { + $annotations = $test->getAnnotations(); + + if (isset($annotations['method']['testdox'][0])) { + $this->currentTestMethodPrettified = $annotations['method']['testdox'][0]; + $prettified = TRUE; + } + } + + if (!$prettified) { + $this->currentTestMethodPrettified = $this->prettifier->prettifyTestMethod($test->getName(FALSE)); + } + + $this->testStatus = PHPUnit_Runner_BaseTestRunner::STATUS_PASSED; + } + } + + /** + * A test ended. + * + * @param PHPUnit_Framework_Test $test + * @param float $time + */ + public function endTest(PHPUnit_Framework_Test $test, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + if (!isset($this->tests[$this->currentTestMethodPrettified])) { + if ($this->testStatus == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED) { + $this->tests[$this->currentTestMethodPrettified]['success'] = 1; + $this->tests[$this->currentTestMethodPrettified]['failure'] = 0; + } else { + $this->tests[$this->currentTestMethodPrettified]['success'] = 0; + $this->tests[$this->currentTestMethodPrettified]['failure'] = 1; + } + } else { + if ($this->testStatus == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED) { + $this->tests[$this->currentTestMethodPrettified]['success']++; + } else { + $this->tests[$this->currentTestMethodPrettified]['failure']++; + } + } + + $this->currentTestClassPrettified = NULL; + $this->currentTestMethodPrettified = NULL; + } + } + + /** + * @since Method available since Release 2.3.0 + */ + protected function doEndClass() + { + foreach ($this->tests as $name => $data) { + $this->onTest($name, $data['failure'] == 0); + } + + $this->endClass($this->testClass); + } + + /** + * Handler for 'start run' event. + * + */ + protected function startRun() + { + } + + /** + * Handler for 'start class' event. + * + * @param string $name + */ + protected function startClass($name) + { + } + + /** + * Handler for 'on test' event. + * + * @param string $name + * @param boolean $success + */ + protected function onTest($name, $success = TRUE) + { + } + + /** + * Handler for 'end class' event. + * + * @param string $name + */ + protected function endClass($name) + { + } + + /** + * Handler for 'end run' event. + * + */ + protected function endRun() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php @@ -0,0 +1,123 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * Prints TestDox documentation in HTML format. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +class PHPUnit_Util_TestDox_ResultPrinter_HTML extends PHPUnit_Util_TestDox_ResultPrinter +{ + /** + * @var boolean + */ + protected $printsHTML = TRUE; + + /** + * Handler for 'start run' event. + * + */ + protected function startRun() + { + $this->write('<html><body>'); + } + + /** + * Handler for 'start class' event. + * + * @param string $name + */ + protected function startClass($name) + { + $this->write( + '<h2 id="' . $name . '">' . $this->currentTestClassPrettified . + '</h2><ul>' + ); + } + + /** + * Handler for 'on test' event. + * + * @param string $name + * @param boolean $success + */ + protected function onTest($name, $success = TRUE) + { + if (!$success) { + $strikeOpen = '<strike>'; + $strikeClose = '</strike>'; + } else { + $strikeOpen = ''; + $strikeClose = ''; + } + + $this->write('<li>' . $strikeOpen . $name . $strikeClose . '</li>'); + } + + /** + * Handler for 'end class' event. + * + * @param string $name + */ + protected function endClass($name) + { + $this->write('</ul>'); + } + + /** + * Handler for 'end run' event. + * + */ + protected function endRun() + { + $this->write('</body></html>'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php @@ -0,0 +1,95 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * Prints TestDox documentation in text format. + * + * @package PHPUnit + * @subpackage Util_TestDox + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +class PHPUnit_Util_TestDox_ResultPrinter_Text extends PHPUnit_Util_TestDox_ResultPrinter +{ + /** + * Handler for 'start class' event. + * + * @param string $name + */ + protected function startClass($name) + { + $this->write($this->currentTestClassPrettified . "\n"); + } + + /** + * Handler for 'on test' event. + * + * @param string $name + * @param boolean $success + */ + protected function onTest($name, $success = TRUE) + { + if ($success) { + $this->write(' [x] '); + } else { + $this->write(' [ ] '); + } + + $this->write($name . "\n"); + } + + /** + * Handler for 'end class' event. + * + * @param string $name + */ + protected function endClass($name) + { + $this->write("\n"); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php @@ -0,0 +1,148 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.1.0 + */ + +/** + * Iterator for test suites. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.1.0 + */ +class PHPUnit_Util_TestSuiteIterator implements RecursiveIterator +{ + /** + * @var integer + */ + protected $position; + + /** + * @var PHPUnit_Framework_Test[] + */ + protected $tests; + + /** + * Constructor. + * + * @param PHPUnit_Framework_TestSuite $suite + */ + public function __construct(PHPUnit_Framework_TestSuite $testSuite) + { + $this->tests = $testSuite->tests(); + } + + /** + * Rewinds the Iterator to the first element. + * + */ + public function rewind() + { + $this->position = 0; + } + + /** + * Checks if there is a current element after calls to rewind() or next(). + * + * @return boolean + */ + public function valid() + { + return $this->position < count($this->tests); + } + + /** + * Returns the key of the current element. + * + * @return integer + */ + public function key() + { + return $this->position; + } + + /** + * Returns the current element. + * + * @return PHPUnit_Framework_Test + */ + public function current() + { + return $this->valid() ? $this->tests[$this->position] : NULL; + } + + /** + * Moves forward to next element. + * + */ + public function next() + { + $this->position++; + } + + /** + * Returns the sub iterator for the current element. + * + * @return PHPUnit_Util_TestSuiteIterator + */ + public function getChildren() + { + return new PHPUnit_Util_TestSuiteIterator( + $this->tests[$this->position] + ); + } + + /** + * Checks whether the current element has children. + * + * @return boolean + */ + public function hasChildren() + { + return $this->tests[$this->position] instanceof PHPUnit_Framework_TestSuite; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Type.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/Type.php @@ -0,0 +1,303 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +/** + * Utility class for textual type (and value) representation. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class PHPUnit_Util_Type +{ + public static function isType($type) + { + return in_array( + $type, + array( + 'numeric', + 'integer', + 'int', + 'float', + 'string', + 'boolean', + 'bool', + 'null', + 'array', + 'object', + 'resource', + 'scalar' + ) + ); + } + + /** + * Exports a value into a string + * + * The output of this method is similar to the output of print_r(), but + * improved in various aspects: + * + * - NULL is rendered as "null" (instead of "") + * - TRUE is rendered as "true" (instead of "1") + * - FALSE is rendered as "false" (instead of "") + * - Strings are always quoted with single quotes + * - Carriage returns and newlines are normalized to \n + * - Recursion and repeated rendering is treated properly + * + * @param mixed $value The value to export + * @param integer $indentation The indentation level of the 2nd+ line + * @return string + * @since Method available since Release 3.6.0 + */ + public static function export($value, $indentation = 0) + { + return self::recursiveExport($value, $indentation); + } + + /** + * Recursive implementation of export + * + * @param mixed $value The value to export + * @param integer $indentation The indentation level of the 2nd+ line + * @param array $processedObjects Contains all objects that were already + * rendered + * @return string + * @since Method available since Release 3.6.0 + * @see PHPUnit_Util_Type::export + */ + protected static function recursiveExport($value, $indentation, &$processedObjects = array()) + { + if ($value === NULL) { + return 'null'; + } + + if ($value === TRUE) { + return 'true'; + } + + if ($value === FALSE) { + return 'false'; + } + + if (is_string($value)) { + // Match for most non printable chars somewhat taking multibyte chars into account + if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) { + return 'Binary String: 0x' . bin2hex($value); + } + + return "'" . + str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value) . + "'"; + } + + $origValue = $value; + + if (is_object($value)) { + if (in_array($value, $processedObjects, TRUE)) { + return sprintf( + '%s Object (*RECURSION*)', + + get_class($value) + ); + } + + $processedObjects[] = $value; + + // Convert object to array + $value = self::toArray($value); + } + + if (is_array($value)) { + $whitespace = str_repeat(' ', $indentation); + + // There seems to be no other way to check arrays for recursion + // http://www.php.net/manual/en/language.types.array.php#73936 + preg_match_all('/\n \[(\w+)\] => Array\s+\*RECURSION\*/', print_r($value, TRUE), $matches); + $recursiveKeys = array_unique($matches[1]); + + // Convert to valid array keys + // Numeric integer strings are automatically converted to integers + // by PHP + foreach ($recursiveKeys as $key => $recursiveKey) { + if ((string)(integer)$recursiveKey === $recursiveKey) { + $recursiveKeys[$key] = (integer)$recursiveKey; + } + } + + $content = ''; + + foreach ($value as $key => $val) { + if (in_array($key, $recursiveKeys, TRUE)) { + $val = 'Array (*RECURSION*)'; + } + + else { + $val = self::recursiveExport($val, $indentation+1, $processedObjects); + } + + $content .= $whitespace . ' ' . self::export($key) . ' => ' . $val . "\n"; + } + + if (strlen($content) > 0) { + $content = "\n" . $content . $whitespace; + } + + return sprintf( + "%s (%s)", + + is_object($origValue) ? get_class($origValue) . ' Object' : 'Array', + $content + ); + } + + if (is_double($value) && (double)(integer)$value === $value) { + return $value . '.0'; + } + + return (string)$value; + } + + /** + * Exports a value into a single-line string + * + * The output of this method is similar to the output of + * PHPUnit_Util_Type::export. This method guarantees thought that the + * result contains now newlines. + * + * Newlines are replaced by the visible string '\n'. Contents of arrays + * and objects (if any) are replaced by '...'. + * + * @param mixed $value The value to export + * @param integer $indentation The indentation level of the 2nd+ line + * @return string + * @see PHPUnit_Util_Type::export + */ + public static function shortenedExport($value) + { + if (is_string($value)) { + return self::shortenedString($value); + } + + if (is_object($value)) { + return sprintf( + '%s Object (%s)', + get_class($value), + count(self::toArray($value)) > 0 ? '...' : '' + ); + } + + if (is_array($value)) { + return sprintf( + 'Array (%s)', + count($value) > 0 ? '...' : '' + ); + } + + return self::export($value); + } + + /** + * Shortens a string and converts all new lines to '\n' + * + * @param string $string The string to shorten + * @param integer $max The maximum length for the string + * @return string + */ + public static function shortenedString($string, $maxLength = 40) + { + $string = self::export($string); + + if (strlen($string) > $maxLength) { + $string = substr($string, 0, $maxLength - 10) . '...' . substr($string, -7); + } + + return str_replace("\n", '\n', $string); + } + + /** + * Converts an object to an array containing all of its private, protected + * and public properties. + * + * @param object $object + * @return array + * @since Method available since Release 3.6.0 + */ + public static function toArray($object) + { + $array = array(); + + foreach ((array)$object as $key => $value) { + // properties are transformed to keys in the following way: + + // private $property => "\0Classname\0property" + // protected $property => "\0*\0property" + // public $property => "property" + + if (preg_match('/^\0.+\0(.+)$/', $key, $matches)) { + $key = $matches[1]; + } + + $array[$key] = $value; + } + + // Some internal classes like SplObjectStorage don't work with the + // above (fast) mechanism nor with reflection + // Format the output similarly to print_r() in this case + if ($object instanceof SplObjectStorage) { + foreach ($object as $key => $value) { + $array[spl_object_hash($value)] = array( + 'obj' => $value, + 'inf' => $object->getInfo(), + ); + } + } + + return $array; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/XML.php b/libs/php-ssh/vendor/phpunit/phpunit/PHPUnit/Util/XML.php @@ -0,0 +1,920 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.2.0 + */ + +/** + * XML helpers. + * + * @package PHPUnit + * @subpackage Util + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.2.0 + */ +class PHPUnit_Util_XML +{ + /** + * @param string $string + * @return string + * @author Kore Nordmann <mail@kore-nordmann.de> + * @since Method available since Release 3.4.6 + */ + public static function prepareString($string) + { + return preg_replace_callback( + '/[\\x00-\\x04\\x0b\\x0c\\x0e-\\x1f\\x7f]/', + function ($matches) + { + return sprintf('&#x%02x;', ord($matches[0])); + }, + htmlspecialchars( + PHPUnit_Util_String::convertToUtf8($string), ENT_COMPAT, 'UTF-8' + ) + ); + } + + /** + * Loads an XML (or HTML) file into a DOMDocument object. + * + * @param string $filename + * @param boolean $isHtml + * @param boolean $xinclude + * @return DOMDocument + * @since Method available since Release 3.3.0 + */ + public static function loadFile($filename, $isHtml = FALSE, $xinclude = FALSE) + { + $reporting = error_reporting(0); + $contents = file_get_contents($filename); + error_reporting($reporting); + + if ($contents === FALSE) { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Could not read "%s".', + $filename + ) + ); + } + + return self::load($contents, $isHtml, $filename, $xinclude); + } + + /** + * Load an $actual document into a DOMDocument. This is called + * from the selector assertions. + * + * If $actual is already a DOMDocument, it is returned with + * no changes. Otherwise, $actual is loaded into a new DOMDocument + * as either HTML or XML, depending on the value of $isHtml. If $isHtml is + * false and $xinclude is true, xinclude is performed on the loaded + * DOMDocument. + * + * Note: prior to PHPUnit 3.3.0, this method loaded a file and + * not a string as it currently does. To load a file into a + * DOMDocument, use loadFile() instead. + * + * @param string|DOMDocument $actual + * @param boolean $isHtml + * @param string $filename + * @param boolean $xinclude + * @return DOMDocument + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + * @author Tobias Schlitt <toby@php.net> + */ + public static function load($actual, $isHtml = FALSE, $filename = '', $xinclude = FALSE) + { + if ($actual instanceof DOMDocument) { + return $actual; + } + + $document = new DOMDocument; + + $internal = libxml_use_internal_errors(TRUE); + $message = ''; + $reporting = error_reporting(0); + + if ($isHtml) { + $loaded = $document->loadHTML($actual); + } else { + $loaded = $document->loadXML($actual); + } + + if ('' !== $filename) { + // Necessary for xinclude + $document->documentURI = $filename; + } + + if (!$isHtml && $xinclude) { + $document->xinclude(); + } + + foreach (libxml_get_errors() as $error) { + $message .= $error->message; + } + + libxml_use_internal_errors($internal); + error_reporting($reporting); + + if ($loaded === FALSE) { + if ($filename != '') { + throw new PHPUnit_Framework_Exception( + sprintf( + 'Could not load "%s".%s', + + $filename, + $message != '' ? "\n" . $message : '' + ) + ); + } else { + throw new PHPUnit_Framework_Exception($message); + } + } + + return $document; + } + + /** + * + * + * @param DOMNode $node + * @return string + * @since Method available since Release 3.4.0 + */ + public static function nodeToText(DOMNode $node) + { + if ($node->childNodes->length == 1) { + return $node->nodeValue; + } + + $result = ''; + + foreach ($node->childNodes as $childNode) { + $result .= $node->ownerDocument->saveXML($childNode); + } + + return $result; + } + + /** + * + * + * @param DOMNode $node + * @since Method available since Release 3.3.0 + * @author Mattis Stordalen Flister <mattis@xait.no> + */ + public static function removeCharacterDataNodes(DOMNode $node) + { + if ($node->hasChildNodes()) { + for ($i = $node->childNodes->length - 1; $i >= 0; $i--) { + if (($child = $node->childNodes->item($i)) instanceof DOMCharacterData) { + $node->removeChild($child); + } + } + } + } + + /** + * "Convert" a DOMElement object into a PHP variable. + * + * @param DOMElement $element + * @return mixed + * @since Method available since Release 3.4.0 + */ + public static function xmlToVariable(DOMElement $element) + { + $variable = NULL; + + switch ($element->tagName) { + case 'array': { + $variable = array(); + + foreach ($element->getElementsByTagName('element') as $element) { + $value = self::xmlToVariable($element->childNodes->item(1)); + + if ($element->hasAttribute('key')) { + $variable[(string)$element->getAttribute('key')] = $value; + } else { + $variable[] = $value; + } + } + } + break; + + case 'object': { + $className = $element->getAttribute('class'); + + if ($element->hasChildNodes()) { + $arguments = $element->childNodes->item(1)->childNodes; + $constructorArgs = array(); + + foreach ($arguments as $argument) { + if ($argument instanceof DOMElement) { + $constructorArgs[] = self::xmlToVariable($argument); + } + } + + $class = new ReflectionClass($className); + $variable = $class->newInstanceArgs($constructorArgs); + } else { + $variable = new $className; + } + } + break; + + case 'boolean': { + $variable = $element->nodeValue == 'true' ? TRUE : FALSE; + } + break; + + case 'integer': + case 'double': + case 'string': { + $variable = $element->nodeValue; + + settype($variable, $element->tagName); + } + break; + } + + return $variable; + } + + /** + * Validate list of keys in the associative array. + * + * @param array $hash + * @param array $validKeys + * @return array + * @throws PHPUnit_Framework_Exception + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function assertValidKeys(array $hash, array $validKeys) + { + $valids = array(); + + // Normalize validation keys so that we can use both indexed and + // associative arrays. + foreach ($validKeys as $key => $val) { + is_int($key) ? $valids[$val] = NULL : $valids[$key] = $val; + } + + $validKeys = array_keys($valids); + + // Check for invalid keys. + foreach ($hash as $key => $value) { + if (!in_array($key, $validKeys)) { + $unknown[] = $key; + } + } + + if (!empty($unknown)) { + throw new PHPUnit_Framework_Exception( + 'Unknown key(s): ' . implode(', ', $unknown) + ); + } + + // Add default values for any valid keys that are empty. + foreach ($valids as $key => $value) { + if (!isset($hash[$key])) { + $hash[$key] = $value; + } + } + + return $hash; + } + + /** + * Parse a CSS selector into an associative array suitable for + * use with findNodes(). + * + * @param string $selector + * @param mixed $content + * @return array + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + public static function convertSelectToTag($selector, $content = TRUE) + { + $selector = trim(preg_replace("/\s+/", " ", $selector)); + + // substitute spaces within attribute value + while (preg_match('/\[[^\]]+"[^"]+\s[^"]+"\]/', $selector)) { + $selector = preg_replace( + '/(\[[^\]]+"[^"]+)\s([^"]+"\])/', "$1__SPACE__$2", $selector + ); + } + + if (strstr($selector, ' ')) { + $elements = explode(' ', $selector); + } else { + $elements = array($selector); + } + + $previousTag = array(); + + foreach (array_reverse($elements) as $element) { + $element = str_replace('__SPACE__', ' ', $element); + + // child selector + if ($element == '>') { + $previousTag = array('child' => $previousTag['descendant']); + continue; + } + + $tag = array(); + + // match element tag + preg_match("/^([^\.#\[]*)/", $element, $eltMatches); + + if (!empty($eltMatches[1])) { + $tag['tag'] = $eltMatches[1]; + } + + // match attributes (\[[^\]]*\]*), ids (#[^\.#\[]*), + // and classes (\.[^\.#\[]*)) + preg_match_all( + "/(\[[^\]]*\]*|#[^\.#\[]*|\.[^\.#\[]*)/", $element, $matches + ); + + if (!empty($matches[1])) { + $classes = array(); + $attrs = array(); + + foreach ($matches[1] as $match) { + // id matched + if (substr($match, 0, 1) == '#') { + $tag['id'] = substr($match, 1); + } + + // class matched + else if (substr($match, 0, 1) == '.') { + $classes[] = substr($match, 1); + } + + // attribute matched + else if (substr($match, 0, 1) == '[' && + substr($match, -1, 1) == ']') { + $attribute = substr($match, 1, strlen($match) - 2); + $attribute = str_replace('"', '', $attribute); + + // match single word + if (strstr($attribute, '~=')) { + list($key, $value) = explode('~=', $attribute); + $value = "regexp:/.*\b$value\b.*/"; + } + + // match substring + else if (strstr($attribute, '*=')) { + list($key, $value) = explode('*=', $attribute); + $value = "regexp:/.*$value.*/"; + } + + // exact match + else { + list($key, $value) = explode('=', $attribute); + } + + $attrs[$key] = $value; + } + } + + if ($classes) { + $tag['class'] = join(' ', $classes); + } + + if ($attrs) { + $tag['attributes'] = $attrs; + } + } + + // tag content + if (is_string($content)) { + $tag['content'] = $content; + } + + // determine previous child/descendants + if (!empty($previousTag['descendant'])) { + $tag['descendant'] = $previousTag['descendant']; + } + + else if (!empty($previousTag['child'])) { + $tag['child'] = $previousTag['child']; + } + + $previousTag = array('descendant' => $tag); + } + + return $tag; + } + + /** + * Parse an $actual document and return an array of DOMNodes + * matching the CSS $selector. If an error occurs, it will + * return FALSE. + * + * To only return nodes containing a certain content, give + * the $content to match as a string. Otherwise, setting + * $content to TRUE will return all nodes matching $selector. + * + * The $actual document may be a DOMDocument or a string + * containing XML or HTML, identified by $isHtml. + * + * @param array $selector + * @param string $content + * @param mixed $actual + * @param boolean $isHtml + * @return false|array + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + * @author Tobias Schlitt <toby@php.net> + */ + public static function cssSelect($selector, $content, $actual, $isHtml = TRUE) + { + $matcher = self::convertSelectToTag($selector, $content); + $dom = self::load($actual, $isHtml); + $tags = self::findNodes($dom, $matcher, $isHtml); + + return $tags; + } + + /** + * Parse out the options from the tag using DOM object tree. + * + * @param DOMDocument $dom + * @param array $options + * @param boolean $isHtml + * @return array + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + * @author Tobias Schlitt <toby@php.net> + */ + public static function findNodes(DOMDocument $dom, array $options, $isHtml = TRUE) + { + $valid = array( + 'id', 'class', 'tag', 'content', 'attributes', 'parent', + 'child', 'ancestor', 'descendant', 'children' + ); + + $filtered = array(); + $options = self::assertValidKeys($options, $valid); + + // find the element by id + if ($options['id']) { + $options['attributes']['id'] = $options['id']; + } + + if ($options['class']) { + $options['attributes']['class'] = $options['class']; + } + + // find the element by a tag type + if ($options['tag']) { + if ($isHtml) { + $elements = self::getElementsByCaseInsensitiveTagName( + $dom, $options['tag'] + ); + } else { + $elements = $dom->getElementsByTagName($options['tag']); + } + + foreach ($elements as $element) { + $nodes[] = $element; + } + + if (empty($nodes)) { + return FALSE; + } + } + + // no tag selected, get them all + else { + $tags = array( + 'a', 'abbr', 'acronym', 'address', 'area', 'b', 'base', 'bdo', + 'big', 'blockquote', 'body', 'br', 'button', 'caption', 'cite', + 'code', 'col', 'colgroup', 'dd', 'del', 'div', 'dfn', 'dl', + 'dt', 'em', 'fieldset', 'form', 'frame', 'frameset', 'h1', 'h2', + 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'i', 'iframe', + 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', + 'map', 'meta', 'noframes', 'noscript', 'object', 'ol', 'optgroup', + 'option', 'p', 'param', 'pre', 'q', 'samp', 'script', 'select', + 'small', 'span', 'strong', 'style', 'sub', 'sup', 'table', + 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', + 'tr', 'tt', 'ul', 'var' + ); + + foreach ($tags as $tag) { + if ($isHtml) { + $elements = self::getElementsByCaseInsensitiveTagName( + $dom, $tag + ); + } else { + $elements = $dom->getElementsByTagName($tag); + } + + foreach ($elements as $element) { + $nodes[] = $element; + } + } + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by attributes + if ($options['attributes']) { + foreach ($nodes as $node) { + $invalid = FALSE; + + foreach ($options['attributes'] as $name => $value) { + // match by regexp if like "regexp:/foo/i" + if (preg_match('/^regexp\s*:\s*(.*)/i', $value, $matches)) { + if (!preg_match($matches[1], $node->getAttribute($name))) { + $invalid = TRUE; + } + } + + // class can match only a part + else if ($name == 'class') { + // split to individual classes + $findClasses = explode( + ' ', preg_replace("/\s+/", " ", $value) + ); + + $allClasses = explode( + ' ', + preg_replace("/\s+/", " ", $node->getAttribute($name)) + ); + + // make sure each class given is in the actual node + foreach ($findClasses as $findClass) { + if (!in_array($findClass, $allClasses)) { + $invalid = TRUE; + } + } + } + + // match by exact string + else { + if ($node->getAttribute($name) != $value) { + $invalid = TRUE; + } + } + } + + // if every attribute given matched + if (!$invalid) { + $filtered[] = $node; + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by content + if ($options['content'] !== NULL) { + foreach ($nodes as $node) { + $invalid = FALSE; + + // match by regexp if like "regexp:/foo/i" + if (preg_match('/^regexp\s*:\s*(.*)/i', $options['content'], $matches)) { + if (!preg_match($matches[1], self::getNodeText($node))) { + $invalid = TRUE; + } + } + + // match empty string + else if ($options['content'] === '') { + if (self::getNodeText($node) !== '') { + $invalid = TRUE; + } + } + + // match by exact string + else if (strstr(self::getNodeText($node), $options['content']) === FALSE) { + $invalid = TRUE; + } + + if (!$invalid) { + $filtered[] = $node; + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by parent node + if ($options['parent']) { + $parentNodes = self::findNodes($dom, $options['parent'], $isHtml); + $parentNode = isset($parentNodes[0]) ? $parentNodes[0] : NULL; + + foreach ($nodes as $node) { + if ($parentNode !== $node->parentNode) { + continue; + } + + $filtered[] = $node; + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by child node + if ($options['child']) { + $childNodes = self::findNodes($dom, $options['child'], $isHtml); + $childNodes = !empty($childNodes) ? $childNodes : array(); + + foreach ($nodes as $node) { + foreach ($node->childNodes as $child) { + foreach ($childNodes as $childNode) { + if ($childNode === $child) { + $filtered[] = $node; + } + } + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by ancestor + if ($options['ancestor']) { + $ancestorNodes = self::findNodes($dom, $options['ancestor'], $isHtml); + $ancestorNode = isset($ancestorNodes[0]) ? $ancestorNodes[0] : NULL; + + foreach ($nodes as $node) { + $parent = $node->parentNode; + + while ($parent && $parent->nodeType != XML_HTML_DOCUMENT_NODE) { + if ($parent === $ancestorNode) { + $filtered[] = $node; + } + + $parent = $parent->parentNode; + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by descendant + if ($options['descendant']) { + $descendantNodes = self::findNodes($dom, $options['descendant'], $isHtml); + $descendantNodes = !empty($descendantNodes) ? $descendantNodes : array(); + + foreach ($nodes as $node) { + foreach (self::getDescendants($node) as $descendant) { + foreach ($descendantNodes as $descendantNode) { + if ($descendantNode === $descendant) { + $filtered[] = $node; + } + } + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return FALSE; + } + } + + // filter by children + if ($options['children']) { + $validChild = array('count', 'greater_than', 'less_than', 'only'); + $childOptions = self::assertValidKeys( + $options['children'], $validChild + ); + + foreach ($nodes as $node) { + $childNodes = $node->childNodes; + + foreach ($childNodes as $childNode) { + if ($childNode->nodeType !== XML_CDATA_SECTION_NODE && + $childNode->nodeType !== XML_TEXT_NODE) { + $children[] = $childNode; + } + } + + // we must have children to pass this filter + if (!empty($children)) { + // exact count of children + if ($childOptions['count'] !== NULL) { + if (count($children) !== $childOptions['count']) { + break; + } + } + + // range count of children + else if ($childOptions['less_than'] !== NULL && + $childOptions['greater_than'] !== NULL) { + if (count($children) >= $childOptions['less_than'] || + count($children) <= $childOptions['greater_than']) { + break; + } + } + + // less than a given count + else if ($childOptions['less_than'] !== NULL) { + if (count($children) >= $childOptions['less_than']) { + break; + } + } + + // more than a given count + else if ($childOptions['greater_than'] !== NULL) { + if (count($children) <= $childOptions['greater_than']) { + break; + } + } + + // match each child against a specific tag + if ($childOptions['only']) { + $onlyNodes = self::findNodes( + $dom, $childOptions['only'], $isHtml + ); + + // try to match each child to one of the 'only' nodes + foreach ($children as $child) { + $matched = FALSE; + + foreach ($onlyNodes as $onlyNode) { + if ($onlyNode === $child) { + $matched = TRUE; + } + } + + if (!$matched) { + break(2); + } + } + } + + $filtered[] = $node; + } + } + + $nodes = $filtered; + $filtered = array(); + + if (empty($nodes)) { + return; + } + } + + // return the first node that matches all criteria + return !empty($nodes) ? $nodes : array(); + } + + /** + * Recursively get flat array of all descendants of this node. + * + * @param DOMNode $node + * @return array + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + protected static function getDescendants(DOMNode $node) + { + $allChildren = array(); + $childNodes = $node->childNodes ? $node->childNodes : array(); + + foreach ($childNodes as $child) { + if ($child->nodeType === XML_CDATA_SECTION_NODE || + $child->nodeType === XML_TEXT_NODE) { + continue; + } + + $children = self::getDescendants($child); + $allChildren = array_merge($allChildren, $children, array($child)); + } + + return isset($allChildren) ? $allChildren : array(); + } + + /** + * Gets elements by case insensitive tagname. + * + * @param DOMDocument $dom + * @param string $tag + * @return DOMNodeList + * @since Method available since Release 3.4.0 + */ + protected static function getElementsByCaseInsensitiveTagName(DOMDocument $dom, $tag) + { + $elements = $dom->getElementsByTagName(strtolower($tag)); + + if ($elements->length == 0) { + $elements = $dom->getElementsByTagName(strtoupper($tag)); + } + + return $elements; + } + + /** + * Get the text value of this node's child text node. + * + * @param DOMNode $node + * @return string + * @since Method available since Release 3.3.0 + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + */ + protected static function getNodeText(DOMNode $node) + { + if (!$node->childNodes instanceof DOMNodeList) { + return ''; + } + + $result = ''; + + foreach ($node->childNodes as $childNode) { + if ($childNode->nodeType === XML_TEXT_NODE || + $childNode->nodeType === XML_CDATA_SECTION_NODE) { + $result .= trim($childNode->data) . ' '; + } else { + $result .= self::getNodeText($childNode); + } + } + + return str_replace(' ', ' ', $result); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/README.md b/libs/php-ssh/vendor/phpunit/phpunit/README.md @@ -0,0 +1,41 @@ +# PHPUnit + +PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. + +[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v/stable.png)](https://packagist.org/packages/phpunit/phpunit) +[![Build Status](https://travis-ci.org/sebastianbergmann/phpunit.png?branch=3.7)](https://travis-ci.org/sebastianbergmann/phpunit) +[![Dependency Status](https://www.versioneye.com/php/phpunit:phpunit/3.7.28/badge.png)](https://www.versioneye.com/php/phpunit:phpunit/3.7.28) + +## Installation + +We distribute a [PHP Archive (PHAR)](http://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file: + + wget https://phar.phpunit.de/phpunit.phar + chmod +x phpunit.phar + mv phpunit.phar /usr/local/bin/phpunit + +You can also immediately use the PHAR after you have downloaded it, of course: + + wget https://phar.phpunit.de/phpunit.phar + php phpunit.phar + +Alternatively, you may use [Composer](http://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the [documentation](http://phpunit.de/documentation.html) for details on how to do this. + +## Contribute + +Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. + +The development of PHPUnit is discussed on the [dev@phpunit.de](mailto:dev-subscribe@phpunit.de) mailing list as well as on the [#phpunit channel on the Freenode IRC network](irc://irc.freenode.net/phpunit). + +## List of Contributors + +Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components: + +* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors) +* [PHP_CodeCoverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors) +* [PHPUnit_MockObject](https://github.com/sebastianbergmann/phpunit-mock-objects/graphs/contributors) + +A very special thanks to everyone who has contributed to the documentation and helps maintaining the translations: + +* [PHPUnit Documentation](https://github.com/sebastianbergmann/phpunit-documentation/graphs/contributors) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php @@ -0,0 +1,108 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Success.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Extensions_RepeatedTestTest extends PHPUnit_Framework_TestCase +{ + protected $suite; + + public function __construct() + { + $this->suite = new PHPUnit_Framework_TestSuite; + + $this->suite->addTest(new Success); + $this->suite->addTest(new Success); + } + + public function testRepeatedOnce() + { + $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 1); + $this->assertEquals(2, count($test)); + + $result = $test->run(); + $this->assertEquals(2, count($result)); + } + + public function testRepeatedMoreThanOnce() + { + $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 3); + $this->assertEquals(6, count($test)); + + $result = $test->run(); + $this->assertEquals(6, count($result)); + } + + public function testRepeatedZero() + { + $test = new PHPUnit_Extensions_RepeatedTest($this->suite, 0); + $this->assertEquals(0, count($test)); + + $result = $test->run(); + $this->assertEquals(0, count($result)); + } + + public function testRepeatedNegative() + { + try { + $test = new PHPUnit_Extensions_RepeatedTest($this->suite, -1); + } + + catch (Exception $e) { + return; + } + + $this->fail('Should throw an Exception'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php @@ -0,0 +1,80 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Kuzuha SHINODA <kuzuha01@hotmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.20 + */ + +require_once dirname(dirname(dirname(__DIR__))) . '/PHPUnit/Framework/Assert/Functions.php'; + +/** + * + * + * @package PHPUnit + * @author Kuzuha SHINODA <kuzuha01@hotmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.20 + */ +class Framework_Assert_FunctionsTest extends PHPUnit_Framework_TestCase +{ + + public function testLogicalAnd() + { + $expected = $this->logicalAnd($this->isTrue(), $this->isFalse()); + $actual = logicalAnd($this->isTrue(), $this->isFalse()); + $this->assertSame($expected->toString(), $actual->toString()); + } + + public function testLogicalOr() + { + $expected = $this->logicalOr($this->isTrue(), $this->isFalse()); + $actual = logicalOr($this->isTrue(), $this->isFalse()); + $this->assertSame($expected->toString(), $actual->toString()); + } + + public function testLogicalXor() + { + $expected = $this->logicalXor($this->isTrue(), $this->isFalse()); + $actual = logicalXor($this->isTrue(), $this->isFalse()); + $this->assertSame($expected->toString(), $actual->toString()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php @@ -0,0 +1,4267 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'SampleClass.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Struct.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestIterator.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Author.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Book.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithToString.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'SampleArrayAccess.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Framework_AssertTest extends PHPUnit_Framework_TestCase +{ + protected $filesDirectory; + + protected function setUp() + { + $this->filesDirectory = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; + + $this->html = file_get_contents( + $this->filesDirectory . 'SelectorAssertionsFixture.html' + ); + } + + /** + * @covers PHPUnit_Framework_Assert::fail + */ + public function testFail() + { + try { + $this->fail(); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + throw new PHPUnit_Framework_AssertionFailedError('Fail did not throw fail exception'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertSplObjectStorageContainsObject() + { + $a = new stdClass; + $b = new stdClass; + $c = new SplObjectStorage; + $c->attach($a); + + $this->assertContains($a, $c); + + try { + $this->assertContains($b, $c); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertArrayContainsObject() + { + $a = new stdClass; + $b = new stdClass; + + $this->assertContains($a, array($a)); + + try { + $this->assertContains($a, array($b)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertArrayContainsString() + { + $this->assertContains('foo', array('foo')); + + try { + $this->assertContains('foo', array('bar')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + /** + * @covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf + */ + public function testAssertContainsOnlyInstancesOf() + { + $test = array( + new Book(), + new Book + ); + $this->assertContainsOnlyInstancesOf('Book', $test); + $this->assertContainsOnlyInstancesOf('stdClass', array(new stdClass())); + + $test2 = array( + new Author('Test') + ); + try { + $this->assertContainsOnlyInstancesOf('Book', $test2); + } catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertArrayHasKeyThrowsException() + { + $this->assertArrayHasKey(NULL, array()); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + */ + public function testAssertArrayHasIntegerKey() + { + $this->assertArrayHasKey(0, array('foo')); + + try { + $this->assertArrayHasKey(1, array('foo')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertArrayNotHasKeyThrowsException() + { + $this->assertArrayNotHasKey(NULL, array()); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey + */ + public function testAssertArrayNotHasIntegerKey() + { + $this->assertArrayNotHasKey(1, array('foo')); + + try { + $this->assertArrayNotHasKey(0, array('foo')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + */ + public function testAssertArrayHasStringKey() + { + $this->assertArrayHasKey('foo', array('foo' => 'bar')); + + try { + $this->assertArrayHasKey('bar', array('foo' => 'bar')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey + */ + public function testAssertArrayNotHasStringKey() + { + $this->assertArrayNotHasKey('bar', array('foo' => 'bar')); + + try { + $this->assertArrayNotHasKey('foo', array('foo' => 'bar')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + */ + public function testAssertArrayHasKeyAcceptsArrayObjectValue() + { + $array = new ArrayObject(); + $array['foo'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertArrayHasKeyProperlyFailsWithArrayObjectValue() + { + $array = new ArrayObject(); + $array['bar'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + */ + public function testAssertArrayHasKeyAcceptsArrayAccessValue() + { + $array = new SampleArrayAccess(); + $array['foo'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertArrayHasKeyProperlyFailsWithArrayAccessValue() + { + $array = new SampleArrayAccess(); + $array['bar'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey + */ + public function testAssertArrayNotHasKeyAcceptsArrayAccessValue() + { + $array = new ArrayObject(); + $array['foo'] = 'bar'; + $this->assertArrayNotHasKey('bar', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertArrayNotHasKeyProperlyFailsWithArrayAccessValue() + { + $array = new ArrayObject(); + $array['bar'] = 'bar'; + $this->assertArrayNotHasKey('bar', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertContainsThrowsException() + { + $this->assertContains(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertIteratorContainsObject() + { + $foo = new stdClass; + + $this->assertContains($foo, new TestIterator(array($foo))); + + try { + $this->assertContains($foo, new TestIterator(array(new stdClass))); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertIteratorContainsString() + { + $this->assertContains('foo', new TestIterator(array('foo'))); + + try { + $this->assertContains('foo', new TestIterator(array('bar'))); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContains + */ + public function testAssertStringContainsString() + { + $this->assertContains('foo', 'foobar'); + + try { + $this->assertContains('foo', 'bar'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContains + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertNotContainsThrowsException() + { + $this->assertNotContains(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContains + */ + public function testAssertSplObjectStorageNotContainsObject() + { + $a = new stdClass; + $b = new stdClass; + $c = new SplObjectStorage; + $c->attach($a); + + $this->assertNotContains($b, $c); + + try { + $this->assertNotContains($a, $c); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContains + */ + public function testAssertArrayNotContainsObject() + { + $a = new stdClass; + $b = new stdClass; + + $this->assertNotContains($a, array($b)); + + try { + $this->assertNotContains($a, array($a)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContains + */ + public function testAssertArrayNotContainsString() + { + $this->assertNotContains('foo', array('bar')); + + try { + $this->assertNotContains('foo', array('foo')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContains + */ + public function testAssertStringNotContainsString() + { + $this->assertNotContains('foo', 'bar'); + + try { + $this->assertNotContains('foo', 'foo'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContainsOnly + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertContainsOnlyThrowsException() + { + $this->assertContainsOnly(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertContainsOnlyInstancesOfThrowsException() + { + $this->assertContainsOnlyInstancesOf(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContainsOnly + */ + public function testAssertArrayContainsOnlyIntegers() + { + $this->assertContainsOnly('integer', array(1, 2, 3)); + + try { + $this->assertContainsOnly('integer', array("1", 2, 3)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContainsOnly + */ + public function testAssertArrayNotContainsOnlyIntegers() + { + $this->assertNotContainsOnly('integer', array("1", 2, 3)); + + try { + $this->assertNotContainsOnly('integer', array(1, 2, 3)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertContainsOnly + */ + public function testAssertArrayContainsOnlyStdClass() + { + $this->assertContainsOnly('StdClass', array(new StdClass)); + + try { + $this->assertContainsOnly('StdClass', array('StdClass')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotContainsOnly + */ + public function testAssertArrayNotContainsOnlyStdClass() + { + $this->assertNotContainsOnly('StdClass', array('StdClass')); + + try { + $this->assertNotContainsOnly('StdClass', array(new StdClass)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + protected function createDOMDocument($content) + { + $document = new DOMDocument; + $document->preserveWhiteSpace = FALSE; + $document->loadXML($content); + + return $document; + } + + protected function sameValues() + { + $object = new SampleClass(4, 8, 15); + // cannot use $filesDirectory, because neither setUp() nor + // setUpBeforeClass() are executed before the data providers + $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; + $resource = fopen($file, 'r'); + + return array( + // NULL + array(NULL, NULL), + // strings + array('a', 'a'), + // integers + array(0, 0), + // floats + array(2.3, 2.3), + array(1/3, 1 - 2/3), + array(log(0), log(0)), + // arrays + array(array(), array()), + array(array(0 => 1), array(0 => 1)), + array(array(0 => NULL), array(0 => NULL)), + array(array('a', 'b' => array(1, 2)), array('a', 'b' => array(1, 2))), + // objects + array($object, $object), + // resources + array($resource, $resource), + ); + } + + protected function notEqualValues() + { + // cyclic dependencies + $book1 = new Book; + $book1->author = new Author('Terry Pratchett'); + $book1->author->books[] = $book1; + $book2 = new Book; + $book2->author = new Author('Terry Pratch'); + $book2->author->books[] = $book2; + + $book3 = new Book; + $book3->author = 'Terry Pratchett'; + $book4 = new stdClass; + $book4->author = 'Terry Pratchett'; + + $object1 = new SampleClass( 4, 8, 15); + $object2 = new SampleClass(16, 23, 42); + $object3 = new SampleClass( 4, 8, 15); + $storage1 = new SplObjectStorage; + $storage1->attach($object1); + $storage2 = new SplObjectStorage; + $storage2->attach($object3); // same content, different object + + // cannot use $filesDirectory, because neither setUp() nor + // setUpBeforeClass() are executed before the data providers + $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; + + return array( + // strings + array('a', 'b'), + array('a', 'A'), + // integers + array(1, 2), + array(2, 1), + // floats + array(2.3, 4.2), + array(2.3, 4.2, 0.5), + array(array(2.3), array(4.2), 0.5), + array(array(array(2.3)), array(array(4.2)), 0.5), + array(new Struct(2.3), new Struct(4.2), 0.5), + array(array(new Struct(2.3)), array(new Struct(4.2)), 0.5), + // NAN + array(NAN, NAN), + // arrays + array(array(), array(0 => 1)), + array(array(0 => 1), array()), + array(array(0 => NULL), array()), + array(array(0 => 1, 1 => 2), array(0 => 1, 1 => 3)), + array(array('a', 'b' => array(1, 2)), array('a', 'b' => array(2, 1))), + // objects + array(new SampleClass(4, 8, 15), new SampleClass(16, 23, 42)), + array($object1, $object2), + array($book1, $book2), + array($book3, $book4), // same content, different class + // resources + array(fopen($file, 'r'), fopen($file, 'r')), + // SplObjectStorage + array($storage1, $storage2), + // DOMDocument + array( + $this->createDOMDocument('<root></root>'), + $this->createDOMDocument('<bar/>'), + ), + array( + $this->createDOMDocument('<foo attr1="bar"/>'), + $this->createDOMDocument('<foo attr1="foobar"/>'), + ), + array( + $this->createDOMDocument('<foo> bar </foo>'), + $this->createDOMDocument('<foo />'), + ), + array( + $this->createDOMDocument('<foo xmlns="urn:myns:bar"/>'), + $this->createDOMDocument('<foo xmlns="urn:notmyns:bar"/>'), + ), + array( + $this->createDOMDocument('<foo> bar </foo>'), + $this->createDOMDocument('<foo> bir </foo>'), + ), + // Exception + //array(new Exception('Exception 1'), new Exception('Exception 2')), + // different types + array(new SampleClass(4, 8, 15), FALSE), + array(FALSE, new SampleClass(4, 8, 15)), + array(array(0 => 1, 1 => 2), FALSE), + array(FALSE, array(0 => 1, 1 => 2)), + array(array(), new stdClass), + array(new stdClass, array()), + // PHP: 0 == 'Foobar' => TRUE! + // We want these values to differ + array(0, 'Foobar'), + array('Foobar', 0), + array(3, acos(8)), + array(acos(8), 3) + ); + } + + protected function equalValues() + { + // cyclic dependencies + $book1 = new Book; + $book1->author = new Author('Terry Pratchett'); + $book1->author->books[] = $book1; + $book2 = new Book; + $book2->author = new Author('Terry Pratchett'); + $book2->author->books[] = $book2; + + $object1 = new SampleClass(4, 8, 15); + $object2 = new SampleClass(4, 8, 15); + $storage1 = new SplObjectStorage; + $storage1->attach($object1); + $storage2 = new SplObjectStorage; + $storage2->attach($object1); + + return array( + // strings + array('a', 'A', 0, FALSE, TRUE), // ignore case + // arrays + array(array('a' => 1, 'b' => 2), array('b' => 2, 'a' => 1)), + array(array(1), array('1')), + array(array(3, 2, 1), array(2, 3, 1), 0, TRUE), // canonicalized comparison + // floats + array(2.3, 2.5, 0.5), + array(array(2.3), array(2.5), 0.5), + array(array(array(2.3)), array(array(2.5)), 0.5), + array(new Struct(2.3), new Struct(2.5), 0.5), + array(array(new Struct(2.3)), array(new Struct(2.5)), 0.5), + // numeric with delta + array(1, 2, 1), + // objects + array($object1, $object2), + array($book1, $book2), + // SplObjectStorage + array($storage1, $storage2), + // DOMDocument + array( + $this->createDOMDocument('<root></root>'), + $this->createDOMDocument('<root/>'), + ), + array( + $this->createDOMDocument('<root attr="bar"></root>'), + $this->createDOMDocument('<root attr="bar"/>'), + ), + array( + $this->createDOMDocument('<root><foo attr="bar"></foo></root>'), + $this->createDOMDocument('<root><foo attr="bar"/></root>'), + ), + array( + $this->createDOMDocument("<root>\n <child/>\n</root>"), + $this->createDOMDocument('<root><child/></root>'), + ), + // Exception + //array(new Exception('Exception 1'), new Exception('Exception 1')), + // mixed types + array(0, '0'), + array('0', 0), + array(2.3, '2.3'), + array('2.3', 2.3), + array((string)(1/3), 1 - 2/3), + array(1/3, (string)(1 - 2/3)), + array('string representation', new ClassWithToString), + array(new ClassWithToString, 'string representation'), + ); + } + + public function equalProvider() + { + // same |= equal + return array_merge($this->equalValues(), $this->sameValues()); + } + + public function notEqualProvider() + { + return $this->notEqualValues(); + } + + public function sameProvider() + { + return $this->sameValues(); + } + + public function notSameProvider() + { + // not equal |= not same + // equal, ¬same |= not same + return array_merge($this->notEqualValues(), $this->equalValues()); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEquals + * @dataProvider equalProvider + */ + public function testAssertEqualsSucceeds($a, $b, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + $this->assertEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEquals + * @dataProvider notEqualProvider + */ + public function testAssertEqualsFails($a, $b, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + try { + $this->assertEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotEquals + * @dataProvider notEqualProvider + */ + public function testAssertNotEqualsSucceeds($a, $b, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + $this->assertNotEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotEquals + * @dataProvider equalProvider + */ + public function testAssertNotEqualsFails($a, $b, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE) + { + try { + $this->assertNotEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSame + * @dataProvider sameProvider + */ + public function testAssertSameSucceeds($a, $b) + { + $this->assertSame($a, $b); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSame + * @dataProvider notSameProvider + */ + public function testAssertSameFails($a, $b) + { + try { + $this->assertSame($a, $b); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotSame + * @dataProvider notSameProvider + */ + public function testAssertNotSameSucceeds($a, $b) + { + $this->assertNotSame($a, $b); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotSame + * @dataProvider sameProvider + */ + public function testAssertNotSameFails($a, $b) + { + try { + $this->assertNotSame($a, $b); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile + */ + public function testAssertXmlFileEqualsXmlFile() + { + $this->assertXmlFileEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'foo.xml' + ); + + try { + $this->assertXmlFileEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'bar.xml' + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile + */ + public function testAssertXmlFileNotEqualsXmlFile() + { + $this->assertXmlFileNotEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'bar.xml' + ); + + try { + $this->assertXmlFileNotEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'foo.xml' + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile + */ + public function testAssertXmlStringEqualsXmlFile() + { + $this->assertXmlStringEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'foo.xml') + ); + + try { + $this->assertXmlStringEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'bar.xml') + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile + */ + public function testXmlStringNotEqualsXmlFile() + { + $this->assertXmlStringNotEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'bar.xml') + ); + + try { + $this->assertXmlStringNotEqualsXmlFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'foo.xml') + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString + */ + public function testAssertXmlStringEqualsXmlString() + { + $this->assertXmlStringEqualsXmlString('<root/>', '<root/>'); + + try { + $this->assertXmlStringEqualsXmlString('<foo/>', '<bar/>'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString + */ + public function testAssertXmlStringNotEqualsXmlString() + { + $this->assertXmlStringNotEqualsXmlString('<foo/>', '<bar/>'); + + try { + $this->assertXmlStringNotEqualsXmlString('<root/>', '<root/>'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + */ + public function testXMLStructureIsSame() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureExpected.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + * @expectedException PHPUnit_Framework_ExpectationFailedException + */ + public function testXMLStructureWrongNumberOfAttributes() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureWrongNumberOfAttributes.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + * @expectedException PHPUnit_Framework_ExpectationFailedException + */ + public function testXMLStructureWrongNumberOfNodes() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureWrongNumberOfNodes.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + */ + public function testXMLStructureIsSameButDataIsNot() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureIsSameButDataIsNot.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + */ + public function testXMLStructureAttributesAreSameButValuesAreNot() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureAttributesAreSameButValuesAreNot.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEqualXMLStructure + */ + public function testXMLStructureIgnoreTextNodes() + { + $expected = new DOMDocument; + $expected->load($this->filesDirectory . 'structureExpected.xml'); + + $actual = new DOMDocument; + $actual->load($this->filesDirectory . 'structureIgnoreTextNodes.xml'); + + $this->assertEqualXMLStructure( + $expected->firstChild, $actual->firstChild, TRUE + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEquals + */ + public function testAssertStringEqualsNumeric() + { + $this->assertEquals('0', 0); + + try { + $this->assertEquals('0', 1); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotEquals + */ + public function testAssertStringEqualsNumeric2() + { + $this->assertNotEquals('A', 0); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileExists + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertFileExistsThrowsException() + { + $this->assertFileExists(NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileExists + */ + public function testAssertFileExists() + { + $this->assertFileExists(__FILE__); + + try { + $this->assertFileExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileNotExists + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertFileNotExistsThrowsException() + { + $this->assertFileNotExists(NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileNotExists + */ + public function testAssertFileNotExists() + { + $this->assertFileNotExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + + try { + $this->assertFileNotExists(__FILE__); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + */ + public function testAssertObjectHasAttribute() + { + $o = new Author('Terry Pratchett'); + + $this->assertObjectHasAttribute('name', $o); + + try { + $this->assertObjectHasAttribute('foo', $o); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + */ + public function testAssertObjectNotHasAttribute() + { + $o = new Author('Terry Pratchett'); + + $this->assertObjectNotHasAttribute('foo', $o); + + try { + $this->assertObjectNotHasAttribute('name', $o); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNull + */ + public function testAssertNull() + { + $this->assertNull(NULL); + + try { + $this->assertNull(new stdClass); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotNull + */ + public function testAssertNotNull() + { + $this->assertNotNull(new stdClass); + + try { + $this->assertNotNull(NULL); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTrue + */ + public function testAssertTrue() + { + $this->assertTrue(TRUE); + + try { + $this->assertTrue(FALSE); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFalse + */ + public function testAssertFalse() + { + $this->assertFalse(FALSE); + + try { + $this->assertFalse(TRUE); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertRegExp + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertRegExpThrowsException() + { + $this->assertRegExp(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertRegExp + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertRegExpThrowsException2() + { + $this->assertRegExp('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotRegExp + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertNotRegExpThrowsException() + { + $this->assertNotRegExp(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotRegExp + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertNotRegExpThrowsException2() + { + $this->assertNotRegExp('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertRegExp + */ + public function testAssertRegExp() + { + $this->assertRegExp('/foo/', 'foobar'); + + try { + $this->assertRegExp('/foo/', 'bar'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotRegExp + */ + public function testAssertNotRegExp() + { + $this->assertNotRegExp('/foo/', 'bar'); + + try { + $this->assertNotRegExp('/foo/', 'foobar'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSame + */ + public function testAssertSame() + { + $o = new stdClass; + + $this->assertSame($o, $o); + + try { + $this->assertSame( + new stdClass, + new stdClass + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSame + */ + public function testAssertSame2() + { + $this->assertSame(TRUE, TRUE); + $this->assertSame(FALSE, FALSE); + + try { + $this->assertSame(TRUE, FALSE); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotSame + */ + public function testAssertNotSame() + { + $this->assertNotSame( + new stdClass, + NULL + ); + + $this->assertNotSame( + NULL, + new stdClass + ); + + $this->assertNotSame( + new stdClass, + new stdClass + ); + + $o = new stdClass; + + try { + $this->assertNotSame($o, $o); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotSame + */ + public function testAssertNotSame2() + { + $this->assertNotSame(TRUE, FALSE); + $this->assertNotSame(FALSE, TRUE); + + try { + $this->assertNotSame(TRUE, TRUE); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotSame + */ + public function testAssertNotSameFailsNull() + { + try { + $this->assertNotSame(NULL, NULL); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertGreaterThan + */ + public function testGreaterThan() + { + $this->assertGreaterThan(1, 2); + + try { + $this->assertGreaterThan(2, 1); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeGreaterThan + */ + public function testAttributeGreaterThan() + { + $this->assertAttributeGreaterThan( + 1, 'bar', new ClassWithNonPublicAttributes + ); + + try { + $this->assertAttributeGreaterThan( + 1, 'foo', new ClassWithNonPublicAttributes + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertGreaterThanOrEqual + */ + public function testGreaterThanOrEqual() + { + $this->assertGreaterThanOrEqual(1, 2); + + try { + $this->assertGreaterThanOrEqual(2, 1); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual + */ + public function testAttributeGreaterThanOrEqual() + { + $this->assertAttributeGreaterThanOrEqual( + 1, 'bar', new ClassWithNonPublicAttributes + ); + + try { + $this->assertAttributeGreaterThanOrEqual( + 2, 'foo', new ClassWithNonPublicAttributes + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertLessThan + */ + public function testLessThan() + { + $this->assertLessThan(2, 1); + + try { + $this->assertLessThan(1, 2); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeLessThan + */ + public function testAttributeLessThan() + { + $this->assertAttributeLessThan( + 2, 'foo', new ClassWithNonPublicAttributes + ); + + try { + $this->assertAttributeLessThan( + 1, 'bar', new ClassWithNonPublicAttributes + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertLessThanOrEqual + */ + public function testLessThanOrEqual() + { + $this->assertLessThanOrEqual(2, 1); + + try { + $this->assertLessThanOrEqual(1, 2); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual + */ + public function testAttributeLessThanOrEqual() + { + $this->assertAttributeLessThanOrEqual( + 2, 'foo', new ClassWithNonPublicAttributes + ); + + try { + $this->assertAttributeLessThanOrEqual( + 1, 'bar', new ClassWithNonPublicAttributes + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::readAttribute + */ + public function testReadAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertEquals('foo', $this->readAttribute($obj, 'publicAttribute')); + $this->assertEquals('bar', $this->readAttribute($obj, 'protectedAttribute')); + $this->assertEquals('baz', $this->readAttribute($obj, 'privateAttribute')); + $this->assertEquals('bar', $this->readAttribute($obj, 'protectedParentAttribute')); + //$this->assertEquals('bar', $this->readAttribute($obj, 'privateParentAttribute')); + } + + /** + * @covers PHPUnit_Framework_Assert::readAttribute + */ + public function testReadAttribute2() + { + $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'publicStaticAttribute')); + $this->assertEquals('bar', $this->readAttribute('ClassWithNonPublicAttributes', 'protectedStaticAttribute')); + $this->assertEquals('baz', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticAttribute')); + $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'protectedStaticParentAttribute')); + $this->assertEquals('foo', $this->readAttribute('ClassWithNonPublicAttributes', 'privateStaticParentAttribute')); + } + + /** + * @covers PHPUnit_Framework_Assert::readAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testReadAttribute3() + { + $this->readAttribute('StdClass', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::readAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testReadAttribute4() + { + $this->readAttribute('NotExistingClass', 'foo'); + } + + /** + * @covers PHPUnit_Framework_Assert::readAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testReadAttribute5() + { + $this->readAttribute(NULL, 'foo'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeContains + */ + public function testAssertPublicAttributeContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeContains('foo', 'publicArray', $obj); + + try { + $this->assertAttributeContains('bar', 'publicArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeContainsOnly + */ + public function testAssertPublicAttributeContainsOnly() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeContainsOnly('string', 'publicArray', $obj); + + try { + $this->assertAttributeContainsOnly('integer', 'publicArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotContains + */ + public function testAssertPublicAttributeNotContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotContains('bar', 'publicArray', $obj); + + try { + $this->assertAttributeNotContains('foo', 'publicArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotContainsOnly + */ + public function testAssertPublicAttributeNotContainsOnly() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotContainsOnly('integer', 'publicArray', $obj); + + try { + $this->assertAttributeNotContainsOnly('string', 'publicArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeContains + */ + public function testAssertProtectedAttributeContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeContains('bar', 'protectedArray', $obj); + + try { + $this->assertAttributeContains('foo', 'protectedArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotContains + */ + public function testAssertProtectedAttributeNotContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotContains('foo', 'protectedArray', $obj); + + try { + $this->assertAttributeNotContains('bar', 'protectedArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeContains + */ + public function testAssertPrivateAttributeContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeContains('baz', 'privateArray', $obj); + + try { + $this->assertAttributeContains('foo', 'privateArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotContains + */ + public function testAssertPrivateAttributeNotContains() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotContains('foo', 'privateArray', $obj); + + try { + $this->assertAttributeNotContains('baz', 'privateArray', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertPublicAttributeEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeEquals('foo', 'publicAttribute', $obj); + + try { + $this->assertAttributeEquals('bar', 'publicAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertPublicAttributeNotEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotEquals('bar', 'publicAttribute', $obj); + + try { + $this->assertAttributeNotEquals('foo', 'publicAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeSame + */ + public function testAssertPublicAttributeSame() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeSame('foo', 'publicAttribute', $obj); + + try { + $this->assertAttributeSame('bar', 'publicAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotSame + */ + public function testAssertPublicAttributeNotSame() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotSame('bar', 'publicAttribute', $obj); + + try { + $this->assertAttributeNotSame('foo', 'publicAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertProtectedAttributeEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeEquals('bar', 'protectedAttribute', $obj); + + try { + $this->assertAttributeEquals('foo', 'protectedAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertProtectedAttributeNotEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotEquals('foo', 'protectedAttribute', $obj); + + try { + $this->assertAttributeNotEquals('bar', 'protectedAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertPrivateAttributeEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeEquals('baz', 'privateAttribute', $obj); + + try { + $this->assertAttributeEquals('foo', 'privateAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertPrivateAttributeNotEquals() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertAttributeNotEquals('foo', 'privateAttribute', $obj); + + try { + $this->assertAttributeNotEquals('baz', 'privateAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertPublicStaticAttributeEquals() + { + $this->assertAttributeEquals('foo', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeEquals('bar', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertPublicStaticAttributeNotEquals() + { + $this->assertAttributeNotEquals('bar', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeNotEquals('foo', 'publicStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertProtectedStaticAttributeEquals() + { + $this->assertAttributeEquals('bar', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeEquals('foo', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertProtectedStaticAttributeNotEquals() + { + $this->assertAttributeNotEquals('foo', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeNotEquals('bar', 'protectedStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEquals + */ + public function testAssertPrivateStaticAttributeEquals() + { + $this->assertAttributeEquals('baz', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeEquals('foo', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEquals + */ + public function testAssertPrivateStaticAttributeNotEquals() + { + $this->assertAttributeNotEquals('foo', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertAttributeNotEquals('baz', 'privateStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassHasAttributeThrowsException() + { + $this->assertClassHasAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassHasAttributeThrowsException2() + { + $this->assertClassHasAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassNotHasAttributeThrowsException() + { + $this->assertClassNotHasAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassNotHasAttributeThrowsException2() + { + $this->assertClassNotHasAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassHasStaticAttributeThrowsException() + { + $this->assertClassHasStaticAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassHasStaticAttributeThrowsException2() + { + $this->assertClassHasStaticAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassNotHasStaticAttributeThrowsException() + { + $this->assertClassNotHasStaticAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertClassNotHasStaticAttributeThrowsException2() + { + $this->assertClassNotHasStaticAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertObjectHasAttributeThrowsException() + { + $this->assertObjectHasAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertObjectHasAttributeThrowsException2() + { + $this->assertObjectHasAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertObjectNotHasAttributeThrowsException() + { + $this->assertObjectNotHasAttribute(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertObjectNotHasAttributeThrowsException2() + { + $this->assertObjectNotHasAttribute('foo', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasAttribute + */ + public function testClassHasPublicAttribute() + { + $this->assertClassHasAttribute('publicAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertClassHasAttribute('attribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasAttribute + */ + public function testClassNotHasPublicAttribute() + { + $this->assertClassNotHasAttribute('attribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertClassNotHasAttribute('publicAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassHasStaticAttribute + */ + public function testClassHasPublicStaticAttribute() + { + $this->assertClassHasStaticAttribute('publicStaticAttribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertClassHasStaticAttribute('attribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute + */ + public function testClassNotHasPublicStaticAttribute() + { + $this->assertClassNotHasStaticAttribute('attribute', 'ClassWithNonPublicAttributes'); + + try { + $this->assertClassNotHasStaticAttribute('publicStaticAttribute', 'ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + */ + public function testObjectHasPublicAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectHasAttribute('publicAttribute', $obj); + + try { + $this->assertObjectHasAttribute('attribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + */ + public function testObjectNotHasPublicAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectNotHasAttribute('attribute', $obj); + + try { + $this->assertObjectNotHasAttribute('publicAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + */ + public function testObjectHasOnTheFlyAttribute() + { + $obj = new StdClass; + $obj->foo = 'bar'; + + $this->assertObjectHasAttribute('foo', $obj); + + try { + $this->assertObjectHasAttribute('bar', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + */ + public function testObjectNotHasOnTheFlyAttribute() + { + $obj = new StdClass; + $obj->foo = 'bar'; + + $this->assertObjectNotHasAttribute('bar', $obj); + + try { + $this->assertObjectNotHasAttribute('foo', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + */ + public function testObjectHasProtectedAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectHasAttribute('protectedAttribute', $obj); + + try { + $this->assertObjectHasAttribute('attribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + */ + public function testObjectNotHasProtectedAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectNotHasAttribute('attribute', $obj); + + try { + $this->assertObjectNotHasAttribute('protectedAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectHasAttribute + */ + public function testObjectHasPrivateAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectHasAttribute('privateAttribute', $obj); + + try { + $this->assertObjectHasAttribute('attribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertObjectNotHasAttribute + */ + public function testObjectNotHasPrivateAttribute() + { + $obj = new ClassWithNonPublicAttributes; + + $this->assertObjectNotHasAttribute('attribute', $obj); + + try { + $this->assertObjectNotHasAttribute('privateAttribute', $obj); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::attribute + * @covers PHPUnit_Framework_Assert::equalTo + */ + public function testAssertThatAttributeEquals() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->attribute( + $this->equalTo('foo'), + 'publicAttribute' + ) + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::attribute + * @covers PHPUnit_Framework_Assert::equalTo + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertThatAttributeEquals2() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->attribute( + $this->equalTo('bar'), + 'publicAttribute' + ) + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::attribute + * @covers PHPUnit_Framework_Assert::equalTo + */ + public function testAssertThatAttributeEqualTo() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->attributeEqualTo('publicAttribute', 'foo') + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::anything + */ + public function testAssertThatAnything() + { + $this->assertThat('anything', $this->anything()); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::anything + * @covers PHPUnit_Framework_Assert::logicalAnd + */ + public function testAssertThatAnythingAndAnything() + { + $this->assertThat( + 'anything', + $this->logicalAnd( + $this->anything(), $this->anything() + ) + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::anything + * @covers PHPUnit_Framework_Assert::logicalOr + */ + public function testAssertThatAnythingOrAnything() + { + $this->assertThat( + 'anything', + $this->logicalOr( + $this->anything(), $this->anything() + ) + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::anything + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Assert::logicalXor + */ + public function testAssertThatAnythingXorNotAnything() + { + $this->assertThat( + 'anything', + $this->logicalXor( + $this->anything(), + $this->logicalNot($this->anything()) + ) + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::contains + */ + public function testAssertThatContains() + { + $this->assertThat(array('foo'), $this->contains('foo')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::stringContains + */ + public function testAssertThatStringContains() + { + $this->assertThat('barfoobar', $this->stringContains('foo')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::containsOnly + */ + public function testAssertThatContainsOnly() + { + $this->assertThat(array('foo'), $this->containsOnly('string')); + } + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::containsOnlyInstancesOf + */ + public function testAssertThatContainsOnlyInstancesOf() + { + $this->assertThat(array(new Book), $this->containsOnlyInstancesOf('Book')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::arrayHasKey + */ + public function testAssertThatArrayHasKey() + { + $this->assertThat(array('foo' => 'bar'), $this->arrayHasKey('foo')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::classHasAttribute + */ + public function testAssertThatClassHasAttribute() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->classHasAttribute('publicAttribute') + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::classHasStaticAttribute + */ + public function testAssertThatClassHasStaticAttribute() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->classHasStaticAttribute('publicStaticAttribute') + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::objectHasAttribute + */ + public function testAssertThatObjectHasAttribute() + { + $this->assertThat( + new ClassWithNonPublicAttributes, + $this->objectHasAttribute('publicAttribute') + ); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::equalTo + */ + public function testAssertThatEqualTo() + { + $this->assertThat('foo', $this->equalTo('foo')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::identicalTo + */ + public function testAssertThatIdenticalTo() + { + $value = new StdClass; + $constraint = $this->identicalTo($value); + + $this->assertThat($value, $constraint); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::isInstanceOf + */ + public function testAssertThatIsInstanceOf() + { + $this->assertThat(new StdClass, $this->isInstanceOf('StdClass')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::isType + */ + public function testAssertThatIsType() + { + $this->assertThat('string', $this->isType('string')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::fileExists + */ + public function testAssertThatFileExists() + { + $this->assertThat(__FILE__, $this->fileExists()); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::greaterThan + */ + public function testAssertThatGreaterThan() + { + $this->assertThat(2, $this->greaterThan(1)); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::greaterThanOrEqual + */ + public function testAssertThatGreaterThanOrEqual() + { + $this->assertThat(2, $this->greaterThanOrEqual(1)); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::lessThan + */ + public function testAssertThatLessThan() + { + $this->assertThat(1, $this->lessThan(2)); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::lessThanOrEqual + */ + public function testAssertThatLessThanOrEqual() + { + $this->assertThat(1, $this->lessThanOrEqual(2)); + } + + /** + * @covers PHPUnit_Framework_Assert::assertThat + * @covers PHPUnit_Framework_Assert::matchesRegularExpression + */ + public function testAssertThatMatchesRegularExpression() + { + $this->assertThat('foobar', $this->matchesRegularExpression('/foo/')); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagTypeTrue() + { + $matcher = array('tag' => 'html'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagTypeFalse() + { + $matcher = array('tag' => 'code'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagIdTrue() + { + $matcher = array('id' => 'test_text'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagIdFalse() + { + $matcher = array('id' => 'test_text_doesnt_exist'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagStringContentTrue() + { + $matcher = array('id' => 'test_text', + 'content' => 'My test tag content'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagStringContentFalse() + { + $matcher = array('id' => 'test_text', + 'content' => 'My non existent tag content'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagRegexpContentTrue() + { + $matcher = array('id' => 'test_text', + 'content' => 'regexp:/test tag/'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagRegexpModifierContentTrue() + { + $matcher = array('id' => 'test_text', + 'content' => 'regexp:/TEST TAG/i'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagRegexpContentFalse() + { + $matcher = array('id' => 'test_text', + 'content' => 'regexp:/asdf/'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagCdataContentTrue() + { + $matcher = array('tag' => 'script', + 'content' => 'alert(\'Hello, world!\');'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagCdataContentFalse() + { + $matcher = array('tag' => 'script', + 'content' => 'asdf'); + $this->assertTag($matcher, $this->html); + } + + + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesTrueA() + { + $matcher = array('tag' => 'span', + 'attributes' => array('class' => 'test_class')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesTrueB() + { + $matcher = array('tag' => 'div', + 'attributes' => array('id' => 'test_child_id')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagAttributesFalse() + { + $matcher = array('tag' => 'span', + 'attributes' => array('class' => 'test_missing_class')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesRegexpTrueA() + { + $matcher = array('tag' => 'span', + 'attributes' => array('class' => 'regexp:/.+_class/')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesRegexpTrueB() + { + $matcher = array('tag' => 'div', + 'attributes' => array('id' => 'regexp:/.+_child_.+/')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesRegexpModifierTrue() + { + $matcher = array('tag' => 'div', + 'attributes' => array('id' => 'regexp:/.+_CHILD_.+/i')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagAttributesRegexpModifierFalse() + { + $matcher = array('tag' => 'div', + 'attributes' => array('id' => 'regexp:/.+_CHILD_.+/')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagAttributesRegexpFalse() + { + $matcher = array('tag' => 'span', + 'attributes' => array('class' => 'regexp:/.+_missing_.+/')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesMultiPartClassTrueA() + { + $matcher = array('tag' => 'div', + 'id' => 'test_multi_class', + 'attributes' => array('class' => 'multi class')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAttributesMultiPartClassTrueB() + { + $matcher = array('tag' => 'div', + 'id' => 'test_multi_class', + 'attributes' => array('class' => 'multi')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagAttributesMultiPartClassFalse() + { + $matcher = array('tag' => 'div', + 'id' => 'test_multi_class', + 'attributes' => array('class' => 'mul')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagParentTrue() + { + $matcher = array('tag' => 'head', + 'parent' => array('tag' => 'html')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagParentFalse() + { + $matcher = array('tag' => 'head', + 'parent' => array('tag' => 'div')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagMultiplePossibleChildren() + { + $matcher = array( + 'tag' => 'li', + 'parent' => array( + 'tag' => 'ul', + 'id' => 'another_ul' + ) + ); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagChildTrue() + { + $matcher = array('tag' => 'html', + 'child' => array('tag' => 'head')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagChildFalse() + { + $matcher = array('tag' => 'html', + 'child' => array('tag' => 'div')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagAncestorTrue() + { + $matcher = array('tag' => 'div', + 'ancestor' => array('tag' => 'html')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagAncestorFalse() + { + $matcher = array('tag' => 'html', + 'ancestor' => array('tag' => 'div')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagDescendantTrue() + { + $matcher = array('tag' => 'html', + 'descendant' => array('tag' => 'div')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagDescendantFalse() + { + $matcher = array('tag' => 'div', + 'descendant' => array('tag' => 'html')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagChildrenCountTrue() + { + $matcher = array('tag' => 'ul', + 'children' => array('count' => 3)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagChildrenCountFalse() + { + $matcher = array('tag' => 'ul', + 'children' => array('count' => 5)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagChildrenLessThanTrue() + { + $matcher = array('tag' => 'ul', + 'children' => array('less_than' => 10)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagChildrenLessThanFalse() + { + $matcher = array('tag' => 'ul', + 'children' => array('less_than' => 2)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagChildrenGreaterThanTrue() + { + $matcher = array('tag' => 'ul', + 'children' => array('greater_than' => 2)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagChildrenGreaterThanFalse() + { + $matcher = array('tag' => 'ul', + 'children' => array('greater_than' => 10)); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagChildrenOnlyTrue() + { + $matcher = array('tag' => 'ul', + 'children' => array('only' => array('tag' =>'li'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagChildrenOnlyFalse() + { + $matcher = array('tag' => 'ul', + 'children' => array('only' => array('tag' =>'div'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagTypeIdTrueA() + { + $matcher = array('tag' => 'ul', 'id' => 'my_ul'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagTypeIdTrueB() + { + $matcher = array('id' => 'my_ul', 'tag' => 'ul'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagTypeIdTrueC() + { + $matcher = array('tag' => 'input', 'id' => 'input_test_id'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertTagTypeIdFalse() + { + $matcher = array('tag' => 'div', 'id' => 'my_ul'); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertTagContentAttributes() + { + $matcher = array('tag' => 'div', + 'content' => 'Test Id Text', + 'attributes' => array('id' => 'test_id', + 'class' => 'my_test_class')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertParentContentAttributes() + { + $matcher = array('tag' => 'div', + 'content' => 'Test Id Text', + 'attributes' => array('id' => 'test_id', + 'class' => 'my_test_class'), + 'parent' => array('tag' => 'body')); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertChildContentAttributes() + { + $matcher = array('tag' => 'div', + 'content' => 'Test Id Text', + 'attributes' => array('id' => 'test_id', + 'class' => 'my_test_class'), + 'child' => array('tag' => 'div', + 'attributes' => array('id' => 'test_child_id'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertChildSubChildren() + { + $matcher = array('id' => 'test_id', + 'child' => array('id' => 'test_child_id', + 'child' => array('id' => 'test_subchild_id'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertAncestorContentAttributes() + { + $matcher = array('id' => 'test_subchild_id', + 'content' => 'My Subchild', + 'attributes' => array('id' => 'test_subchild_id'), + 'ancestor' => array('tag' => 'div', + 'attributes' => array('id' => 'test_id'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertDescendantContentAttributes() + { + $matcher = array('id' => 'test_id', + 'content' => 'Test Id Text', + 'attributes' => array('id' => 'test_id'), + 'descendant' => array('tag' => 'span', + 'attributes' => array('id' => 'test_subchild_id'))); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertTag + */ + public function testAssertChildrenContentAttributes() + { + $matcher = array('id' => 'test_children', + 'content' => 'My Children', + 'attributes' => array('class' => 'children'), + + 'children' => array('less_than' => '25', + 'greater_than' => '2', + 'only' => array('tag' => 'div', + 'attributes' => array('class' => 'my_child')) + )); + $this->assertTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotTag + */ + public function testAssertNotTagTypeIdFalse() + { + $matcher = array('tag' => 'div', 'id' => 'my_ul'); + $this->assertNotTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotTag + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertNotTagContentAttributes() + { + $matcher = array('tag' => 'div', + 'content' => 'Test Id Text', + 'attributes' => array('id' => 'test_id', + 'class' => 'my_test_class')); + $this->assertNotTag($matcher, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountPresentTrue() + { + $selector = 'div#test_id'; + $count = TRUE; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountPresentFalse() + { + $selector = 'div#non_existent'; + $count = TRUE; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountNotPresentTrue() + { + $selector = 'div#non_existent'; + $count = FALSE; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectNotPresentFalse() + { + $selector = 'div#test_id'; + $count = FALSE; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountChildTrue() + { + $selector = '#my_ul > li'; + $count = 3; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountChildFalse() + { + $selector = '#my_ul > li'; + $count = 4; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountDescendantTrue() + { + $selector = '#my_ul li'; + $count = 3; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountDescendantFalse() + { + $selector = '#my_ul li'; + $count = 4; + + $this->assertSelectCount($selector, $count, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountGreaterThanTrue() + { + $selector = '#my_ul > li'; + $range = array('>' => 2); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountGreaterThanFalse() + { + $selector = '#my_ul > li'; + $range = array('>' => 3); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountGreaterThanEqualToTrue() + { + $selector = '#my_ul > li'; + $range = array('>=' => 3); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountGreaterThanEqualToFalse() + { + $selector = '#my_ul > li'; + $range = array('>=' => 4); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountLessThanTrue() + { + $selector = '#my_ul > li'; + $range = array('<' => 4); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountLessThanFalse() + { + $selector = '#my_ul > li'; + $range = array('<' => 3); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountLessThanEqualToTrue() + { + $selector = '#my_ul > li'; + $range = array('<=' => 3); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountLessThanEqualToFalse() + { + $selector = '#my_ul > li'; + $range = array('<=' => 2); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + */ + public function testAssertSelectCountRangeTrue() + { + $selector = '#my_ul > li'; + $range = array('>' => 2, '<' => 4); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectCount + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectCountRangeFalse() + { + $selector = '#my_ul > li'; + $range = array('>' => 1, '<' => 3); + + $this->assertSelectCount($selector, $range, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectEquals + */ + public function testAssertSelectEqualsContentPresentTrue() + { + $selector = 'span.test_class'; + $content = 'Test Class Text'; + + $this->assertSelectEquals($selector, $content, TRUE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectEquals + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectEqualsContentPresentFalse() + { + $selector = 'span.test_class'; + $content = 'Test Nonexistent'; + + $this->assertSelectEquals($selector, $content, TRUE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectEquals + */ + public function testAssertSelectEqualsContentNotPresentTrue() + { + $selector = 'span.test_class'; + $content = 'Test Nonexistent'; + + $this->assertSelectEquals($selector, $content, FALSE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectEquals + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertSelectEqualsContentNotPresentFalse() + { + $selector = 'span.test_class'; + $content = 'Test Class Text'; + + $this->assertSelectEquals($selector, $content, FALSE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectRegExp + */ + public function testAssertSelectRegExpContentPresentTrue() + { + $selector = 'span.test_class'; + $regexp = '/Test.*Text/'; + + $this->assertSelectRegExp($selector, $regexp, TRUE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSelectRegExp + */ + public function testAssertSelectRegExpContentPresentFalse() + { + $selector = 'span.test_class'; + $regexp = '/Nonexistant/'; + + $this->assertSelectRegExp($selector, $regexp, FALSE, $this->html); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileEquals + */ + public function testAssertFileEquals() + { + $this->assertFileEquals( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'foo.xml' + ); + + try { + $this->assertFileEquals( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'bar.xml' + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertFileNotEquals + */ + public function testAssertFileNotEquals() + { + $this->assertFileNotEquals( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'bar.xml' + ); + + try { + $this->assertFileNotEquals( + $this->filesDirectory . 'foo.xml', + $this->filesDirectory . 'foo.xml' + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEqualsFile + */ + public function testAssertStringEqualsFile() + { + $this->assertStringEqualsFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'foo.xml') + ); + + try { + $this->assertStringEqualsFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'bar.xml') + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringNotEqualsFile + */ + public function testAssertStringNotEqualsFile() + { + $this->assertStringNotEqualsFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'bar.xml') + ); + + try { + $this->assertStringNotEqualsFile( + $this->filesDirectory . 'foo.xml', + file_get_contents($this->filesDirectory . 'foo.xml') + ); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringStartsWithThrowsException() + { + $this->assertStringStartsWith(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringStartsWithThrowsException2() + { + $this->assertStringStartsWith('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringStartsNotWithThrowsException() + { + $this->assertStringStartsNotWith(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringStartsNotWithThrowsException2() + { + $this->assertStringStartsNotWith('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringEndsWithThrowsException() + { + $this->assertStringEndsWith(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringEndsWithThrowsException2() + { + $this->assertStringEndsWith('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringEndsNotWithThrowsException() + { + $this->assertStringEndsNotWith(NULL, NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith + * @expectedException PHPUnit_Framework_Exception + */ + public function testAssertStringEndsNotWithThrowsException2() + { + $this->assertStringEndsNotWith('', NULL); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsWith + */ + public function testAssertStringStartsWith() + { + $this->assertStringStartsWith('prefix', 'prefixfoo'); + + try { + $this->assertStringStartsWith('prefix', 'foo'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringStartsNotWith + */ + public function testAssertStringStartsNotWith() + { + $this->assertStringStartsNotWith('prefix', 'foo'); + + try { + $this->assertStringStartsNotWith('prefix', 'prefixfoo'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsWith + */ + public function testAssertStringEndsWith() + { + $this->assertStringEndsWith('suffix', 'foosuffix'); + + try { + $this->assertStringEndsWith('suffix', 'foo'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringEndsNotWith + */ + public function testAssertStringEndsNotWith() + { + $this->assertStringEndsNotWith('suffix', 'foo'); + + try { + $this->assertStringEndsNotWith('suffix', 'foosuffix'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat + */ + public function testAssertStringMatchesFormat() + { + $this->assertStringMatchesFormat('*%s*', '***'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringMatchesFormat + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertStringMatchesFormatFailure() + { + $this->assertStringMatchesFormat('*%s*', '**'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertStringNotMatchesFormat + */ + public function testAssertStringNotMatchesFormat() + { + $this->assertStringNotMatchesFormat('*%s*', '**'); + + try { + $this->assertStringMatchesFormat('*%s*', '**'); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertEmpty + */ + public function testAssertEmpty() + { + $this->assertEmpty(array()); + + try { + $this->assertEmpty(array('foo')); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertNotEmpty + */ + public function testAssertNotEmpty() + { + $this->assertNotEmpty(array('foo')); + + try { + $this->assertNotEmpty(array()); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeEmpty + */ + public function testAssertAttributeEmpty() + { + $o = new StdClass; + $o->a = array(); + + $this->assertAttributeEmpty('a', $o); + + try { + $o->a = array('b'); + $this->assertAttributeEmpty('a', $o); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertAttributeNotEmpty + */ + public function testAssertAttributeNotEmpty() + { + $o = new StdClass; + $o->a = array('b'); + + $this->assertAttributeNotEmpty('a', $o); + + try { + $o->a = array(); + $this->assertAttributeNotEmpty('a', $o); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::markTestIncomplete + */ + public function testMarkTestIncomplete() + { + try { + $this->markTestIncomplete('incomplete'); + } + + catch (PHPUnit_Framework_IncompleteTestError $e) { + $this->assertEquals('incomplete', $e->getMessage()); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::markTestSkipped + */ + public function testMarkTestSkipped() + { + try { + $this->markTestSkipped('skipped'); + } + + catch (PHPUnit_Framework_SkippedTestError $e) { + $this->assertEquals('skipped', $e->getMessage()); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertCount + */ + public function testAssertCount() + { + $this->assertCount(2, array(1,2)); + + try { + $this->assertCount(2, array(1,2,3)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertCount + */ + public function testAssertCountThrowsExceptionIfExpectedCountIsNoInteger() + { + + try { + $this->assertCount('a', array()); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Argument #1 of PHPUnit_Framework_Assert::assertCount() must be a integer', $e->getMessage()); + + return; + } + + $this->fail(); + } + + + /** + * @covers PHPUnit_Framework_Assert::assertCount + */ + public function testAssertCountThrowsExceptionIfElementIsNotCountable() + { + + try { + $this->assertCount(2, ''); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Argument #2 of PHPUnit_Framework_Assert::assertCount() must be a countable', $e->getMessage()); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSameSize + */ + public function testAssertSameSize() + { + $this->assertSameSize(array(1,2), array(3,4)); + + try { + $this->assertSameSize(array(1,2), array(1,2,3)); + } + + catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertSameSize + */ + public function testAssertSameSizeThrowsExceptionIfExpectedIsNotCountable() + { + + try { + $this->assertSameSize('a', array()); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Argument #1 of PHPUnit_Framework_Assert::assertSameSize() must be a countable', $e->getMessage()); + + return; + } + + $this->fail(); + } + + + /** + * @covers PHPUnit_Framework_Assert::assertSameSize + */ + public function testAssertSameSizeThrowsExceptionIfActualIsNotCountable() + { + + try { + $this->assertSameSize(array(), ''); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Argument #2 of PHPUnit_Framework_Assert::assertSameSize() must be a countable', $e->getMessage()); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString + */ + public function testAssertJsonStringEqualsJsonString() + { + $expected = '{"Mascott" : "Tux"}'; + $actual = '{"Mascott" : "Tux"}'; + $message = 'Given Json strings do not match'; + + $this->assertJsonStringEqualsJsonString($expected, $actual, $message); + } + + /** + * @dataProvider validInvalidJsonDataprovider + * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString + */ + public function testAssertJsonStringEqualsJsonStringErrorRaised($expected, $actual) + { + try { + $this->assertJsonStringEqualsJsonString($expected, $actual); + } catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + $this->fail('Expected exception not found'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString + */ + public function testAssertJsonStringNotEqualsJsonString() + { + $expected = '{"Mascott" : "Beastie"}'; + $actual = '{"Mascott" : "Tux"}'; + $message = 'Given Json strings do match'; + + $this->assertJsonStringNotEqualsJsonString($expected, $actual, $message); + } + + /** + * @dataProvider validInvalidJsonDataprovider + * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString + */ + public function testAssertJsonStringNotEqualsJsonStringErrorRaised($expected, $actual) + { + try { + $this->assertJsonStringNotEqualsJsonString($expected, $actual); + } catch (PHPUnit_Framework_AssertionFailedError $e) { + return; + } + $this->fail('Expected exception not found'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile + */ + public function testAssertJsonStringEqualsJsonFile() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + $actual = json_encode(array("Mascott" => "Tux")); + $message = ''; + $this->assertJsonStringEqualsJsonFile($file, $actual, $message); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile + */ + public function testAssertJsonStringEqualsJsonFileExpectingExpectationFailedException() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + $actual = json_encode(array("Mascott" => "Beastie")); + $message = ''; + try { + $this->assertJsonStringEqualsJsonFile($file, $actual, $message); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + 'Failed asserting that \'{"Mascott":"Beastie"}\' matches JSON string "{"Mascott":"Tux"}".', + $e->getMessage() + ); + return; + } + + $this->fail('Expected Exception not thrown.'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile + */ + public function testAssertJsonStringEqualsJsonFileExpectingException() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + try { + $this->assertJsonStringEqualsJsonFile($file, NULL); + } catch (PHPUnit_Framework_Exception $e) { + return; + } + $this->fail('Expected Exception not thrown.'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile + */ + public function testAssertJsonStringNotEqualsJsonFile() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + $actual = json_encode(array("Mascott" => "Beastie")); + $message = ''; + $this->assertJsonStringNotEqualsJsonFile($file, $actual, $message); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile + */ + public function testAssertJsonStringNotEqualsJsonFileExpectingException() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + try { + $this->assertJsonStringNotEqualsJsonFile($file, NULL); + } catch (PHPUnit_Framework_Exception $e) { + return; + } + $this->fail('Expected exception not found.'); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile + */ + public function testAssertJsonFileNotEqualsJsonFile() + { + $fileExpected = __DIR__ . '/../_files/JsonData/simpleObject.js'; + $fileActual = __DIR__ . '/../_files/JsonData/arrayObject.js'; + $message = ''; + $this->assertJsonFileNotEqualsJsonFile($fileExpected, $fileActual, $message); + } + + /** + * @covers PHPUnit_Framework_Assert::assertJsonFileEqualsJsonFile + */ + public function testAssertJsonFileEqualsJsonFile() + { + $file = __DIR__ . '/../_files/JsonData/simpleObject.js'; + $message = ''; + $this->assertJsonFileEqualsJsonFile($file, $file, $message); + } + + public static function validInvalidJsonDataprovider() + { + return array( + 'error syntax in expected JSON' => array('{"Mascott"::}', '{"Mascott" : "Tux"}'), + 'error UTF-8 in actual JSON' => array('{"Mascott" : "Tux"}', '{"Mascott" : :}'), + ); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php @@ -0,0 +1,159 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithToString.php'; + +class TestClass {} +class TestClassComparator extends PHPUnit_Framework_Comparator_Object {} + +/** + * + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class Framework_ComparatorTest extends PHPUnit_Framework_TestCase +{ + // Don't use other test methods than ->fail() here, because the testers tested + // here are the foundation for the other test methods + + public function instanceProvider() + { + $tmpfile = tmpfile(); + + return array( + array(NULL, NULL, 'PHPUnit_Framework_Comparator_Scalar'), + array(NULL, TRUE, 'PHPUnit_Framework_Comparator_Scalar'), + array(TRUE, NULL, 'PHPUnit_Framework_Comparator_Scalar'), + array(TRUE, TRUE, 'PHPUnit_Framework_Comparator_Scalar'), + array(FALSE, FALSE, 'PHPUnit_Framework_Comparator_Scalar'), + array(TRUE, FALSE, 'PHPUnit_Framework_Comparator_Scalar'), + array(FALSE, TRUE, 'PHPUnit_Framework_Comparator_Scalar'), + array('', '', 'PHPUnit_Framework_Comparator_Scalar'), + array('0', '0', 'PHPUnit_Framework_Comparator_Numeric'), + array('0', 0, 'PHPUnit_Framework_Comparator_Numeric'), + array(0, '0', 'PHPUnit_Framework_Comparator_Numeric'), + array(0, 0, 'PHPUnit_Framework_Comparator_Numeric'), + array(1.0, 0, 'PHPUnit_Framework_Comparator_Double'), + array(0, 1.0, 'PHPUnit_Framework_Comparator_Double'), + array(1.0, 1.0, 'PHPUnit_Framework_Comparator_Double'), + array(array(1), array(1), 'PHPUnit_Framework_Comparator_Array'), + array($tmpfile, $tmpfile, 'PHPUnit_Framework_Comparator_Resource'), + array(new stdClass, new stdClass, 'PHPUnit_Framework_Comparator_Object'), + array(new SplObjectStorage, new SplObjectStorage, 'PHPUnit_Framework_Comparator_SplObjectStorage'), + array(new Exception, new Exception, 'PHPUnit_Framework_Comparator_Exception'), + array(new DOMDocument, new DOMDocument, 'PHPUnit_Framework_Comparator_DOMDocument'), + // mixed types + array($tmpfile, array(1), 'PHPUnit_Framework_Comparator_Type'), + array(array(1), $tmpfile, 'PHPUnit_Framework_Comparator_Type'), + array($tmpfile, '1', 'PHPUnit_Framework_Comparator_Type'), + array('1', $tmpfile, 'PHPUnit_Framework_Comparator_Type'), + array($tmpfile, new stdClass, 'PHPUnit_Framework_Comparator_Type'), + array(new stdClass, $tmpfile, 'PHPUnit_Framework_Comparator_Type'), + array(new stdClass, array(1), 'PHPUnit_Framework_Comparator_Type'), + array(array(1), new stdClass, 'PHPUnit_Framework_Comparator_Type'), + array(new stdClass, '1', 'PHPUnit_Framework_Comparator_Type'), + array('1', new stdClass, 'PHPUnit_Framework_Comparator_Type'), + array(new ClassWithToString, '1', 'PHPUnit_Framework_Comparator_Scalar'), + array('1', new ClassWithToString, 'PHPUnit_Framework_Comparator_Scalar'), + array(1.0, new stdClass, 'PHPUnit_Framework_Comparator_Type'), + array(new stdClass, 1.0, 'PHPUnit_Framework_Comparator_Type'), + array(1.0, array(1), 'PHPUnit_Framework_Comparator_Type'), + array(array(1), 1.0, 'PHPUnit_Framework_Comparator_Type'), + ); + } + + /** + * @dataProvider instanceProvider + */ + public function testGetInstance($a, $b, $expected) + { + $factory = new PHPUnit_Framework_ComparatorFactory; + + if (get_class($factory->getComparatorFor($a, $b)) != $expected) { + $this->fail(); + } + } + + public function testRegister() + { + $comparator = new TestClassComparator; + + $factory = new PHPUnit_Framework_ComparatorFactory; + $factory->register($comparator); + + $a = new TestClass; + $b = new TestClass; + $expected = 'TestClassComparator'; + + if (get_class($factory->getComparatorFor($a, $b)) != $expected) { + $factory->unregister($comparator); + $this->fail(); + } + + $factory->unregister($comparator); + } + + public function testUnregister() + { + $comparator = new TestClassComparator; + + $factory = new PHPUnit_Framework_ComparatorFactory; + $factory->register($comparator); + $factory->unregister($comparator); + + $a = new TestClass; + $b = new TestClass; + $expected = 'PHPUnit_Framework_Comparator_Object'; + + if (get_class($factory->getComparatorFor($a, $b)) != $expected) { + var_dump(get_class($factory->getComparatorFor($a, $b))); + $this->fail(); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/CountTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/CountTest.php @@ -0,0 +1,108 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Jeroen Versteeg <jversteeg@gmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.30 + */ + +require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestIterator.php'; +require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestIterator2.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Jeroen Versteeg <jversteeg@gmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.7.30 + */ +class CountTest extends PHPUnit_Framework_TestCase +{ + public function testCount() + { + $countConstraint = new PHPUnit_Framework_Constraint_Count(3); + $this->assertTrue($countConstraint->evaluate(array(1,2,3), '', true)); + + $countConstraint = new PHPUnit_Framework_Constraint_Count(0); + $this->assertTrue($countConstraint->evaluate(array(), '', true)); + + $countConstraint = new PHPUnit_Framework_Constraint_Count(2); + $it = new TestIterator(array(1, 2)); + $this->assertTrue($countConstraint->evaluate($it, '', true)); + } + + public function testCountDoesNotChangeIteratorKey() + { + $countConstraint = new PHPUnit_Framework_Constraint_Count(2); + + // test with 1st implementation of Iterator + $it = new TestIterator(array(1, 2)); + + $countConstraint->evaluate($it, '', true); + $this->assertEquals(1, $it->current()); + + $it->next(); + $countConstraint->evaluate($it, '', true); + $this->assertEquals(2, $it->current()); + + $it->next(); + $countConstraint->evaluate($it, '', true); + $this->assertFalse($it->valid()); + + // test with 2nd implementation of Iterator + $it = new TestIterator2(array(1, 2)); + + $countConstraint = new PHPUnit_Framework_Constraint_Count(2); + $countConstraint->evaluate($it, '', true); + $this->assertEquals(1, $it->current()); + + $it->next(); + $countConstraint->evaluate($it, '', true); + $this->assertEquals(2, $it->current()); + + $it->next(); + $countConstraint->evaluate($it, '', true); + $this->assertFalse($it->valid()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php @@ -0,0 +1,122 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ + +/** + * @package PHPUnit + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ +class Framework_Constraint_JsonMatches_ErrorMessageProviderTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider translateTypeToPrefixDataprovider + * @covers PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::translateTypeToPrefix + */ + public function testTranslateTypeToPrefix($expected, $type) + { + $this->assertEquals( + $expected, + PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::translateTypeToPrefix($type) + ); + } + + /** + * @dataProvider determineJsonErrorDataprovider + * @covers PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::determineJsonError + */ + public function testDetermineJsonError($expected, $error, $prefix) + { + $this->assertEquals( + $expected, + PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider::determineJsonError( + $error, + $prefix + ) + ); + } + + public static function determineJsonErrorDataprovider() + { + return array( + 'JSON_ERROR_NONE' => array( + NULL, 'json_error_none', '' + ), + 'JSON_ERROR_DEPTH' => array( + 'Maximum stack depth exceeded', JSON_ERROR_DEPTH, '' + ), + 'prefixed JSON_ERROR_DEPTH' => array( + 'TUX: Maximum stack depth exceeded', JSON_ERROR_DEPTH, 'TUX: ' + ), + 'JSON_ERROR_STATE_MISMatch' => array( + 'Underflow or the modes mismatch', JSON_ERROR_STATE_MISMATCH, '' + ), + 'JSON_ERROR_CTRL_CHAR' => array( + 'Unexpected control character found', JSON_ERROR_CTRL_CHAR, '' + ), + 'JSON_ERROR_SYNTAX' => array( + 'Syntax error, malformed JSON', JSON_ERROR_SYNTAX, '' + ), + 'JSON_ERROR_UTF8`' => array( + 'Malformed UTF-8 characters, possibly incorrectly encoded', + JSON_ERROR_UTF8, + '' + ), + 'Invalid error indicator' => array( + 'Unknown error', 55, '' + ), + ); + } + + public static function translateTypeToPrefixDataprovider() + { + return array( + 'expected' => array('Expected value JSON decode error - ', 'expected'), + 'actual' => array('Actual value JSON decode error - ', 'actual'), + 'default' => array('', ''), + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php @@ -0,0 +1,89 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ + +/** + * @package PHPUnit + * @author Bastian Feder <php@bastian-feder.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.0 + */ +class Framework_Constraint_JsonMatchesTest extends PHPUnit_Framework_TestCase +{ + + /** + * @dataProvider evaluateDataprovider + * @covers PHPUnit_Framework_Constraint_JsonMatches::evaluate + * @covers PHPUnit_Framework_Constraint_JsonMatches::matches + * @covers PHPUnit_Framework_Constraint_JsonMatches::__construct + */ + public function testEvaluate($expected, $jsonOther, $jsonValue) + { + $constraint = new PHPUnit_Framework_Constraint_JsonMatches($jsonValue); + $this->assertEquals($expected, $constraint->evaluate($jsonOther, '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_JsonMatches::toString + */ + public function testToString() + { + $jsonValue = json_encode(array('Mascott' => 'Tux')); + $constraint = new PHPUnit_Framework_Constraint_JsonMatches($jsonValue); + + $this->assertEquals('matches JSON string "' . $jsonValue . '"', $constraint->toString()); + } + + + public static function evaluateDataprovider() + { + return array( + 'valid JSON' => array(TRUE, json_encode(array('Mascott' => 'Tux')), json_encode(array('Mascott' => 'Tux'))), + 'error syntax' => array(FALSE, '{"Mascott"::}', json_encode(array('Mascott' => 'Tux'))), + 'error UTF-8' => array(FALSE, json_encode('\xB1\x31'), json_encode(array('Mascott' => 'Tux'))), + 'invalid JSON in class instantiation' => array(FALSE, json_encode(array('Mascott' => 'Tux')), '{"Mascott"::}'), + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php @@ -0,0 +1,3647 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'TestIterator.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.0.0 + */ +class Framework_ConstraintTest extends PHPUnit_Framework_TestCase +{ + /** + * Removes spaces in front of newlines + * + * @param string $string + * @return string + */ + public static function trimnl($string) + { + return preg_replace('/[ ]*\n/', "\n", $string); + } + + /** + * @covers PHPUnit_Framework_Constraint_ArrayHasKey + * @covers PHPUnit_Framework_Assert::arrayHasKey + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayHasKey() + { + $constraint = PHPUnit_Framework_Assert::arrayHasKey(0); + + $this->assertFalse($constraint->evaluate(array(), '', TRUE)); + $this->assertEquals('has the key 0', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(array()); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that an array has the key 0. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ArrayHasKey + * @covers PHPUnit_Framework_Assert::arrayHasKey + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayHasKey2() + { + $constraint = PHPUnit_Framework_Assert::arrayHasKey(0); + + try { + $constraint->evaluate(array(), 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message\nFailed asserting that an array has the key 0. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ArrayHasKey + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::arrayHasKey + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayNotHasKey() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::arrayHasKey(0) + ); + + $this->assertFalse($constraint->evaluate(array(0 => 1), '', TRUE)); + $this->assertEquals('does not have the key 0', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(array(0 => 1)); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that an array does not have the key 0. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ArrayHasKey + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::arrayHasKey + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayNotHasKey2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::arrayHasKey(0) + ); + + try { + $constraint->evaluate(array(0), 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that an array does not have the key 0. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_FileExists + * @covers PHPUnit_Framework_Assert::fileExists + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintFileExists() + { + $constraint = PHPUnit_Framework_Assert::fileExists(); + + $this->assertFalse($constraint->evaluate('foo', '', TRUE)); + $this->assertEquals('file exists', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('foo'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that file "foo" exists. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_FileExists + * @covers PHPUnit_Framework_Assert::fileExists + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintFileExists2() + { + $constraint = PHPUnit_Framework_Assert::fileExists(); + + try { + $constraint->evaluate('foo', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that file "foo" exists. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_FileExists + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Assert::fileExists + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintFileNotExists() + { + $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; + + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::fileExists() + ); + + $this->assertFalse($constraint->evaluate($file, '', TRUE)); + $this->assertEquals('file does not exist', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate($file); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that file "$file" does not exist. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_FileExists + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Assert::fileExists + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintFileNotExists2() + { + $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; + + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::fileExists() + ); + + try { + $constraint->evaluate($file, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that file "$file" does not exist. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Assert::greaterThan + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintGreaterThan() + { + $constraint = PHPUnit_Framework_Assert::greaterThan(1); + + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertTrue($constraint->evaluate(2, '', TRUE)); + $this->assertEquals('is greater than 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(0); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 0 is greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Assert::greaterThan + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintGreaterThan2() + { + $constraint = PHPUnit_Framework_Assert::greaterThan(1); + + try { + $constraint->evaluate(0, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 0 is greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::greaterThan + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotGreaterThan() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::greaterThan(1) + ); + + $this->assertTrue($constraint->evaluate(1, '', TRUE)); + $this->assertEquals('is not greater than 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(2); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 2 is not greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::greaterThan + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotGreaterThan2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::greaterThan(1) + ); + + try { + $constraint->evaluate(2, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 2 is not greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Assert::greaterThanOrEqual + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintGreaterThanOrEqual() + { + $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1); + + $this->assertTrue($constraint->evaluate(1, '', TRUE)); + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertEquals('is equal to 1 or is greater than 1', $constraint->toString()); + $this->assertEquals(2, count($constraint)); + + try { + $constraint->evaluate(0); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 0 is equal to 1 or is greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Assert::greaterThanOrEqual + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintGreaterThanOrEqual2() + { + $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1); + + try { + $constraint->evaluate(0, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 0 is equal to 1 or is greater than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::greaterThanOrEqual + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotGreaterThanOrEqual() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::greaterThanOrEqual(1) + ); + + $this->assertFalse($constraint->evaluate(1, '', TRUE)); + $this->assertEquals('not( is equal to 1 or is greater than 1 )', $constraint->toString()); + $this->assertEquals(2, count($constraint)); + + try { + $constraint->evaluate(1); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that not( 1 is equal to 1 or is greater than 1 ). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_GreaterThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::greaterThanOrEqual + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotGreaterThanOrEqual2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::greaterThanOrEqual(1) + ); + + try { + $constraint->evaluate(1, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that not( 1 is equal to 1 or is greater than 1 ). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsAnything + * @covers PHPUnit_Framework_Assert::anything + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsAnything() + { + $constraint = PHPUnit_Framework_Assert::anything(); + + $this->assertTrue($constraint->evaluate(NULL, '', TRUE)); + $this->assertNull($constraint->evaluate(NULL)); + $this->assertEquals('is anything', $constraint->toString()); + $this->assertEquals(0, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsAnything + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::anything + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotIsAnything() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::anything() + ); + + $this->assertFalse($constraint->evaluate(NULL, '', TRUE)); + $this->assertEquals('is not anything', $constraint->toString()); + $this->assertEquals(0, count($constraint)); + + try { + $constraint->evaluate(NULL); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that null is not anything. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Assert::equalTo + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsEqual() + { + $constraint = PHPUnit_Framework_Assert::equalTo(1); + + $this->assertTrue($constraint->evaluate(1, '', TRUE)); + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertEquals('is equal to 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(0); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 0 matches expected 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + public function isEqualProvider() + { + $a = new stdClass; + $a->foo = 'bar'; + $b = new stdClass; + $ahash = spl_object_hash($a); + $bhash = spl_object_hash($b); + + $c = new stdClass; + $c->foo = 'bar'; + $c->int = 1; + $c->array = array(0, array(1), array(2), 3); + $c->related = new stdClass; + $c->related->foo = "a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk"; + $c->self = $c; + $c->c = $c; + $d = new stdClass; + $d->foo = 'bar'; + $d->int = 2; + $d->array = array(0, array(4), array(2), 3); + $d->related = new stdClass; + $d->related->foo = "a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk"; + $d->self = $d; + $d->c = $c; + + $storage1 = new SplObjectStorage; + $storage1->attach($a); + $storage1->attach($b); + $storage2 = new SplObjectStorage; + $storage2->attach($b); + + $dom1 = new DOMDocument; + $dom1->preserveWhiteSpace = FALSE; + $dom1->loadXML('<root></root>'); + $dom2 = new DOMDocument; + $dom2->preserveWhiteSpace = FALSE; + $dom2->loadXML('<root><foo/></root>'); + + return array( + array(1, 0, <<<EOF +Failed asserting that 0 matches expected 1. + +EOF + ), + array(1.1, 0, <<<EOF +Failed asserting that 0 matches expected 1.1. + +EOF + ), + array('a', 'b', <<<EOF +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ +-'a' ++'b' + +EOF + ), + array("a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk", "a\np\nc\nd\ne\nf\ng\nh\ni\nw\nk", <<<EOF +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ + 'a +-b ++p + +@@ @@ + i +-j ++w + k' + +EOF + ), + array(1, array(0), <<<EOF +Array (...) does not match expected type "integer". + +EOF + ), + array(array(0), 1, <<<EOF +1 does not match expected type "array". + +EOF + ), + array(array(0), array(1), <<<EOF +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => 0 ++ 0 => 1 + ) + +EOF + ), + array(array(TRUE), array('true'), <<<EOF +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => true ++ 0 => 'true' + ) + +EOF + ), + array(array(0, array(1), array(2), 3), array(0, array(4), array(2), 3), <<<EOF +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( + 0 => 0 + 1 => Array ( +- 0 => 1 ++ 0 => 4 + ) + 2 => Array (...) + 3 => 3 + ) + +EOF + ), + array($a, array(0), <<<EOF +Array (...) does not match expected type "object". + +EOF + ), + array(array(0), $a, <<<EOF +stdClass Object (...) does not match expected type "array". + +EOF + ), + array($a, $b, <<<EOF +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + stdClass Object ( +- 'foo' => 'bar' + ) + +EOF + ), + array($c, $d, <<<EOF +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + stdClass Object ( + 'foo' => 'bar' +- 'int' => 1 ++ 'int' => 2 + 'array' => Array ( + 0 => 0 + 1 => Array ( +- 0 => 1 ++ 0 => 4 + +@@ @@ + 'foo' => 'a +- b ++ p + +@@ @@ + i +- j ++ w + k' + ) + 'self' => stdClass Object (...) + 'c' => stdClass Object (...) + ) + +EOF + ), + array($storage1, $storage2, <<<EOF +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + SplObjectStorage Object ( +- '$ahash' => Array ( +- 'obj' => stdClass Object ( +- 'foo' => 'bar' +- ) +- 'inf' => null +- ) + '$bhash' => Array ( + 'obj' => stdClass Object () + 'inf' => null + ) + ) + +EOF + ), + array($dom1, $dom2, <<<EOF +Failed asserting that two DOM documents are equal. +--- Expected ++++ Actual +@@ @@ + <?xml version="1.0"?> +-<root/> ++<root> ++ <foo/> ++</root> + +EOF + ), + ); + } + + /** + * @dataProvider isEqualProvider + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Assert::equalTo + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsEqual2($expected, $actual, $message) + { + $constraint = PHPUnit_Framework_Assert::equalTo($expected); + + try { + $constraint->evaluate($actual, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + "custom message\n$message", + self::trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::equalTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotEqual() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::equalTo(1) + ); + + $this->assertTrue($constraint->evaluate(0, '', TRUE)); + $this->assertFalse($constraint->evaluate(1, '', TRUE)); + $this->assertEquals('is not equal to 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(1); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 1 is not equal to 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::equalTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotEqual2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::equalTo(1) + ); + + try { + $constraint->evaluate(1, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 1 is not equal to 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsIdentical() + { + $a = new stdClass; + $b = new stdClass; + + $constraint = PHPUnit_Framework_Assert::identicalTo($a); + + $this->assertFalse($constraint->evaluate($b, '', TRUE)); + $this->assertTrue($constraint->evaluate($a, '', TRUE)); + $this->assertEquals('is identical to an object of class "stdClass"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate($b); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that two variables reference the same object. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsIdentical2() + { + $a = new stdClass; + $b = new stdClass; + + $constraint = PHPUnit_Framework_Assert::identicalTo($a); + + try { + $constraint->evaluate($b, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that two variables reference the same object. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsIdentical3() + { + $constraint = PHPUnit_Framework_Assert::identicalTo('a'); + + try { + $constraint->evaluate('b', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that two strings are identical. +--- Expected ++++ Actual +@@ @@ +-a ++b + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotIdentical() + { + $a = new stdClass; + $b = new stdClass; + + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::identicalTo($a) + ); + + $this->assertTrue($constraint->evaluate($b, '', TRUE)); + $this->assertFalse($constraint->evaluate($a, '', TRUE)); + $this->assertEquals('is not identical to an object of class "stdClass"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate($a); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that two variables don't reference the same object. + +EOF + , + self::trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotIdentical2() + { + $a = new stdClass; + + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::identicalTo($a) + ); + + try { + $constraint->evaluate($a, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that two variables don't reference the same object. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsIdentical + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::identicalTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotIdentical3() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::identicalTo('a') + ); + + try { + $constraint->evaluate('a', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that two strings are not identical. + +EOF + , + self::trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsInstanceOf + * @covers PHPUnit_Framework_Assert::isInstanceOf + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsInstanceOf() + { + $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception'); + + $this->assertFalse($constraint->evaluate(new stdClass, '', TRUE)); + $this->assertTrue($constraint->evaluate(new Exception, '', TRUE)); + $this->assertEquals('is instance of class "Exception"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(new stdClass); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that stdClass Object () is an instance of class "Exception". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsInstanceOf + * @covers PHPUnit_Framework_Assert::isInstanceOf + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsInstanceOf2() + { + $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception'); + + try { + $constraint->evaluate(new stdClass, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that stdClass Object () is an instance of class "Exception". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsInstanceOf + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isInstanceOf + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotInstanceOf() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isInstanceOf('stdClass') + ); + + $this->assertFalse($constraint->evaluate(new stdClass, '', TRUE)); + $this->assertTrue($constraint->evaluate(new Exception, '', TRUE)); + $this->assertEquals('is not instance of class "stdClass"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(new stdClass); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that stdClass Object () is not an instance of class "stdClass". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsInstanceOf + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isInstanceOf + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotInstanceOf2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isInstanceOf('stdClass') + ); + + try { + $constraint->evaluate(new stdClass, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that stdClass Object () is not an instance of class "stdClass". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsType + * @covers PHPUnit_Framework_Assert::isType + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsType() + { + $constraint = PHPUnit_Framework_Assert::isType('string'); + + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertTrue($constraint->evaluate('', '', TRUE)); + $this->assertEquals('is of type "string"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(new stdClass); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that stdClass Object () is of type "string". + +EOF + , + self::trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsType + * @covers PHPUnit_Framework_Assert::isType + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsType2() + { + $constraint = PHPUnit_Framework_Assert::isType('string'); + + try { + $constraint->evaluate(new stdClass, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that stdClass Object () is of type "string". + +EOF + , + self::trimnl(PHPUnit_Framework_TestFailure::exceptionToString($e)) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsType + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isType + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotType() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isType('string') + ); + + $this->assertTrue($constraint->evaluate(0, '', TRUE)); + $this->assertFalse($constraint->evaluate('', '', TRUE)); + $this->assertEquals('is not of type "string"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(''); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that '' is not of type "string". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsType + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isType + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotType2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isType('string') + ); + + try { + $constraint->evaluate('', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that '' is not of type "string". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsNull + * @covers PHPUnit_Framework_Assert::isNull + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNull() + { + $constraint = PHPUnit_Framework_Assert::isNull(); + + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertTrue($constraint->evaluate(NULL, '', TRUE)); + $this->assertEquals('is null', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(0); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that 0 is null. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsNull + * @covers PHPUnit_Framework_Assert::isNull + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNull2() + { + $constraint = PHPUnit_Framework_Assert::isNull(); + + try { + $constraint->evaluate(0, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that 0 is null. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsNull + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isNull + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotNull() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isNull() + ); + + $this->assertFalse($constraint->evaluate(NULL, '', TRUE)); + $this->assertTrue($constraint->evaluate(0, '', TRUE)); + $this->assertEquals('is not null', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(NULL); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +Failed asserting that null is not null. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsNull + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::isNull + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsNotNull2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::isNull() + ); + + try { + $constraint->evaluate(NULL, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that null is not null. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Assert::lessThan + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintLessThan() + { + $constraint = PHPUnit_Framework_Assert::lessThan(1); + + $this->assertTrue($constraint->evaluate(0, '', TRUE)); + $this->assertFalse($constraint->evaluate(1, '', TRUE)); + $this->assertEquals('is less than 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(1); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 1 is less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Assert::lessThan + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintLessThan2() + { + $constraint = PHPUnit_Framework_Assert::lessThan(1); + + try { + $constraint->evaluate(1, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 1 is less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::lessThan + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotLessThan() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::lessThan(1) + ); + + $this->assertTrue($constraint->evaluate(1, '', TRUE)); + $this->assertFalse($constraint->evaluate(0, '', TRUE)); + $this->assertEquals('is not less than 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(0); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 0 is not less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::lessThan + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotLessThan2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::lessThan(1) + ); + + try { + $constraint->evaluate(0, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 0 is not less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Assert::lessThanOrEqual + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintLessThanOrEqual() + { + $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1); + + $this->assertTrue($constraint->evaluate(1, '', TRUE)); + $this->assertFalse($constraint->evaluate(2, '', TRUE)); + $this->assertEquals('is equal to 1 or is less than 1', $constraint->toString()); + $this->assertEquals(2, count($constraint)); + + try { + $constraint->evaluate(2); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 2 is equal to 1 or is less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + */ + public function testConstraintCallback() + { + $closureReflect = function($parameter) { + return $parameter; + }; + + $closureWithoutParameter = function() { + return TRUE; + }; + + $constraint = PHPUnit_Framework_Assert::callback($closureWithoutParameter); + $this->assertTrue($constraint->evaluate('', '', TRUE)); + + $constraint = PHPUnit_Framework_Assert::callback($closureReflect); + $this->assertTrue($constraint->evaluate(TRUE, '', TRUE)); + $this->assertFalse($constraint->evaluate(FALSE, '', TRUE)); + + $callback = array($this, 'callbackReturningTrue'); + $constraint = PHPUnit_Framework_Assert::callback($callback); + $this->assertTrue($constraint->evaluate(FALSE, '', TRUE)); + + $callback = array('Framework_ConstraintTest', 'staticCallbackReturningTrue'); + $constraint = PHPUnit_Framework_Assert::callback($callback); + $this->assertTrue($constraint->evaluate(NULL, '', TRUE)); + + $this->assertEquals('is accepted by specified callback', $constraint->toString()); + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException PHPUnit_Framework_ExpectationFailedException + * @expectedExceptionMessage Failed asserting that 'This fails' is accepted by specified callback. + */ + public function testConstraintCallbackFailure() + { + $constraint = PHPUnit_Framework_Assert::callback(function() { + return FALSE; + }); + $constraint->evaluate('This fails'); + } + + public function callbackReturningTrue() + { + return TRUE; + } + + public static function staticCallbackReturningTrue() + { + return TRUE; + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException InvalidArgumentException + * @expectedExceptionMessage Specified callback <invalid callback> is not callable. + */ + public function testConstraintCallbackInvalidFunctionArgument() + { + PHPUnit_Framework_Assert::callback('invalid callback'); + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException InvalidArgumentException + * @expectedExceptionMessage Specified callback <empty array> is not callable. + */ + public function testConstraintCallbackInvalidArrayArgumentWithEmptyArray() + { + PHPUnit_Framework_Assert::callback(array()); + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException InvalidArgumentException + * @expectedExceptionMessage Specified callback <array without indexes 0 and 1 set> is not callable. + */ + public function testConstraintCallbackInvalidArrayArgumentWithBadArray() + { + PHPUnit_Framework_Assert::callback(array(3 => 'foo')); + } + + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException InvalidArgumentException + * @expectedExceptionMessage Specified callback <Framework_ConstraintTest::invalid callback> is not callable. + */ + public function testConstraintCallbackInvalidArrayArgumentWithObject() + { + PHPUnit_Framework_Assert::callback(array($this, 'invalid callback')); + } + + /** + * @covers PHPUnit_Framework_Constraint_Callback + * @expectedException InvalidArgumentException + * @expectedExceptionMessage Specified callback <Framework_ConstraintTest::invalid callback> is not callable. + */ + public function testConstraintCallbackInvalidArrayArgumentWithClassname() + { + PHPUnit_Framework_Assert::callback(array('Framework_ConstraintTest', 'invalid callback')); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Assert::lessThanOrEqual + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintLessThanOrEqual2() + { + $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1); + + try { + $constraint->evaluate(2, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 2 is equal to 1 or is less than 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::lessThanOrEqual + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotLessThanOrEqual() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::lessThanOrEqual(1) + ); + + $this->assertTrue($constraint->evaluate(2, '', TRUE)); + $this->assertFalse($constraint->evaluate(1, '', TRUE)); + $this->assertEquals('not( is equal to 1 or is less than 1 )', $constraint->toString()); + $this->assertEquals(2, count($constraint)); + + try { + $constraint->evaluate(1); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that not( 1 is equal to 1 or is less than 1 ). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEqual + * @covers PHPUnit_Framework_Constraint_LessThan + * @covers PHPUnit_Framework_Constraint_Or + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::lessThanOrEqual + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotLessThanOrEqual2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::lessThanOrEqual(1) + ); + + try { + $constraint->evaluate(1, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that not( 1 is equal to 1 or is less than 1 ). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasAttribute + * @covers PHPUnit_Framework_Assert::classHasAttribute + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassHasAttribute() + { + $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute'); + + $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', TRUE)); + $this->assertFalse($constraint->evaluate('stdClass', '', TRUE)); + $this->assertEquals('has attribute "privateAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('stdClass'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that class "stdClass" has attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasAttribute + * @covers PHPUnit_Framework_Assert::classHasAttribute + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassHasAttribute2() + { + $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute'); + + try { + $constraint->evaluate('stdClass', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that class "stdClass" has attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::classHasAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassNotHasAttribute() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::classHasAttribute('privateAttribute') + ); + + $this->assertTrue($constraint->evaluate('stdClass', '', TRUE)); + $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', TRUE)); + $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that class "ClassWithNonPublicAttributes" does not have attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::classHasAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassNotHasAttribute2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::classHasAttribute('privateAttribute') + ); + + try { + $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that class "ClassWithNonPublicAttributes" does not have attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @covers PHPUnit_Framework_Assert::classHasStaticAttribute + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassHasStaticAttribute() + { + $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute'); + + $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', TRUE)); + $this->assertFalse($constraint->evaluate('stdClass', '', TRUE)); + $this->assertEquals('has static attribute "privateStaticAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('stdClass'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that class "stdClass" has static attribute "privateStaticAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @covers PHPUnit_Framework_Assert::classHasStaticAttribute + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassHasStaticAttribute2() + { + $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('foo'); + + try { + $constraint->evaluate('stdClass', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that class "stdClass" has static attribute "foo". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::classHasStaticAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassNotHasStaticAttribute() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute') + ); + + $this->assertTrue($constraint->evaluate('stdClass', '', TRUE)); + $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', TRUE)); + $this->assertEquals('does not have static attribute "privateStaticAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('ClassWithNonPublicAttributes'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that class "ClassWithNonPublicAttributes" does not have static attribute "privateStaticAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ClassHasStaticAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::classHasStaticAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintClassNotHasStaticAttribute2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute') + ); + + try { + $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that class "ClassWithNonPublicAttributes" does not have static attribute "privateStaticAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute + * @covers PHPUnit_Framework_Assert::objectHasAttribute + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintObjectHasAttribute() + { + $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute'); + + $this->assertTrue($constraint->evaluate(new ClassWithNonPublicAttributes, '', TRUE)); + $this->assertFalse($constraint->evaluate(new stdClass, '', TRUE)); + $this->assertEquals('has attribute "privateAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(new stdClass); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that object of class "stdClass" has attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute + * @covers PHPUnit_Framework_Assert::objectHasAttribute + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintObjectHasAttribute2() + { + $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute'); + + try { + $constraint->evaluate(new stdClass, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that object of class "stdClass" has attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::objectHasAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintObjectNotHasAttribute() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute') + ); + + $this->assertTrue($constraint->evaluate(new stdClass, '', TRUE)); + $this->assertFalse($constraint->evaluate(new ClassWithNonPublicAttributes, '', TRUE)); + $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(new ClassWithNonPublicAttributes); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that object of class "ClassWithNonPublicAttributes" does not have attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_ObjectHasAttribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::objectHasAttribute + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintObjectNotHasAttribute2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute') + ); + + try { + $constraint->evaluate(new ClassWithNonPublicAttributes, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that object of class "ClassWithNonPublicAttributes" does not have attribute "privateAttribute". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_PCREMatch + * @covers PHPUnit_Framework_Assert::matchesRegularExpression + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintPCREMatch() + { + $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/'); + + $this->assertFalse($constraint->evaluate('barbazbar', '', TRUE)); + $this->assertTrue($constraint->evaluate('barfoobar', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/foo/"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('barbazbar'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'barbazbar' matches PCRE pattern "/foo/". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_PCREMatch + * @covers PHPUnit_Framework_Assert::matchesRegularExpression + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintPCREMatch2() + { + $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/'); + + try { + $constraint->evaluate('barbazbar', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that 'barbazbar' matches PCRE pattern "/foo/". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_PCREMatch + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::matchesRegularExpression + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintPCRENotMatch() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::matchesRegularExpression('/foo/') + ); + + $this->assertTrue($constraint->evaluate('barbazbar', '', TRUE)); + $this->assertFalse($constraint->evaluate('barfoobar', '', TRUE)); + $this->assertEquals('does not match PCRE pattern "/foo/"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('barfoobar'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'barfoobar' does not match PCRE pattern "/foo/". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_PCREMatch + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::matchesRegularExpression + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintPCRENotMatch2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::matchesRegularExpression('/foo/') + ); + + try { + $constraint->evaluate('barfoobar', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals(<<<EOF +custom message +Failed asserting that 'barfoobar' does not match PCRE pattern "/foo/". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches() + { + $constraint = PHPUnit_Framework_Assert::matches('*%c*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('***', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*.\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches2() + { + $constraint = PHPUnit_Framework_Assert::matches('*%s*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('***', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*[^\r\n]+\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches3() + { + $constraint = PHPUnit_Framework_Assert::matches('*%i*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('*0*', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*[+-]?\d+\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches4() + { + $constraint = PHPUnit_Framework_Assert::matches('*%d*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('*0*', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*\d+\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches5() + { + $constraint = PHPUnit_Framework_Assert::matches('*%x*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('*0f0f0f*', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*[0-9a-fA-F]+\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringMatches + * @covers PHPUnit_Framework_Assert::matches + * @covers PHPUnit_Framework_Constraint::count + */ + public function testConstraintStringMatches6() + { + $constraint = PHPUnit_Framework_Assert::matches('*%f*'); + $this->assertFalse($constraint->evaluate('**', '', TRUE)); + $this->assertTrue($constraint->evaluate('*1.0*', '', TRUE)); + $this->assertEquals('matches PCRE pattern "/^\*[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?\*$/s"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringStartsWith + * @covers PHPUnit_Framework_Assert::stringStartsWith + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringStartsWith() + { + $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix'); + + $this->assertFalse($constraint->evaluate('foo', '', TRUE)); + $this->assertTrue($constraint->evaluate('prefixfoo', '', TRUE)); + $this->assertEquals('starts with "prefix"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('foo'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'foo' starts with "prefix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringStartsWith + * @covers PHPUnit_Framework_Assert::stringStartsWith + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringStartsWith2() + { + $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix'); + + try { + $constraint->evaluate('foo', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message\nFailed asserting that 'foo' starts with "prefix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringStartsWith + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::stringStartsWith + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringStartsNotWith() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringStartsWith('prefix') + ); + + $this->assertTrue($constraint->evaluate('foo', '', TRUE)); + $this->assertFalse($constraint->evaluate('prefixfoo', '', TRUE)); + $this->assertEquals('starts not with "prefix"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('prefixfoo'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'prefixfoo' starts not with "prefix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringStartsWith + * @covers PHPUnit_Framework_Assert::stringStartsWith + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringStartsNotWith2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringStartsWith('prefix') + ); + + try { + $constraint->evaluate('prefixfoo', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 'prefixfoo' starts not with "prefix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringContains + * @covers PHPUnit_Framework_Assert::stringContains + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringContains() + { + $constraint = PHPUnit_Framework_Assert::stringContains('foo'); + + $this->assertFalse($constraint->evaluate('barbazbar', '', TRUE)); + $this->assertTrue($constraint->evaluate('barfoobar', '', TRUE)); + $this->assertEquals('contains "foo"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('barbazbar'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'barbazbar' contains "foo". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringContains + * @covers PHPUnit_Framework_Assert::stringContains + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringContains2() + { + $constraint = PHPUnit_Framework_Assert::stringContains('foo'); + + try { + $constraint->evaluate('barbazbar', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 'barbazbar' contains "foo". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringContains + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::stringContains + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringNotContains() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringContains('foo') + ); + + $this->assertTrue($constraint->evaluate('barbazbar', '', TRUE)); + $this->assertFalse($constraint->evaluate('barfoobar', '', TRUE)); + $this->assertEquals('does not contain "foo"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('barfoobar'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'barfoobar' does not contain "foo". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringContains + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::stringContains + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringNotContains2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringContains('foo') + ); + + try { + $constraint->evaluate('barfoobar', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 'barfoobar' does not contain "foo". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringEndsWith + * @covers PHPUnit_Framework_Assert::stringEndsWith + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringEndsWith() + { + $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix'); + + $this->assertFalse($constraint->evaluate('foo', '', TRUE)); + $this->assertTrue($constraint->evaluate('foosuffix', '', TRUE)); + $this->assertEquals('ends with "suffix"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('foo'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'foo' ends with "suffix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringEndsWith + * @covers PHPUnit_Framework_Assert::stringEndsWith + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringEndsWith2() + { + $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix'); + + try { + $constraint->evaluate('foo', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 'foo' ends with "suffix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringEndsWith + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::stringEndsWith + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringEndsNotWith() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringEndsWith('suffix') + ); + + $this->assertTrue($constraint->evaluate('foo', '', TRUE)); + $this->assertFalse($constraint->evaluate('foosuffix', '', TRUE)); + $this->assertEquals('ends not with "suffix"', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate('foosuffix'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that 'foosuffix' ends not with "suffix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_StringEndsWith + * @covers PHPUnit_Framework_Assert::stringEndsWith + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintStringEndsNotWith2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::stringEndsWith('suffix') + ); + + try { + $constraint->evaluate('foosuffix', 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that 'foosuffix' ends not with "suffix". + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayContains() + { + $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo'); + + $this->assertFalse($constraint->evaluate(array('bar'), '', TRUE)); + $this->assertTrue($constraint->evaluate(array('foo'), '', TRUE)); + $this->assertEquals("contains 'foo'", $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(array('bar')); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that an array contains 'foo'. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayContains2() + { + $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo'); + + try { + $constraint->evaluate(array('bar'), 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that an array contains 'foo'. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayNotContains() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + new PHPUnit_Framework_Constraint_TraversableContains('foo') + ); + + $this->assertTrue($constraint->evaluate(array('bar'), '', TRUE)); + $this->assertFalse($constraint->evaluate(array('foo'), '', TRUE)); + $this->assertEquals("does not contain 'foo'", $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(array('foo')); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that an array does not contain 'foo'. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintArrayNotContains2() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + new PHPUnit_Framework_Constraint_TraversableContains('foo') + ); + + try { + $constraint->evaluate(array('foo'), 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that an array does not contain 'foo'. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintSplObjectStorageContains() + { + $object = new StdClass; + $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object); + $this->assertEquals("contains stdClass Object ()", $constraint->toString()); + + $storage = new SplObjectStorage; + $this->assertFalse($constraint->evaluate($storage, '', TRUE)); + + $storage->attach($object); + $this->assertTrue($constraint->evaluate($storage, '', TRUE)); + + try { + $constraint->evaluate(new SplObjectStorage); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that an iterator contains stdClass Object (). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_TraversableContains + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintSplObjectStorageContains2() + { + $object = new StdClass; + $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object); + + try { + $constraint->evaluate(new SplObjectStorage, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message +Failed asserting that an iterator contains stdClass Object (). + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::attributeEqualTo + * @covers PHPUnit_Framework_Constraint_Attribute + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testAttributeEqualTo() + { + $object = new ClassWithNonPublicAttributes; + $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 1); + + $this->assertTrue($constraint->evaluate($object, '', TRUE)); + $this->assertEquals('attribute "foo" is equal to 1', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2); + + $this->assertFalse($constraint->evaluate($object, '', TRUE)); + + try { + $constraint->evaluate($object); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that attribute "foo" is equal to 2. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::attributeEqualTo + * @covers PHPUnit_Framework_Constraint_Attribute + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testAttributeEqualTo2() + { + $object = new ClassWithNonPublicAttributes; + $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2); + + try { + $constraint->evaluate($object, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message\nFailed asserting that attribute "foo" is equal to 2. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::attributeEqualTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Constraint_Attribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testAttributeNotEqualTo() + { + $object = new ClassWithNonPublicAttributes; + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::attributeEqualTo('foo', 2) + ); + + $this->assertTrue($constraint->evaluate($object, '', TRUE)); + $this->assertEquals('attribute "foo" is not equal to 2', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::attributeEqualTo('foo', 1) + ); + + $this->assertFalse($constraint->evaluate($object, '', TRUE)); + + try { + $constraint->evaluate($object); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that attribute "foo" is not equal to 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Assert::attributeEqualTo + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_Constraint_Attribute + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testAttributeNotEqualTo2() + { + $object = new ClassWithNonPublicAttributes; + $constraint = PHPUnit_Framework_Assert::logicalNot( + PHPUnit_Framework_Assert::attributeEqualTo('foo', 1) + ); + + try { + $constraint->evaluate($object, 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message\nFailed asserting that attribute "foo" is not equal to 1. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEmpty + * @covers PHPUnit_Framework_Constraint::count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsEmpty() + { + $constraint = new PHPUnit_Framework_Constraint_IsEmpty; + + $this->assertFalse($constraint->evaluate(array('foo'), '', TRUE)); + $this->assertTrue($constraint->evaluate(array(), '', TRUE)); + $this->assertEquals('is empty', $constraint->toString()); + $this->assertEquals(1, count($constraint)); + + try { + $constraint->evaluate(array('foo')); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that an array is empty. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_IsEmpty + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintIsEmpty2() + { + $constraint = new PHPUnit_Framework_Constraint_IsEmpty; + + try { + $constraint->evaluate(array('foo'), 'custom message'); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +custom message\nFailed asserting that an array is empty. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_Count + */ + public function testConstraintCountWithAnArray() + { + $constraint = new PHPUnit_Framework_Constraint_Count(5); + + $this->assertTrue($constraint->evaluate(array(1,2,3,4,5), '', TRUE)); + $this->assertFalse($constraint->evaluate(array(1,2,3,4), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_Count + */ + public function testConstraintCountWithAnIteratorWhichDoesNotImplementCountable() + { + $constraint = new PHPUnit_Framework_Constraint_Count(5); + + $this->assertTrue($constraint->evaluate(new TestIterator(array(1,2,3,4,5)), '', TRUE)); + $this->assertFalse($constraint->evaluate(new TestIterator(array(1,2,3,4)), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_Count + */ + public function testConstraintCountWithAnObjectImplementingCountable() + { + $constraint = new PHPUnit_Framework_Constraint_Count(5); + + $this->assertTrue($constraint->evaluate(new ArrayObject(array(1,2,3,4,5)), '', TRUE)); + $this->assertFalse($constraint->evaluate(new ArrayObject(array(1,2,3,4)), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_Count + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintCountFailing() + { + $constraint = new PHPUnit_Framework_Constraint_Count(5); + + try { + $constraint->evaluate(array(1,2)); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that actual size 2 matches expected size 5. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_Count + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotCountFailing() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + new PHPUnit_Framework_Constraint_Count(2) + ); + + try { + $constraint->evaluate(array(1,2)); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that actual size 2 does not match expected size 2. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_SameSize + */ + public function testConstraintSameSizeWithAnArray() + { + $constraint = new PHPUnit_Framework_Constraint_SameSize(array(1,2,3,4,5)); + + $this->assertTrue($constraint->evaluate(array(6,7,8,9,10), '', TRUE)); + $this->assertFalse($constraint->evaluate(array(1,2,3,4), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_SameSize + */ + public function testConstraintSameSizeWithAnIteratorWhichDoesNotImplementCountable() + { + $constraint = new PHPUnit_Framework_Constraint_SameSize(new TestIterator(array(1,2,3,4,5))); + + $this->assertTrue($constraint->evaluate(new TestIterator(array(6,7,8,9,10)), '', TRUE)); + $this->assertFalse($constraint->evaluate(new TestIterator(array(1,2,3,4)), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_SameSize + */ + public function testConstraintSameSizeWithAnObjectImplementingCountable() + { + $constraint = new PHPUnit_Framework_Constraint_SameSize(new ArrayObject(array(1,2,3,4,5))); + + $this->assertTrue($constraint->evaluate(new ArrayObject(array(6,7,8,9,10)), '', TRUE)); + $this->assertFalse($constraint->evaluate(new ArrayObject(array(1,2,3,4)), '', TRUE)); + } + + /** + * @covers PHPUnit_Framework_Constraint_SameSize + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintSameSizeFailing() + { + $constraint = new PHPUnit_Framework_Constraint_SameSize(array(1,2,3,4,5)); + + try { + $constraint->evaluate(array(1,2)); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that actual size 2 matches expected size 5. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } + + /** + * @covers PHPUnit_Framework_Constraint_SameSize + * @covers PHPUnit_Framework_Constraint_Not + * @covers PHPUnit_Framework_Assert::logicalNot + * @covers PHPUnit_Framework_TestFailure::exceptionToString + */ + public function testConstraintNotSameSizeFailing() + { + $constraint = PHPUnit_Framework_Assert::logicalNot( + new PHPUnit_Framework_Constraint_SameSize(array(1,2)) + ); + + try { + $constraint->evaluate(array(3,4)); + } + + catch (PHPUnit_Framework_ExpectationFailedException $e) { + $this->assertEquals( + <<<EOF +Failed asserting that actual size 2 does not match expected size 2. + +EOF + , + PHPUnit_Framework_TestFailure::exceptionToString($e) + ); + + return; + } + + $this->fail(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php @@ -0,0 +1,185 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'InheritedTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoTestCaseClass.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoTestCases.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NotPublicTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NotVoidTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'OneTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'OverrideTestCase.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Framework_SuiteTest extends PHPUnit_Framework_TestCase { + protected $result; + + protected function setUp() + { + $this->result = new PHPUnit_Framework_TestResult; + } + + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite; + + $suite->addTest(new Framework_SuiteTest('testAddTestSuite')); + $suite->addTest(new Framework_SuiteTest('testInheritedTests')); + $suite->addTest(new Framework_SuiteTest('testNoTestCases')); + $suite->addTest(new Framework_SuiteTest('testNoTestCaseClass')); + $suite->addTest(new Framework_SuiteTest('testNotExistingTestCase')); + $suite->addTest(new Framework_SuiteTest('testNotPublicTestCase')); + $suite->addTest(new Framework_SuiteTest('testNotVoidTestCase')); + $suite->addTest(new Framework_SuiteTest('testOneTestCase')); + $suite->addTest(new Framework_SuiteTest('testShadowedTests')); + + return $suite; + } + + public function testAddTestSuite() + { + $suite = new PHPUnit_Framework_TestSuite( + 'OneTestCase' + ); + + $suite->run($this->result); + + $this->assertEquals(1, count($this->result)); + } + + public function testInheritedTests() + { + $suite = new PHPUnit_Framework_TestSuite( + 'InheritedTestCase' + ); + + $suite->run($this->result); + + $this->assertTrue($this->result->wasSuccessful()); + $this->assertEquals(2, count($this->result)); + } + + public function testNoTestCases() + { + $suite = new PHPUnit_Framework_TestSuite( + 'NoTestCases' + ); + + $suite->run($this->result); + + $this->assertTrue(!$this->result->wasSuccessful()); + $this->assertEquals(1, $this->result->failureCount()); + $this->assertEquals(1, count($this->result)); + } + + /** + * @expectedException PHPUnit_Framework_Exception + */ + public function testNoTestCaseClass() + { + $suite = new PHPUnit_Framework_TestSuite('NoTestCaseClass'); + } + + public function testNotExistingTestCase() + { + $suite = new Framework_SuiteTest('notExistingMethod'); + + $suite->run($this->result); + + $this->assertEquals(0, $this->result->errorCount()); + $this->assertEquals(1, $this->result->failureCount()); + $this->assertEquals(1, count($this->result)); + } + + public function testNotPublicTestCase() + { + $suite = new PHPUnit_Framework_TestSuite( + 'NotPublicTestCase' + ); + + $this->assertEquals(2, count($suite)); + } + + public function testNotVoidTestCase() + { + $suite = new PHPUnit_Framework_TestSuite( + 'NotVoidTestCase' + ); + + $this->assertEquals(1, count($suite)); + } + + public function testOneTestCase() + { + $suite = new PHPUnit_Framework_TestSuite( + 'OneTestCase' + ); + + $suite->run($this->result); + + $this->assertEquals(0, $this->result->errorCount()); + $this->assertEquals(0, $this->result->failureCount()); + $this->assertEquals(1, count($this->result)); + $this->assertTrue($this->result->wasSuccessful()); + } + + public function testShadowedTests() + { + $suite = new PHPUnit_Framework_TestSuite( + 'OverrideTestCase' + ); + + $suite->run($this->result); + + $this->assertEquals(1, count($this->result)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php @@ -0,0 +1,439 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Error.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionInAssertPostConditionsTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionInAssertPreConditionsTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionInSetUpTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionInTearDownTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionInTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Failure.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NoArgTestCaseTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'OutputTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'RequirementsTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Singleton.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Success.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ThrowExceptionTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ThrowNoExceptionTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'WasRun.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ChangeCurrentWorkingDirectoryTest.php'; + +$GLOBALS['a'] = 'a'; +$_ENV['b'] = 'b'; +$_POST['c'] = 'c'; +$_GET['d'] = 'd'; +$_COOKIE['e'] = 'e'; +$_SERVER['f'] = 'f'; +$_FILES['g'] = 'g'; +$_REQUEST['h'] = 'h'; +$GLOBALS['i'] = 'i'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Framework_TestCaseTest extends PHPUnit_Framework_TestCase +{ + protected $backupGlobalsBlacklist = array('i', 'singleton'); + + public function testCaseToString() + { + $this->assertEquals( + 'Framework_TestCaseTest::testCaseToString', + $this->toString() + ); + } + + public function testSuccess() + { + $test = new Success; + $result = $test->run(); + + $this->assertEquals(0, $result->errorCount()); + $this->assertEquals(0, $result->failureCount()); + $this->assertEquals(1, count($result)); + } + + public function testFailure() + { + $test = new Failure; + $result = $test->run(); + + $this->assertEquals(0, $result->errorCount()); + $this->assertEquals(1, $result->failureCount()); + $this->assertEquals(1, count($result)); + } + + public function testError() + { + $test = new Error; + $result = $test->run(); + + $this->assertEquals(1, $result->errorCount()); + $this->assertEquals(0, $result->failureCount()); + $this->assertEquals(1, count($result)); + } + + public function testExceptionInSetUp() + { + $test = new ExceptionInSetUpTest('testSomething'); + $result = $test->run(); + + $this->assertTrue($test->setUp); + $this->assertFalse($test->assertPreConditions); + $this->assertFalse($test->testSomething); + $this->assertFalse($test->assertPostConditions); + $this->assertTrue($test->tearDown); + } + + public function testExceptionInAssertPreConditions() + { + $test = new ExceptionInAssertPreConditionsTest('testSomething'); + $result = $test->run(); + + $this->assertTrue($test->setUp); + $this->assertTrue($test->assertPreConditions); + $this->assertFalse($test->testSomething); + $this->assertFalse($test->assertPostConditions); + $this->assertTrue($test->tearDown); + } + + public function testExceptionInTest() + { + $test = new ExceptionInTest('testSomething'); + $result = $test->run(); + + $this->assertTrue($test->setUp); + $this->assertTrue($test->assertPreConditions); + $this->assertTrue($test->testSomething); + $this->assertFalse($test->assertPostConditions); + $this->assertTrue($test->tearDown); + } + + public function testExceptionInAssertPostConditions() + { + $test = new ExceptionInAssertPostConditionsTest('testSomething'); + $result = $test->run(); + + $this->assertTrue($test->setUp); + $this->assertTrue($test->assertPreConditions); + $this->assertTrue($test->testSomething); + $this->assertTrue($test->assertPostConditions); + $this->assertTrue($test->tearDown); + } + + public function testExceptionInTearDown() + { + $test = new ExceptionInTearDownTest('testSomething'); + $result = $test->run(); + + $this->assertTrue($test->setUp); + $this->assertTrue($test->assertPreConditions); + $this->assertTrue($test->testSomething); + $this->assertTrue($test->assertPostConditions); + $this->assertTrue($test->tearDown); + } + + public function testNoArgTestCasePasses() + { + $result = new PHPUnit_Framework_TestResult; + $t = new PHPUnit_Framework_TestSuite('NoArgTestCaseTest'); + + $t->run($result); + + $this->assertEquals(1, count($result)); + $this->assertEquals(0, $result->failureCount()); + $this->assertEquals(0, $result->errorCount()); + } + + public function testWasRun() + { + $test = new WasRun; + $test->run(); + + $this->assertTrue($test->wasRun); + } + + public function testException() + { + $test = new ThrowExceptionTestCase('test'); + $test->setExpectedException('RuntimeException'); + + $result = $test->run(); + + $this->assertEquals(1, count($result)); + $this->assertTrue($result->wasSuccessful()); + } + + public function testNoException() + { + $test = new ThrowNoExceptionTestCase('test'); + $test->setExpectedException('RuntimeException'); + + $result = $test->run(); + + $this->assertEquals(1, $result->failureCount()); + $this->assertEquals(1, count($result)); + } + + public function testWrongException() + { + $test = new ThrowExceptionTestCase('test'); + $test->setExpectedException('InvalidArgumentException'); + + $result = $test->run(); + + $this->assertEquals(1, $result->failureCount()); + $this->assertEquals(1, count($result)); + } + + /** + * @backupGlobals enabled + */ + public function testGlobalsBackupPre() + { + global $a; + global $i; + + $this->assertEquals('a', $a); + $this->assertEquals('a', $GLOBALS['a']); + $this->assertEquals('b', $_ENV['b']); + $this->assertEquals('c', $_POST['c']); + $this->assertEquals('d', $_GET['d']); + $this->assertEquals('e', $_COOKIE['e']); + $this->assertEquals('f', $_SERVER['f']); + $this->assertEquals('g', $_FILES['g']); + $this->assertEquals('h', $_REQUEST['h']); + $this->assertEquals('i', $i); + $this->assertEquals('i', $GLOBALS['i']); + + $GLOBALS['a'] = 'aa'; + $GLOBALS['foo'] = 'bar'; + $_ENV['b'] = 'bb'; + $_POST['c'] = 'cc'; + $_GET['d'] = 'dd'; + $_COOKIE['e'] = 'ee'; + $_SERVER['f'] = 'ff'; + $_FILES['g'] = 'gg'; + $_REQUEST['h'] = 'hh'; + $GLOBALS['i'] = 'ii'; + + $this->assertEquals('aa', $a); + $this->assertEquals('aa', $GLOBALS['a']); + $this->assertEquals('bar', $GLOBALS['foo']); + $this->assertEquals('bb', $_ENV['b']); + $this->assertEquals('cc', $_POST['c']); + $this->assertEquals('dd', $_GET['d']); + $this->assertEquals('ee', $_COOKIE['e']); + $this->assertEquals('ff', $_SERVER['f']); + $this->assertEquals('gg', $_FILES['g']); + $this->assertEquals('hh', $_REQUEST['h']); + $this->assertEquals('ii', $i); + $this->assertEquals('ii', $GLOBALS['i']); + } + + public function testGlobalsBackupPost() + { + global $a; + global $i; + + $this->assertEquals('a', $a); + $this->assertEquals('a', $GLOBALS['a']); + $this->assertEquals('b', $_ENV['b']); + $this->assertEquals('c', $_POST['c']); + $this->assertEquals('d', $_GET['d']); + $this->assertEquals('e', $_COOKIE['e']); + $this->assertEquals('f', $_SERVER['f']); + $this->assertEquals('g', $_FILES['g']); + $this->assertEquals('h', $_REQUEST['h']); + $this->assertEquals('ii', $i); + $this->assertEquals('ii', $GLOBALS['i']); + + $this->assertArrayNotHasKey('foo', $GLOBALS); + } + + /** + * @backupGlobals enabled + * @backupStaticAttributes enabled + */ + public function testStaticAttributesBackupPre() + { + $GLOBALS['singleton'] = Singleton::getInstance(); + } + + public function testStaticAttributesBackupPost() + { + $this->assertNotSame($GLOBALS['singleton'], Singleton::getInstance()); + } + + public function testExpectOutputStringFooActualFoo() + { + $test = new OutputTestCase('testExpectOutputStringFooActualFoo'); + $result = $test->run(); + + $this->assertEquals(1, count($result)); + $this->assertTrue($result->wasSuccessful()); + } + + public function testExpectOutputStringFooActualBar() + { + $test = new OutputTestCase('testExpectOutputStringFooActualBar'); + $result = $test->run(); + + $this->assertEquals(1, count($result)); + $this->assertFalse($result->wasSuccessful()); + } + + public function testExpectOutputRegexFooActualFoo() + { + $test = new OutputTestCase('testExpectOutputRegexFooActualFoo'); + $result = $test->run(); + + $this->assertEquals(1, count($result)); + $this->assertTrue($result->wasSuccessful()); + } + + public function testExpectOutputRegexFooActualBar() + { + $test = new OutputTestCase('testExpectOutputRegexFooActualBar'); + $result = $test->run(); + + $this->assertEquals(1, count($result)); + $this->assertFalse($result->wasSuccessful()); + } + + public function testSkipsIfRequiresHigherVersionOfPHPUnit() + { + $test = new RequirementsTest('testAlwaysSkip'); + $result = $test->run(); + + $this->assertEquals(1, $result->skippedCount()); + $this->assertEquals( + 'PHPUnit 1111111 (or later) is required.', + $test->getStatusMessage() + ); + } + + public function testSkipsIfRequiresHigherVersionOfPHP() + { + $test = new RequirementsTest('testAlwaysSkip2'); + $result = $test->run(); + + $this->assertEquals(1, $result->skippedCount()); + $this->assertEquals( + 'PHP 9999999 (or later) is required.', + $test->getStatusMessage() + ); + } + + public function testSkipsIfRequiresNonExistingFunction() + { + $test = new RequirementsTest('testNine'); + $result = $test->run(); + + $this->assertEquals(1, $result->skippedCount()); + $this->assertEquals( + 'Function testFunc is required.', + $test->getStatusMessage() + ); + } + + public function testSkipsIfRequiresNonExistingExtension() + { + $test = new RequirementsTest('testTen'); + $result = $test->run(); + + $this->assertEquals( + 'Extension testExt is required.', + $test->getStatusMessage() + ); + } + + public function testSkipsProvidesMessagesForAllSkippingReasons() + { + $test = new RequirementsTest('testAllPossibleRequirements'); + $result = $test->run(); + + $this->assertEquals( + 'PHP 99-dev (or later) is required.' . PHP_EOL . + 'PHPUnit 9-dev (or later) is required.' . PHP_EOL . + 'Function testFuncOne is required.' . PHP_EOL . + 'Function testFuncTwo is required.' . PHP_EOL . + 'Extension testExtOne is required.' . PHP_EOL . + 'Extension testExtTwo is required.', + $test->getStatusMessage() + ); + } + + public function testRequiringAnExistingFunctionDoesNotSkip() + { + $test = new RequirementsTest('testExistingFunction'); + $result = $test->run(); + $this->assertEquals(0, $result->skippedCount()); + } + + public function testRequiringAnExistingExtensionDoesNotSkip() + { + $test = new RequirementsTest('testExistingExtension'); + $result = $test->run(); + $this->assertEquals(0, $result->skippedCount()); + } + + public function testCurrentWorkingDirectoryIsRestored() + { + $expectedCwd = getcwd(); + + $test = new ChangeCurrentWorkingDirectoryTest('testSomethingThatChangesTheCwd'); + $test->run(); + + $this->assertSame($expectedCwd, getcwd()); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php @@ -0,0 +1,68 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.20 + */ + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.7.20 + */ +class Framework_TestFailureTest extends PHPUnit_Framework_TestCase +{ + /** + * @covers PHPUnit_Framework_TestFailure::toString + */ + public function testToString() + { + $test = new self(__FUNCTION__); + $exception = new PHPUnit_Framework_Exception('message'); + $failure = new PHPUnit_Framework_TestFailure($test, $exception); + + $this->assertEquals(__METHOD__ . ': message', $failure->toString()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php @@ -0,0 +1,79 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DoubleTestCase.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Success.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Framework_TestImplementorTest extends PHPUnit_Framework_TestCase +{ + protected $test; + + public function __construct() + { + $this->test = new DoubleTestCase( + new Success + ); + } + + public function testSuccessfulRun() + { + $result = new PHPUnit_Framework_TestResult; + + $this->test->run($result); + + $this->assertEquals(count($this->test), count($result)); + $this->assertEquals(0, $result->errorCount()); + $this->assertEquals(0, $result->failureCount()); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php @@ -0,0 +1,145 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Error.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Failure.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Success.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Framework_TestListenerTest extends PHPUnit_Framework_TestCase implements PHPUnit_Framework_TestListener +{ + protected $endCount; + protected $errorCount; + protected $failureCount; + protected $notImplementedCount; + protected $skippedCount; + protected $result; + protected $startCount; + + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->errorCount++; + } + + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + $this->failureCount++; + } + + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->notImplementedCount++; + } + + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + $this->skippedCount++; + } + + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + } + + public function startTest(PHPUnit_Framework_Test $test) + { + $this->startCount++; + } + + public function endTest(PHPUnit_Framework_Test $test, $time) + { + $this->endCount++; + } + + protected function setUp() + { + $this->result = new PHPUnit_Framework_TestResult; + $this->result->addListener($this); + + $this->endCount = 0; + $this->failureCount = 0; + $this->notImplementedCount = 0; + $this->skippedCount = 0; + $this->startCount = 0; + } + + public function testError() + { + $test = new Error; + $test->run($this->result); + + $this->assertEquals(1, $this->errorCount); + $this->assertEquals(1, $this->endCount); + } + + public function testFailure() + { + $test = new Failure; + $test->run($this->result); + + $this->assertEquals(1, $this->failureCount); + $this->assertEquals(1, $this->endCount); + } + + public function testStartStop() + { + $test = new Success; + $test->run($this->result); + + $this->assertEquals(1, $this->startCount); + $this->assertEquals(1, $this->endCount); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021.phpt @@ -0,0 +1,19 @@ +--TEST-- +#1021: Depending on a test that uses a data provider does not work +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue1021Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/1021/Issue1021Test.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021/Issue1021Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/1021/Issue1021Test.php @@ -0,0 +1,23 @@ +<?php +class Issue1021Test extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider provider + */ + public function testSomething($data) + { + $this->assertTrue($data); + } + + /** + * @depends testSomething + */ + public function testSomethingElse() + { + } + + public function provider() + { + return array(array(TRUE)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523.phpt @@ -0,0 +1,19 @@ +--TEST-- +#523: assertAttributeEquals does not work with classes extending ArrayIterator +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue523Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/523/Issue523Test.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523/Issue523Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/523/Issue523Test.php @@ -0,0 +1,13 @@ +<?php +class Issue523Test extends PHPUnit_Framework_TestCase +{ + public function testAttributeEquals() + { + $this->assertAttributeEquals('foo', 'field', new Issue523()); + } +}; + +class Issue523 extends ArrayIterator +{ + protected $field = 'foo'; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578.phpt @@ -0,0 +1,37 @@ +--TEST-- +#578: Double printing of trace line for exceptions from notices and warnings +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue578Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/578/Issue578Test.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +EEE + +Time: %s, Memory: %sMb + +There were 3 errors: + +1) Issue578Test::testNoticesDoublePrintStackTrace +Invalid error type specified + +%s/Issue578Test.php:%i + +2) Issue578Test::testWarningsDoublePrintStackTrace +Invalid error type specified + +%s/Issue578Test.php:%i + +3) Issue578Test::testUnexpectedExceptionsPrintsCorrectly +Exception: Double printed exception + +%s/Issue578Test.php:%i + +FAILURES! +Tests: 3, Assertions: 0, Errors: 3. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578/Issue578Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/578/Issue578Test.php @@ -0,0 +1,20 @@ +<?php +class Issue578Test extends PHPUnit_Framework_TestCase +{ + public function testNoticesDoublePrintStackTrace() + { + $this->iniSet('error_reporting', E_ALL | E_NOTICE); + trigger_error('Stack Trace Test Notice', E_NOTICE); + } + + public function testWarningsDoublePrintStackTrace() + { + $this->iniSet('error_reporting', E_ALL | E_NOTICE); + trigger_error('Stack Trace Test Notice', E_WARNING); + } + + public function testUnexpectedExceptionsPrintsCorrectly() + { + throw new Exception('Double printed exception'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684.phpt @@ -0,0 +1,26 @@ +--TEST-- +#684: Unable to find test class when no test methods exists +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue684Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/684/Issue684Test.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Warning +No tests found in class "Foo_Bar_Issue684Test". + + +FAILURES! +Tests: 1, Assertions: 0, Failures: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684/Issue684Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/684/Issue684Test.php @@ -0,0 +1,4 @@ +<?php +class Foo_Bar_Issue684Test extends PHPUnit_Framework_TestCase +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783.phpt @@ -0,0 +1,21 @@ +--TEST-- +#783: Tests getting executed twice when using multiple groups +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--group'; +$_SERVER['argv'][3] = 'foo,bar'; +$_SERVER['argv'][4] = 'ParentSuite'; +$_SERVER['argv'][5] = dirname(__FILE__).'/783/ParentSuite.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 0 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ChildSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ChildSuite.php @@ -0,0 +1,15 @@ +<?php +require_once 'OneTest.php'; +require_once 'TwoTest.php'; + +class ChildSuite +{ + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Child'); + $suite->addTestSuite('OneTest'); + $suite->addTestSuite('TwoTest'); + + return $suite; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/OneTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/OneTest.php @@ -0,0 +1,10 @@ +<?php +/** +* @group foo +*/ +class OneTest extends PHPUnit_Framework_TestCase +{ + public function testSomething() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ParentSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/ParentSuite.php @@ -0,0 +1,13 @@ +<?php +require_once 'ChildSuite.php'; + +class ParentSuite +{ + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Parent'); + $suite->addTest(ChildSuite::suite()); + + return $suite; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/TwoTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/783/TwoTest.php @@ -0,0 +1,10 @@ +<?php +/** +* @group bar +*/ +class TwoTest extends PHPUnit_Framework_TestCase +{ + public function testSomething() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472.phpt @@ -0,0 +1,19 @@ +--TEST-- +GH-1472: assertEqualXMLStructure modifies the tested elements +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue1472Test'; +$_SERVER['argv'][3] = dirname(__FILE__) . '/1472/Issue1472Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 4 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472/Issue1472Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/1472/Issue1472Test.php @@ -0,0 +1,21 @@ +<?php +class Issue1472Test extends PHPUnit_Framework_TestCase +{ + public function testAssertEqualXMLStructure() + { + $doc = new DOMDocument; + $doc->loadXML('<root><label>text content</label></root>'); + + $xpath = new DOMXPath($doc); + + $labelElement = $doc->getElementsByTagName('label')->item(0); + + $this->assertEquals(1, $xpath->evaluate('count(//label[text() = "text content"])')); + + $expectedElmt = $doc->createElement('label', 'text content'); + $this->assertEqualXMLStructure($expectedElmt, $labelElement); + + // the following assertion fails, even though it passed before - which is due to the assertEqualXMLStructure() has modified the $labelElement + $this->assertEquals(1, $xpath->evaluate('count(//label[text() = "text content"])')); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244.phpt @@ -0,0 +1,40 @@ +--TEST-- +GH-244: Expected Exception should support string codes +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'Issue244Test'; +$_SERVER['argv'][4] = dirname(__FILE__).'/244/Issue244Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.FFF + +Time: %s, Memory: %sMb + +There were 3 failures: + +1) Issue244Test::testFails +Failed asserting that '123StringCode' is equal to expected exception code 'OtherString'. + +%s:%i + +2) Issue244Test::testFailsTooIfExpectationIsANumber +Failed asserting that '123StringCode' is equal to expected exception code 123. + +%s:%i + +3) Issue244Test::testFailsTooIfExceptionCodeIsANumber +Failed asserting that 123 is equal to expected exception code '123String'. + +%s:%i + +FAILURES! +Tests: 4, Assertions: 8, Failures: 3. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244/Issue244Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/244/Issue244Test.php @@ -0,0 +1,55 @@ +<?php +class Issue244Test extends PHPUnit_Framework_TestCase +{ + /** + * @expectedException Issue244Exception + * @expectedExceptionCode 123StringCode + */ + public function testWorks() + { + throw new Issue244Exception; + } + + /** + * @expectedException Issue244Exception + * @expectedExceptionCode OtherString + */ + public function testFails() + { + throw new Issue244Exception; + } + + /** + * @expectedException Issue244Exception + * @expectedExceptionCode 123 + */ + public function testFailsTooIfExpectationIsANumber() + { + throw new Issue244Exception; + } + + /** + * @expectedException Issue244ExceptionIntCode + * @expectedExceptionCode 123String + */ + public function testFailsTooIfExceptionCodeIsANumber() + { + throw new Issue244ExceptionIntCode; + } +} + +class Issue244Exception extends Exception +{ + public function __construct() + { + $this->code = '123StringCode'; + } +} + +class Issue244ExceptionIntCode extends Exception +{ + public function __construct() + { + $this->code = 123; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322.phpt @@ -0,0 +1,28 @@ +--TEST-- +GH-322: group commandline option should override group/exclude setting in phpunit.xml +--FILE-- +<?php + +$_SERVER['argv'][1] = '--configuration'; +$_SERVER['argv'][2] = dirname(__FILE__).'/322/phpunit322.xml'; +$_SERVER['argv'][3] = '--debug'; +$_SERVER['argv'][4] = '--group'; +$_SERVER['argv'][5] = 'one'; +$_SERVER['argv'][6] = 'Issue322Test'; +$_SERVER['argv'][7] = dirname(__FILE__).'/322/Issue322Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +Configuration read from %s + + +Starting test 'Issue322Test::testOne'. +. + +Time: %s, Memory: %sMb + +OK (1 test, 0 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/Issue322Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/Issue322Test.php @@ -0,0 +1,17 @@ +<?php +class Issue322Test extends PHPUnit_Framework_TestCase +{ + /** + * @group one + */ + public function testOne() + { + } + + /** + * @group two + */ + public function testTwo() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml @@ -0,0 +1,11 @@ +<phpunit> + <testsuite name="My Test Suite"> + <file>Test.php</file> + </testsuite> + + <groups> + <exclude> + <group>one</group> + </exclude> + </groups> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433.phpt @@ -0,0 +1,33 @@ +--TEST-- +GH-433: expectOutputString not completely working as expected +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue433Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/433/Issue433Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +..F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Issue433Test::testNotMatchingOutput +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ +-'foo' ++'bar' + + +FAILURES! +Tests: 3, Assertions: 3, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433/Issue433Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/433/Issue433Test.php @@ -0,0 +1,21 @@ +<?php +class Issue433Test extends PHPUnit_Framework_TestCase +{ + public function testOutputWithExpectationBefore() + { + $this->expectOutputString('test'); + print 'test'; + } + + public function testOutputWithExpectationAfter() + { + print 'test'; + $this->expectOutputString('test'); + } + + public function testNotMatchingOutput() + { + print 'bar'; + $this->expectOutputString('foo'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445.phpt @@ -0,0 +1,34 @@ +--TEST-- +GH-455: expectOutputString not working in strict mode +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--strict'; +$_SERVER['argv'][3] = 'Issue445Test'; +$_SERVER['argv'][4] = dirname(__FILE__).'/445/Issue445Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +..F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Issue445Test::testNotMatchingOutput +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ +-'foo' ++'bar' + + +FAILURES! +Tests: 3, Assertions: 3, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445/Issue445Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/445/Issue445Test.php @@ -0,0 +1,21 @@ +<?php +class Issue445Test extends PHPUnit_Framework_TestCase +{ + public function testOutputWithExpectationBefore() + { + $this->expectOutputString('test'); + print 'test'; + } + + public function testOutputWithExpectationAfter() + { + print 'test'; + $this->expectOutputString('test'); + } + + public function testNotMatchingOutput() + { + print 'bar'; + $this->expectOutputString('foo'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-498: The test methods won't be run if a dataProvider throws Exception and --group is added in command line +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--group'; +$_SERVER['argv'][3] = 'trueOnly'; +$_SERVER['argv'][4] = 'Issue498Test'; +$_SERVER['argv'][5] = dirname(__FILE__).'/498/Issue498Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Warning +The data provider specified for Issue498Test::shouldBeFalse is invalid. +Can't create the data + + +FAILURES! +Tests: 1, Assertions: 0, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498/Issue498Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/498/Issue498Test.php @@ -0,0 +1,46 @@ +<?php + +class Issue498Test extends PHPUnit_Framework_TestCase +{ + + /** + * @test + * @dataProvider shouldBeTrueDataProvider + * @group falseOnly + */ + public function shouldBeTrue($testData) + { + $this->assertTrue(true); + } + + + /** + * @test + * @dataProvider shouldBeFalseDataProvider + * @group trueOnly + */ + public function shouldBeFalse($testData) + { + $this->assertFalse(false); + } + + public function shouldBeTrueDataProvider() + { + + //throw new Exception("Can't create the data"); + return array( + array(true), + array(false) + ); + } + + public function shouldBeFalseDataProvider() + { + + throw new Exception("Can't create the data"); + return array( + array(true), + array(false) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503.phpt @@ -0,0 +1,34 @@ +--TEST-- +GH-503: assertEquals() Line Ending Differences Are Obscure +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue503Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/503/Issue503Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Issue503Test::testCompareDifferentLineEndings +Failed asserting that two strings are identical. +--- Expected ++++ Actual +@@ @@ + #Warning: Strings contain different line endings! + foo + +%s:%i + +FAILURES! +Tests: 1, Assertions: 1, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503/Issue503Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/503/Issue503Test.php @@ -0,0 +1,11 @@ +<?php +class Issue503Test extends PHPUnit_Framework_TestCase +{ + public function testCompareDifferentLineEndings() + { + $this->assertSame( + "foo\n", + "foo\r\n" + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581.phpt @@ -0,0 +1,43 @@ +--TEST-- +GH-581: PHPUnit_Util_Type::export adds extra newlines in Windows +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue581Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/581/Issue581Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Issue581Test::testExportingObjectsDoesNotBreakWindowsLineFeeds +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + stdClass Object ( + 0 => 1 + 1 => 2 + 2 => 'Test\n' + 3 => 4 +- 4 => 5 ++ 4 => 1 + 5 => 6 + 6 => 7 + 7 => 8 + ) + +%s:%i + +FAILURES! +Tests: 1, Assertions: 1, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581/Issue581Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/581/Issue581Test.php @@ -0,0 +1,10 @@ +<?php +class Issue581Test extends PHPUnit_Framework_TestCase +{ + public function testExportingObjectsDoesNotBreakWindowsLineFeeds() { + $this->assertEquals( + (object)array(1,2,"Test\r\n",4,5,6,7,8), + (object)array(1,2,"Test\r\n",4,1,6,7,8) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-74: catchable fatal error in 3.5 +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'Issue74Test'; +$_SERVER['argv'][4] = dirname(__FILE__).'/74/Issue74Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +E + +Time: %s, Memory: %sMb + +There was 1 error: + +1) Issue74Test::testCreateAndThrowNewExceptionInProcessIsolation +NewException: Testing GH-74 + +%s/Tests/Regression/GitHub/74/Issue74Test.php:7 +%s + +FAILURES! +Tests: 1, Assertions: 0, Errors: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php @@ -0,0 +1,9 @@ +<?php +class Issue74Test extends PHPUnit_Framework_TestCase +{ + public function testCreateAndThrowNewExceptionInProcessIsolation() + { + require_once __DIR__ . '/NewException.php'; + throw new NewException('Testing GH-74'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php @@ -0,0 +1,4 @@ +<?php +class NewException extends Exception +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765.phpt @@ -0,0 +1,28 @@ +--TEST-- +GH-765: Fatal error triggered in PHPUnit when exception is thrown in data provider of a test with a dependency +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'Issue765Test'; +$_SERVER['argv'][3] = dirname(__FILE__).'/765/Issue765Test.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Warning +The data provider specified for Issue765Test::testDependent is invalid. + + +FAILURES! +Tests: 2, Assertions: 1, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765/Issue765Test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/765/Issue765Test.php @@ -0,0 +1,22 @@ +<?php +class Issue765Test extends PHPUnit_Framework_TestCase +{ + public function testDependee() + { + $this->assertTrue(true); + } + + /** + * @depends testDependee + * @dataProvider dependentProvider + */ + public function testDependent($a) + { + $this->assertTrue(true); + } + + public function dependentProvider() + { + throw new Exception; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/863.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Regression/GitHub/863.phpt @@ -0,0 +1,25 @@ +--TEST-- +GH-863: Number of tests to run calculated incorrectly when --repeat is used +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--repeat'; +$_SERVER['argv'][3] = '50'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(dirname(dirname(__FILE__))) . '/_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +............................................................... 63 / 150 ( 42%) +............................................................... 126 / 150 ( 84%) +........................ + +Time: %s, Memory: %sMb + +OK (150 tests, 150 assertions) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Runner/BaseTestRunnerTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Runner/BaseTestRunnerTest.php @@ -0,0 +1,65 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.0.0 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MockRunner.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'NonStatic.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.0.0 + */ +class Runner_BaseTestRunnerTest extends PHPUnit_Framework_TestCase +{ + public function testInvokeNonStaticSuite() + { + $runner = new MockRunner; + $runner->getTest('NonStatic'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/abstract-test-class.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/abstract-test-class.phpt @@ -0,0 +1,30 @@ +--TEST-- +phpunit AbstractTest ../_files/AbstractTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'AbstractTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/AbstractTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Warning +Cannot instantiate class "AbstractTest". + +%s:%i + +FAILURES! +Tests: 1, Assertions: 0, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/concrete-test-class.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/concrete-test-class.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit ConcreteTest ../_files/ConcreteTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'ConcreteTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/ConcreteTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 0 assertions) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml-isolation.phpt @@ -0,0 +1,49 @@ +--TEST-- +phpunit --process-isolation --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--log-junit'; +$_SERVER['argv'][4] = 'php://stdout'; +$_SERVER['argv'][5] = 'DataProviderTest'; +$_SERVER['argv'][6] = dirname(dirname(__FILE__)) . '/_files/DataProviderTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +..F.<?xml version="1.0" encoding="UTF-8"?> +<testsuites> + <testsuite name="DataProviderTest" file="%s/DataProviderTest.php" tests="4" assertions="4" failures="1" errors="0" time="%f"> + <testsuite name="DataProviderTest::testAdd" tests="4" assertions="4" failures="1" errors="0" time="%f"> + <testcase name="testAdd with data set #0" assertions="1" time="%f"/> + <testcase name="testAdd with data set #1" assertions="1" time="%f"/> + <testcase name="testAdd with data set #2" assertions="1" time="%f"> + <failure type="PHPUnit_Framework_ExpectationFailedException">DataProviderTest::testAdd with data set #2 (1, 1, 3) +Failed asserting that 2 matches expected 3. + +%s:%i +</failure> + </testcase> + <testcase name="testAdd with data set #3" assertions="1" time="%f"/> + </testsuite> + </testsuite> +</testsuites> + + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) DataProviderTest::testAdd with data set #2 (1, 1, 3) +Failed asserting that 2 matches expected 3. +%s:%i + +FAILURES! +Tests: 4, Assertions: 4, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-log-xml.phpt @@ -0,0 +1,50 @@ +--TEST-- +phpunit --log-junit php://stdout DataProviderTest ../_files/DataProviderTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--log-junit'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'DataProviderTest'; +$_SERVER['argv'][5] = dirname(dirname(__FILE__)) . '/_files/DataProviderTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +..F.<?xml version="1.0" encoding="UTF-8"?> +<testsuites> + <testsuite name="DataProviderTest" file="%s/DataProviderTest.php" tests="4" assertions="4" failures="1" errors="0" time="%f"> + <testsuite name="DataProviderTest::testAdd" tests="4" assertions="4" failures="1" errors="0" time="%f"> + <testcase name="testAdd with data set #0" assertions="1" time="%f"/> + <testcase name="testAdd with data set #1" assertions="1" time="%f"/> + <testcase name="testAdd with data set #2" assertions="1" time="%f"> + <failure type="PHPUnit_Framework_ExpectationFailedException">DataProviderTest::testAdd with data set #2 (1, 1, 3) +Failed asserting that 2 matches expected 3. + +%s:%i +%s:%i +</failure> + </testcase> + <testcase name="testAdd with data set #3" assertions="1" time="%f"/> + </testsuite> + </testsuite> +</testsuites> + + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) DataProviderTest::testAdd with data set #2 (1, 1, 3) +Failed asserting that 2 matches expected 3. +%s:%i +%s:%i + +FAILURES! +Tests: 4, Assertions: 4, Failures: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-testdox.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dataprovider-testdox.phpt @@ -0,0 +1,19 @@ +--TEST-- +phpunit --testdox DataProviderTest ../_files/DataProviderTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--testdox'; +$_SERVER['argv'][3] = 'DataProviderTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/DataProviderTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +DataProvider + [ ] Add diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/debug.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/debug.phpt @@ -0,0 +1,28 @@ +--TEST-- +phpunit --debug BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--debug'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + + +Starting test 'BankAccountTest::testBalanceIsInitiallyZero'. +. +Starting test 'BankAccountTest::testBalanceCannotBecomeNegative'. +. +Starting test 'BankAccountTest::testBalanceCannotBecomeNegative2'. +. + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default-isolation.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit --process-isolation BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/default.phpt @@ -0,0 +1,21 @@ +--TEST-- +phpunit BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'BankAccountTest'; +$_SERVER['argv'][3] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies-isolation.phpt @@ -0,0 +1,42 @@ +--TEST-- +phpunit --process-isolation --verbose DependencyTestSuite ../_files/DependencyTestSuite.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--verbose'; +$_SERVER['argv'][4] = 'DependencyTestSuite'; +$_SERVER['argv'][5] = dirname(dirname(__FILE__)) . '/_files/DependencyTestSuite.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +...FSS + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) DependencyFailureTest::testOne + +%s:%i + +There were 2 skipped tests: + +1) DependencyFailureTest::testTwo +This test depends on "DependencyFailureTest::testOne" to pass. + +%s:%i + +2) DependencyFailureTest::testThree +This test depends on "DependencyFailureTest::testTwo" to pass. + +%s:%i + +FAILURES! +Tests: 4, Assertions: 0, Failures: 1, Skipped: 2. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies.phpt @@ -0,0 +1,42 @@ +--TEST-- +phpunit --verbose DependencyTestSuite ../_files/DependencyTestSuite.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--verbose'; +$_SERVER['argv'][3] = 'DependencyTestSuite'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/DependencyTestSuite.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +...FSS + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) DependencyFailureTest::testOne + +%s:%i +%s:%i + +There were 2 skipped tests: + +1) DependencyFailureTest::testTwo +This test depends on "DependencyFailureTest::testOne" to pass. + +%s:%i + +2) DependencyFailureTest::testThree +This test depends on "DependencyFailureTest::testTwo" to pass. + +%s:%i + +FAILURES! +Tests: 4, Assertions: 0, Failures: 1, Skipped: 2. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2-isolation.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --process-isolation StackTest ../_files/StackTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'StackTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/StackTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 5 assertions) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies2.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit StackTest ../_files/StackTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'StackTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/StackTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 5 assertions) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3-isolation.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --process-isolation MultiDependencyTest ../_files/MultiDependencyTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'MultiDependencyTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/MultiDependencyTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 2 assertions) + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/dependencies3.phpt @@ -0,0 +1,21 @@ +--TEST-- +phpunit MultiDependencyTest ../_files/MultiDependencyTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'MultiDependencyTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/MultiDependencyTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 2 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/empty-testcase.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/empty-testcase.phpt @@ -0,0 +1,29 @@ +--TEST-- +phpunit EmptyTestCaseTest ../_files/EmptyTestCaseTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'EmptyTestCaseTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/EmptyTestCaseTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +F + +Time: %s, Memory: %sMb + +There was 1 failure: + +1) Warning +No tests found in class "EmptyTestCaseTest". + +%s:%i + +FAILURES! +Tests: 1, Assertions: 0, Failures: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exception-stack.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exception-stack.phpt @@ -0,0 +1,55 @@ +--TEST-- +phpunit ExceptionStackTest ../_files/ExceptionStack.php +--FILE-- +<?php +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'ExceptionStackTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/ExceptionStack.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +EE + +Time: %s, Memory: %sMb + +There were 2 errors: + +1) ExceptionStackTest::testPrintingChildException +ExceptionStackTestException: Child exception +message +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => 1 ++ 0 => 2 + ) + +%s:%i + +Caused by +%s:%i + +2) ExceptionStackTest::testNestedExceptions +Exception: One + +%s:%i + +Caused by +InvalidArgumentException: Two + +%s:%i + +Caused by +Exception: Three + +%s:%i + +FAILURES! +Tests: 2, Assertions: 1, Errors: 2. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group-isolation.phpt @@ -0,0 +1,24 @@ +--TEST-- +phpunit --process-isolation --exclude-group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--exclude-group'; +$_SERVER['argv'][4] = 'balanceIsInitiallyZero'; +$_SERVER['argv'][5] = 'BankAccountTest'; +$_SERVER['argv'][6] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 2 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/exclude-group.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --exclude-group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--exclude-group'; +$_SERVER['argv'][3] = 'balanceIsInitiallyZero'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +.. + +Time: %s, Memory: %sMb + +OK (2 tests, 2 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure-isolation.phpt @@ -0,0 +1,144 @@ +--TEST-- +phpunit --process-isolation FailureTest ../_files/FailureTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'FailureTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/FailureTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +FFFFFFFFFFFFF + +Time: %s, Memory: %sMb + +There were 13 failures: + +1) FailureTest::testAssertArrayEqualsArray +message +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => 1 ++ 0 => 2 + ) + +%s:%i + +2) FailureTest::testAssertIntegerEqualsInteger +message +Failed asserting that 2 matches expected 1. + +%s:%i + +3) FailureTest::testAssertObjectEqualsObject +message +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + stdClass Object ( +- 'foo' => 'bar' ++ 'bar' => 'foo' + ) + +%s:%i + +4) FailureTest::testAssertNullEqualsString +message +Failed asserting that 'bar' matches expected null. + +%s:%i + +5) FailureTest::testAssertStringEqualsString +message +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ +-'foo' ++'bar' + +%s:%i + +6) FailureTest::testAssertTextEqualsText +message +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ + 'foo +-bar ++baz + ' + +%s:%i + +7) FailureTest::testAssertStringMatchesFormat +message +Failed asserting that format description matches text. +--- Expected ++++ Actual +@@ @@ +-*%s* ++** + +%s:%i + +8) FailureTest::testAssertNumericEqualsNumeric +message +Failed asserting that 2 matches expected 1. + +%s:%i + +9) FailureTest::testAssertTextSameText +message +Failed asserting that two strings are identical. +--- Expected ++++ Actual +@@ @@ +-foo ++bar + +%s:%i + +10) FailureTest::testAssertObjectSameObject +message +Failed asserting that two variables reference the same object. + +%s:%i + +11) FailureTest::testAssertObjectSameNull +message +Failed asserting that null is identical to an object of class "stdClass". + +%s:%i + +12) FailureTest::testAssertFloatSameFloat +message +Failed asserting that 1.5 is identical to 1.0. + +%s:%i + +13) FailureTest::testAssertStringMatchesFormatFile +Failed asserting that format description matches text. +--- Expected ++++ Actual +@@ @@ +-FOO +- ++...BAR... + +%s:%i + +FAILURES! +Tests: 13, Assertions: 14, Failures: 13. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/failure.phpt @@ -0,0 +1,144 @@ +--TEST-- +phpunit FailureTest ../_files/FailureTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'FailureTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/FailureTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +FFFFFFFFFFFFF + +Time: %s, Memory: %sMb + +There were 13 failures: + +1) FailureTest::testAssertArrayEqualsArray +message +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => 1 ++ 0 => 2 + ) + +%s:%i + +2) FailureTest::testAssertIntegerEqualsInteger +message +Failed asserting that 2 matches expected 1. + +%s:%i + +3) FailureTest::testAssertObjectEqualsObject +message +Failed asserting that two objects are equal. +--- Expected ++++ Actual +@@ @@ + stdClass Object ( +- 'foo' => 'bar' ++ 'bar' => 'foo' + ) + +%s:%i + +4) FailureTest::testAssertNullEqualsString +message +Failed asserting that 'bar' matches expected null. + +%s:%i + +5) FailureTest::testAssertStringEqualsString +message +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ +-'foo' ++'bar' + +%s:%i + +6) FailureTest::testAssertTextEqualsText +message +Failed asserting that two strings are equal. +--- Expected ++++ Actual +@@ @@ + 'foo +-bar ++baz + ' + +%s:%i + +7) FailureTest::testAssertStringMatchesFormat +message +Failed asserting that format description matches text. +--- Expected ++++ Actual +@@ @@ +-*%s* ++** + +%s:%i + +8) FailureTest::testAssertNumericEqualsNumeric +message +Failed asserting that 2 matches expected 1. + +%s:%i + +9) FailureTest::testAssertTextSameText +message +Failed asserting that two strings are identical. +--- Expected ++++ Actual +@@ @@ +-foo ++bar + +%s:%i + +10) FailureTest::testAssertObjectSameObject +message +Failed asserting that two variables reference the same object. + +%s:%i + +11) FailureTest::testAssertObjectSameNull +message +Failed asserting that null is identical to an object of class "stdClass". + +%s:%i + +12) FailureTest::testAssertFloatSameFloat +message +Failed asserting that 1.5 is identical to 1.0. + +%s:%i + +13) FailureTest::testAssertStringMatchesFormatFile +Failed asserting that format description matches text. +--- Expected ++++ Actual +@@ @@ +-FOO +- ++...BAR... + +%s:%i + +FAILURES! +Tests: 13, Assertions: 14, Failures: 13. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal-isolation.phpt @@ -0,0 +1,29 @@ +--TEST-- +phpunit FatalTest ../_files/FatalTest.php +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = 'FatalTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/FatalTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +E + +Time: %s, Memory: %sMb + +There was 1 error: + +1) FatalTest::testFatalError +PHPUnit_Framework_Exception: %s error: Call to undefined function non_existing_function() in %s + + +FAILURES! +Tests: 1, Assertions: 0, Errors: 1. + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/fatal.phpt @@ -0,0 +1,17 @@ +--TEST-- +phpunit FatalTest ../_files/FatalTest.php +--FILE-- +<?php + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = 'FatalTest'; +$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/FatalTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + + +Fatal error: Call to undefined function non_existing_function() in %s diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class-isolation.phpt @@ -0,0 +1,24 @@ +--TEST-- +phpunit --process-isolation --filter BankAccountTest BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--filter'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = 'BankAccountTest'; +$_SERVER['argv'][6] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-class.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --filter BankAccountTest BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--filter'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method-isolation.phpt @@ -0,0 +1,24 @@ +--TEST-- +phpunit --process-isolation --filter testBalanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--filter'; +$_SERVER['argv'][4] = 'testBalanceIsInitiallyZero'; +$_SERVER['argv'][5] = 'BankAccountTest'; +$_SERVER['argv'][6] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-method.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --filter testBalanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--filter'; +$_SERVER['argv'][3] = 'testBalanceIsInitiallyZero'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-no-results.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/filter-no-results.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --filter testBalanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--filter'; +$_SERVER['argv'][3] = 'doesNotExist'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + + + +Time: %s, Memory: %sMb + +No tests executed! diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group-isolation.phpt @@ -0,0 +1,24 @@ +--TEST-- +phpunit --process-isolation --group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--process-isolation'; +$_SERVER['argv'][3] = '--group'; +$_SERVER['argv'][4] = 'balanceIsInitiallyZero'; +$_SERVER['argv'][5] = 'BankAccountTest'; +$_SERVER['argv'][6] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/group.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --group balanceIsInitiallyZero BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--group'; +$_SERVER['argv'][3] = 'balanceIsInitiallyZero'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +. + +Time: %s, Memory: %sMb + +OK (1 test, 1 assertion) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help.phpt @@ -0,0 +1,67 @@ +--TEST-- +phpunit +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +Usage: phpunit [options] UnitTest [UnitTest.php] + phpunit [options] <directory> + + --log-junit <file> Log test execution in JUnit XML format to file. + --log-tap <file> Log test execution in TAP format to file. + --log-json <file> Log test execution in JSON format. + + --coverage-clover <file> Generate code coverage report in Clover XML format. + --coverage-html <dir> Generate code coverage report in HTML format. + --coverage-php <file> Serialize PHP_CodeCoverage object to file. + --coverage-text=<file> Generate code coverage report in text format. + Default to writing to the standard output. + + --testdox-html <file> Write agile documentation in HTML format to file. + --testdox-text <file> Write agile documentation in Text format to file. + + --filter <pattern> Filter which tests to run. + --testsuite <pattern> Filter which testsuite to run. + --group ... Only runs tests from the specified group(s). + --exclude-group ... Exclude tests from the specified group(s). + --list-groups List available test groups. + --test-suffix ... Only search for test in files with specified + suffix(es). Default: Test.php,.phpt + + --loader <loader> TestSuiteLoader implementation to use. + --printer <printer> TestSuiteListener implementation to use. + --repeat <times> Runs the test(s) repeatedly. + + --tap Report test execution progress in TAP format. + --testdox Report test execution progress in TestDox format. + + --colors Use colors in output. + --stderr Write to STDERR instead of STDOUT. + --stop-on-error Stop execution upon first error. + --stop-on-failure Stop execution upon first error or failure. + --stop-on-skipped Stop execution upon first skipped test. + --stop-on-incomplete Stop execution upon first incomplete test. + --strict Run tests in strict mode. + -v|--verbose Output more verbose information. + --debug Display debugging information during test execution. + + --process-isolation Run each test in a separate PHP process. + --no-globals-backup Do not backup and restore $GLOBALS for each test. + --static-backup Backup and restore static attributes for each test. + + --bootstrap <file> A "bootstrap" PHP file that is run before the tests. + -c|--configuration <file> Read configuration from XML file. + --no-configuration Ignore default configuration file (phpunit.xml). + --include-path <path(s)> Prepend PHP's include_path with given path(s). + -d key[=value] Sets a php.ini value. + + -h|--help Prints this usage information. + --version Prints the version and exits. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help2.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/help2.phpt @@ -0,0 +1,68 @@ +--TEST-- +phpunit --help +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--help'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +Usage: phpunit [options] UnitTest [UnitTest.php] + phpunit [options] <directory> + + --log-junit <file> Log test execution in JUnit XML format to file. + --log-tap <file> Log test execution in TAP format to file. + --log-json <file> Log test execution in JSON format. + + --coverage-clover <file> Generate code coverage report in Clover XML format. + --coverage-html <dir> Generate code coverage report in HTML format. + --coverage-php <file> Serialize PHP_CodeCoverage object to file. + --coverage-text=<file> Generate code coverage report in text format. + Default to writing to the standard output. + + --testdox-html <file> Write agile documentation in HTML format to file. + --testdox-text <file> Write agile documentation in Text format to file. + + --filter <pattern> Filter which tests to run. + --testsuite <pattern> Filter which testsuite to run. + --group ... Only runs tests from the specified group(s). + --exclude-group ... Exclude tests from the specified group(s). + --list-groups List available test groups. + --test-suffix ... Only search for test in files with specified + suffix(es). Default: Test.php,.phpt + + --loader <loader> TestSuiteLoader implementation to use. + --printer <printer> TestSuiteListener implementation to use. + --repeat <times> Runs the test(s) repeatedly. + + --tap Report test execution progress in TAP format. + --testdox Report test execution progress in TestDox format. + + --colors Use colors in output. + --stderr Write to STDERR instead of STDOUT. + --stop-on-error Stop execution upon first error. + --stop-on-failure Stop execution upon first error or failure. + --stop-on-skipped Stop execution upon first skipped test. + --stop-on-incomplete Stop execution upon first incomplete test. + --strict Run tests in strict mode. + -v|--verbose Output more verbose information. + --debug Display debugging information during test execution. + + --process-isolation Run each test in a separate PHP process. + --no-globals-backup Do not backup and restore $GLOBALS for each test. + --static-backup Backup and restore static attributes for each test. + + --bootstrap <file> A "bootstrap" PHP file that is run before the tests. + -c|--configuration <file> Read configuration from XML file. + --no-configuration Ignore default configuration file (phpunit.xml). + --include-path <path(s)> Prepend PHP's include_path with given path(s). + -d key[=value] Sets a php.ini value. + + -h|--help Prints this usage information. + --version Prints the version and exits. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/list-groups.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/list-groups.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit --list-groups BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--list-groups'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +Available test group(s): + - Sebastian Bergmann <sebastian@phpunit.de> + - balanceCannotBecomeNegative + - balanceIsInitiallyZero + - specification diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-json.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-json.phpt @@ -0,0 +1,77 @@ +--TEST-- +phpunit --log-json php://stdout BankAccountTest ../_files/BankAccountTest.php +--SKIPIF-- +<?php +if (!defined("JSON_PRETTY_PRINT")) { + echo "Skip: Test requires JSON_PRETTY_PRINT / PHP >= 5.4"; +} +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--log-json'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +{ + "event": "suiteStart", + "suite": "BankAccountTest", + "tests": 3 +}{ + "event": "testStart", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceIsInitiallyZero" +}.{ + "event": "test", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceIsInitiallyZero", + "status": "pass", + "time": %f, + "trace": [ + + ], + "message": "", + "output": "" +}{ + "event": "testStart", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceCannotBecomeNegative" +}.{ + "event": "test", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceCannotBecomeNegative", + "status": "pass", + "time": %f, + "trace": [ + + ], + "message": "", + "output": "" +}{ + "event": "testStart", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceCannotBecomeNegative2" +}.{ + "event": "test", + "suite": "BankAccountTest", + "test": "BankAccountTest::testBalanceCannotBecomeNegative2", + "status": "pass", + "time": %f, + "trace": [ + + ], + "message": "", + "output": "" +} + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-tap.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-tap.phpt @@ -0,0 +1,28 @@ +--TEST-- +phpunit --log-tap php://stdout BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--log-tap'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +TAP version 13 +.ok 1 - BankAccountTest::testBalanceIsInitiallyZero +.ok 2 - BankAccountTest::testBalanceCannotBecomeNegative +.ok 3 - BankAccountTest::testBalanceCannotBecomeNegative2 +1..3 + + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-xml.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/log-xml.phpt @@ -0,0 +1,31 @@ +--TEST-- +phpunit --log-junit php://stdout BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--log-junit'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +...<?xml version="1.0" encoding="UTF-8"?> +<testsuites> + <testsuite name="BankAccountTest" file="%sBankAccountTest.php" fullPackage="PHPUnit" package="PHPUnit" tests="3" assertions="3" failures="0" errors="0" time="%f"> + <testcase name="testBalanceIsInitiallyZero" class="BankAccountTest" file="%sBankAccountTest.php" line="72" assertions="1" time="%f"/> + <testcase name="testBalanceCannotBecomeNegative" class="BankAccountTest" file="%sBankAccountTest.php" line="82" assertions="1" time="%f"/> + <testcase name="testBalanceCannotBecomeNegative2" class="BankAccountTest" file="%sBankAccountTest.php" line="102" assertions="1" time="%f"/> + </testsuite> +</testsuites> + + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-incomplete.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-incomplete.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --strict IncompleteTest ../_files/IncompleteTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--strict'; +$_SERVER['argv'][3] = 'IncompleteTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/IncompleteTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +I + +Time: %s, Memory: %sMb + +OK, but incomplete or skipped tests! +Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-isolation.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict-isolation.phpt @@ -0,0 +1,24 @@ +--TEST-- +phpunit --strict --process-isolation IncompleteTest ../_files/IncompleteTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--strict'; +$_SERVER['argv'][3] = '--process-isolation'; +$_SERVER['argv'][4] = 'NothingTest'; +$_SERVER['argv'][5] = dirname(dirname(__FILE__)) . '/_files/NothingTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +I + +Time: %s, Memory: %sMb + +OK, but incomplete or skipped tests! +Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/strict.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --strict NothingTest ../_files/NothingTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--strict'; +$_SERVER['argv'][3] = 'NothingTest'; +$_SERVER['argv'][4] = dirname(dirname(__FILE__)) . '/_files/NothingTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +I + +Time: %s, Memory: %sMb + +OK, but incomplete or skipped tests! +Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/tap.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/tap.phpt @@ -0,0 +1,20 @@ +--TEST-- +phpunit --tap BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--tap'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +TAP version 13 +ok 1 - BankAccountTest::testBalanceIsInitiallyZero +ok 2 - BankAccountTest::testBalanceCannotBecomeNegative +ok 3 - BankAccountTest::testBalanceCannotBecomeNegative2 +1..3 diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-multiple.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-multiple.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit --test-suffix .test.php,.my.php ../_files/ +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--test-suffix'; +$_SERVER['argv'][3] = '.test.php,.my.php'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +..... + +Time: %s, Memory: %sMb + +OK (5 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-single.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/test-suffix-single.phpt @@ -0,0 +1,22 @@ +--TEST-- +phpunit --test-suffix .test.php ../_files/ +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--test-suffix'; +$_SERVER['argv'][3] = '.test.php'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +... + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-html.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-html.phpt @@ -0,0 +1,23 @@ +--TEST-- +phpunit --testdox-html php://stdout BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--testdox-html'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +<html><body><h2 id="BankAccountTest">BankAccount</h2><ul>...<li>Balance is initially zero</li><li>Balance cannot become negative</li></ul></body></html> + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-text.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox-text.phpt @@ -0,0 +1,27 @@ +--TEST-- +phpunit --testdox-text php://stdout BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--testdox-text'; +$_SERVER['argv'][3] = 'php://stdout'; +$_SERVER['argv'][4] = 'BankAccountTest'; +$_SERVER['argv'][5] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +BankAccount +... [x] Balance is initially zero + [x] Balance cannot become negative + + + +Time: %s, Memory: %sMb + +OK (3 tests, 3 assertions) diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox.phpt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/TextUI/testdox.phpt @@ -0,0 +1,21 @@ +--TEST-- +phpunit --testdox php://stdout BankAccountTest ../_files/BankAccountTest.php +--FILE-- +<?php +define('PHPUNIT_TESTSUITE', TRUE); + +$_SERVER['argv'][1] = '--no-configuration'; +$_SERVER['argv'][2] = '--testdox'; +$_SERVER['argv'][3] = 'BankAccountTest'; +$_SERVER['argv'][4] = dirname(__FILE__).'/../_files/BankAccountTest.php'; + +require_once dirname(dirname(dirname(__FILE__))) . '/PHPUnit/Autoload.php'; +PHPUnit_TextUI_Command::main(); +?> +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann. + +BankAccount + [x] Balance is initially zero + [x] Balance cannot become negative + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ClassTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ClassTest.php @@ -0,0 +1,84 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Ben Selby <benmatselby@gmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.5.6 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; + +require_once 'PHPUnit/Util/Class.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @author Ben Selby <benmatselby@gmail.com> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.5.6 + */ +class Util_ClassTest extends PHPUnit_Framework_TestCase +{ + /** + * Test that if a dynamic variable is defined on a class then + * the $attribute variable will be NULL, but the variable defined + * will be a public one so we are safe to return it + * + * Currently $attribute is NULL but we try and call isPublic() on it. + * This breaks for php 5.2.10 + * + * @covers PHPUnit_Util_Class::getObjectAttribute + * + * @return void + */ + public function testGetObjectAttributeCanHandleDynamicVariables() + { + $attributeName = '_variable'; + $object = new stdClass(); + $object->$attributeName = 'Test'; + + $actual = PHPUnit_Util_Class::getObjectAttribute($object, $attributeName); + $this->assertEquals('Test', $actual); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php @@ -0,0 +1,390 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class Util_ConfigurationTest extends PHPUnit_Framework_TestCase +{ + protected $configuration; + + protected function setUp() + { + $this->configuration = PHPUnit_Util_Configuration::getInstance( + dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.xml' + ); + } + + /** + * @expectedException PHPUnit_Framework_Exception + */ + public function testExceptionIsThrownForNotExistingConfigurationFile() + { + PHPUnit_Util_Configuration::getInstance('not_existing_file.xml'); + } + + public function testFilterConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 'blacklist' => + array( + 'include' => + array( + 'directory' => + array( + 0 => + array( + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' + ), + ), + 'file' => + array( + 0 => '/path/to/file', + ), + ), + 'exclude' => + array( + 'directory' => + array( + 0 => + array( + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' + ), + ), + 'file' => + array( + 0 => '/path/to/file', + ), + ), + ), + 'whitelist' => + array( + 'addUncoveredFilesFromWhitelist' => TRUE, + 'processUncoveredFilesFromWhitelist' => FALSE, + 'include' => + array( + 'directory' => + array( + 0 => + array( + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' + ), + ), + 'file' => + array( + 0 => '/path/to/file', + ), + ), + 'exclude' => + array( + 'directory' => + array( + 0 => + array( + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' + ), + ), + 'file' => + array( + 0 => '/path/to/file', + ), + ), + ), + ), + $this->configuration->getFilterConfiguration() + ); + } + + public function testGroupConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 'include' => + array( + 0 => 'name', + ), + 'exclude' => + array( + 0 => 'name', + ), + ), + $this->configuration->getGroupConfiguration() + ); + } + + public function testListenerConfigurationIsReadCorrectly() + { + $dir = __DIR__; + $includePath = ini_get('include_path'); + + ini_set('include_path', $dir . PATH_SEPARATOR . $includePath); + + $this->assertEquals( + array( + 0 => + array( + 'class' => 'MyListener', + 'file' => '/optional/path/to/MyListener.php', + 'arguments' => + array( + 0 => + array( + 0 => 'Sebastian', + ), + 1 => 22, + 2 => 'April', + 3 => 19.78, + 4 => NULL, + 5 => new stdClass, + 6 => dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyTestFile.php', + 7 => dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyRelativePath', + ), + ), + array( + 'class' => 'IncludePathListener', + 'file' => __FILE__, + 'arguments' => array() + ), + array( + 'class' => 'CompactArgumentsListener', + 'file' => '/CompactArgumentsListener.php', + 'arguments' => + array( + 0 => 42 + ), + ), + ), + $this->configuration->getListenerConfiguration() + ); + + ini_set('include_path', $includePath); + } + + public function testLoggingConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 'charset' => 'UTF-8', + 'lowUpperBound' => '35', + 'highLowerBound' => '70', + 'highlight' => FALSE, + 'coverage-html' => '/tmp/report', + 'coverage-clover' => '/tmp/clover.xml', + 'json' => '/tmp/logfile.json', + 'plain' => '/tmp/logfile.txt', + 'tap' => '/tmp/logfile.tap', + 'logIncompleteSkipped' => FALSE, + 'junit' => '/tmp/logfile.xml', + 'testdox-html' => '/tmp/testdox.html', + 'testdox-text' => '/tmp/testdox.txt', + ), + $this->configuration->getLoggingConfiguration() + ); + } + + public function testPHPConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 'include_path' => + array( + dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.', + '/path/to/lib' + ), + 'ini'=> array('foo' => 'bar'), + 'const'=> array('FOO' => FALSE, 'BAR' => TRUE), + 'var'=> array('foo' => FALSE), + 'env'=> array('foo' => TRUE), + 'post'=> array('foo' => 'bar'), + 'get'=> array('foo' => 'bar'), + 'cookie'=> array('foo' => 'bar'), + 'server'=> array('foo' => 'bar'), + 'files'=> array('foo' => 'bar'), + 'request'=> array('foo' => 'bar'), + ), + $this->configuration->getPHPConfiguration() + ); + } + + /** + * @backupGlobals enabled + */ + public function testPHPConfigurationIsHandledCorrectly() + { + $this->configuration->handlePHPConfiguration(); + + $path = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.' . PATH_SEPARATOR . '/path/to/lib'; + $this->assertStringStartsWith($path, ini_get('include_path')); + $this->assertEquals(FALSE, FOO); + $this->assertEquals(TRUE, BAR); + $this->assertEquals(FALSE, $GLOBALS['foo']); + $this->assertEquals(TRUE, $_ENV['foo']); + $this->assertEquals(TRUE, getenv('foo')); + $this->assertEquals('bar', $_POST['foo']); + $this->assertEquals('bar', $_GET['foo']); + $this->assertEquals('bar', $_COOKIE['foo']); + $this->assertEquals('bar', $_SERVER['foo']); + $this->assertEquals('bar', $_FILES['foo']); + $this->assertEquals('bar', $_REQUEST['foo']); + } + + public function testPHPUnitConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 'backupGlobals' => TRUE, + 'backupStaticAttributes' => FALSE, + 'bootstrap' => '/path/to/bootstrap.php', + 'cacheTokens' => FALSE, + 'colors' => FALSE, + 'convertErrorsToExceptions' => TRUE, + 'convertNoticesToExceptions' => TRUE, + 'convertWarningsToExceptions' => TRUE, + 'forceCoversAnnotation' => FALSE, + 'mapTestClassNameToCoveredClassName' => FALSE, + 'printerClass' => 'PHPUnit_TextUI_ResultPrinter', + 'stopOnFailure' => FALSE, + 'strict' => FALSE, + 'testSuiteLoaderClass' => 'PHPUnit_Runner_StandardTestSuiteLoader', + 'verbose' => FALSE, + 'timeoutForSmallTests' => 1, + 'timeoutForMediumTests' => 10, + 'timeoutForLargeTests' => 60 + ), + $this->configuration->getPHPUnitConfiguration() + ); + } + + public function testSeleniumBrowserConfigurationIsReadCorrectly() + { + $this->assertEquals( + array( + 0 => + array( + 'name' => 'Firefox on Linux', + 'browser' => '*firefox /usr/lib/firefox/firefox-bin', + 'host' => 'my.linux.box', + 'port' => 4444, + 'timeout' => 30000, + ), + ), + $this->configuration->getSeleniumBrowserConfiguration() + ); + } + + public function testXincludeInConfiguration() + { + $configurationWithXinclude = PHPUnit_Util_Configuration::getInstance( + dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration_xinclude.xml' + ); + + $this->assertConfigurationEquals( + $this->configuration, + $configurationWithXinclude + ); + } + + /** + * Asserts that the values in $actualConfiguration equal $expectedConfiguration. + * + * @param PHPUnit_Util_Configuration $expectedConfiguration + * @param PHPUnit_Util_Configuration $actualConfiguration + * @return void + */ + protected function assertConfigurationEquals( PHPUnit_Util_Configuration $expectedConfiguration, PHPUnit_Util_Configuration $actualConfiguration ) + { + $this->assertEquals( + $expectedConfiguration->getFilterConfiguration(), + $actualConfiguration->getFilterConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getGroupConfiguration(), + $actualConfiguration->getGroupConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getListenerConfiguration(), + $actualConfiguration->getListenerConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getLoggingConfiguration(), + $actualConfiguration->getLoggingConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getPHPConfiguration(), + $actualConfiguration->getPHPConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getPHPUnitConfiguration(), + $actualConfiguration->getPHPUnitConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getSeleniumBrowserConfiguration(), + $actualConfiguration->getSeleniumBrowserConfiguration() + ); + $this->assertEquals( + $expectedConfiguration->getTestSuiteConfiguration(), + $actualConfiguration->getTestSuiteConfiguration() + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/DiffTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/DiffTest.php @@ -0,0 +1,268 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class Util_DiffTest extends PHPUnit_Framework_TestCase +{ + const REMOVED = 2; + const ADDED = 1; + const OLD = 0; + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorMessage() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-a\n+b\n", + PHPUnit_Util_Diff::diff('a', 'b') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorMessage_toArray() + { + $diff = array(); + $diff[] = array('a', self::REMOVED); + $diff[] = array('b', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('a', 'b') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorStartSame() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-ba\n+bc\n", + PHPUnit_Util_Diff::diff('ba', 'bc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorStartSame_toArray() + { + $diff = array(); + $diff[] = array('ba', self::REMOVED); + $diff[] = array('bc', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('ba', 'bc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorEndSame() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-ab\n+cb\n", + PHPUnit_Util_Diff::diff('ab', 'cb') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorEndSame_toArray() + { + $diff = array(); + $diff[] = array('ab', self::REMOVED); + $diff[] = array('cb', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('ab', 'cb') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorStartAndEndSame() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-abc\n+adc\n", + PHPUnit_Util_Diff::diff('abc', 'adc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorStartAndEndSame_toArray() + { + $diff = array(); + $diff[] = array('abc', self::REMOVED); + $diff[] = array('adc', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('abc', 'adc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorStartSameComplete() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-ab\n+abc\n", + PHPUnit_Util_Diff::diff('ab', 'abc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorStartSameComplete_toArray() + { + $diff = array(); + $diff[] = array('ab', self::REMOVED); + $diff[] = array('abc', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('ab', 'abc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorEndSameComplete() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-bc\n+abc\n", + PHPUnit_Util_Diff::diff('bc', 'abc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorEndSameComplete_toArray() + { + $diff = array(); + $diff[] = array('bc', self::REMOVED); + $diff[] = array('abc', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('bc', 'abc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorOverlappingMatches() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-abc\n+abbc\n", + PHPUnit_Util_Diff::diff('abc', 'abbc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorOverlappingMatches_toArray() + { + $diff = array(); + $diff[] = array('abc', self::REMOVED); + $diff[] = array('abbc', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('abc', 'abbc') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diff + */ + public function testComparisonErrorOverlappingMatches2() + { + $this->assertEquals( + "--- Expected\n+++ Actual\n@@ @@\n-abcdde\n+abcde\n", + PHPUnit_Util_Diff::diff('abcdde', 'abcde') + ); + } + + /** + * @covers PHPUnit_Util_Diff::diffToArray + */ + public function testComparisonErrorOverlappingMatches2_toArray() + { + $diff = array(); + $diff[] = array('abcdde', self::REMOVED); + $diff[] = array('abcde', self::ADDED); + + $this->assertEquals( + $diff, + PHPUnit_Util_Diff::diffToArray('abcdde', 'abcde') + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php @@ -0,0 +1,108 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.1.0 + */ +class Util_TestDox_NamePrettifierTest extends PHPUnit_Framework_TestCase +{ + protected $namePrettifier; + + protected function setUp() + { + $this->namePrettifier = new PHPUnit_Util_TestDox_NamePrettifier; + } + + public function testTitleHasSensibleDefaults() + { + $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('FooTest')); + $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('TestFoo')); + $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('TestFooTest')); + } + + public function testCaterForUserDefinedSuffix() + { + $this->namePrettifier->setSuffix('TestCase'); + $this->namePrettifier->setPrefix(NULL); + + $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('FooTestCase')); + $this->assertEquals('TestFoo', $this->namePrettifier->prettifyTestClass('TestFoo')); + $this->assertEquals('FooTest', $this->namePrettifier->prettifyTestClass('FooTest')); + } + + public function testCaterForUserDefinedPrefix() + { + $this->namePrettifier->setSuffix(NULL); + $this->namePrettifier->setPrefix('XXX'); + + $this->assertEquals('Foo', $this->namePrettifier->prettifyTestClass('XXXFoo')); + $this->assertEquals('TestXXX', $this->namePrettifier->prettifyTestClass('TestXXX')); + $this->assertEquals('XXX', $this->namePrettifier->prettifyTestClass('XXXXXX')); + } + + public function testTestNameIsConvertedToASentence() + { + $this->assertEquals('This is a test', $this->namePrettifier->prettifyTestMethod('testThisIsATest')); + $this->assertEquals('This is a test', $this->namePrettifier->prettifyTestMethod('testThisIsATest2')); + $this->assertEquals('this is a test', $this->namePrettifier->prettifyTestMethod('this_is_a_test')); + $this->assertEquals('Foo for bar is 0', $this->namePrettifier->prettifyTestMethod('testFooForBarIs0')); + $this->assertEquals('Foo for baz is 1', $this->namePrettifier->prettifyTestMethod('testFooForBazIs1')); + } + + /** + * @ticket 224 + */ + public function testTestNameIsNotGroupedWhenNotInSequence() + { + $this->assertEquals('Sets redirect header on 301', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn301')); + $this->assertEquals('Sets redirect header on 302', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn302')); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TestTest.php @@ -0,0 +1,241 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.6 + */ + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ExceptionNamespaceTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'RequirementsTest.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'RequirementsClassDocBlockTest.php'; + +/** + * + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.6 + */ +class Util_TestTest extends PHPUnit_Framework_TestCase +{ + public function testGetExpectedException() + { + $this->assertSame( + array('class' => 'FooBarBaz', 'code' => NULL, 'message' => ''), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testOne') + ); + + $this->assertSame( + array('class' => 'Foo_Bar_Baz', 'code' => NULL, 'message' => ''), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testTwo') + ); + + $this->assertSame( + array('class' => 'Foo\Bar\Baz', 'code' => NULL, 'message' => ''), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testThree') + ); + + $this->assertSame( + array('class' => 'ほげ', 'code' => NULL, 'message' => ''), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFour') + ); + + $this->assertSame( + array('class' => 'Class', 'code' => 1234, 'message' => 'Message'), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testFive') + ); + + $this->assertSame( + array('class' => 'Class', 'code' => 1234, 'message' => 'Message'), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSix') + ); + + $this->assertSame( + array('class' => 'Class', 'code' => 'ExceptionCode', 'message' => 'Message'), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSeven') + ); + + $this->assertSame( + array('class' => 'Class', 'code' => 0, 'message' => 'Message'), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testEight') + ); + $this->assertSame( + array('class' => 'Class', 'code' => ExceptionTest::ERROR_CODE, 'message' => ExceptionTest::ERROR_MESSAGE), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testNine') + ); + $this->assertSame( + array('class' => 'Class', 'code' => NULL, 'message' => ''), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testSingleLine') + ); + $this->assertSame( + array('class' => 'Class', 'code' => My\Space\ExceptionNamespaceTest::ERROR_CODE, 'message' => My\Space\ExceptionNamespaceTest::ERROR_MESSAGE), + PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testConstants') + ); + // Ensure the Class::CONST expression is only evaluated when the constant really exists + $this->assertSame( + array('class' => 'Class', 'code' => 'ExceptionTest::UNKNOWN_CODE_CONSTANT', 'message' => 'ExceptionTest::UNKNOWN_MESSAGE_CONSTANT'), + PHPUnit_Util_Test::getExpectedException('ExceptionTest', 'testUnknownConstants') + ); + $this->assertSame( + array('class' => 'Class', 'code' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_CODE_CONSTANT', 'message' => 'My\Space\ExceptionNamespaceTest::UNKNOWN_MESSAGE_CONSTANT'), + PHPUnit_Util_Test::getExpectedException('My\Space\ExceptionNamespaceTest', 'testUnknownConstants') + ); + } + + public function provideRequirements() + { + return array( + array('testOne', array()), + array('testTwo', array('PHPUnit' => '1.0')), + array('testThree', array('PHP' => '2.0')), + array('testFour', array('PHPUnit'=>'2.0', 'PHP' => '1.0')), + array('testFive', array('PHP' => '5.4.0RC6')), + array('testSix', array('PHP' => '5.4.0-alpha1')), + array('testSeven', array('PHP' => '5.4.0beta2')), + array('testEight', array('PHP' => '5.4-dev')), + array('testNine', array('functions' => array('testFunc'))), + array('testTen', array('extensions' => array('testExt'))), + array('testSpace', array('extensions' => array('spl'))), + array( + 'testAllPossibleRequirements', + array( + 'PHP' => '99-dev', + 'PHPUnit' => '9-dev', + 'functions' => array( + 'testFuncOne', + 'testFuncTwo', + ), + 'extensions' => array( + 'testExtOne', + 'testExtTwo', + ) + ) + ) + ); + } + + /** + * @dataProvider provideRequirements + */ + public function testGetRequirements($test, $result) + { + $this->assertEquals( + $result, + PHPUnit_Util_Test::getRequirements('RequirementsTest', $test) + ); + } + + public function testGetRequirementsMergesClassAndMethodDocBlocks() + { + $expectedAnnotations = array( + 'PHP' => '5.4', + 'PHPUnit' => '3.7', + 'functions' => array( + 'testFuncClass', + 'testFuncMethod', + ), + 'extensions' => array( + 'testExtClass', + 'testExtMethod', + ) + ); + + $this->assertEquals( + $expectedAnnotations, + PHPUnit_Util_Test::getRequirements('RequirementsClassDocBlockTest', 'testMethod') + ); + } + + public function testGetProvidedDataRegEx() + { + $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider method', $matches); + $this->assertEquals(1, $result); + $this->assertEquals('method', $matches[1]); + + $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider class::method', $matches); + $this->assertEquals(1, $result); + $this->assertEquals('class::method', $matches[1]); + + $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\class::method', $matches); + $this->assertEquals(1, $result); + $this->assertEquals('namespace\class::method', $matches[1]); + + $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider namespace\namespace\class::method', $matches); + $this->assertEquals(1, $result); + $this->assertEquals('namespace\namespace\class::method', $matches[1]); + + $result = preg_match(PHPUnit_Util_Test::REGEX_DATA_PROVIDER, '@dataProvider メソッド', $matches); + $this->assertEquals(1, $result); + $this->assertEquals('メソッド', $matches[1]); + } + + public function testParseAnnotation() + { + $this->assertEquals( + array('Foo', 'ほげ'), + PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotation') + ); + } + + /** + * @depends Foo + * @depends ほげ + */ + public function methodForTestParseAnnotation() + { + } + + public function testParseAnnotationThatIsOnlyOneLine() + { + $this->assertEquals( + array('Bar'), + PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotationThatIsOnlyOneLine') + ); + } + + /** @depends Bar */ + public function methodForTestParseAnnotationThatIsOnlyOneLine() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TypeTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/TypeTest.php @@ -0,0 +1,269 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; + +require_once 'PHPUnit/Util/Type.php'; + +/** + * + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class Util_TypeTest extends PHPUnit_Framework_TestCase +{ + /** + * Removes spaces in front newlines + * + * @param string $string + * @return string + */ + public static function trimnl($string) + { + return preg_replace('/[ ]*\n/', "\n", $string); + } + + public function exportProvider() + { + $obj2 = new stdClass; + $obj2->foo = 'bar'; + + $obj = new stdClass; + //@codingStandardsIgnoreStart + $obj->null = NULL; + //@codingStandardsIgnoreEnd + $obj->boolean = TRUE; + $obj->integer = 1; + $obj->double = 1.2; + $obj->string = '1'; + $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; + $obj->object = $obj2; + $obj->objectagain = $obj2; + $obj->array = array('foo' => 'bar'); + $obj->self = $obj; + + $array = array( + 0 => 0, + 'null' => NULL, + 'boolean' => TRUE, + 'integer' => 1, + 'double' => 1.2, + 'string' => '1', + 'text' => "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", + 'object' => $obj2, + 'objectagain' => $obj2, + 'array' => array('foo' => 'bar'), + ); + + $array['self'] = &$array; + + return array( + array(NULL, 'null'), + array(TRUE, 'true'), + array(1, '1'), + array(1.0, '1.0'), + array(1.2, '1.2'), + array('1', "'1'"), + // \n\r and \r is converted to \n + array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", +<<<EOF +'this +is +a +very +very +very +very +very +very +long +text' +EOF + ), + array(new stdClass, 'stdClass Object ()'), + array($obj, +<<<EOF +stdClass Object ( + 'null' => null + 'boolean' => true + 'integer' => 1 + 'double' => 1.2 + 'string' => '1' + 'text' => 'this +is +a +very +very +very +very +very +very +long +text' + 'object' => stdClass Object ( + 'foo' => 'bar' + ) + 'objectagain' => stdClass Object (*RECURSION*) + 'array' => Array ( + 'foo' => 'bar' + ) + 'self' => stdClass Object (*RECURSION*) +) +EOF + ), + array(array(), 'Array ()'), + array($array, +<<<EOF +Array ( + 0 => 0 + 'null' => null + 'boolean' => true + 'integer' => 1 + 'double' => 1.2 + 'string' => '1' + 'text' => 'this +is +a +very +very +very +very +very +very +long +text' + 'object' => stdClass Object ( + 'foo' => 'bar' + ) + 'objectagain' => stdClass Object (*RECURSION*) + 'array' => Array ( + 'foo' => 'bar' + ) + 'self' => Array (*RECURSION*) +) +EOF + ), + array( + chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5), + 'Binary String: 0x000102030405' + ), + array( + implode('', array_map('chr', range(0x0e, 0x1f))), + 'Binary String: 0x0e0f101112131415161718191a1b1c1d1e1f' + ), + array( + chr(0x00) . chr(0x09), + 'Binary String: 0x0009' + ), + array( + '', + "''" + ), + ); + } + + /** + * @dataProvider exportProvider + */ + public function testExport($value, $expected) + { + $this->assertSame($expected, self::trimnl(PHPUnit_Util_Type::export($value))); + } + + public function shortenedExportProvider() + { + $obj = new stdClass; + $obj->foo = 'bar'; + + $array = array( + 'foo' => 'bar', + ); + + return array( + array(NULL, 'null'), + array(TRUE, 'true'), + array(1, '1'), + array(1.0, '1.0'), + array(1.2, '1.2'), + array('1', "'1'"), + // \n\r and \r is converted to \n + array("this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext", "'this\\nis\\na\\nvery\\nvery\\nvery\\nvery...g\\ntext'"), + array(new stdClass, 'stdClass Object ()'), + array($obj, 'stdClass Object (...)'), + array(array(), 'Array ()'), + array($array, 'Array (...)'), + ); + } + + /** + * @dataProvider shortenedExportProvider + */ + public function testShortenedExport($value, $expected) + { + $this->assertSame($expected, self::trimnl(PHPUnit_Util_Type::shortenedExport($value))); + } + + public function provideNonBinaryMultibyteStrings() + { + return array( + array(implode('', array_map('chr', range(0x09, 0x0d))), 5), + array(implode('', array_map('chr', range(0x20, 0x7f))), 96), + array(implode('', array_map('chr', range(0x80, 0xff))), 128), + ); + } + + + /** + * @dataProvider provideNonBinaryMultibyteStrings + */ + public function testNonBinaryStringExport($value, $expectedLength) + { + $this->assertRegExp("~'.{{$expectedLength}}'\$~s", PHPUnit_Util_Type::export($value)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/XMLTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/Util/XMLTest.php @@ -0,0 +1,328 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.3.0 + */ + +/** + * + * + * @package PHPUnit + * @author Mike Naberezny <mike@maintainable.com> + * @author Derek DeVries <derek@maintainable.com> + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.3.0 + */ +class Util_XMLTest extends PHPUnit_Framework_TestCase +{ + public function testAssertValidKeysValidKeys() + { + $options = array('testA' => 1, 'testB' => 2, 'testC' => 3); + $valid = array('testA', 'testB', 'testC'); + $expected = array('testA' => 1, 'testB' => 2, 'testC' => 3); + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + + $this->assertEquals($expected, $validated); + } + + public function testAssertValidKeysValidKeysEmpty() + { + $options = array('testA' => 1, 'testB' => 2); + $valid = array('testA', 'testB', 'testC'); + $expected = array('testA' => 1, 'testB' => 2, 'testC' => NULL); + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + + $this->assertEquals($expected, $validated); + } + + public function testAssertValidKeysDefaultValuesA() + { + $options = array('testA' => 1, 'testB' => 2); + $valid = array('testA' => 23, 'testB' => 24, 'testC' => 25); + $expected = array('testA' => 1, 'testB' => 2, 'testC' => 25); + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + + $this->assertEquals($expected, $validated); + } + + public function testAssertValidKeysDefaultValuesB() + { + $options = array(); + $valid = array('testA' => 23, 'testB' => 24, 'testC' => 25); + $expected = array('testA' => 23, 'testB' => 24, 'testC' => 25); + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + + $this->assertEquals($expected, $validated); + } + + public function testAssertValidKeysInvalidKey() + { + $options = array('testA' => 1, 'testB' => 2, 'testD' => 3); + $valid = array('testA', 'testB', 'testC'); + + try { + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + $this->fail(); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Unknown key(s): testD', $e->getMessage()); + } + } + + public function testAssertValidKeysInvalidKeys() + { + $options = array('testA' => 1, 'testD' => 2, 'testE' => 3); + $valid = array('testA', 'testB', 'testC'); + + try { + $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid); + $this->fail(); + } + + catch (PHPUnit_Framework_Exception $e) { + $this->assertEquals('Unknown key(s): testD, testE', $e->getMessage()); + } + } + + public function testConvertAssertSelect() + { + $selector = 'div#folder.open a[href="http://www.xerox.com"][title="xerox"].selected.big > span'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', + 'id' => 'folder', + 'class' => 'open', + 'descendant' => array('tag' => 'a', + 'class' => 'selected big', + 'attributes' => array('href' => 'http://www.xerox.com', + 'title' => 'xerox'), + 'child' => array('tag' => 'span'))); + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectElt() + { + $selector = 'div'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertClass() + { + $selector = '.foo'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('class' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertId() + { + $selector = '#foo'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('id' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertAttribute() + { + $selector = '[foo="bar"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('attributes' => array('foo' => 'bar')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertAttributeSpaces() + { + $selector = '[foo="bar baz"] div[value="foo bar"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('attributes' => array('foo' => 'bar baz'), + 'descendant' => array('tag' => 'div', + 'attributes' => array('value' => 'foo bar'))); + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertAttributeMultipleSpaces() + { + $selector = '[foo="bar baz"] div[value="foo bar baz"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('attributes' => array('foo' => 'bar baz'), + 'descendant' => array('tag' => 'div', + 'attributes' => array('value' => 'foo bar baz'))); + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltClass() + { + $selector = 'div.foo'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'class' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltId() + { + $selector = 'div#foo'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'id' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltAttrEqual() + { + $selector = 'div[foo="bar"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'attributes' => array('foo' => 'bar')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltMultiAttrEqual() + { + $selector = 'div[foo="bar"][baz="fob"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'attributes' => array('foo' => 'bar', 'baz' => 'fob')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltAttrHasOne() + { + $selector = 'div[foo~="bar"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'attributes' => array('foo' => 'regexp:/.*\bbar\b.*/')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltAttrContains() + { + $selector = 'div[foo*="bar"]'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'attributes' => array('foo' => 'regexp:/.*bar.*/')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltChild() + { + $selector = 'div > a'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'child' => array('tag' => 'a')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectEltDescendant() + { + $selector = 'div a'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector); + $tag = array('tag' => 'div', 'descendant' => array('tag' => 'a')); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectContent() + { + $selector = '#foo'; + $content = 'div contents'; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); + $tag = array('id' => 'foo', 'content' => 'div contents'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectTrue() + { + $selector = '#foo'; + $content = TRUE; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); + $tag = array('id' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertSelectFalse() + { + $selector = '#foo'; + $content = FALSE; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); + $tag = array('id' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertNumber() + { + $selector = '.foo'; + $content = 3; + $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); + $tag = array('class' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testConvertAssertRange() + { + $selector = '#foo'; + $content = array('greater_than' => 5, 'less_than' => 10); + $converted = PHPUnit_Util_XML::convertSelectToTag($selector, $content); + $tag = array('id' => 'foo'); + + $this->assertEquals($tag, $converted); + } + + public function testPrepareStringEscapesChars() + { + $this->assertEquals('&#x1b;', PHPUnit_Util_XML::prepareString("\033")); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/AbstractTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/AbstractTest.php @@ -0,0 +1,7 @@ +<?php +abstract class AbstractTest extends PHPUnit_Framework_TestCase +{ + public function testOne() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Author.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Author.php @@ -0,0 +1,66 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * An author. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class Author +{ + // the order of properties is important for testing the cycle! + public $books = array(); + + private $name = ''; + + public function __construct($name) + { + $this->name = $name; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccount.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccount.php @@ -0,0 +1,116 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +class BankAccountException extends RuntimeException {} + +/** + * A bank account. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.3.0 + */ +class BankAccount +{ + /** + * The bank account's balance. + * + * @var float + */ + protected $balance = 0; + + /** + * Returns the bank account's balance. + * + * @return float + */ + public function getBalance() + { + return $this->balance; + } + + /** + * Sets the bank account's balance. + * + * @param float $balance + * @throws BankAccountException + */ + protected function setBalance($balance) + { + if ($balance >= 0) { + $this->balance = $balance; + } else { + throw new BankAccountException; + } + } + + /** + * Deposits an amount of money to the bank account. + * + * @param float $balance + * @throws BankAccountException + */ + public function depositMoney($balance) + { + $this->setBalance($this->getBalance() + $balance); + + return $this->getBalance(); + } + + /** + * Withdraws an amount of money from the bank account. + * + * @param float $balance + * @throws BankAccountException + */ + public function withdrawMoney($balance) + { + $this->setBalance($this->getBalance() - $balance); + + return $this->getBalance(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php @@ -0,0 +1,133 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; +require_once 'BankAccount.php'; + +/** + * Tests for the BankAccount class. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.3.0 + */ +class BankAccountTest extends PHPUnit_Framework_TestCase +{ + protected $ba; + + protected function setUp() + { + $this->ba = new BankAccount; + } + + /** + * @covers BankAccount::getBalance + * @group balanceIsInitiallyZero + * @group specification + */ + public function testBalanceIsInitiallyZero() + { + $this->assertEquals(0, $this->ba->getBalance()); + } + + /** + * @covers BankAccount::withdrawMoney + * @group balanceCannotBecomeNegative + * @group specification + */ + public function testBalanceCannotBecomeNegative() + { + try { + $this->ba->withdrawMoney(1); + } + + catch (BankAccountException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::depositMoney + * @group balanceCannotBecomeNegative + * @group specification + */ + public function testBalanceCannotBecomeNegative2() + { + try { + $this->ba->depositMoney(-1); + } + + catch (BankAccountException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::getBalance + * @covers BankAccount::depositMoney + * @covers BankAccount::withdrawMoney + * @group balanceCannotBecomeNegative + */ + /* + public function testDepositingAndWithdrawingMoneyWorks() + { + $this->assertEquals(0, $this->ba->getBalance()); + $this->ba->depositMoney(1); + $this->assertEquals(1, $this->ba->getBalance()); + $this->ba->withdrawMoney(1); + $this->assertEquals(0, $this->ba->getBalance()); + } + */ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php @@ -0,0 +1,133 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 2.3.0 + */ + +require_once 'PHPUnit/Framework/TestCase.php'; +require_once 'BankAccount.php'; + +/** + * Tests for the BankAccount class. + * + * @package PHPUnit + * @author Sebastian Bergmann <sebastian@phpunit.de> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 2.3.0 + */ +class BankAccountWithCustomExtensionTest extends PHPUnit_Framework_TestCase +{ + protected $ba; + + protected function setUp() + { + $this->ba = new BankAccount; + } + + /** + * @covers BankAccount::getBalance + * @group balanceIsInitiallyZero + * @group specification + */ + public function testBalanceIsInitiallyZero() + { + $this->assertEquals(0, $this->ba->getBalance()); + } + + /** + * @covers BankAccount::withdrawMoney + * @group balanceCannotBecomeNegative + * @group specification + */ + public function testBalanceCannotBecomeNegative() + { + try { + $this->ba->withdrawMoney(1); + } + + catch (BankAccountException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::depositMoney + * @group balanceCannotBecomeNegative + * @group specification + */ + public function testBalanceCannotBecomeNegative2() + { + try { + $this->ba->depositMoney(-1); + } + + catch (BankAccountException $e) { + $this->assertEquals(0, $this->ba->getBalance()); + + return; + } + + $this->fail(); + } + + /** + * @covers BankAccount::getBalance + * @covers BankAccount::depositMoney + * @covers BankAccount::withdrawMoney + * @group balanceCannotBecomeNegative + */ + /* + public function testDepositingAndWithdrawingMoneyWorks() + { + $this->assertEquals(0, $this->ba->getBalance()); + $this->ba->depositMoney(1); + $this->assertEquals(1, $this->ba->getBalance()); + $this->ba->withdrawMoney(1); + $this->assertEquals(0, $this->ba->getBalance()); + } + */ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Book.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Book.php @@ -0,0 +1,59 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * A book. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class Book +{ + // the order of properties is important for testing the cycle! + public $author = NULL; +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Calculator.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Calculator.php @@ -0,0 +1,14 @@ +<?php +class Calculator +{ + /** + * @assert (0, 0) == 0 + * @assert (0, 1) == 1 + * @assert (1, 0) == 1 + * @assert (1, 1) == 2 + */ + public function add($a, $b) + { + return $a + $b; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ChangeCurrentWorkingDirectoryTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ChangeCurrentWorkingDirectoryTest.php @@ -0,0 +1,10 @@ +<?php +class ChangeCurrentWorkingDirectoryTest extends PHPUnit_Framework_TestCase +{ + public function testSomethingThatChangesTheCwd() + { + chdir('../'); + $this->assertTrue(TRUE); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithNonPublicAttributes.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithNonPublicAttributes.php @@ -0,0 +1,29 @@ +<?php +class ParentClassWithPrivateAttributes +{ + private static $privateStaticParentAttribute = 'foo'; + private $privateParentAttribute = 'bar'; +} + +class ParentClassWithProtectedAttributes extends ParentClassWithPrivateAttributes +{ + protected static $protectedStaticParentAttribute = 'foo'; + protected $protectedParentAttribute = 'bar'; +} + +class ClassWithNonPublicAttributes extends ParentClassWithProtectedAttributes +{ + public static $publicStaticAttribute = 'foo'; + protected static $protectedStaticAttribute = 'bar'; + protected static $privateStaticAttribute = 'baz'; + + public $publicAttribute = 'foo'; + public $foo = 1; + public $bar = 2; + protected $protectedAttribute = 'bar'; + protected $privateAttribute = 'baz'; + + public $publicArray = array('foo'); + protected $protectedArray = array('bar'); + protected $privateArray = array('baz'); +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php @@ -0,0 +1,61 @@ +<?php +/** + * PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since File available since Release 3.6.0 + */ + +/** + * A class with a __toString() method. + * + * @package PHPUnit + * @author Bernhard Schussek <bschussek@2bepublished.at> + * @copyright 2001-2014 Sebastian Bergmann <sebastian@phpunit.de> + * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License + * @link http://www.phpunit.de/ + * @since Class available since Release 3.6.0 + */ +class ClassWithToString +{ + public function __toString() + { + return 'string representation'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.my.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.my.php @@ -0,0 +1,9 @@ +<?php +require_once 'AbstractTest.php'; + +class ConcreteWithMyCustomExtensionTest extends AbstractTest +{ + public function testTwo() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ConcreteTest.php @@ -0,0 +1,9 @@ +<?php +require_once 'AbstractTest.php'; + +class ConcreteTest extends AbstractTest +{ + public function testTwo() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DataProviderTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DataProviderTest.php @@ -0,0 +1,21 @@ +<?php +class DataProviderTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider providerMethod + */ + public function testAdd($a, $b, $c) + { + $this->assertEquals($c, $a + $b); + } + + public static function providerMethod() + { + return array( + array(0, 0, 0), + array(0, 1, 1), + array(1, 1, 3), + array(1, 0, 1) + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyFailureTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyFailureTest.php @@ -0,0 +1,22 @@ +<?php +class DependencyFailureTest extends PHPUnit_Framework_TestCase +{ + public function testOne() + { + $this->fail(); + } + + /** + * @depends testOne + */ + public function testTwo() + { + } + + /** + * @depends testTwo + */ + public function testThree() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencySuccessTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencySuccessTest.php @@ -0,0 +1,21 @@ +<?php +class DependencySuccessTest extends PHPUnit_Framework_TestCase +{ + public function testOne() + { + } + + /** + * @depends testOne + */ + public function testTwo() + { + } + + /** + * @depends DependencySuccessTest::testTwo + */ + public function testThree() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyTestSuite.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DependencyTestSuite.php @@ -0,0 +1,16 @@ +<?php +require_once 'DependencyFailureTest.php'; +require_once 'DependencySuccessTest.php'; + +class DependencyTestSuite +{ + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Test Dependencies'); + + $suite->addTestSuite('DependencySuccessTest'); + $suite->addTestSuite('DependencyFailureTest'); + + return $suite; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DoubleTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/DoubleTestCase.php @@ -0,0 +1,25 @@ +<?php +class DoubleTestCase implements PHPUnit_Framework_Test +{ + protected $testCase; + + public function __construct(PHPUnit_Framework_TestCase $testCase) + { + $this->testCase = $testCase; + } + + public function count() + { + return 2; + } + + public function run(PHPUnit_Framework_TestResult $result = NULL) + { + $result->startTest($this); + + $this->testCase->runBare(); + $this->testCase->runBare(); + + $result->endTest($this, 0); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/EmptyTestCaseTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/EmptyTestCaseTest.php @@ -0,0 +1,4 @@ +<?php +class EmptyTestCaseTest extends PHPUnit_Framework_TestCase +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Error.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Error.php @@ -0,0 +1,8 @@ +<?php +class Error extends PHPUnit_Framework_TestCase +{ + protected function runTest() + { + throw new Exception; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPostConditionsTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPostConditionsTest.php @@ -0,0 +1,35 @@ +<?php +class ExceptionInAssertPostConditionsTest extends PHPUnit_Framework_TestCase +{ + public $setUp = FALSE; + public $assertPreConditions = FALSE; + public $assertPostConditions = FALSE; + public $tearDown = FALSE; + public $testSomething = FALSE; + + protected function setUp() + { + $this->setUp = TRUE; + } + + protected function assertPreConditions() + { + $this->assertPreConditions = TRUE; + } + + public function testSomething() + { + $this->testSomething = TRUE; + } + + protected function assertPostConditions() + { + $this->assertPostConditions = TRUE; + throw new Exception; + } + + protected function tearDown() + { + $this->tearDown = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPreConditionsTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInAssertPreConditionsTest.php @@ -0,0 +1,35 @@ +<?php +class ExceptionInAssertPreConditionsTest extends PHPUnit_Framework_TestCase +{ + public $setUp = FALSE; + public $assertPreConditions = FALSE; + public $assertPostConditions = FALSE; + public $tearDown = FALSE; + public $testSomething = FALSE; + + protected function setUp() + { + $this->setUp = TRUE; + } + + protected function assertPreConditions() + { + $this->assertPreConditions = TRUE; + throw new Exception; + } + + public function testSomething() + { + $this->testSomething = TRUE; + } + + protected function assertPostConditions() + { + $this->assertPostConditions = TRUE; + } + + protected function tearDown() + { + $this->tearDown = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInSetUpTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInSetUpTest.php @@ -0,0 +1,35 @@ +<?php +class ExceptionInSetUpTest extends PHPUnit_Framework_TestCase +{ + public $setUp = FALSE; + public $assertPreConditions = FALSE; + public $assertPostConditions = FALSE; + public $tearDown = FALSE; + public $testSomething = FALSE; + + protected function setUp() + { + $this->setUp = TRUE; + throw new Exception; + } + + protected function assertPreConditions() + { + $this->assertPreConditions = TRUE; + } + + public function testSomething() + { + $this->testSomething = TRUE; + } + + protected function assertPostConditions() + { + $this->assertPostConditions = TRUE; + } + + protected function tearDown() + { + $this->tearDown = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTearDownTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTearDownTest.php @@ -0,0 +1,35 @@ +<?php +class ExceptionInTearDownTest extends PHPUnit_Framework_TestCase +{ + public $setUp = FALSE; + public $assertPreConditions = FALSE; + public $assertPostConditions = FALSE; + public $tearDown = FALSE; + public $testSomething = FALSE; + + protected function setUp() + { + $this->setUp = TRUE; + } + + protected function assertPreConditions() + { + $this->assertPreConditions = TRUE; + } + + public function testSomething() + { + $this->testSomething = TRUE; + } + + protected function assertPostConditions() + { + $this->assertPostConditions = TRUE; + } + + protected function tearDown() + { + $this->tearDown = TRUE; + throw new Exception; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionInTest.php @@ -0,0 +1,35 @@ +<?php +class ExceptionInTest extends PHPUnit_Framework_TestCase +{ + public $setUp = FALSE; + public $assertPreConditions = FALSE; + public $assertPostConditions = FALSE; + public $tearDown = FALSE; + public $testSomething = FALSE; + + protected function setUp() + { + $this->setUp = TRUE; + } + + protected function assertPreConditions() + { + $this->assertPreConditions = TRUE; + } + + public function testSomething() + { + $this->testSomething = TRUE; + throw new Exception; + } + + protected function assertPostConditions() + { + $this->assertPostConditions = TRUE; + } + + protected function tearDown() + { + $this->tearDown = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionNamespaceTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionNamespaceTest.php @@ -0,0 +1,38 @@ +<?php + +namespace My\Space; + +class ExceptionNamespaceTest extends \PHPUnit_Framework_TestCase +{ + /** + * Exception message + * + * @var string + */ + const ERROR_MESSAGE = 'Exception namespace message'; + + /** + * Exception code + * + * @var integer + */ + const ERROR_CODE = 200; + + /** + * @expectedException Class + * @expectedExceptionMessage My\Space\ExceptionNamespaceTest::ERROR_MESSAGE + * @expectedExceptionCode My\Space\ExceptionNamespaceTest::ERROR_CODE + */ + public function testConstants() + { + } + + /** + * @expectedException Class + * @expectedExceptionCode My\Space\ExceptionNamespaceTest::UNKNOWN_CODE_CONSTANT + * @expectedExceptionMessage My\Space\ExceptionNamespaceTest::UNKNOWN_MESSAGE_CONSTANT + */ + public function testUnknownConstants() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionStack.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionStack.php @@ -0,0 +1,23 @@ +<?php +class ExceptionStackTestException extends Exception { } + +class ExceptionStackTest extends PHPUnit_Framework_TestCase +{ + public function testPrintingChildException() + { + try { + $this->assertEquals(array(1), array(2), 'message'); + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + $message = $e->getMessage() . "\n" . $e->getComparisonFailure()->getDiff(); + throw new ExceptionStackTestException("Child exception\n$message", 101, $e); + } + } + + public function testNestedExceptions() + { + $exceptionThree = new Exception('Three'); + $exceptionTwo = new InvalidArgumentException('Two', 0, $exceptionThree); + $exceptionOne = new Exception('One', 0, $exceptionTwo); + throw $exceptionOne; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ExceptionTest.php @@ -0,0 +1,102 @@ +<?php +class ExceptionTest extends PHPUnit_Framework_TestCase +{ + /** + * Exception message + * + * @var string + */ + const ERROR_MESSAGE = 'Exception message'; + + /** + * Exception code + * + * @var integer + */ + const ERROR_CODE = 500; + + /** + * @expectedException FooBarBaz + */ + public function testOne() + { + } + + /** + * @expectedException Foo_Bar_Baz + */ + public function testTwo() + { + } + + /** + * @expectedException Foo\Bar\Baz + */ + public function testThree() + { + } + + /** + * @expectedException ほげ + */ + public function testFour() + { + } + + /** + * @expectedException Class Message 1234 + */ + public function testFive() + { + } + + /** + * @expectedException Class + * @expectedExceptionMessage Message + * @expectedExceptionCode 1234 + */ + public function testSix() + { + } + + /** + * @expectedException Class + * @expectedExceptionMessage Message + * @expectedExceptionCode ExceptionCode + */ + public function testSeven() + { + } + + /** + * @expectedException Class + * @expectedExceptionMessage Message + * @expectedExceptionCode 0 + */ + public function testEight() + { + } + + /** + * @expectedException Class + * @expectedExceptionMessage ExceptionTest::ERROR_MESSAGE + * @expectedExceptionCode ExceptionTest::ERROR_CODE + */ + public function testNine() + { + } + + /** @expectedException Class */ + public function testSingleLine() + { + } + + /** + * @expectedException Class + * @expectedExceptionCode ExceptionTest::UNKNOWN_CODE_CONSTANT + * @expectedExceptionMessage ExceptionTest::UNKNOWN_MESSAGE_CONSTANT + */ + public function testUnknownConstants() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Failure.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Failure.php @@ -0,0 +1,8 @@ +<?php +class Failure extends PHPUnit_Framework_TestCase +{ + protected function runTest() + { + $this->fail(); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FailureTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FailureTest.php @@ -0,0 +1,76 @@ +<?php +class FailureTest extends PHPUnit_Framework_TestCase +{ + public function testAssertArrayEqualsArray() + { + $this->assertEquals(array(1), array(2), 'message'); + } + + public function testAssertIntegerEqualsInteger() + { + $this->assertEquals(1, 2, 'message'); + } + + public function testAssertObjectEqualsObject() + { + $a = new StdClass; + $a->foo = 'bar'; + + $b = new StdClass; + $b->bar = 'foo'; + + $this->assertEquals($a, $b, 'message'); + } + + public function testAssertNullEqualsString() + { + $this->assertEquals(NULL, 'bar', 'message'); + } + + public function testAssertStringEqualsString() + { + $this->assertEquals('foo', 'bar', 'message'); + } + + public function testAssertTextEqualsText() + { + $this->assertEquals("foo\nbar\n", "foo\nbaz\n", 'message'); + } + + public function testAssertStringMatchesFormat() + { + $this->assertStringMatchesFormat('*%s*', '**', 'message'); + } + + public function testAssertNumericEqualsNumeric() + { + $this->assertEquals(1, 2, 'message'); + } + + public function testAssertTextSameText() + { + $this->assertSame('foo', 'bar', 'message'); + } + + public function testAssertObjectSameObject() + { + $this->assertSame(new StdClass, new StdClass, 'message'); + } + + public function testAssertObjectSameNull() + { + $this->assertSame(new StdClass, NULL, 'message'); + } + + public function testAssertFloatSameFloat() + { + $this->assertSame(1.0, 1.5, 'message'); + } + + // Note that due to the implementation of this assertion it counts as 2 asserts + public function testAssertStringMatchesFormatFile() + { + $this->assertStringMatchesFormatFile(__DIR__ . '/expectedFileFormat.txt', '...BAR...'); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FatalTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/FatalTest.php @@ -0,0 +1,14 @@ +<?php + +class FatalTest extends PHPUnit_Framework_TestCase +{ + public function testFatalError() + { + if(extension_loaded('xdebug')) { + xdebug_disable(); + } + + non_existing_function(); + } + +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/IncompleteTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/IncompleteTest.php @@ -0,0 +1,8 @@ +<?php +class IncompleteTest extends PHPUnit_Framework_TestCase +{ + public function testIncomplete() + { + $this->markTestIncomplete('Test incomplete'); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/InheritedTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/InheritedTestCase.php @@ -0,0 +1,9 @@ +<?php +require_once 'OneTestCase.php'; + +class InheritedTestCase extends OneTestCase +{ + public function test2() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/arrayObject.js b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/arrayObject.js @@ -0,0 +1 @@ +["Mascott", "Tux", "OS", "Linux"] diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject.js b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject.js @@ -0,0 +1 @@ +{"Mascott":"Tux"} +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject2.js b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/JsonData/simpleObject2.js @@ -0,0 +1 @@ +{"Mascott":"Tux"} +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MockRunner.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MockRunner.php @@ -0,0 +1,7 @@ +<?php +class MockRunner extends PHPUnit_Runner_BaseTestRunner +{ + protected function runFailed($message) + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MultiDependencyTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/MultiDependencyTest.php @@ -0,0 +1,23 @@ +<?php +class MultiDependencyTest extends PHPUnit_Framework_TestCase +{ + public function testOne() + { + return 'foo'; + } + + public function testTwo() + { + return 'bar'; + } + + /** + * @depends testOne + * @depends testTwo + */ + public function testThree($a, $b) + { + $this->assertEquals('foo', $a); + $this->assertEquals('bar', $b); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoArgTestCaseTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoArgTestCaseTest.php @@ -0,0 +1,7 @@ +<?php +class NoArgTestCaseTest extends PHPUnit_Framework_TestCase +{ + public function testNothing() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCaseClass.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCaseClass.php @@ -0,0 +1,4 @@ +<?php +class NoTestCaseClass +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCases.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NoTestCases.php @@ -0,0 +1,7 @@ +<?php +class NoTestCases extends PHPUnit_Framework_TestCase +{ + public function noTestCase() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NonStatic.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NonStatic.php @@ -0,0 +1,8 @@ +<?php +class NonStatic +{ + public function suite() + { + return NULL; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotPublicTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotPublicTestCase.php @@ -0,0 +1,11 @@ +<?php +class NotPublicTestCase extends PHPUnit_Framework_TestCase +{ + public function testPublic() + { + } + + protected function testNotPublic() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotVoidTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NotVoidTestCase.php @@ -0,0 +1,4 @@ +<?php +class NotVoidTestCase extends PHPUnit_Framework_TestCase +{ +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NothingTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/NothingTest.php @@ -0,0 +1,7 @@ +<?php +class NothingTest extends PHPUnit_Framework_TestCase +{ + public function testNothing() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OneTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OneTestCase.php @@ -0,0 +1,11 @@ +<?php +class OneTestCase extends PHPUnit_Framework_TestCase +{ + public function noTestCase() + { + } + + public function testCase($arg = '') + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OutputTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OutputTestCase.php @@ -0,0 +1,27 @@ +<?php +class OutputTestCase extends PHPUnit_Framework_TestCase +{ + public function testExpectOutputStringFooActualFoo() + { + $this->expectOutputString('foo'); + print 'foo'; + } + + public function testExpectOutputStringFooActualBar() + { + $this->expectOutputString('foo'); + print 'bar'; + } + + public function testExpectOutputRegexFooActualFoo() + { + $this->expectOutputRegex('/foo/'); + print 'foo'; + } + + public function testExpectOutputRegexFooActualBar() + { + $this->expectOutputRegex('/foo/'); + print 'bar'; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OverrideTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/OverrideTestCase.php @@ -0,0 +1,9 @@ +<?php +require_once 'OneTestCase.php'; + +class OverrideTestCase extends OneTestCase +{ + public function testCase($arg = '') + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsClassDocBlockTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsClassDocBlockTest.php @@ -0,0 +1,23 @@ +<?php + +/** + * @requires PHP 5.3 + * @requires PHPUnit 3.8 + * @requires function testFuncClass + * @requires extension testExtClass + */ +class RequirementsClassDocBlockTest { + + /** + * @requires PHP 5.4 + * @requires PHPUnit 3.7 + * @requires function testFuncMethod + * @requires extension testExtMethod + */ + public function testMethod() + { + } + +} + + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/RequirementsTest.php @@ -0,0 +1,119 @@ +<?php +class RequirementsTest extends PHPUnit_Framework_TestCase +{ + public function testOne() + { + } + + /** + * @requires PHPUnit 1.0 + */ + public function testTwo() + { + } + + /** + * @requires PHP 2.0 + */ + public function testThree() + { + } + + /** + * @requires PHPUnit 2.0 + * @requires PHP 1.0 + */ + public function testFour() + { + } + + /** + * @requires PHP 5.4.0RC6 + */ + public function testFive() + { + } + + /** + * @requires PHP 5.4.0-alpha1 + */ + public function testSix() + { + } + + /** + * @requires PHP 5.4.0beta2 + */ + public function testSeven() + { + } + + /** + * @requires PHP 5.4-dev + */ + public function testEight() + { + } + + + /** + * @requires function testFunc + */ + public function testNine() + { + } + + /** + * @requires extension testExt + */ + public function testTen() + { + } + + /** + * @requires PHP 99-dev + * @requires PHPUnit 9-dev + * @requires function testFuncOne + * @requires function testFuncTwo + * @requires extension testExtOne + * @requires extension testExtTwo + */ + public function testAllPossibleRequirements() + { + } + + /** + * @requires function array_merge + */ + public function testExistingFunction() + { + } + + /** + * @requires extension spl + */ + public function testExistingExtension() + { + } + + /** + * @requires PHPUnit 1111111 + */ + public function testAlwaysSkip() + { + } + + /** + * @requires PHP 9999999 + */ + public function testAlwaysSkip2() + { + } + + /** + * @requires extension spl + */ + public function testSpace() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php @@ -0,0 +1,32 @@ +<?php +/** + * Sample class that implements ArrayAccess copied from + * http://www.php.net/manual/en/class.arrayaccess.php + * with some minor changes + * This class required for PHPUnit_Framework_Constraint_ArrayHasKey testing + */ + +class SampleArrayAccess implements ArrayAccess +{ + private $container; + + public function __construct() { + $this->container = array(); + } + public function offsetSet($offset, $value) { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + public function offsetExists($offset) { + return isset($this->container[$offset]); + } + public function offsetUnset($offset) { + unset($this->container[$offset]); + } + public function offsetGet($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleClass.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SampleClass.php @@ -0,0 +1,14 @@ +<?php +class SampleClass +{ + public $a; + protected $b; + protected $c; + + public function __construct($a, $b, $c) + { + $this->a = $a; + $this->b = $b; + $this->c = $c; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SelectorAssertionsFixture.html b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/SelectorAssertionsFixture.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <title>Login</title> + <link type="text/css" rel="Stylesheet" href="/stylesheets/screen.css"> + <script type="text/javascript">alert('Hello, world!');</script> + </head> + <body id="login"> + <ul id="my_ul" class="my_ul_class"> + <li class="my_li">Test LI 1</li> + <li class="my_li">Test LI 2</li> + <li class="my_li">Test LI 3</li> + </ul> + <ul id="another_ul" class="my_ul_class"> + <li class="my_li">Test LI 4</li> + </ul> + <div id="test_id" class="my_test_class"> + <div id="test_child_id"> + <span id="test_subchild_id">My Subchild</span> + My Child + </div> + + Test Id Text + </div> + <div id="test_children" class="children"> + My Children + <div class="my_child">1</div> + <div class="my_child">2</div> + <div class="my_child">3</div> + <div class="my_child">4</div> + </div> + <span class="test_class"> + Test Class Text + </span> + <img src="/images/login_logo.gif" alt="Login Logo"> + <input id="input_test_id" type="text" class="full"> + <div id="test_text"> + My test tag content + <div class="another_node">more text</div> + </div> + <div id="test_multi_class" class="multi part class">test</div> + </body> +</html> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Singleton.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Singleton.php @@ -0,0 +1,22 @@ +<?php +class Singleton +{ + private static $uniqueInstance = NULL; + + protected function __construct() + { + } + + private final function __clone() + { + } + + public static function getInstance() + { + if (self::$uniqueInstance === NULL) { + self::$uniqueInstance = new Singleton; + } + + return self::$uniqueInstance; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/StackTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/StackTest.php @@ -0,0 +1,24 @@ +<?php +class StackTest extends PHPUnit_Framework_TestCase +{ + public function testPush() + { + $stack = array(); + $this->assertEquals(0, count($stack)); + + array_push($stack, 'foo'); + $this->assertEquals('foo', $stack[count($stack)-1]); + $this->assertEquals(1, count($stack)); + + return $stack; + } + + /** + * @depends testPush + */ + public function testPop(array $stack) + { + $this->assertEquals('foo', array_pop($stack)); + $this->assertEquals(0, count($stack)); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Struct.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Struct.php @@ -0,0 +1,10 @@ +<?php +class Struct +{ + public $var; + + public function __construct($var) + { + $this->var = $var; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Success.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/Success.php @@ -0,0 +1,7 @@ +<?php +class Success extends PHPUnit_Framework_TestCase +{ + protected function runTest() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TemplateMethodsTest.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TemplateMethodsTest.php @@ -0,0 +1,52 @@ +<?php +class TemplateMethodsTest extends PHPUnit_Framework_TestCase +{ + public static function setUpBeforeClass() + { + print __METHOD__ . "\n"; + } + + protected function setUp() + { + print __METHOD__ . "\n"; + } + + protected function assertPreConditions() + { + print __METHOD__ . "\n"; + } + + public function testOne() + { + print __METHOD__ . "\n"; + $this->assertTrue(TRUE); + } + + public function testTwo() + { + print __METHOD__ . "\n"; + $this->assertTrue(FALSE); + } + + protected function assertPostConditions() + { + print __METHOD__ . "\n"; + } + + protected function tearDown() + { + print __METHOD__ . "\n"; + } + + public static function tearDownAfterClass() + { + print __METHOD__ . "\n"; + } + + protected function onNotSuccessfulTest(Exception $e) + { + print __METHOD__ . "\n"; + throw $e; + } +} +?> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator.php @@ -0,0 +1,36 @@ +<?php +class TestIterator implements Iterator +{ + protected $array; + protected $position = 0; + + public function __construct($array = array()) + { + $this->array = $array; + } + + public function rewind() + { + $this->position = 0; + } + + public function valid() + { + return $this->position < count($this->array); + } + + public function key() + { + return $this->position; + } + + public function current() + { + return $this->array[$this->position]; + } + + public function next() + { + $this->position++; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator2.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/TestIterator2.php @@ -0,0 +1,35 @@ +<?php +class TestIterator2 implements Iterator { + + protected $data; + + public function __construct(array $array) + { + $this->data = $array; + } + + public function current() + { + return current($this->data); + } + + public function next() + { + next($this->data); + } + + public function key() + { + return key($this->data); + } + + public function valid() + { + return key($this->data) !== null; + } + + public function rewind() + { + reset($this->data); + } +} +\ No newline at end of file diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowExceptionTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowExceptionTestCase.php @@ -0,0 +1,8 @@ +<?php +class ThrowExceptionTestCase extends PHPUnit_Framework_TestCase +{ + public function test() + { + throw new RuntimeException; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowNoExceptionTestCase.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/ThrowNoExceptionTestCase.php @@ -0,0 +1,7 @@ +<?php +class ThrowNoExceptionTestCase extends PHPUnit_Framework_TestCase +{ + public function test() + { + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/WasRun.php b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/WasRun.php @@ -0,0 +1,10 @@ +<?php +class WasRun extends PHPUnit_Framework_TestCase +{ + public $wasRun = FALSE; + + protected function runTest() + { + $this->wasRun = TRUE; + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/bar.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/bar.xml @@ -0,0 +1 @@ +<bar/> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<phpunit backupGlobals="true" + backupStaticAttributes="false" + bootstrap="/path/to/bootstrap.php" + cacheTokens="false" + colors="false" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + forceCoversAnnotation="false" + mapTestClassNameToCoveredClassName="false" + printerClass="PHPUnit_TextUI_ResultPrinter" + stopOnFailure="false" + testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" + timeoutForSmallTests="1" + timeoutForMediumTests="10" + timeoutForLargeTests="60" + strict="false" + verbose="false"> + <testsuites> + <testsuite name="My Test Suite"> + <directory suffix="Test.php" phpVersion="5.3.0" phpVersionOperator=">=">/path/to/files</directory> + <file phpVersion="5.3.0" phpVersionOperator=">=">/path/to/MyTest.php</file> + </testsuite> + </testsuites> + + <groups> + <include> + <group>name</group> + </include> + <exclude> + <group>name</group> + </exclude> + </groups> + + <filter> + <blacklist> + <directory suffix=".php">/path/to/files</directory> + <file>/path/to/file</file> + <exclude> + <directory suffix=".php">/path/to/files</directory> + <file>/path/to/file</file> + </exclude> + </blacklist> + <whitelist addUncoveredFilesFromWhitelist="true" + processUncoveredFilesFromWhitelist="false"> + <directory suffix=".php">/path/to/files</directory> + <file>/path/to/file</file> + <exclude> + <directory suffix=".php">/path/to/files</directory> + <file>/path/to/file</file> + </exclude> + </whitelist> + </filter> + + <listeners> + <listener class="MyListener" file="/optional/path/to/MyListener.php"> + <arguments> + <array> + <element key="0"> + <string>Sebastian</string> + </element> + </array> + <integer>22</integer> + <string>April</string> + <double>19.78</double> + <null/> + <object class="stdClass"/> + <file>MyTestFile.php</file> + <directory>MyRelativePath</directory> + </arguments> + </listener> + <listener class="IncludePathListener" file="ConfigurationTest.php" /> + <listener class="CompactArgumentsListener" file="/CompactArgumentsListener.php"><arguments><integer>42</integer></arguments></listener> + </listeners> + + <logging> + <log type="coverage-html" target="/tmp/report" + charset="UTF-8" highlight="false" + lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="/tmp/clover.xml"/> + <log type="json" target="/tmp/logfile.json"/> + <log type="plain" target="/tmp/logfile.txt"/> + <log type="tap" target="/tmp/logfile.tap"/> + <log type="junit" target="/tmp/logfile.xml" logIncompleteSkipped="false"/> + <log type="testdox-html" target="/tmp/testdox.html"/> + <log type="testdox-text" target="/tmp/testdox.txt"/> + </logging> + + <php> + <includePath>.</includePath> + <includePath>/path/to/lib</includePath> + <ini name="foo" value="bar"/> + <const name="FOO" value="false"/> + <const name="BAR" value="true"/> + <var name="foo" value="false"/> + <env name="foo" value="true"/> + <post name="foo" value="bar"/> + <get name="foo" value="bar"/> + <cookie name="foo" value="bar"/> + <server name="foo" value="bar"/> + <files name="foo" value="bar"/> + <request name="foo" value="bar"/> + </php> + + <selenium> + <browser name="Firefox on Linux" + browser="*firefox /usr/lib/firefox/firefox-bin" + host="my.linux.box" + port="4444" + timeout="30000"/> + </selenium> +</phpunit> + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration_xinclude.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/configuration_xinclude.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8" ?> + +<phpunit backupGlobals="true" + backupStaticAttributes="false" + bootstrap="/path/to/bootstrap.php" + cacheTokens="false" + colors="false" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + forceCoversAnnotation="false" + mapTestClassNameToCoveredClassName="false" + printerClass="PHPUnit_TextUI_ResultPrinter" + stopOnFailure="false" + testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" + timeoutForSmallTests="1" + timeoutForMediumTests="10" + timeoutForLargeTests="60" + strict="false" + verbose="false"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/testsuites)" /> + + <groups> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/groups/*)" /> + </groups> + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/filter)" /> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/listeners)" /> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/logging)" /> + + <php> + <includePath>.</includePath> + <includePath>/path/to/lib</includePath> + <ini name="foo" value="bar"/> + <const name="FOO" value="false"/> + <const name="BAR" value="true"/> + <var name="foo" value="false"/> + <env name="foo" value="true"/> + <post name="foo" value="bar"/> + <get name="foo" value="bar"/> + <cookie name="foo" value="bar"/> + <server name="foo" value="bar"/> + <files name="foo" value="bar"/> + <request name="foo" value="bar"/> + </php> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="configuration.xml" + parse="xml" + xpointer="xpointer(/phpunit/selenium)" /> +</phpunit> + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/expectedFileFormat.txt b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/expectedFileFormat.txt @@ -0,0 +1 @@ +FOO diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/foo.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/foo.xml @@ -0,0 +1 @@ +<foo/> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureAttributesAreSameButValuesAreNot.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureAttributesAreSameButValuesAreNot.xml @@ -0,0 +1,10 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image xmlns:xlink="notthesame" xlink:href="Pictures/kristian.jpg"/> + </draw:frame> + <text:p text:style-name="Text">Image <text:sequence xmlns:style="notthesame" text:ref-name="refImage1" style:num-format="1" text:formula="ooow:Image+1" text:name="Image">1</text:sequence>: Dette er en test caption</text:p> + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureExpected.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureExpected.xml @@ -0,0 +1,10 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Pictures/kristian.jpg"/> + </draw:frame> + <text:p text:style-name="Text">Image <text:sequence xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" text:ref-name="refImage1" style:num-format="1" text:formula="ooow:Image+1" text:name="Image">1</text:sequence>: Dette er en test caption</text:p> + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIgnoreTextNodes.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIgnoreTextNodes.xml @@ -0,0 +1,13 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + textnode + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Pictures/kristian.jpg"/> textnode + </draw:frame> + textnode + <text:p text:style-name="Text">Image <text:sequence xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" text:ref-name="refImage1" style:num-format="1" text:formula="ooow:Image+1" text:name="Image">1</text:sequence>: Dette er en test caption</text:p> + textnode + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIsSameButDataIsNot.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureIsSameButDataIsNot.xml @@ -0,0 +1,10 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Pictures/kristian.jpg"/> + </draw:frame> + <text:p text:style-name="Text">Image is not the same <text:sequence xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" text:ref-name="refImage1" style:num-format="1" text:formula="ooow:Image+1" text:name="Image">1</text:sequence>: Dette er en test caption</text:p> + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfAttributes.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfAttributes.xml @@ -0,0 +1,10 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image/> + </draw:frame> + <text:p text:style-name="Text">Image <text:sequence xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" text:ref-name="refImage1" style:num-format="1" text:formula="ooow:Image+1" text:name="Image">1</text:sequence>: Dette er en test caption</text:p> + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfNodes.xml b/libs/php-ssh/vendor/phpunit/phpunit/Tests/_files/structureWrongNumberOfNodes.xml @@ -0,0 +1,9 @@ +<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"> + <draw:frame xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" svg:width="12.567708175cm" svg:height="16.848541467cm" draw:style-name="Frame"> + <draw:text-box> + <draw:frame svg:width="12.567708175cm" svg:height="15.848541467cm" draw:style-name="Image"> + <draw:image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="Pictures/kristian.jpg"/> + </draw:frame> + </draw:text-box> + </draw:frame> +</text:p> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build.xml b/libs/php-ssh/vendor/phpunit/phpunit/build.xml @@ -0,0 +1,294 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="PHPUnit" default="build"> + <property name="php" value="php"/> + + <target name="build" + depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpdox"/> + + <target name="clean" description="Cleanup build artifacts"> + <delete dir="${basedir}/bin"/> + <delete dir="${basedir}/vendor"/> + <delete file="${basedir}/composer.lock"/> + <delete file="${basedir}/composer.phar"/> + <delete dir="${basedir}/build/api"/> + <delete dir="${basedir}/build/code-browser"/> + <delete dir="${basedir}/build/coverage"/> + <delete dir="${basedir}/build/logs"/> + <delete dir="${basedir}/build/pdepend"/> + <delete dir="${basedir}/build/phar"/> + + <delete> + <fileset dir="${basedir}/build"> + <include name="**/*.phar" /> + </fileset> + </delete> + </target> + + <target name="prepare" depends="clean,phpab" + description="Prepare for build"> + <mkdir dir="${basedir}/build/api"/> + <mkdir dir="${basedir}/build/code-browser"/> + <mkdir dir="${basedir}/build/coverage"/> + <mkdir dir="${basedir}/build/logs"/> + <mkdir dir="${basedir}/build/pdepend"/> + <mkdir dir="${basedir}/build/phpdox"/> + </target> + + <target name="phpab" description="Generate autoloader scripts"> + <exec executable="phpab"> + <arg value="--output" /> + <arg path="PHPUnit/Autoload.php" /> + <arg value="--template" /> + <arg path="PHPUnit/Autoload.php.in" /> + <arg value="--indent" /> + <arg value=" " /> + <arg path="PHPUnit" /> + </exec> + </target> + + <target name="lint"> + <apply executable="${php}" failonerror="true"> + <arg value="-l" /> + + <fileset dir="${basedir}/PHPUnit"> + <include name="**/*.php" /> + <modified /> + </fileset> + + <fileset dir="${basedir}/Tests"> + <include name="**/*.php" /> + <modified /> + </fileset> + </apply> + </target> + + <target name="phploc" description="Measure project size using PHPLOC"> + <exec executable="phploc"> + <arg value="--log-csv" /> + <arg value="${basedir}/build/logs/phploc.csv" /> + <arg value="--log-xml" /> + <arg value="${basedir}/build/logs/phploc.xml" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="pdepend" + description="Calculate software metrics using PHP_Depend"> + <exec executable="pdepend"> + <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /> + <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" /> + <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="phpmd" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHPUnit" /> + <arg value="text" /> + <arg value="${basedir}/build/phpmd.xml" /> + </exec> + </target> + + <target name="phpmd-ci" + description="Perform project mess detection using PHPMD"> + <exec executable="phpmd"> + <arg path="${basedir}/PHPUnit" /> + <arg value="xml" /> + <arg value="${basedir}/build/phpmd.xml" /> + <arg value="--reportfile" /> + <arg value="${basedir}/build/logs/pmd.xml" /> + </exec> + </target> + + <target name="phpcs" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs"> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHPUnit" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcs-ci" + description="Find coding standard violations using PHP_CodeSniffer"> + <exec executable="phpcs" output="/dev/null"> + <arg value="--report=checkstyle" /> + <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" /> + <arg value="--standard=${basedir}/build/PHPCS" /> + <arg value="--extensions=php" /> + <arg value="--ignore=Autoload.php" /> + <arg path="${basedir}/PHPUnit" /> + <arg path="${basedir}/Tests" /> + </exec> + </target> + + <target name="phpcpd" description="Find duplicate code using PHPCPD"> + <exec executable="phpcpd"> + <arg value="--log-pmd" /> + <arg value="${basedir}/build/logs/pmd-cpd.xml" /> + <arg path="${basedir}/PHPUnit" /> + </exec> + </target> + + <target name="phpunit" description="Run unit tests with PHPUnit"> + <exec executable="${php}" failonerror="true"> + <arg path="${basedir}/phpunit.php" /> + </exec> + </target> + + <target name="phpdox" + description="Generate software project documentation using phpDox"> + <exec executable="phpdox" /> + </target> + + <target name="phar" + description="Create PHAR archive of PHPUnit and all its dependencies" + depends="phar-prepare,phar-build"> + </target> + + <target name="phar-prepare" depends="clean"> + <mkdir dir="${basedir}/build/phar"/> + + <get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar"/> + + <exec executable="php"> + <arg value="composer.phar"/> + <arg value="install"/> + </exec> + + <copy file="${basedir}/composer.json" tofile="${basedir}/composer.json.bak"/> + + <exec executable="php"> + <arg value="composer.phar"/> + <arg value="require"/> + <arg value="phpunit/dbunit"/> + <arg value="1.3.*"/> + </exec> + + <exec executable="php"> + <arg value="composer.phar"/> + <arg value="require"/> + <arg value="phpunit/phpunit-selenium"/> + <arg value="1.3.*"/> + </exec> + + <exec executable="php"> + <arg value="composer.phar"/> + <arg value="require"/> + <arg value="phpunit/php-invoker"/> + <arg value="1.1.*"/> + </exec> + + <move file="${basedir}/composer.json.bak" tofile="${basedir}/composer.json"/> + + <copy todir="${basedir}/build/phar/php-code-coverage"> + <fileset dir="${basedir}/vendor/phpunit/php-code-coverage/PHP"> + <include name="**/*" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/php-file-iterator"> + <fileset dir="${basedir}/vendor/phpunit/php-file-iterator/File"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/php-text-template"> + <fileset dir="${basedir}/vendor/phpunit/php-text-template/Text"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/php-timer"> + <fileset dir="${basedir}/vendor/phpunit/php-timer/PHP"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/php-token-stream"> + <fileset dir="${basedir}/vendor/phpunit/php-token-stream/PHP"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/phpunit-mock-objects"> + <fileset dir="${basedir}/vendor/phpunit/phpunit-mock-objects/PHPUnit"> + <include name="**/*" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/symfony"> + <fileset dir="${basedir}/vendor/symfony"> + <include name="**/*.php" /> + <exclude name="**/Tests/**" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/pear"> + <fileset dir="${basedir}/vendor/pear-pear.php.net"> + <include name="**/*.php" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/dbunit"> + <fileset dir="${basedir}/vendor/phpunit/dbunit/PHPUnit"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/php-invoker"> + <fileset dir="${basedir}/vendor/phpunit/php-invoker/PHP"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <copy todir="${basedir}/build/phar/phpunit-selenium"> + <fileset dir="${basedir}/vendor/phpunit/phpunit-selenium/PHPUnit"> + <include name="**/*.php" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + </target> + + <target name="phar-build"> + <exec executable="bash" outputproperty="version"> + <arg value="-c" /> + <arg value="${basedir}/phpunit.php --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'" /> + </exec> + + <copy todir="${basedir}/build/phar/phpunit"> + <fileset dir="${basedir}/PHPUnit"> + <include name="**/*.php" /> + <include name="**/*.tpl*" /> + <exclude name="**/Autoload.*" /> + </fileset> + </copy> + + <exec executable="phpab"> + <arg value="--all" /> + <arg value="--phar" /> + <arg value="--output" /> + <arg path="${basedir}/build/phpunit-${version}.phar" /> + <arg value="--template" /> + <arg path="${basedir}/build/phar-autoload.php.in" /> + <arg value="--indent" /> + <arg value=" " /> + <arg path="${basedir}/build/phar" /> + </exec> + + <chmod file="${basedir}/build/phpunit-${version}.phar" perm="ugo+rx"/> + </target> +</project> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php b/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -0,0 +1,23 @@ +<?php +class PHPCS_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff +{ + public function __construct() + { + parent::__construct(true); + } + + protected function getPatterns() + { + return array( + 'do {EOL...} while (...);EOL', + 'while (...) {EOL', + 'for (...) {EOL', + 'if (...) {EOL', + 'foreach (...) {EOL', + // Decide whether to use '}EOLelse' or '} else' + #'}EOLelse if (...) {EOL', + #'}EOLelse {EOL', + 'do {EOL', + ); + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php b/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php @@ -0,0 +1,22 @@ +<?php +class PHPCS_Sniffs_Whitespace_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff +{ + public function register() + { + return array(T_STRING_CONCAT); + } + + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE || + $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { + + $phpcsFile->addError( + 'Concatenation operator must be surrounded by whitespace', + $stackPtr + ); + } + } +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/ruleset.xml b/libs/php-ssh/vendor/phpunit/phpunit/build/PHPCS/ruleset.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<ruleset name="Sebastian"> + <description>Sebastian Bergmann's coding standard</description> + + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> + + <rule ref="Generic.Commenting.Todo"/> + + <rule ref="Generic.ControlStructures.InlineControlStructure"/> + + <rule ref="Generic.Files.LineEndings"/> + + <rule ref="Generic.Formatting.DisallowMultipleStatements"/> + <rule ref="Generic.Formatting.NoSpaceAfterCast"/> + + <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/> + <rule ref="PEAR.Functions.ValidDefaultValue"/> + + <rule ref="Generic.NamingConventions.ConstructorName"/> + <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> + <rule ref="PEAR.NamingConventions.ValidClassName"/> + + <rule ref="Generic.PHP.DisallowShortOpenTag"/> + <rule ref="Generic.PHP.NoSilencedErrors"/> + <rule ref="Generic.PHP.UpperCaseConstant"/> + + <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> + <rule ref="Generic.WhiteSpace.ScopeIndent"/> + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/assertions.php b/libs/php-ssh/vendor/phpunit/phpunit/build/assertions.php @@ -0,0 +1,65 @@ +#!/usr/bin/env php +<?php +require dirname(__DIR__) . '/PHPUnit/Autoload.php'; + +$buffer = ''; +$class = new ReflectionClass('PHPUnit_Framework_Assert'); +$methods = array(); + +foreach ($class->getMethods() as $method) { + $docblock = $method->getDocComment(); + $name = $method->getName(); + + if (strpos($name, 'assert') === 0 || + strpos($docblock, '@return PHPUnit_Framework_Constraint') !== FALSE) { + $methods[$name] = array( + 'class' => 'PHPUnit_Framework_Assert', + 'docblock' => $docblock, + 'sigDecl' => str_replace( + array('= false', '= true'), + array('= FALSE', '= TRUE'), + PHPUnit_Util_Class::getMethodParameters($method) + ), + 'sigCall' => PHPUnit_Util_Class::getMethodParameters($method, TRUE) + ); + } +} + +$class = new ReflectionClass('PHPUnit_Framework_TestCase'); + +foreach ($class->getMethods() as $method) { + $docblock = $method->getDocComment(); + $name = $method->getName(); + + if (strpos($docblock, '@return PHPUnit_Framework_MockObject_Matcher') !== FALSE || + strpos($docblock, '@return PHPUnit_Framework_MockObject_Stub') !== FALSE) { + $methods[$name] = array( + 'class' => 'PHPUnit_Framework_TestCase', + 'docblock' => $docblock, + 'sigDecl' => str_replace( + array('= false', '= true'), + array('= FALSE', '= TRUE'), + PHPUnit_Util_Class::getMethodParameters($method) + ), + 'sigCall' => PHPUnit_Util_Class::getMethodParameters($method, TRUE) + ); + } +} + +ksort($methods); + +foreach ($methods as $name => $data) { + $buffer .= sprintf( + "\n\n%s\nfunction %s(%s)\n{\n return call_user_func_array(\n '%s::%s',\n func_get_args()\n );\n}", + str_replace(' ', '', $data['docblock']), + $name, + $data['sigDecl'], + $data['class'], + $name, + $data['sigCall'] + ); +} + +$template = new Text_Template(dirname(__DIR__) . '/PHPUnit/Framework/Assert/Functions.php.in'); +$template->setVar(array('functions' => $buffer)); +$template->renderTo(dirname(__DIR__) . '/PHPUnit/Framework/Assert/Functions.php'); diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/phar-autoload.php.in b/libs/php-ssh/vendor/phpunit/phpunit/build/phar-autoload.php.in @@ -0,0 +1,37 @@ +#!/usr/bin/env php +<?php +if ($GLOBALS['_SERVER']['SCRIPT_NAME'] != '-') { + $phar = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']); +} else { + $files = get_included_files(); + $phar = $files[0]; +} + +define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', $phar)); + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + } + + $class = strtolower($class); + + if (isset($classes[$class])) { + require 'phar://___PHAR___' . $classes[$class]; + } + } +); + +Phar::mapPhar('___PHAR___'); + +if ($GLOBALS['_SERVER']['SCRIPT_NAME'] != '-') { + PHPUnit_TextUI_Command::main(); +} + +__HALT_COMPILER(); diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/phpmd.xml b/libs/php-ssh/vendor/phpunit/phpunit/build/phpmd.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> + +<ruleset name="Sebastian" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description>Sebastian Bergmann's ruleset</description> + + <rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> + <rule ref="rulesets/codesize.xml/NPathComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> + <rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> + <rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> + + <rule ref="rulesets/design.xml/EvalExpression" /> + <rule ref="rulesets/design.xml/ExitExpression" /> + <rule ref="rulesets/design.xml/GotoStatement" /> + + <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> + + <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> + <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> + <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> +</ruleset> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/build/travis-ci.xml b/libs/php-ssh/vendor/phpunit/phpunit/build/travis-ci.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://phpunit.de/phpunit.xsd" + backupGlobals="false" + colors="true" + verbose="true"> + <testsuites> + <testsuite name="PHPUnit"> + <directory suffix="Test.php">../Tests/Framework</directory> + <directory suffix=".phpt">../Tests/Framework/MockObject</directory> + <directory suffix="Test.php">../Tests/Extensions</directory> + <directory suffix=".phpt">../Tests/Regression</directory> + <directory suffix="Test.php">../Tests/Runner</directory> + <directory suffix=".phpt">../Tests/TextUI</directory> + <directory suffix="Test.php">../Tests/Util</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-text" target="php://stdout"/> + </logging> + + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">../PHPUnit</directory> + <exclude> + <file>../PHPUnit/Autoload.php</file> + <file>../PHPUnit/Framework/Assert/Functions.php</file> + </exclude> + </whitelist> + </filter> + + <php> + <const name="PHPUNIT_TESTSUITE" value="true"/> + </php> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/composer.json b/libs/php-ssh/vendor/phpunit/phpunit/composer.json @@ -0,0 +1,67 @@ +{ + "name": "phpunit/phpunit", + "description": "The PHP Unit Testing framework.", + "type": "library", + "keywords": [ + "phpunit", + "xunit", + "testing" + ], + "homepage": "http://www.phpunit.de/", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "irc": "irc://irc.freenode.net/phpunit" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", + "symfony/yaml": "~2.0", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*" + }, + "require-dev": { + "pear-pear.php.net/pear": "1.9.4" + }, + "repositories": [ + { + "type": "pear", + "url": "http://pear.php.net" + } + ], + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "composer/bin/phpunit" + ], + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "include-path": [ + "", + "../../symfony/yaml/" + ] +} diff --git a/libs/php-ssh/vendor/phpunit/phpunit/composer/bin/phpunit b/libs/php-ssh/vendor/phpunit/phpunit/composer/bin/phpunit @@ -0,0 +1,63 @@ +#!/usr/bin/env php +<?php +/* PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main'); + +$files = array( + __DIR__ . '/../../vendor/autoload.php', + __DIR__ . '/../../../../autoload.php' +); + +foreach ($files as $file) { + if (file_exists($file)) { + require $file; + + define('PHPUNIT_COMPOSER_INSTALL', $file); + + break; + } +} + +if (!defined('PHPUNIT_COMPOSER_INSTALL')) { + die( + 'You need to set up the project dependencies using the following commands:' . PHP_EOL . + 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . + 'php composer.phar install' . PHP_EOL + ); +} + +PHPUnit_TextUI_Command::main(); diff --git a/libs/php-ssh/vendor/phpunit/phpunit/phpdox.xml.dist b/libs/php-ssh/vendor/phpunit/phpunit/phpdox.xml.dist @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8" ?> +<phpdox xmlns="http://phpdox.net/config"> + <project name="PHPUnit" source="PHPUnit" workdir="build/phpdox"> + <collector publiconly="false"> + <include mask="*.php" /> + <exclude mask="*Autoload.php" /> + </collector> + + <generator output="build"> + <enrich base="${basedir}/build/logs"> + <source type="build" /> + <source type="git" /> + <source type="phploc" /> + <source type="checkstyle" /> + <source type="pmd" /> + </enrich> + + <build engine="html" enabled="true" output="api"> + <file extension="html" /> + </build> + </generator> + </project> +</phpdox> + diff --git a/libs/php-ssh/vendor/phpunit/phpunit/phpunit.php b/libs/php-ssh/vendor/phpunit/phpunit/phpunit.php @@ -0,0 +1,46 @@ +#!/usr/bin/env php +<?php +/* PHPUnit + * + * Copyright (c) 2001-2014, Sebastian Bergmann <sebastian@phpunit.de>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main'); + +if (strpos('@php_bin@', '@php_bin') === 0) { + require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php'; +} else { + require '@php_dir@' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . 'Autoload.php'; +} + +PHPUnit_TextUI_Command::main(); diff --git a/libs/php-ssh/vendor/phpunit/phpunit/phpunit.xml.dist b/libs/php-ssh/vendor/phpunit/phpunit/phpunit.xml.dist @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd" + bootstrap="PHPUnit/Autoload.php" + backupGlobals="false" + verbose="true"> + <testsuites> + <testsuite name="PHPUnit"> + <directory suffix="Test.php">Tests/Framework</directory> + <directory suffix=".phpt">Tests/Framework/MockObject</directory> + <directory suffix="Test.php">Tests/Extensions</directory> + <directory suffix=".phpt">Tests/Regression</directory> + <directory suffix="Test.php">Tests/Runner</directory> + <directory suffix=".phpt">Tests/TextUI</directory> + <directory suffix="Test.php">Tests/Util</directory> + </testsuite> + </testsuites> + + <logging> + <log type="coverage-html" target="build/coverage" title="PHPUnit" + charset="UTF-8" yui="true" highlight="true" + lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="build/logs/clover.xml"/> + <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> + </logging> + + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">PHPUnit</directory> + <exclude> + <file>PHPUnit/Autoload.php</file> + <file>PHPUnit/Framework/Assert/Functions.php</file> + </exclude> + </whitelist> + </filter> + + <php> + <const name="PHPUNIT_TESTSUITE" value="true"/> + </php> +</phpunit> diff --git a/libs/php-ssh/vendor/phpunit/phpunit/phpunit.xsd b/libs/php-ssh/vendor/phpunit/phpunit/phpunit.xsd @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:annotation> + <xs:documentation source="http://www.phpunit.de/manual/3.7/en/appendixes.configuration.html"> + This Schema file defines the rules by which the XML configuration file of PHPUnit 3.7 may be structured. + </xs:documentation> + <xs:appinfo source="http://www.phpunit.de/manual/current/en/appendixes.configuration.html"/> + </xs:annotation> + <xs:element name="phpunit" type="phpUnitType"> + <xs:annotation> + <xs:documentation>Root Element</xs:documentation> + </xs:annotation> + </xs:element> + <xs:complexType name="filtersType"> + <xs:choice> + <xs:sequence> + <xs:element name="blacklist" type="filterType"/> + <xs:element name="whitelist" type="whiteListType" minOccurs="0"/> + </xs:sequence> + <xs:sequence> + <xs:element name="whitelist" type="whiteListType"/> + </xs:sequence> + </xs:choice> + </xs:complexType> + <xs:complexType name="filterType"> + <xs:sequence> + <xs:group ref="pathGroup"/> + <xs:element name="exclude" maxOccurs="unbounded" minOccurs="0"> + <xs:complexType> + <xs:group ref="pathGroup"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + <xs:complexType name="whiteListType"> + <xs:complexContent> + <xs:extension base="filterType"> + <xs:attribute name="processUncoveredFilesFromWhitelist" default="true" type="xs:boolean"/> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="groupsType"> + <xs:choice> + <xs:sequence> + <xs:element name="include" type="groupType"/> + <xs:element name="exclude" type="groupType" minOccurs="0"/> + </xs:sequence> + <xs:sequence> + <xs:element name="exclude" type="groupType"/> + </xs:sequence> + </xs:choice> + </xs:complexType> + <xs:complexType name="groupType"> + <xs:sequence> + <xs:element name="group" type="xs:string" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="listenersType"> + <xs:sequence> + <xs:element name="listener" type="objectType" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="objectType"> + <xs:sequence> + <xs:element name="arguments" minOccurs="0"> + <xs:complexType> + <xs:group ref="argumentsGroup"/> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="class" type="xs:string" use="required"/> + <xs:attribute name="file" type="xs:anyURI"/> + </xs:complexType> + <xs:complexType name="arrayType"> + <xs:sequence> + <xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="argumentType"> + <xs:group ref="argumentChoice"/> + <xs:attribute name="key" use="required"/> + </xs:complexType> + <xs:group name="argumentsGroup"> + <xs:sequence> + <xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="null" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:group> + <xs:group name="argumentChoice"> + <xs:choice> + <xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="null" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + </xs:choice> + </xs:group> + <xs:complexType name="loggersType"> + <xs:sequence> + <xs:element name="log" type="loggerType" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="loggerType"> + <xs:attribute name="type"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="coverage-html"/> + <xs:enumeration value="coverage-clover"/> + <xs:enumeration value="json"/> + <xs:enumeration value="plain"/> + <xs:enumeration value="tap"/> + <xs:enumeration value="junit"/> + <xs:enumeration value="testdox-html"/> + <xs:enumeration value="testdox-text"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="target" type="xs:anyURI"/> + <xs:attribute name="title" type="xs:string"/> + <xs:attribute name="charset" type="xs:string" default="UTF-8"/> + <xs:attribute name="yui" type="xs:boolean" default="true"/> + <xs:attribute name="highlight" type="xs:boolean" default="false"/> + <xs:attribute name="lowUpperBound" type="xs:nonNegativeInteger" default="35"/> + <xs:attribute name="highLowerBound" type="xs:nonNegativeInteger" default="70"/> + <xs:attribute name="logIncompleteSkipped" type="xs:boolean" default="false"/> + </xs:complexType> + <xs:group name="pathGroup"> + <xs:sequence> + <xs:element name="directory" type="directoryFilterType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="file" type="fileFilterType" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:group> + <xs:complexType name="directoryFilterType"> + <xs:simpleContent> + <xs:extension base="xs:anyURI"> + <xs:attribute type="xs:string" name="suffix" default="Test.php"/> + <xs:attributeGroup ref="phpVersionGroup"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="fileFilterType"> + <xs:simpleContent> + <xs:extension base="xs:anyURI"> + <xs:attributeGroup ref="phpVersionGroup"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:attributeGroup name="phpVersionGroup"> + <xs:attribute name="phpVersion" type="xs:string" default="5.3.0"/> + <xs:attribute name="phpVersionOperator" type="xs:string" default="&gt;="/> + </xs:attributeGroup> + <xs:complexType name="phpType"> + <xs:sequence> + <xs:element name="includePath" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="ini" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="const" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="var" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="env" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="post" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="get" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="cookie" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="server" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="files" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="request" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="namedValueType"> + <xs:attribute name="name" use="required" type="xs:string"/> + <xs:attribute name="value" use="required" type="xs:anySimpleType"/> + </xs:complexType> + <xs:complexType name="phpUnitType"> + <xs:annotation> + <xs:documentation>The main type specifying the document structure</xs:documentation> + </xs:annotation> + <xs:group ref="configGroup"/> + <xs:attributeGroup ref="configAttributeGroup"/> + </xs:complexType> + <xs:attributeGroup name="configAttributeGroup"> + <xs:attribute name="backupGlobals" type="xs:boolean" default="true"/> + <xs:attribute name="backupStaticAttributes" type="xs:boolean" default="false"/> + <xs:attribute name="bootstrap" type="xs:anyURI"/> + <xs:attribute name="cacheTokens" type="xs:boolean"/> + <xs:attribute name="colors" type="xs:boolean" default="false"/> + <xs:attribute name="convertErrorsToExceptions" type="xs:boolean" default="true"/> + <xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/> + <xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/> + <xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/> + <xs:attribute name="mapTestClassNameToCoveredClassName" type="xs:boolean" default="false"/> + <xs:attribute name="printerClass" type="xs:string" default="PHPUnit_TextUI_ResultPrinter"/> + <xs:attribute name="printerFile" type="xs:anyURI"/> + <xs:attribute name="processIsolation" type="xs:boolean" default="false"/> + <xs:attribute name="stopOnError" type="xs:boolean" default="false"/> + <xs:attribute name="stopOnFailure" type="xs:boolean" default="false"/> + <xs:attribute name="stopOnIncomplete" type="xs:boolean" default="false"/> + <xs:attribute name="stopOnSkipped" type="xs:boolean" default="false"/> + <xs:attribute name="strict" type="xs:boolean" default="false"/> + <xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit_Runner_StandardTestSuiteLoader"/> + <xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/> + <xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/> + <xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/> + <xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/> + <xs:attribute name="verbose" type="xs:boolean" default="false"/> + </xs:attributeGroup> + <xs:group name="configGroup"> + <xs:all> + <xs:element ref="testSuiteFacet" minOccurs="0"/> + <xs:element name="groups" type="groupsType" minOccurs="0"/> + <xs:element name="filter" type="filtersType" minOccurs="0"/> + <xs:element name="logging" type="loggersType" minOccurs="0"/> + <xs:element name="listeners" type="listenersType" minOccurs="0"/> + <xs:element name="php" type="phpType" minOccurs="0"/> + <xs:element name="selenium" type="seleniumType" minOccurs="0"/> + </xs:all> + </xs:group> + <xs:complexType name="seleniumType"> + <xs:sequence> + <xs:element name="browser" type="browserType"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="browserType"> + <xs:attribute name="name" type="xs:string"/> + <xs:attribute name="browser" type="xs:string"/> + <xs:attribute name="host" type="xs:anyURI"/> + <xs:attribute name="port" type="xs:nonNegativeInteger"/> + <xs:attribute name="timeout" type="xs:nonNegativeInteger"/> + </xs:complexType> + <xs:element name="testSuiteFacet" abstract="true"/> + <xs:element name="testsuite" type="testSuiteType" substitutionGroup="testSuiteFacet"/> + <xs:element name="testsuites" type="testSuitesType" substitutionGroup="testSuiteFacet"/> + <xs:complexType name="testSuitesType"> + <xs:sequence> + <xs:element name="testsuite" type="testSuiteType"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="testSuiteType"> + <xs:sequence> + <xs:group ref="pathGroup"/> + <xs:element name="exclude" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="name" type="xs:string" use="required"/> + </xs:complexType> +</xs:schema> diff --git a/libs/php-ssh/vendor/symfony/filesystem/.gitignore b/libs/php-ssh/vendor/symfony/filesystem/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/libs/php-ssh/vendor/symfony/filesystem/CHANGELOG.md b/libs/php-ssh/vendor/symfony/filesystem/CHANGELOG.md @@ -0,0 +1,28 @@ +CHANGELOG +========= + +2.6.0 +----- + + * added LockHandler + +2.3.12 +------ + + * deprecated dumpFile() file mode argument. + +2.3.0 +----- + + * added the dumpFile() method to atomically write files + +2.2.0 +----- + + * added a delete option for the mirror() method + +2.1.0 +----- + + * 24eb396 : BC Break : mkdir() function now throws exception in case of failure instead of returning Boolean value + * created the component diff --git a/libs/php-ssh/vendor/symfony/filesystem/Exception/ExceptionInterface.php b/libs/php-ssh/vendor/symfony/filesystem/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Romain Neutron <imprec@gmail.com> + * + * @api + */ +interface ExceptionInterface +{ +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Exception/FileNotFoundException.php b/libs/php-ssh/vendor/symfony/filesystem/Exception/FileNotFoundException.php @@ -0,0 +1,34 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * Exception class thrown when a file couldn't be found. + * + * @author Fabien Potencier <fabien@symfony.com> + * @author Christian Gärtner <christiangaertner.film@googlemail.com> + */ +class FileNotFoundException extends IOException +{ + public function __construct($message = null, $code = 0, \Exception $previous = null, $path = null) + { + if (null === $message) { + if (null === $path) { + $message = 'File could not be found.'; + } else { + $message = sprintf('File "%s" could not be found.', $path); + } + } + + parent::__construct($message, $code, $previous, $path); + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Exception/IOException.php b/libs/php-ssh/vendor/symfony/filesystem/Exception/IOException.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * Exception class thrown when a filesystem operation failure happens. + * + * @author Romain Neutron <imprec@gmail.com> + * @author Christian Gärtner <christiangaertner.film@googlemail.com> + * @author Fabien Potencier <fabien@symfony.com> + * + * @api + */ +class IOException extends \RuntimeException implements IOExceptionInterface +{ + private $path; + + public function __construct($message, $code = 0, \Exception $previous = null, $path = null) + { + $this->path = $path; + + parent::__construct($message, $code, $previous); + } + + /** + * {@inheritdoc} + */ + public function getPath() + { + return $this->path; + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Exception/IOExceptionInterface.php b/libs/php-ssh/vendor/symfony/filesystem/Exception/IOExceptionInterface.php @@ -0,0 +1,27 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Exception; + +/** + * IOException interface for file and input/output stream related exceptions thrown by the component. + * + * @author Christian Gärtner <christiangaertner.film@googlemail.com> + */ +interface IOExceptionInterface extends ExceptionInterface +{ + /** + * Returns the associated path for the exception. + * + * @return string The path. + */ + public function getPath(); +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Filesystem.php b/libs/php-ssh/vendor/symfony/filesystem/Filesystem.php @@ -0,0 +1,499 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem; + +use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Exception\FileNotFoundException; + +/** + * Provides basic utility to manipulate the file system. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Filesystem +{ + /** + * Copies a file. + * + * This method only copies the file if the origin file is newer than the target file. + * + * By default, if the target already exists, it is not overridden. + * + * @param string $originFile The original filename + * @param string $targetFile The target filename + * @param bool $override Whether to override an existing file or not + * + * @throws FileNotFoundException When originFile doesn't exist + * @throws IOException When copy fails + */ + public function copy($originFile, $targetFile, $override = false) + { + if (stream_is_local($originFile) && !is_file($originFile)) { + throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile); + } + + $this->mkdir(dirname($targetFile)); + + $doCopy = true; + if (!$override && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) { + $doCopy = filemtime($originFile) > filemtime($targetFile); + } + + if ($doCopy) { + // https://bugs.php.net/bug.php?id=64634 + if (false === $source = @fopen($originFile, 'r')) { + throw new IOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading.', $originFile, $targetFile), 0, null, $originFile); + } + + // Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default + if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) { + throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile); + } + + $bytesCopied = stream_copy_to_stream($source, $target); + fclose($source); + fclose($target); + unset($source, $target); + + if (!is_file($targetFile)) { + throw new IOException(sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile); + } + + // Like `cp`, preserve executable permission bits + @chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111)); + + if (stream_is_local($originFile) && $bytesCopied !== ($bytesOrigin = filesize($originFile))) { + throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile); + } + } + } + + /** + * Creates a directory recursively. + * + * @param string|array|\Traversable $dirs The directory path + * @param int $mode The directory mode + * + * @throws IOException On any directory creation failure + */ + public function mkdir($dirs, $mode = 0777) + { + foreach ($this->toIterator($dirs) as $dir) { + if (is_dir($dir)) { + continue; + } + + if (true !== @mkdir($dir, $mode, true)) { + $error = error_get_last(); + if (!is_dir($dir)) { + // The directory was not created by a concurrent process. Let's throw an exception with a developer friendly error message if we have one + if ($error) { + throw new IOException(sprintf('Failed to create "%s": %s.', $dir, $error['message']), 0, null, $dir); + } + throw new IOException(sprintf('Failed to create "%s"', $dir), 0, null, $dir); + } + } + } + } + + /** + * Checks the existence of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check + * + * @return bool true if the file exists, false otherwise + */ + public function exists($files) + { + foreach ($this->toIterator($files) as $file) { + if (!file_exists($file)) { + return false; + } + } + + return true; + } + + /** + * Sets access and modification time of file. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create + * @param int $time The touch time as a Unix timestamp + * @param int $atime The access time as a Unix timestamp + * + * @throws IOException When touch fails + */ + public function touch($files, $time = null, $atime = null) + { + foreach ($this->toIterator($files) as $file) { + $touch = $time ? @touch($file, $time, $atime) : @touch($file); + if (true !== $touch) { + throw new IOException(sprintf('Failed to touch "%s".', $file), 0, null, $file); + } + } + } + + /** + * Removes files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove + * + * @throws IOException When removal fails + */ + public function remove($files) + { + $files = iterator_to_array($this->toIterator($files)); + $files = array_reverse($files); + foreach ($files as $file) { + if (!file_exists($file) && !is_link($file)) { + continue; + } + + if (is_dir($file) && !is_link($file)) { + $this->remove(new \FilesystemIterator($file)); + + if (true !== @rmdir($file)) { + throw new IOException(sprintf('Failed to remove directory "%s".', $file), 0, null, $file); + } + } else { + // https://bugs.php.net/bug.php?id=52176 + if ('\\' === DIRECTORY_SEPARATOR && is_dir($file)) { + if (true !== @rmdir($file)) { + throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file); + } + } else { + if (true !== @unlink($file)) { + throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file); + } + } + } + } + } + + /** + * Change mode for an array of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode + * @param int $mode The new mode (octal) + * @param int $umask The mode mask (octal) + * @param bool $recursive Whether change the mod recursively or not + * + * @throws IOException When the change fail + */ + public function chmod($files, $mode, $umask = 0000, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chmod(new \FilesystemIterator($file), $mode, $umask, true); + } + if (true !== @chmod($file, $mode & ~$umask)) { + throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file); + } + } + } + + /** + * Change the owner of an array of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner + * @param string $user The new owner user name + * @param bool $recursive Whether change the owner recursively or not + * + * @throws IOException When the change fail + */ + public function chown($files, $user, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chown(new \FilesystemIterator($file), $user, true); + } + if (is_link($file) && function_exists('lchown')) { + if (true !== @lchown($file, $user)) { + throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file); + } + } else { + if (true !== @chown($file, $user)) { + throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file); + } + } + } + } + + /** + * Change the group of an array of files or directories. + * + * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group + * @param string $group The group name + * @param bool $recursive Whether change the group recursively or not + * + * @throws IOException When the change fail + */ + public function chgrp($files, $group, $recursive = false) + { + foreach ($this->toIterator($files) as $file) { + if ($recursive && is_dir($file) && !is_link($file)) { + $this->chgrp(new \FilesystemIterator($file), $group, true); + } + if (is_link($file) && function_exists('lchgrp')) { + if (true !== @lchgrp($file, $group) || (defined('HHVM_VERSION') && !posix_getgrnam($group))) { + throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file); + } + } else { + if (true !== @chgrp($file, $group)) { + throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file); + } + } + } + } + + /** + * Renames a file or a directory. + * + * @param string $origin The origin filename or directory + * @param string $target The new filename or directory + * @param bool $overwrite Whether to overwrite the target if it already exists + * + * @throws IOException When target file or directory already exists + * @throws IOException When origin cannot be renamed + */ + public function rename($origin, $target, $overwrite = false) + { + // we check that target does not exist + if (!$overwrite && is_readable($target)) { + throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); + } + + if (true !== @rename($origin, $target)) { + throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target); + } + } + + /** + * Creates a symbolic link or copy a directory. + * + * @param string $originDir The origin directory path + * @param string $targetDir The symbolic link name + * @param bool $copyOnWindows Whether to copy files if on Windows + * + * @throws IOException When symlink fails + */ + public function symlink($originDir, $targetDir, $copyOnWindows = false) + { + if ('\\' === DIRECTORY_SEPARATOR && $copyOnWindows) { + $this->mirror($originDir, $targetDir); + + return; + } + + $this->mkdir(dirname($targetDir)); + + $ok = false; + if (is_link($targetDir)) { + if (readlink($targetDir) != $originDir) { + $this->remove($targetDir); + } else { + $ok = true; + } + } + + if (!$ok && true !== @symlink($originDir, $targetDir)) { + $report = error_get_last(); + if (is_array($report)) { + if ('\\' === DIRECTORY_SEPARATOR && false !== strpos($report['message'], 'error code(1314)')) { + throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', 0, null, $targetDir); + } + } + throw new IOException(sprintf('Failed to create symbolic link from "%s" to "%s".', $originDir, $targetDir), 0, null, $targetDir); + } + } + + /** + * Given an existing path, convert it to a path relative to a given starting path. + * + * @param string $endPath Absolute path of target + * @param string $startPath Absolute path where traversal begins + * + * @return string Path of target relative to starting path + */ + public function makePathRelative($endPath, $startPath) + { + // Normalize separators on Windows + if ('\\' === DIRECTORY_SEPARATOR) { + $endPath = str_replace('\\', '/', $endPath); + $startPath = str_replace('\\', '/', $startPath); + } + + // Split the paths into arrays + $startPathArr = explode('/', trim($startPath, '/')); + $endPathArr = explode('/', trim($endPath, '/')); + + // Find for which directory the common path stops + $index = 0; + while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) { + ++$index; + } + + // Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels) + $depth = count($startPathArr) - $index; + + // Repeated "../" for each level need to reach the common path + $traverser = str_repeat('../', $depth); + + $endPathRemainder = implode('/', array_slice($endPathArr, $index)); + + // Construct $endPath from traversing to the common path, then to the remaining $endPath + $relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : ''); + + return '' === $relativePath ? './' : $relativePath; + } + + /** + * Mirrors a directory to another. + * + * @param string $originDir The origin directory + * @param string $targetDir The target directory + * @param \Traversable $iterator A Traversable instance + * @param array $options An array of boolean options + * Valid options are: + * - $options['override'] Whether to override an existing file on copy or not (see copy()) + * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink()) + * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) + * + * @throws IOException When file type is unknown + */ + public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array()) + { + $targetDir = rtrim($targetDir, '/\\'); + $originDir = rtrim($originDir, '/\\'); + + // Iterate in destination folder to remove obsolete entries + if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) { + $deleteIterator = $iterator; + if (null === $deleteIterator) { + $flags = \FilesystemIterator::SKIP_DOTS; + $deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST); + } + foreach ($deleteIterator as $file) { + $origin = str_replace($targetDir, $originDir, $file->getPathname()); + if (!$this->exists($origin)) { + $this->remove($file); + } + } + } + + $copyOnWindows = false; + if (isset($options['copy_on_windows'])) { + $copyOnWindows = $options['copy_on_windows']; + } + + if (null === $iterator) { + $flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS; + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); + } + + if ($this->exists($originDir)) { + $this->mkdir($targetDir); + } + + foreach ($iterator as $file) { + $target = str_replace($originDir, $targetDir, $file->getPathname()); + + if ($copyOnWindows) { + if (is_link($file) || is_file($file)) { + $this->copy($file, $target, isset($options['override']) ? $options['override'] : false); + } elseif (is_dir($file)) { + $this->mkdir($target); + } else { + throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); + } + } else { + if (is_link($file)) { + $this->symlink($file->getRealPath(), $target); + } elseif (is_dir($file)) { + $this->mkdir($target); + } elseif (is_file($file)) { + $this->copy($file, $target, isset($options['override']) ? $options['override'] : false); + } else { + throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); + } + } + } + } + + /** + * Returns whether the file path is an absolute path. + * + * @param string $file A file path + * + * @return bool + */ + public function isAbsolutePath($file) + { + return (strspn($file, '/\\', 0, 1) + || (strlen($file) > 3 && ctype_alpha($file[0]) + && substr($file, 1, 1) === ':' + && (strspn($file, '/\\', 2, 1)) + ) + || null !== parse_url($file, PHP_URL_SCHEME) + ); + } + + /** + * Atomically dumps content into a file. + * + * @param string $filename The file to be written to. + * @param string $content The data to write into the file. + * @param null|int $mode The file mode (octal). If null, file permissions are not modified + * Deprecated since version 2.3.12, to be removed in 3.0. + * + * @throws IOException If the file cannot be written to. + */ + public function dumpFile($filename, $content, $mode = 0666) + { + $dir = dirname($filename); + + if (!is_dir($dir)) { + $this->mkdir($dir); + } elseif (!is_writable($dir)) { + throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir); + } + + $tmpFile = tempnam($dir, basename($filename)); + + if (false === @file_put_contents($tmpFile, $content)) { + throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename); + } + + $this->rename($tmpFile, $filename, true); + if (null !== $mode) { + if (func_num_args() > 2) { + @trigger_error('Support for modifying file permissions is deprecated since version 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED); + } + + $this->chmod($filename, $mode); + } + } + + /** + * @param mixed $files + * + * @return \Traversable + */ + private function toIterator($files) + { + if (!$files instanceof \Traversable) { + $files = new \ArrayObject(is_array($files) ? $files : array($files)); + } + + return $files; + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/LICENSE b/libs/php-ssh/vendor/symfony/filesystem/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2015 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/libs/php-ssh/vendor/symfony/filesystem/LockHandler.php b/libs/php-ssh/vendor/symfony/filesystem/LockHandler.php @@ -0,0 +1,114 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem; + +use Symfony\Component\Filesystem\Exception\IOException; + +/** + * LockHandler class provides a simple abstraction to lock anything by means of + * a file lock. + * + * A locked file is created based on the lock name when calling lock(). Other + * lock handlers will not be able to lock the same name until it is released + * (explicitly by calling release() or implicitly when the instance holding the + * lock is destroyed). + * + * @author Grégoire Pineau <lyrixx@lyrixx.info> + * @author Romain Neutron <imprec@gmail.com> + * @author Nicolas Grekas <p@tchwork.com> + */ +class LockHandler +{ + private $file; + private $handle; + + /** + * @param string $name The lock name + * @param string|null $lockPath The directory to store the lock. Default values will use temporary directory + * + * @throws IOException If the lock directory could not be created or is not writable + */ + public function __construct($name, $lockPath = null) + { + $lockPath = $lockPath ?: sys_get_temp_dir(); + + if (!is_dir($lockPath)) { + $fs = new Filesystem(); + $fs->mkdir($lockPath); + } + + if (!is_writable($lockPath)) { + throw new IOException(sprintf('The directory "%s" is not writable.', $lockPath), 0, null, $lockPath); + } + + $this->file = sprintf('%s/sf.%s.%s.lock', $lockPath, preg_replace('/[^a-z0-9\._-]+/i', '-', $name), hash('sha256', $name)); + } + + /** + * Lock the resource. + * + * @param bool $blocking wait until the lock is released + * + * @return bool Returns true if the lock was acquired, false otherwise + * + * @throws IOException If the lock file could not be created or opened + */ + public function lock($blocking = false) + { + if ($this->handle) { + return true; + } + + // Silence both userland and native PHP error handlers + $errorLevel = error_reporting(0); + set_error_handler('var_dump', 0); + + if (!$this->handle = fopen($this->file, 'r')) { + if ($this->handle = fopen($this->file, 'x')) { + chmod($this->file, 0444); + } elseif (!$this->handle = fopen($this->file, 'r')) { + usleep(100); // Give some time for chmod() to complete + $this->handle = fopen($this->file, 'r'); + } + } + restore_error_handler(); + error_reporting($errorLevel); + + if (!$this->handle) { + $error = error_get_last(); + throw new IOException($error['message'], 0, null, $this->file); + } + + // On Windows, even if PHP doc says the contrary, LOCK_NB works, see + // https://bugs.php.net/54129 + if (!flock($this->handle, LOCK_EX | ($blocking ? 0 : LOCK_NB))) { + fclose($this->handle); + $this->handle = null; + + return false; + } + + return true; + } + + /** + * Release the resource. + */ + public function release() + { + if ($this->handle) { + flock($this->handle, LOCK_UN | LOCK_NB); + fclose($this->handle); + $this->handle = null; + } + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/README.md b/libs/php-ssh/vendor/symfony/filesystem/README.md @@ -0,0 +1,47 @@ +Filesystem Component +==================== + +Filesystem provides basic utility to manipulate the file system: + +```php +<?php + +use Symfony\Component\Filesystem\Filesystem; + +$filesystem = new Filesystem(); + +$filesystem->copy($originFile, $targetFile, $override = false); + +$filesystem->mkdir($dirs, $mode = 0777); + +$filesystem->touch($files, $time = null, $atime = null); + +$filesystem->remove($files); + +$filesystem->exists($files); + +$filesystem->chmod($files, $mode, $umask = 0000, $recursive = false); + +$filesystem->chown($files, $user, $recursive = false); + +$filesystem->chgrp($files, $group, $recursive = false); + +$filesystem->rename($origin, $target); + +$filesystem->symlink($originDir, $targetDir, $copyOnWindows = false); + +$filesystem->makePathRelative($endPath, $startPath); + +$filesystem->mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array()); + +$filesystem->isAbsolutePath($file); +``` + +Resources +--------- + +You can run the unit tests with the following command: + + $ cd path/to/Symfony/Component/Filesystem/ + $ composer install + $ phpunit diff --git a/libs/php-ssh/vendor/symfony/filesystem/Tests/ExceptionTest.php b/libs/php-ssh/vendor/symfony/filesystem/Tests/ExceptionTest.php @@ -0,0 +1,46 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Tests; + +use Symfony\Component\Filesystem\Exception\IOException; +use Symfony\Component\Filesystem\Exception\FileNotFoundException; + +/** + * Test class for Filesystem. + */ +class ExceptionTest extends \PHPUnit_Framework_TestCase +{ + public function testGetPath() + { + $e = new IOException('', 0, null, '/foo'); + $this->assertEquals('/foo', $e->getPath(), 'The pass should be returned.'); + } + + public function testGeneratedMessage() + { + $e = new FileNotFoundException(null, 0, null, '/foo'); + $this->assertEquals('/foo', $e->getPath()); + $this->assertEquals('File "/foo" could not be found.', $e->getMessage(), 'A message should be generated.'); + } + + public function testGeneratedMessageWithoutPath() + { + $e = new FileNotFoundException(); + $this->assertEquals('File could not be found.', $e->getMessage(), 'A message should be generated.'); + } + + public function testCustomMessage() + { + $e = new FileNotFoundException('bar', 0, null, '/foo'); + $this->assertEquals('bar', $e->getMessage(), 'A custom message should be possible still.'); + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTest.php b/libs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTest.php @@ -0,0 +1,1015 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Tests; + +/** + * Test class for Filesystem. + */ +class FilesystemTest extends FilesystemTestCase +{ + public function testCopyCreatesNewFile() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + + $this->assertFileExists($targetFilePath); + $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testCopyFails() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testCopyUnreadableFileFails() + { + // skip test on Windows; PHP can't easily set file as unreadable on Windows + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('This test cannot run on Windows.'); + } + + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + + // make sure target cannot be read + $this->filesystem->chmod($sourceFilePath, 0222); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + } + + public function testCopyOverridesExistingFileIfModified() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + file_put_contents($targetFilePath, 'TARGET FILE'); + touch($targetFilePath, time() - 1000); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + + $this->assertFileExists($targetFilePath); + $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); + } + + public function testCopyDoesNotOverrideExistingFileByDefault() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + file_put_contents($targetFilePath, 'TARGET FILE'); + + // make sure both files have the same modification time + $modificationTime = time() - 1000; + touch($sourceFilePath, $modificationTime); + touch($targetFilePath, $modificationTime); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + + $this->assertFileExists($targetFilePath); + $this->assertEquals('TARGET FILE', file_get_contents($targetFilePath)); + } + + public function testCopyOverridesExistingFileIfForced() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + file_put_contents($targetFilePath, 'TARGET FILE'); + + // make sure both files have the same modification time + $modificationTime = time() - 1000; + touch($sourceFilePath, $modificationTime); + touch($targetFilePath, $modificationTime); + + $this->filesystem->copy($sourceFilePath, $targetFilePath, true); + + $this->assertFileExists($targetFilePath); + $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testCopyWithOverrideWithReadOnlyTargetFails() + { + // skip test on Windows; PHP can't easily set file as unwritable on Windows + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('This test cannot run on Windows.'); + } + + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + file_put_contents($targetFilePath, 'TARGET FILE'); + + // make sure both files have the same modification time + $modificationTime = time() - 1000; + touch($sourceFilePath, $modificationTime); + touch($targetFilePath, $modificationTime); + + // make sure target is read-only + $this->filesystem->chmod($targetFilePath, 0444); + + $this->filesystem->copy($sourceFilePath, $targetFilePath, true); + } + + public function testCopyCreatesTargetDirectoryIfItDoesNotExist() + { + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFileDirectory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; + $targetFilePath = $targetFileDirectory.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + + $this->assertTrue(is_dir($targetFileDirectory)); + $this->assertFileExists($targetFilePath); + $this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); + } + + public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToNotCopy() + { + $sourceFilePath = 'http://symfony.com/images/common/logo/logo_symfony_header.png'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($targetFilePath, 'TARGET FILE'); + + $this->filesystem->copy($sourceFilePath, $targetFilePath, false); + + $this->assertFileExists($targetFilePath); + $this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath)); + } + + public function testMkdirCreatesDirectoriesRecursively() + { + $directory = $this->workspace + .DIRECTORY_SEPARATOR.'directory' + .DIRECTORY_SEPARATOR.'sub_directory'; + + $this->filesystem->mkdir($directory); + + $this->assertTrue(is_dir($directory)); + } + + public function testMkdirCreatesDirectoriesFromArray() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + $directories = array( + $basePath.'1', $basePath.'2', $basePath.'3', + ); + + $this->filesystem->mkdir($directories); + + $this->assertTrue(is_dir($basePath.'1')); + $this->assertTrue(is_dir($basePath.'2')); + $this->assertTrue(is_dir($basePath.'3')); + } + + public function testMkdirCreatesDirectoriesFromTraversableObject() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + $directories = new \ArrayObject(array( + $basePath.'1', $basePath.'2', $basePath.'3', + )); + + $this->filesystem->mkdir($directories); + + $this->assertTrue(is_dir($basePath.'1')); + $this->assertTrue(is_dir($basePath.'2')); + $this->assertTrue(is_dir($basePath.'3')); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testMkdirCreatesDirectoriesFails() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + $dir = $basePath.'2'; + + file_put_contents($dir, ''); + + $this->filesystem->mkdir($dir); + } + + public function testTouchCreatesEmptyFile() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.'1'; + + $this->filesystem->touch($file); + + $this->assertFileExists($file); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testTouchFails() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.'1'.DIRECTORY_SEPARATOR.'2'; + + $this->filesystem->touch($file); + } + + public function testTouchCreatesEmptyFilesFromArray() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + $files = array( + $basePath.'1', $basePath.'2', $basePath.'3', + ); + + $this->filesystem->touch($files); + + $this->assertFileExists($basePath.'1'); + $this->assertFileExists($basePath.'2'); + $this->assertFileExists($basePath.'3'); + } + + public function testTouchCreatesEmptyFilesFromTraversableObject() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + $files = new \ArrayObject(array( + $basePath.'1', $basePath.'2', $basePath.'3', + )); + + $this->filesystem->touch($files); + + $this->assertFileExists($basePath.'1'); + $this->assertFileExists($basePath.'2'); + $this->assertFileExists($basePath.'3'); + } + + public function testRemoveCleansFilesAndDirectoriesIteratively() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; + + mkdir($basePath); + mkdir($basePath.'dir'); + touch($basePath.'file'); + + $this->filesystem->remove($basePath); + + $this->assertTrue(!is_dir($basePath)); + } + + public function testRemoveCleansArrayOfFilesAndDirectories() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + + mkdir($basePath.'dir'); + touch($basePath.'file'); + + $files = array( + $basePath.'dir', $basePath.'file', + ); + + $this->filesystem->remove($files); + + $this->assertTrue(!is_dir($basePath.'dir')); + $this->assertTrue(!is_file($basePath.'file')); + } + + public function testRemoveCleansTraversableObjectOfFilesAndDirectories() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + + mkdir($basePath.'dir'); + touch($basePath.'file'); + + $files = new \ArrayObject(array( + $basePath.'dir', $basePath.'file', + )); + + $this->filesystem->remove($files); + + $this->assertTrue(!is_dir($basePath.'dir')); + $this->assertTrue(!is_file($basePath.'file')); + } + + public function testRemoveIgnoresNonExistingFiles() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + + mkdir($basePath.'dir'); + + $files = array( + $basePath.'dir', $basePath.'file', + ); + + $this->filesystem->remove($files); + + $this->assertTrue(!is_dir($basePath.'dir')); + } + + public function testRemoveCleansInvalidLinks() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; + + mkdir($basePath); + mkdir($basePath.'dir'); + // create symlink to nonexistent file + @symlink($basePath.'file', $basePath.'link'); + + $this->filesystem->remove($basePath); + + $this->assertTrue(!is_dir($basePath)); + } + + public function testFilesExists() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; + + mkdir($basePath); + touch($basePath.'file1'); + mkdir($basePath.'folder'); + + $this->assertTrue($this->filesystem->exists($basePath.'file1')); + $this->assertTrue($this->filesystem->exists($basePath.'folder')); + } + + public function testFilesExistsTraversableObjectOfFilesAndDirectories() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + + mkdir($basePath.'dir'); + touch($basePath.'file'); + + $files = new \ArrayObject(array( + $basePath.'dir', $basePath.'file', + )); + + $this->assertTrue($this->filesystem->exists($files)); + } + + public function testFilesNotExistsTraversableObjectOfFilesAndDirectories() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR; + + mkdir($basePath.'dir'); + touch($basePath.'file'); + touch($basePath.'file2'); + + $files = new \ArrayObject(array( + $basePath.'dir', $basePath.'file', $basePath.'file2', + )); + + unlink($basePath.'file'); + + $this->assertFalse($this->filesystem->exists($files)); + } + + public function testInvalidFileNotExists() + { + $basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; + + $this->assertFalse($this->filesystem->exists($basePath.time())); + } + + public function testChmodChangesFileMode() + { + $this->markAsSkippedIfChmodIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + $file = $dir.DIRECTORY_SEPARATOR.'file'; + touch($file); + + $this->filesystem->chmod($file, 0400); + $this->filesystem->chmod($dir, 0753); + + $this->assertFilePermissions(753, $dir); + $this->assertFilePermissions(400, $file); + } + + public function testChmodWrongMod() + { + $this->markAsSkippedIfChmodIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'file'; + touch($dir); + + $this->filesystem->chmod($dir, 'Wrongmode'); + } + + public function testChmodRecursive() + { + $this->markAsSkippedIfChmodIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + $file = $dir.DIRECTORY_SEPARATOR.'file'; + touch($file); + + $this->filesystem->chmod($file, 0400, 0000, true); + $this->filesystem->chmod($dir, 0753, 0000, true); + + $this->assertFilePermissions(753, $dir); + $this->assertFilePermissions(753, $file); + } + + public function testChmodAppliesUmask() + { + $this->markAsSkippedIfChmodIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + touch($file); + + $this->filesystem->chmod($file, 0770, 0022); + $this->assertFilePermissions(750, $file); + } + + public function testChmodChangesModeOfArrayOfFiles() + { + $this->markAsSkippedIfChmodIsMissing(); + + $directory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $files = array($directory, $file); + + mkdir($directory); + touch($file); + + $this->filesystem->chmod($files, 0753); + + $this->assertFilePermissions(753, $file); + $this->assertFilePermissions(753, $directory); + } + + public function testChmodChangesModeOfTraversableFileObject() + { + $this->markAsSkippedIfChmodIsMissing(); + + $directory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $files = new \ArrayObject(array($directory, $file)); + + mkdir($directory); + touch($file); + + $this->filesystem->chmod($files, 0753); + + $this->assertFilePermissions(753, $file); + $this->assertFilePermissions(753, $directory); + } + + public function testChown() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + + $this->filesystem->chown($dir, $this->getFileOwner($dir)); + } + + public function testChownRecursive() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + $file = $dir.DIRECTORY_SEPARATOR.'file'; + touch($file); + + $this->filesystem->chown($dir, $this->getFileOwner($dir), true); + } + + public function testChownSymlink() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + + $this->filesystem->symlink($file, $link); + + $this->filesystem->chown($link, $this->getFileOwner($link)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testChownSymlinkFails() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + + $this->filesystem->symlink($file, $link); + + $this->filesystem->chown($link, 'user'.time().mt_rand(1000, 9999)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testChownFail() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + + $this->filesystem->chown($dir, 'user'.time().mt_rand(1000, 9999)); + } + + public function testChgrp() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + + $this->filesystem->chgrp($dir, $this->getFileGroup($dir)); + } + + public function testChgrpRecursive() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + $file = $dir.DIRECTORY_SEPARATOR.'file'; + touch($file); + + $this->filesystem->chgrp($dir, $this->getFileGroup($dir), true); + } + + public function testChgrpSymlink() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + + $this->filesystem->symlink($file, $link); + + $this->filesystem->chgrp($link, $this->getFileGroup($link)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testChgrpSymlinkFails() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + + $this->filesystem->symlink($file, $link); + + $this->filesystem->chgrp($link, 'user'.time().mt_rand(1000, 9999)); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testChgrpFail() + { + $this->markAsSkippedIfPosixIsMissing(); + + $dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; + mkdir($dir); + + $this->filesystem->chgrp($dir, 'user'.time().mt_rand(1000, 9999)); + } + + public function testRename() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; + touch($file); + + $this->filesystem->rename($file, $newPath); + + $this->assertFileNotExists($file); + $this->assertFileExists($newPath); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testRenameThrowsExceptionIfTargetAlreadyExists() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; + + touch($file); + touch($newPath); + + $this->filesystem->rename($file, $newPath); + } + + public function testRenameOverwritesTheTargetIfItAlreadyExists() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; + + touch($file); + touch($newPath); + + $this->filesystem->rename($file, $newPath, true); + + $this->assertFileNotExists($file); + $this->assertFileExists($newPath); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + */ + public function testRenameThrowsExceptionOnError() + { + $file = $this->workspace.DIRECTORY_SEPARATOR.uniqid('fs_test_', true); + $newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; + + $this->filesystem->rename($file, $newPath); + } + + public function testSymlink() + { + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('Windows does not support creating "broken" symlinks'); + } + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + // $file does not exists right now: creating "broken" links is a wanted feature + $this->filesystem->symlink($file, $link); + + $this->assertTrue(is_link($link)); + + // Create the linked file AFTER creating the link + touch($file); + + $this->assertEquals($file, readlink($link)); + } + + /** + * @depends testSymlink + */ + public function testRemoveSymlink() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + $this->filesystem->remove($link); + + $this->assertTrue(!is_link($link)); + } + + public function testSymlinkIsOverwrittenIfPointsToDifferentTarget() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + symlink($this->workspace, $link); + + $this->filesystem->symlink($file, $link); + + $this->assertTrue(is_link($link)); + $this->assertEquals($file, readlink($link)); + } + + public function testSymlinkIsNotOverwrittenIfAlreadyCreated() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; + + touch($file); + symlink($file, $link); + + $this->filesystem->symlink($file, $link); + + $this->assertTrue(is_link($link)); + $this->assertEquals($file, readlink($link)); + } + + public function testSymlinkCreatesTargetDirectoryIfItDoesNotExist() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; + $link1 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'link'; + $link2 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'subdir'.DIRECTORY_SEPARATOR.'link'; + + touch($file); + + $this->filesystem->symlink($file, $link1); + $this->filesystem->symlink($file, $link2); + + $this->assertTrue(is_link($link1)); + $this->assertEquals($file, readlink($link1)); + $this->assertTrue(is_link($link2)); + $this->assertEquals($file, readlink($link2)); + } + + /** + * @dataProvider providePathsForMakePathRelative + */ + public function testMakePathRelative($endPath, $startPath, $expectedPath) + { + $path = $this->filesystem->makePathRelative($endPath, $startPath); + + $this->assertEquals($expectedPath, $path); + } + + /** + * @return array + */ + public function providePathsForMakePathRelative() + { + $paths = array( + array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../'), + array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component/', '../'), + array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component', '../'), + array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component/', '../'), + array('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../'), + array('/usr/lib/symfony/', '/var/lib/symfony/src/Symfony/Component', '../../../../../../usr/lib/symfony/'), + array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/', 'src/Symfony/'), + array('/aa/bb', '/aa/bb', './'), + array('/aa/bb', '/aa/bb/', './'), + array('/aa/bb/', '/aa/bb', './'), + array('/aa/bb/', '/aa/bb/', './'), + array('/aa/bb/cc', '/aa/bb/cc/dd', '../'), + array('/aa/bb/cc', '/aa/bb/cc/dd/', '../'), + array('/aa/bb/cc/', '/aa/bb/cc/dd', '../'), + array('/aa/bb/cc/', '/aa/bb/cc/dd/', '../'), + array('/aa/bb/cc', '/aa', 'bb/cc/'), + array('/aa/bb/cc', '/aa/', 'bb/cc/'), + array('/aa/bb/cc/', '/aa', 'bb/cc/'), + array('/aa/bb/cc/', '/aa/', 'bb/cc/'), + array('/a/aab/bb', '/a/aa', '../aab/bb/'), + array('/a/aab/bb', '/a/aa/', '../aab/bb/'), + array('/a/aab/bb/', '/a/aa', '../aab/bb/'), + array('/a/aab/bb/', '/a/aa/', '../aab/bb/'), + ); + + if ('\\' === DIRECTORY_SEPARATOR) { + $paths[] = array('c:\var\lib/symfony/src/Symfony/', 'c:/var/lib/symfony/', 'src/Symfony/'); + } + + return $paths; + } + + public function testMirrorCopiesFilesAndDirectoriesRecursively() + { + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + $directory = $sourcePath.'directory'.DIRECTORY_SEPARATOR; + $file1 = $directory.'file1'; + $file2 = $sourcePath.'file2'; + + mkdir($sourcePath); + mkdir($directory); + file_put_contents($file1, 'FILE1'); + file_put_contents($file2, 'FILE2'); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + $this->assertTrue(is_dir($targetPath.'directory')); + $this->assertFileEquals($file1, $targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'); + $this->assertFileEquals($file2, $targetPath.'file2'); + + $this->filesystem->remove($file1); + + $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => false)); + $this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); + + $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); + $this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); + + file_put_contents($file1, 'FILE1'); + + $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); + $this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); + + $this->filesystem->remove($directory); + $this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); + $this->assertFalse($this->filesystem->exists($targetPath.'directory')); + $this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); + } + + public function testMirrorCreatesEmptyDirectory() + { + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + + mkdir($sourcePath); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + + $this->filesystem->remove($sourcePath); + } + + public function testMirrorCopiesLinks() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + + mkdir($sourcePath); + file_put_contents($sourcePath.'file1', 'FILE1'); + symlink($sourcePath.'file1', $sourcePath.'link1'); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + $this->assertFileEquals($sourcePath.'file1', $targetPath.DIRECTORY_SEPARATOR.'link1'); + $this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); + } + + public function testMirrorCopiesLinkedDirectoryContents() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + + mkdir($sourcePath.'nested/', 0777, true); + file_put_contents($sourcePath.'/nested/file1.txt', 'FILE1'); + // Note: We symlink directory, not file + symlink($sourcePath.'nested', $sourcePath.'link1'); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + $this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.DIRECTORY_SEPARATOR.'link1/file1.txt'); + $this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); + } + + public function testMirrorCopiesRelativeLinkedContents() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + $oldPath = getcwd(); + + mkdir($sourcePath.'nested/', 0777, true); + file_put_contents($sourcePath.'/nested/file1.txt', 'FILE1'); + // Note: Create relative symlink + chdir($sourcePath); + symlink('nested', 'link1'); + + chdir($oldPath); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + $this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.DIRECTORY_SEPARATOR.'link1/file1.txt'); + $this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); + $this->assertEquals($sourcePath.'nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1')); + } + + /** + * @dataProvider providePathsForIsAbsolutePath + */ + public function testIsAbsolutePath($path, $expectedResult) + { + $result = $this->filesystem->isAbsolutePath($path); + + $this->assertEquals($expectedResult, $result); + } + + /** + * @return array + */ + public function providePathsForIsAbsolutePath() + { + return array( + array('/var/lib', true), + array('c:\\\\var\\lib', true), + array('\\var\\lib', true), + array('var/lib', false), + array('../var/lib', false), + array('', false), + array(null, false), + ); + } + + public function testDumpFile() + { + $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; + + $this->filesystem->dumpFile($filename, 'bar'); + + $this->assertFileExists($filename); + $this->assertSame('bar', file_get_contents($filename)); + } + + /** + * @group legacy + */ + public function testDumpFileAndSetPermissions() + { + $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; + + $this->filesystem->dumpFile($filename, 'bar', 0753); + + $this->assertFileExists($filename); + $this->assertSame('bar', file_get_contents($filename)); + + // skip mode check on Windows + if ('\\' !== DIRECTORY_SEPARATOR) { + $this->assertFilePermissions(753, $filename); + } + } + + public function testDumpFileWithNullMode() + { + $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; + + $this->filesystem->dumpFile($filename, 'bar', null); + + $this->assertFileExists($filename); + $this->assertSame('bar', file_get_contents($filename)); + + // skip mode check on Windows + if ('\\' !== DIRECTORY_SEPARATOR) { + $this->assertFilePermissions(600, $filename); + } + } + + public function testDumpFileOverwritesAnExistingFile() + { + $filename = $this->workspace.DIRECTORY_SEPARATOR.'foo.txt'; + file_put_contents($filename, 'FOO BAR'); + + $this->filesystem->dumpFile($filename, 'bar'); + + $this->assertFileExists($filename); + $this->assertSame('bar', file_get_contents($filename)); + } + + public function testCopyShouldKeepExecutionPermission() + { + $this->markAsSkippedIfChmodIsMissing(); + + $sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; + $targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; + + file_put_contents($sourceFilePath, 'SOURCE FILE'); + chmod($sourceFilePath, 0745); + + $this->filesystem->copy($sourceFilePath, $targetFilePath); + + $this->assertFilePermissions(767, $targetFilePath); + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTestCase.php b/libs/php-ssh/vendor/symfony/filesystem/Tests/FilesystemTestCase.php @@ -0,0 +1,119 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Filesystem\Tests; + +use Symfony\Component\Filesystem\Filesystem; + +class FilesystemTestCase extends \PHPUnit_Framework_TestCase +{ + private $umask; + + /** + * @var \Symfony\Component\Filesystem\Filesystem + */ + protected $filesystem = null; + + /** + * @var string + */ + protected $workspace = null; + + private static $symlinkOnWindows = null; + + public static function setUpBeforeClass() + { + if ('\\' === DIRECTORY_SEPARATOR && null === self::$symlinkOnWindows) { + $target = tempnam(sys_get_temp_dir(), 'sl'); + $link = sys_get_temp_dir().'/sl'.microtime(true).mt_rand(); + if (self::$symlinkOnWindows = @symlink($target, $link)) { + unlink($link); + } + unlink($target); + } + } + + protected function setUp() + { + $this->umask = umask(0); + $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000); + mkdir($this->workspace, 0777, true); + $this->workspace = realpath($this->workspace); + $this->filesystem = new Filesystem(); + } + + protected function tearDown() + { + $this->filesystem->remove($this->workspace); + umask($this->umask); + } + + /** + * @param int $expectedFilePerms expected file permissions as three digits (i.e. 755) + * @param string $filePath + */ + protected function assertFilePermissions($expectedFilePerms, $filePath) + { + $actualFilePerms = (int) substr(sprintf('%o', fileperms($filePath)), -3); + $this->assertEquals( + $expectedFilePerms, + $actualFilePerms, + sprintf('File permissions for %s must be %s. Actual %s', $filePath, $expectedFilePerms, $actualFilePerms) + ); + } + + protected function getFileOwner($filepath) + { + $this->markAsSkippedIfPosixIsMissing(); + + $infos = stat($filepath); + if ($datas = posix_getpwuid($infos['uid'])) { + return $datas['name']; + } + } + + protected function getFileGroup($filepath) + { + $this->markAsSkippedIfPosixIsMissing(); + + $infos = stat($filepath); + if ($datas = posix_getgrgid($infos['gid'])) { + return $datas['name']; + } + + $this->markTestSkipped('Unable to retrieve file group name'); + } + + protected function markAsSkippedIfSymlinkIsMissing() + { + if (!function_exists('symlink')) { + $this->markTestSkipped('symlink is not supported'); + } + + if ('\\' === DIRECTORY_SEPARATOR && false === self::$symlinkOnWindows) { + $this->markTestSkipped('symlink requires "Create symbolic links" privilege on windows'); + } + } + + protected function markAsSkippedIfChmodIsMissing() + { + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('chmod is not supported on windows'); + } + } + + protected function markAsSkippedIfPosixIsMissing() + { + if ('\\' === DIRECTORY_SEPARATOR || !function_exists('posix_isatty')) { + $this->markTestSkipped('Posix is not supported'); + } + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/Tests/LockHandlerTest.php b/libs/php-ssh/vendor/symfony/filesystem/Tests/LockHandlerTest.php @@ -0,0 +1,91 @@ +<?php + +namespace Symfony\Component\Filesystem\Tests; + +use Symfony\Component\Filesystem\LockHandler; + +class LockHandlerTest extends \PHPUnit_Framework_TestCase +{ + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + * @expectedExceptionMessage Failed to create "/a/b/c/d/e": mkdir(): Permission denied. + */ + public function testConstructWhenRepositoryDoesNotExist() + { + if (!getenv('USER') || 'root' === getenv('USER')) { + $this->markTestSkipped('This test will fail if run under superuser'); + } + new LockHandler('lock', '/a/b/c/d/e'); + } + + /** + * @expectedException \Symfony\Component\Filesystem\Exception\IOException + * @expectedExceptionMessage The directory "/" is not writable. + */ + public function testConstructWhenRepositoryIsNotWriteable() + { + if (!getenv('USER') || 'root' === getenv('USER')) { + $this->markTestSkipped('This test will fail if run under superuser'); + } + new LockHandler('lock', '/'); + } + + public function testConstructSanitizeName() + { + $lock = new LockHandler('<?php echo "% hello word ! %" ?>'); + + $file = sprintf('%s/sf.-php-echo-hello-word-.4b3d9d0d27ddef3a78a64685dda3a963e478659a9e5240feaf7b4173a8f28d5f.lock', sys_get_temp_dir()); + // ensure the file does not exist before the lock + @unlink($file); + + $lock->lock(); + + $this->assertFileExists($file); + + $lock->release(); + } + + public function testLockRelease() + { + $name = 'symfony-test-filesystem.lock'; + + $l1 = new LockHandler($name); + $l2 = new LockHandler($name); + + $this->assertTrue($l1->lock()); + $this->assertFalse($l2->lock()); + + $l1->release(); + + $this->assertTrue($l2->lock()); + $l2->release(); + } + + public function testLockTwice() + { + $name = 'symfony-test-filesystem.lock'; + + $lockHandler = new LockHandler($name); + + $this->assertTrue($lockHandler->lock()); + $this->assertTrue($lockHandler->lock()); + + $lockHandler->release(); + } + + public function testLockIsReleased() + { + $name = 'symfony-test-filesystem.lock'; + + $l1 = new LockHandler($name); + $l2 = new LockHandler($name); + + $this->assertTrue($l1->lock()); + $this->assertFalse($l2->lock()); + + $l1 = null; + + $this->assertTrue($l2->lock()); + $l2->release(); + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/composer.json b/libs/php-ssh/vendor/symfony/filesystem/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/filesystem", + "type": "library", + "description": "Symfony Filesystem Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\Filesystem\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + } +} diff --git a/libs/php-ssh/vendor/symfony/filesystem/phpunit.xml.dist b/libs/php-ssh/vendor/symfony/filesystem/phpunit.xml.dist @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" + backupGlobals="false" + colors="true" + bootstrap="vendor/autoload.php" +> + <php> + <ini name="error_reporting" value="-1" /> + </php> + + <testsuites> + <testsuite name="Symfony Filesystem Component Test Suite"> + <directory>./Tests/</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>./</directory> + <exclude> + <directory>./Tests</directory> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/libs/php-ssh/vendor/symfony/yaml/.gitignore b/libs/php-ssh/vendor/symfony/yaml/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/libs/php-ssh/vendor/symfony/yaml/CHANGELOG.md b/libs/php-ssh/vendor/symfony/yaml/CHANGELOG.md @@ -0,0 +1,8 @@ +CHANGELOG +========= + +2.1.0 +----- + + * Yaml::parse() does not evaluate loaded files as PHP files by default + anymore (call Yaml::enablePhpParsing() to get back the old behavior) diff --git a/libs/php-ssh/vendor/symfony/yaml/Dumper.php b/libs/php-ssh/vendor/symfony/yaml/Dumper.php @@ -0,0 +1,73 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Dumper dumps PHP variables to YAML strings. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Dumper +{ + /** + * The amount of spaces to use for indentation of nested nodes. + * + * @var int + */ + protected $indentation = 4; + + /** + * Sets the indentation. + * + * @param int $num The amount of spaces to use for indentation of nested nodes. + */ + public function setIndentation($num) + { + $this->indentation = (int) $num; + } + + /** + * Dumps a PHP value to YAML. + * + * @param mixed $input The PHP value + * @param int $inline The level where you switch to inline YAML + * @param int $indent The level of indentation (used internally) + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML representation of the PHP value + */ + public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) + { + $output = ''; + $prefix = $indent ? str_repeat(' ', $indent) : ''; + + if ($inline <= 0 || !is_array($input) || empty($input)) { + $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); + } else { + $isAHash = array_keys($input) !== range(0, count($input) - 1); + + foreach ($input as $key => $value) { + $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); + + $output .= sprintf('%s%s%s%s', + $prefix, + $isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-', + $willBeInlined ? ' ' : "\n", + $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $exceptionOnInvalidType, $objectSupport) + ).($willBeInlined ? "\n" : ''); + } + } + + return $output; + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Escaper.php b/libs/php-ssh/vendor/symfony/yaml/Escaper.php @@ -0,0 +1,97 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Escaper encapsulates escaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski <matthew@lewinski.org> + */ +class Escaper +{ + // Characters that would cause a dumped string to require double quoting. + const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; + + // Mapping arrays for escaping a double quoted string. The backslash is + // first to ensure proper escaping because str_replace operates iteratively + // on the input arrays. This ordering of the characters avoids the use of strtr, + // which performs more slowly. + private static $escapees = array('\\', '\\\\', '\\"', '"', + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); + private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', + '\\N', '\\_', '\\L', '\\P',); + + /** + * Determines if a PHP value would require double quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require double quotes. + */ + public static function requiresDoubleQuoting($value) + { + return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); + } + + /** + * Escapes and surrounds a PHP value with double quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithDoubleQuotes($value) + { + return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value)); + } + + /** + * Determines if a PHP value would require single quoting in YAML. + * + * @param string $value A PHP value + * + * @return bool True if the value would require single quotes. + */ + public static function requiresSingleQuoting($value) + { + // Determines if a PHP value is entirely composed of a value that would + // require single quoting in YAML. + if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) { + return true; + } + + // Determines if the PHP value contains any single characters that would + // cause it to require single quoting in YAML. + return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); + } + + /** + * Escapes and surrounds a PHP value with single quotes. + * + * @param string $value A PHP value + * + * @return string The quoted, escaped string + */ + public static function escapeWithSingleQuotes($value) + { + return sprintf("'%s'", str_replace('\'', '\'\'', $value)); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Exception/DumpException.php b/libs/php-ssh/vendor/symfony/yaml/Exception/DumpException.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during dumping. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @api + */ +class DumpException extends RuntimeException +{ +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Exception/ExceptionInterface.php b/libs/php-ssh/vendor/symfony/yaml/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @api + */ +interface ExceptionInterface +{ +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Exception/ParseException.php b/libs/php-ssh/vendor/symfony/yaml/Exception/ParseException.php @@ -0,0 +1,148 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @api + */ +class ParseException extends RuntimeException +{ + private $parsedFile; + private $parsedLine; + private $snippet; + private $rawMessage; + + /** + * Constructor. + * + * @param string $message The error message + * @param int $parsedLine The line where the error occurred + * @param int $snippet The snippet of code near the problem + * @param string $parsedFile The file name where the error occurred + * @param \Exception $previous The previous exception + */ + public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null) + { + $this->parsedFile = $parsedFile; + $this->parsedLine = $parsedLine; + $this->snippet = $snippet; + $this->rawMessage = $message; + + $this->updateRepr(); + + parent::__construct($this->message, 0, $previous); + } + + /** + * Gets the snippet of code near the error. + * + * @return string The snippet of code + */ + public function getSnippet() + { + return $this->snippet; + } + + /** + * Sets the snippet of code near the error. + * + * @param string $snippet The code snippet + */ + public function setSnippet($snippet) + { + $this->snippet = $snippet; + + $this->updateRepr(); + } + + /** + * Gets the filename where the error occurred. + * + * This method returns null if a string is parsed. + * + * @return string The filename + */ + public function getParsedFile() + { + return $this->parsedFile; + } + + /** + * Sets the filename where the error occurred. + * + * @param string $parsedFile The filename + */ + public function setParsedFile($parsedFile) + { + $this->parsedFile = $parsedFile; + + $this->updateRepr(); + } + + /** + * Gets the line where the error occurred. + * + * @return int The file line + */ + public function getParsedLine() + { + return $this->parsedLine; + } + + /** + * Sets the line where the error occurred. + * + * @param int $parsedLine The file line + */ + public function setParsedLine($parsedLine) + { + $this->parsedLine = $parsedLine; + + $this->updateRepr(); + } + + private function updateRepr() + { + $this->message = $this->rawMessage; + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + if (null !== $this->parsedFile) { + if (PHP_VERSION_ID >= 50400) { + $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } else { + $jsonOptions = 0; + } + $this->message .= sprintf(' in %s', json_encode($this->parsedFile, $jsonOptions)); + } + + if ($this->parsedLine >= 0) { + $this->message .= sprintf(' at line %d', $this->parsedLine); + } + + if ($this->snippet) { + $this->message .= sprintf(' (near "%s")', $this->snippet); + } + + if ($dot) { + $this->message .= '.'; + } + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Exception/RuntimeException.php b/libs/php-ssh/vendor/symfony/yaml/Exception/RuntimeException.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Exception; + +/** + * Exception class thrown when an error occurs during parsing. + * + * @author Romain Neutron <imprec@gmail.com> + * + * @api + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Inline.php b/libs/php-ssh/vendor/symfony/yaml/Inline.php @@ -0,0 +1,546 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; +use Symfony\Component\Yaml\Exception\DumpException; + +/** + * Inline implements a YAML parser/dumper for the YAML inline syntax. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Inline +{ + const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; + + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + private static $objectForMap = false; + + /** + * Converts a YAML string to a PHP array. + * + * @param string $value A YAML string + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param array $references Mapping of variable names to values + * + * @return array A PHP array representing the YAML string + * + * @throws ParseException + */ + public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false, $references = array()) + { + self::$exceptionOnInvalidType = $exceptionOnInvalidType; + self::$objectSupport = $objectSupport; + self::$objectForMap = $objectForMap; + + $value = trim($value); + + if ('' === $value) { + return ''; + } + + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } + + $i = 0; + switch ($value[0]) { + case '[': + $result = self::parseSequence($value, $i, $references); + ++$i; + break; + case '{': + $result = self::parseMapping($value, $i, $references); + ++$i; + break; + default: + $result = self::parseScalar($value, null, array('"', "'"), $i, true, $references); + } + + // some comments are allowed at the end + if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { + throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $result; + } + + /** + * Dumps a given PHP variable to a YAML string. + * + * @param mixed $value The PHP variable to convert + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML string representing the PHP array + * + * @throws DumpException When trying to dump PHP resource + */ + public static function dump($value, $exceptionOnInvalidType = false, $objectSupport = false) + { + switch (true) { + case is_resource($value): + if ($exceptionOnInvalidType) { + throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + } + + return 'null'; + case is_object($value): + if ($objectSupport) { + return '!!php/object:'.serialize($value); + } + + if ($exceptionOnInvalidType) { + throw new DumpException('Object support when dumping a YAML file has been disabled.'); + } + + return 'null'; + case is_array($value): + return self::dumpArray($value, $exceptionOnInvalidType, $objectSupport); + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case ctype_digit($value): + return is_string($value) ? "'$value'" : (int) $value; + case is_numeric($value): + $locale = setlocale(LC_NUMERIC, 0); + if (false !== $locale) { + setlocale(LC_NUMERIC, 'C'); + } + if (is_float($value)) { + $repr = (string) $value; + if (is_infinite($value)) { + $repr = str_ireplace('INF', '.Inf', $repr); + } elseif (floor($value) == $value && $repr == $value) { + // Preserve float data type since storing a whole number will result in integer value. + $repr = '!!float '.$repr; + } + } else { + $repr = is_string($value) ? "'$value'" : (string) $value; + } + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + + return $repr; + case '' == $value: + return "''"; + case Escaper::requiresDoubleQuoting($value): + return Escaper::escapeWithDoubleQuotes($value); + case Escaper::requiresSingleQuoting($value): + case preg_match(self::getHexRegex(), $value): + case preg_match(self::getTimestampRegex(), $value): + return Escaper::escapeWithSingleQuotes($value); + default: + return $value; + } + } + + /** + * Dumps a PHP array to a YAML string. + * + * @param array $value The PHP array to dump + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string The YAML string representing the PHP array + */ + private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) + { + // array + $keys = array_keys($value); + $keysCount = count($keys); + if ((1 === $keysCount && '0' == $keys[0]) + || ($keysCount > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) + ) { + $output = array(); + foreach ($value as $val) { + $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); + } + + return sprintf('[%s]', implode(', ', $output)); + } + + // mapping + $output = array(); + foreach ($value as $key => $val) { + $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); + } + + return sprintf('{ %s }', implode(', ', $output)); + } + + /** + * Parses a scalar to a YAML string. + * + * @param string $scalar + * @param string $delimiters + * @param array $stringDelimiters + * @param int &$i + * @param bool $evaluate + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true, $references = array()) + { + if (in_array($scalar[$i], $stringDelimiters)) { + // quoted scalar + $output = self::parseQuotedScalar($scalar, $i); + + if (null !== $delimiters) { + $tmp = ltrim(substr($scalar, $i), ' '); + if (!in_array($tmp[0], $delimiters)) { + throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); + } + } + } else { + // "normal" string + if (!$delimiters) { + $output = substr($scalar, $i); + $i += strlen($output); + + // remove comments + if (false !== $strpos = strpos($output, ' #')) { + $output = rtrim(substr($output, 0, $strpos)); + } + } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { + $output = $match[1]; + $i += strlen($output); + } else { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); + } + + if ($evaluate) { + $output = self::evaluateScalar($output, $references); + } + } + + return $output; + } + + /** + * Parses a quoted scalar to YAML. + * + * @param string $scalar + * @param int &$i + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseQuotedScalar($scalar, &$i) + { + if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { + throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); + } + + $output = substr($match[0], 1, strlen($match[0]) - 2); + + $unescaper = new Unescaper(); + if ('"' == $scalar[$i]) { + $output = $unescaper->unescapeDoubleQuotedString($output); + } else { + $output = $unescaper->unescapeSingleQuotedString($output); + } + + $i += strlen($match[0]); + + return $output; + } + + /** + * Parses a sequence to a YAML string. + * + * @param string $sequence + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseSequence($sequence, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($sequence); + ++$i; + + // [foo, bar, ...] + while ($i < $len) { + switch ($sequence[$i]) { + case '[': + // nested sequence + $output[] = self::parseSequence($sequence, $i, $references); + break; + case '{': + // nested mapping + $output[] = self::parseMapping($sequence, $i, $references); + break; + case ']': + return $output; + case ',': + case ' ': + break; + default: + $isQuoted = in_array($sequence[$i], array('"', "'")); + $value = self::parseScalar($sequence, array(',', ']'), array('"', "'"), $i, true, $references); + + // the value can be an array if a reference has been resolved to an array var + if (!is_array($value) && !$isQuoted && false !== strpos($value, ': ')) { + // embedded mapping? + try { + $pos = 0; + $value = self::parseMapping('{'.$value.'}', $pos, $references); + } catch (\InvalidArgumentException $e) { + // no, it's not + } + } + + $output[] = $value; + + --$i; + } + + ++$i; + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); + } + + /** + * Parses a mapping to a YAML string. + * + * @param string $mapping + * @param int &$i + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException When malformed inline YAML string is parsed + */ + private static function parseMapping($mapping, &$i = 0, $references = array()) + { + $output = array(); + $len = strlen($mapping); + ++$i; + + // {foo: bar, bar:foo, ...} + while ($i < $len) { + switch ($mapping[$i]) { + case ' ': + case ',': + ++$i; + continue 2; + case '}': + if (self::$objectForMap) { + return (object) $output; + } + + return $output; + } + + // key + $key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false); + + // value + $done = false; + + while ($i < $len) { + switch ($mapping[$i]) { + case '[': + // nested sequence + $value = self::parseSequence($mapping, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + break; + case '{': + // nested mapping + $value = self::parseMapping($mapping, $i, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + break; + case ':': + case ' ': + break; + default: + $value = self::parseScalar($mapping, array(',', '}'), array('"', "'"), $i, true, $references); + // Spec: Keys MUST be unique; first one wins. + // Parser cannot abort this mapping earlier, since lines + // are processed sequentially. + if (!isset($output[$key])) { + $output[$key] = $value; + } + $done = true; + --$i; + } + + ++$i; + + if ($done) { + continue 2; + } + } + } + + throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); + } + + /** + * Evaluates scalars and replaces magic values. + * + * @param string $scalar + * @param array $references + * + * @return string A YAML string + * + * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved + */ + private static function evaluateScalar($scalar, $references = array()) + { + $scalar = trim($scalar); + $scalarLower = strtolower($scalar); + + if (0 === strpos($scalar, '*')) { + if (false !== $pos = strpos($scalar, '#')) { + $value = substr($scalar, 1, $pos - 2); + } else { + $value = substr($scalar, 1); + } + + // an unquoted * + if (false === $value || '' === $value) { + throw new ParseException('A reference must contain at least one character.'); + } + + if (!array_key_exists($value, $references)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value)); + } + + return $references[$value]; + } + + switch (true) { + case 'null' === $scalarLower: + case '' === $scalar: + case '~' === $scalar: + return; + case 'true' === $scalarLower: + return true; + case 'false' === $scalarLower: + return false; + // Optimise for returning strings. + case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || $scalar[0] === '!' || is_numeric($scalar[0]): + switch (true) { + case 0 === strpos($scalar, '!str'): + return (string) substr($scalar, 5); + case 0 === strpos($scalar, '! '): + return (int) self::parseScalar(substr($scalar, 2)); + case 0 === strpos($scalar, '!!php/object:'): + if (self::$objectSupport) { + return unserialize(substr($scalar, 13)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return; + case 0 === strpos($scalar, '!!float '): + return (float) substr($scalar, 8); + case ctype_digit($scalar): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); + case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): + $raw = $scalar; + $cast = (int) $scalar; + + return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); + case is_numeric($scalar): + case preg_match(self::getHexRegex(), $scalar): + return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; + case '.inf' === $scalarLower: + case '.nan' === $scalarLower: + return -log(0); + case '-.inf' === $scalarLower: + return log(0); + case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): + return (float) str_replace(',', '', $scalar); + case preg_match(self::getTimestampRegex(), $scalar): + return strtotime($scalar); + } + default: + return (string) $scalar; + } + } + + /** + * Gets a regex that matches a YAML date. + * + * @return string The regular expression + * + * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 + */ + private static function getTimestampRegex() + { + return <<<EOF + ~^ + (?P<year>[0-9][0-9][0-9][0-9]) + -(?P<month>[0-9][0-9]?) + -(?P<day>[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P<hour>[0-9][0-9]?) + :(?P<minute>[0-9][0-9]) + :(?P<second>[0-9][0-9]) + (?:\.(?P<fraction>[0-9]*))? + (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?) + (?::(?P<tz_minute>[0-9][0-9]))?))?)? + $~x +EOF; + } + + /** + * Gets a regex that matches a YAML number in hexadecimal notation. + * + * @return string + */ + private static function getHexRegex() + { + return '~^0x[0-9a-f]++$~i'; + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/LICENSE b/libs/php-ssh/vendor/symfony/yaml/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2015 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/libs/php-ssh/vendor/symfony/yaml/Parser.php b/libs/php-ssh/vendor/symfony/yaml/Parser.php @@ -0,0 +1,704 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Parser parses YAML strings to convert them to PHP arrays. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class Parser +{ + const FOLDED_SCALAR_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?'; + + private $offset = 0; + private $lines = array(); + private $currentLineNb = -1; + private $currentLine = ''; + private $refs = array(); + + /** + * Constructor. + * + * @param int $offset The offset of YAML document (used for line numbers in error messages) + */ + public function __construct($offset = 0) + { + $this->offset = $offset; + } + + /** + * Parses a YAML string to a PHP value. + * + * @param string $value A YAML string + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $objectForMap true if maps should return a stdClass instead of array() + * + * @return mixed A PHP value + * + * @throws ParseException If the YAML is not valid + */ + public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) + { + if (!preg_match('//u', $value)) { + throw new ParseException('The YAML value does not appear to be valid UTF-8.'); + } + $this->currentLineNb = -1; + $this->currentLine = ''; + $value = $this->cleanup($value); + $this->lines = explode("\n", $value); + + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + } + + $data = array(); + $context = null; + $allowOverwrite = false; + while ($this->moveToNextLine()) { + if ($this->isCurrentLineEmpty()) { + continue; + } + + // tab? + if ("\t" === $this->currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $isRef = $mergeNode = false; + if (preg_match('#^\-((?P<leadspaces>\s+)(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) { + if ($context && 'mapping' == $context) { + throw new ParseException('You cannot define a sequence item when in a mapping'); + } + $context = 'sequence'; + + if (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + // array + if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + $c = $this->getRealCurrentLineNb() + 1; + $parser = new self($c); + $parser->refs = &$this->refs; + $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); + } else { + if (isset($values['leadspaces']) + && preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) + ) { + // this is a compact notation element, add to next block and parse + $c = $this->getRealCurrentLineNb(); + $parser = new self($c); + $parser->refs = &$this->refs; + + $block = $values['value']; + if ($this->isNextLineIndented()) { + $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); + } + + $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap); + } else { + $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); + } + } + if ($isRef) { + $this->refs[$isRef] = end($data); + } + } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { + if ($context && 'sequence' == $context) { + throw new ParseException('You cannot define a mapping item when in a sequence'); + } + $context = 'mapping'; + + // force correct settings + Inline::parse(null, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); + try { + $key = Inline::parseScalar($values['key']); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + // Convert float keys to strings, to avoid being converted to integers by PHP + if (is_float($key)) { + $key = (string) $key; + } + + if ('<<' === $key) { + $mergeNode = true; + $allowOverwrite = true; + if (isset($values['value']) && 0 === strpos($values['value'], '*')) { + $refName = substr($values['value'], 1); + if (!array_key_exists($refName, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + $refValue = $this->refs[$refName]; + + if (!is_array($refValue)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + foreach ($refValue as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } else { + if (isset($values['value']) && $values['value'] !== '') { + $value = $values['value']; + } else { + $value = $this->getNextEmbedBlock(); + } + $c = $this->getRealCurrentLineNb() + 1; + $parser = new self($c); + $parser->refs = &$this->refs; + $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); + + if (!is_array($parsed)) { + throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + + if (isset($parsed[0])) { + // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes + // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier + // in the sequence override keys specified in later mapping nodes. + foreach ($parsed as $parsedItem) { + if (!is_array($parsedItem)) { + throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); + } + + foreach ($parsedItem as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } + } else { + // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the + // current mapping, unless the key already exists in it. + foreach ($parsed as $key => $value) { + if (!isset($data[$key])) { + $data[$key] = $value; + } + } + } + } + } elseif (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) { + $isRef = $matches['ref']; + $values['value'] = $matches['value']; + } + + if ($mergeNode) { + // Merge keys + } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + // hash + // if next line is less indented or equal, then it means that the current value is null + if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = null; + } + } else { + $c = $this->getRealCurrentLineNb() + 1; + $parser = new self($c); + $parser->refs = &$this->refs; + $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = $value; + } + } + } else { + $value = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); + // Spec: Keys MUST be unique; first one wins. + // But overwriting is allowed when a merge node is used in current block. + if ($allowOverwrite || !isset($data[$key])) { + $data[$key] = $value; + } + } + if ($isRef) { + $this->refs[$isRef] = $data[$key]; + } + } else { + // multiple documents are not supported + if ('---' === $this->currentLine) { + throw new ParseException('Multiple documents are not supported.'); + } + + // 1-liner optionally followed by newline(s) + if (is_string($value) && $this->lines[0] === trim($value)) { + try { + $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + + if (is_array($value)) { + $first = reset($value); + if (is_string($first) && 0 === strpos($first, '*')) { + $data = array(); + foreach ($value as $alias) { + $data[] = $this->refs[substr($alias, 1)]; + } + $value = $data; + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return $value; + } + + switch (preg_last_error()) { + case PREG_INTERNAL_ERROR: + $error = 'Internal PCRE error.'; + break; + case PREG_BACKTRACK_LIMIT_ERROR: + $error = 'pcre.backtrack_limit reached.'; + break; + case PREG_RECURSION_LIMIT_ERROR: + $error = 'pcre.recursion_limit reached.'; + break; + case PREG_BAD_UTF8_ERROR: + $error = 'Malformed UTF-8 data.'; + break; + case PREG_BAD_UTF8_OFFSET_ERROR: + $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; + break; + default: + $error = 'Unable to parse.'; + } + + throw new ParseException($error, $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + if (isset($mbEncoding)) { + mb_internal_encoding($mbEncoding); + } + + return empty($data) ? null : $data; + } + + /** + * Returns the current line number (takes the offset into account). + * + * @return int The current line number + */ + private function getRealCurrentLineNb() + { + return $this->currentLineNb + $this->offset; + } + + /** + * Returns the current line indentation. + * + * @return int The current line indentation + */ + private function getCurrentLineIndentation() + { + return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' ')); + } + + /** + * Returns the next embed block of YAML. + * + * @param int $indentation The indent level at which the block is to be read, or null for default + * @param bool $inSequence True if the enclosing data structure is a sequence + * + * @return string A YAML string + * + * @throws ParseException When indentation problem are detected + */ + private function getNextEmbedBlock($indentation = null, $inSequence = false) + { + $oldLineIndentation = $this->getCurrentLineIndentation(); + + if (!$this->moveToNextLine()) { + return; + } + + if (null === $indentation) { + $newIndent = $this->getCurrentLineIndentation(); + + $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine); + + if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } else { + $newIndent = $indentation; + } + + $data = array(); + if ($this->getCurrentLineIndentation() >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } else { + $this->moveToPreviousLine(); + + return; + } + + if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { + // the previous line contained a dash but no item content, this line is a sequence item with the same indentation + // and therefore no nested list or mapping + $this->moveToPreviousLine(); + + return; + } + + $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine); + + // Comments must not be removed inside a string block (ie. after a line ending with "|") + $removeCommentsPattern = '~'.self::FOLDED_SCALAR_PATTERN.'$~'; + $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); + + while ($this->moveToNextLine()) { + $indent = $this->getCurrentLineIndentation(); + + if ($indent === $newIndent) { + $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); + } + + if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) { + $this->moveToPreviousLine(); + break; + } + + if ($this->isCurrentLineBlank()) { + $data[] = substr($this->currentLine, $newIndent); + continue; + } + + if ($removeComments && $this->isCurrentLineComment()) { + continue; + } + + if ($indent >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } elseif (0 == $indent) { + $this->moveToPreviousLine(); + + break; + } else { + throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); + } + } + + return implode("\n", $data); + } + + /** + * Moves the parser to the next line. + * + * @return bool + */ + private function moveToNextLine() + { + if ($this->currentLineNb >= count($this->lines) - 1) { + return false; + } + + $this->currentLine = $this->lines[++$this->currentLineNb]; + + return true; + } + + /** + * Moves the parser to the previous line. + */ + private function moveToPreviousLine() + { + $this->currentLine = $this->lines[--$this->currentLineNb]; + } + + /** + * Parses a YAML value. + * + * @param string $value A YAML value + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap true if maps should return a stdClass instead of array() + * + * @return mixed A PHP value + * + * @throws ParseException When reference does not exist + */ + private function parseValue($value, $exceptionOnInvalidType, $objectSupport, $objectForMap) + { + if (0 === strpos($value, '*')) { + if (false !== $pos = strpos($value, '#')) { + $value = substr($value, 1, $pos - 2); + } else { + $value = substr($value, 1); + } + + if (!array_key_exists($value, $this->refs)) { + throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLine); + } + + return $this->refs[$value]; + } + + if (preg_match('/^'.self::FOLDED_SCALAR_PATTERN.'$/', $value, $matches)) { + $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; + + return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); + } + + try { + return Inline::parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); + } catch (ParseException $e) { + $e->setParsedLine($this->getRealCurrentLineNb() + 1); + $e->setSnippet($this->currentLine); + + throw $e; + } + } + + /** + * Parses a folded scalar. + * + * @param string $separator The separator that was used to begin this folded scalar (| or >) + * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) + * @param int $indentation The indentation that was used to begin this folded scalar + * + * @return string The text value + */ + private function parseFoldedScalar($separator, $indicator = '', $indentation = 0) + { + $notEOF = $this->moveToNextLine(); + if (!$notEOF) { + return ''; + } + + $isCurrentLineBlank = $this->isCurrentLineBlank(); + $text = ''; + + // leading blank lines are consumed before determining indentation + while ($notEOF && $isCurrentLineBlank) { + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $text .= "\n"; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + + // determine indentation if not specified + if (0 === $indentation) { + if (preg_match('/^ +/', $this->currentLine, $matches)) { + $indentation = strlen($matches[0]); + } + } + + if ($indentation > 0) { + $pattern = sprintf('/^ {%d}(.*)$/', $indentation); + + while ( + $notEOF && ( + $isCurrentLineBlank || + preg_match($pattern, $this->currentLine, $matches) + ) + ) { + if ($isCurrentLineBlank) { + $text .= substr($this->currentLine, $indentation); + } else { + $text .= $matches[1]; + } + + // newline only if not EOF + if ($notEOF = $this->moveToNextLine()) { + $text .= "\n"; + $isCurrentLineBlank = $this->isCurrentLineBlank(); + } + } + } elseif ($notEOF) { + $text .= "\n"; + } + + if ($notEOF) { + $this->moveToPreviousLine(); + } + + // replace all non-trailing single newlines with spaces in folded blocks + if ('>' === $separator) { + preg_match('/(\n*)$/', $text, $matches); + $text = preg_replace('/(?<!\n)\n(?!\n)/', ' ', rtrim($text, "\n")); + $text .= $matches[1]; + } + + // deal with trailing newlines as indicated + if ('' === $indicator) { + $text = preg_replace('/\n+$/', "\n", $text); + } elseif ('-' === $indicator) { + $text = preg_replace('/\n+$/', '', $text); + } + + return $text; + } + + /** + * Returns true if the next line is indented. + * + * @return bool Returns true if the next line is indented, false otherwise + */ + private function isNextLineIndented() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $EOF = !$this->moveToNextLine(); + + while (!$EOF && $this->isCurrentLineEmpty()) { + $EOF = !$this->moveToNextLine(); + } + + if ($EOF) { + return false; + } + + $ret = false; + if ($this->getCurrentLineIndentation() > $currentIndentation) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the current line is blank or if it is a comment line. + * + * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise + */ + private function isCurrentLineEmpty() + { + return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); + } + + /** + * Returns true if the current line is blank. + * + * @return bool Returns true if the current line is blank, false otherwise + */ + private function isCurrentLineBlank() + { + return '' == trim($this->currentLine, ' '); + } + + /** + * Returns true if the current line is a comment line. + * + * @return bool Returns true if the current line is a comment line, false otherwise + */ + private function isCurrentLineComment() + { + //checking explicitly the first char of the trim is faster than loops or strpos + $ltrimmedLine = ltrim($this->currentLine, ' '); + + return $ltrimmedLine[0] === '#'; + } + + /** + * Cleanups a YAML string to be parsed. + * + * @param string $value The input YAML string + * + * @return string A cleaned up YAML string + */ + private function cleanup($value) + { + $value = str_replace(array("\r\n", "\r"), "\n", $value); + + // strip YAML header + $count = 0; + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); + $this->offset += $count; + + // remove leading comments + $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + } + + // remove start of the document marker (---) + $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); + if ($count == 1) { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + + // remove end of the document marker (...) + $value = preg_replace('#\.\.\.\s*$#', '', $value); + } + + return $value; + } + + /** + * Returns true if the next line starts unindented collection. + * + * @return bool Returns true if the next line starts unindented collection, false otherwise + */ + private function isNextLineUnIndentedCollection() + { + $currentIndentation = $this->getCurrentLineIndentation(); + $notEOF = $this->moveToNextLine(); + + while ($notEOF && $this->isCurrentLineEmpty()) { + $notEOF = $this->moveToNextLine(); + } + + if (false === $notEOF) { + return false; + } + + $ret = false; + if ( + $this->getCurrentLineIndentation() == $currentIndentation + && + $this->isStringUnIndentedCollectionItem($this->currentLine) + ) { + $ret = true; + } + + $this->moveToPreviousLine(); + + return $ret; + } + + /** + * Returns true if the string is un-indented collection item. + * + * @return bool Returns true if the string is un-indented collection item, false otherwise + */ + private function isStringUnIndentedCollectionItem() + { + return (0 === strpos($this->currentLine, '- ')); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/README.md b/libs/php-ssh/vendor/symfony/yaml/README.md @@ -0,0 +1,21 @@ +Yaml Component +============== + +YAML implements most of the YAML 1.2 specification. + +```php +use Symfony\Component\Yaml\Yaml; + +$array = Yaml::parse(file_get_contents(filename)); + +print Yaml::dump($array); +``` + +Resources +--------- + +You can run the unit tests with the following command: + + $ cd path/to/Symfony/Component/Yaml/ + $ composer install + $ phpunit diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/DumperTest.php b/libs/php-ssh/vendor/symfony/yaml/Tests/DumperTest.php @@ -0,0 +1,236 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Parser; +use Symfony\Component\Yaml\Dumper; + +class DumperTest extends \PHPUnit_Framework_TestCase +{ + protected $parser; + protected $dumper; + protected $path; + + protected $array = array( + '' => 'bar', + 'foo' => '#bar', + 'foo\'bar' => array(), + 'bar' => array(1, 'foo'), + 'foobar' => array( + 'foo' => 'bar', + 'bar' => array(1, 'foo'), + 'foobar' => array( + 'foo' => 'bar', + 'bar' => array(1, 'foo'), + ), + ), + ); + + protected function setUp() + { + $this->parser = new Parser(); + $this->dumper = new Dumper(); + $this->path = __DIR__.'/Fixtures'; + } + + protected function tearDown() + { + $this->parser = null; + $this->dumper = null; + $this->path = null; + $this->array = null; + } + + public function testSetIndentation() + { + $this->dumper->setIndentation(7); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: + - 1 + - foo + foobar: + foo: bar + bar: + - 1 + - foo + +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, 4, 0)); + } + + public function testSpecifications() + { + $files = $this->parser->parse(file_get_contents($this->path.'/index.yml')); + foreach ($files as $file) { + $yamls = file_get_contents($this->path.'/'.$file.'.yml'); + + // split YAMLs documents + foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { + if (!$yaml) { + continue; + } + + $test = $this->parser->parse($yaml); + if (isset($test['dump_skip']) && $test['dump_skip']) { + continue; + } elseif (isset($test['todo']) && $test['todo']) { + // TODO + } else { + eval('$expected = '.trim($test['php']).';'); + $this->assertSame($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); + } + } + } + } + + public function testInlineLevel() + { + $expected = <<<EOF +{ '': bar, foo: '#bar', 'foo''bar': { }, bar: [1, foo], foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } } +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, -10), '->dump() takes an inline level argument'); + $this->assertEquals($expected, $this->dumper->dump($this->array, 0), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: [1, foo] +foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } + +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, 1), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: [1, foo] + foobar: { foo: bar, bar: [1, foo] } + +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, 2), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: + - 1 + - foo + foobar: + foo: bar + bar: [1, foo] + +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, 3), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: + - 1 + - foo + foobar: + foo: bar + bar: + - 1 + - foo + +EOF; + $this->assertEquals($expected, $this->dumper->dump($this->array, 4), '->dump() takes an inline level argument'); + $this->assertEquals($expected, $this->dumper->dump($this->array, 10), '->dump() takes an inline level argument'); + } + + public function testObjectSupportEnabled() + { + $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, true); + + $this->assertEquals('{ foo: !!php/object:O:30:"Symfony\Component\Yaml\Tests\A":1:{s:1:"a";s:3:"foo";}, bar: 1 }', $dump, '->dump() is able to dump objects'); + } + + public function testObjectSupportDisabledButNoExceptions() + { + $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1)); + + $this->assertEquals('{ foo: null, bar: 1 }', $dump, '->dump() does not dump objects when disabled'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\DumpException + */ + public function testObjectSupportDisabledWithExceptions() + { + $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, true, false); + } + + /** + * @dataProvider getEscapeSequences + */ + public function testEscapedEscapeSequencesInQuotedScalar($input, $expected) + { + $this->assertEquals($expected, $this->dumper->dump($input)); + } + + public function getEscapeSequences() + { + return array( + 'null' => array("\t\\0", '"\t\\\\0"'), + 'bell' => array("\t\\a", '"\t\\\\a"'), + 'backspace' => array("\t\\b", '"\t\\\\b"'), + 'horizontal-tab' => array("\t\\t", '"\t\\\\t"'), + 'line-feed' => array("\t\\n", '"\t\\\\n"'), + 'vertical-tab' => array("\t\\v", '"\t\\\\v"'), + 'form-feed' => array("\t\\f", '"\t\\\\f"'), + 'carriage-return' => array("\t\\r", '"\t\\\\r"'), + 'escape' => array("\t\\e", '"\t\\\\e"'), + 'space' => array("\t\\ ", '"\t\\\\ "'), + 'double-quote' => array("\t\\\"", '"\t\\\\\\""'), + 'slash' => array("\t\\/", '"\t\\\\/"'), + 'backslash' => array("\t\\\\", '"\t\\\\\\\\"'), + 'next-line' => array("\t\\N", '"\t\\\\N"'), + 'non-breaking-space' => array("\t\\�", '"\t\\\\�"'), + 'line-separator' => array("\t\\L", '"\t\\\\L"'), + 'paragraph-separator' => array("\t\\P", '"\t\\\\P"'), + ); + } +} + +class A +{ + public $a = 'foo'; +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsAnchorAlias.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsAnchorAlias.yml @@ -0,0 +1,31 @@ +--- %YAML:1.0 +test: Simple Alias Example +brief: > + If you need to refer to the same item of data twice, + you can give that item an alias. The alias is a plain + string, starting with an ampersand. The item may then + be referred to by the alias throughout your document + by using an asterisk before the name of the alias. + This is called an anchor. +yaml: | + - &showell Steve + - Clark + - Brian + - Oren + - *showell +php: | + array('Steve', 'Clark', 'Brian', 'Oren', 'Steve') + +--- +test: Alias of a Mapping +brief: > + An alias can be used on any item of data, including + sequences, mappings, and other complex data types. +yaml: | + - &hello + Meat: pork + Starch: potato + - banana + - *hello +php: | + array(array('Meat'=>'pork', 'Starch'=>'potato'), 'banana', array('Meat'=>'pork', 'Starch'=>'potato')) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBasicTests.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBasicTests.yml @@ -0,0 +1,202 @@ +--- %YAML:1.0 +test: Simple Sequence +brief: | + You can specify a list in YAML by placing each + member of the list on a new line with an opening + dash. These lists are called sequences. +yaml: | + - apple + - banana + - carrot +php: | + array('apple', 'banana', 'carrot') +--- +test: Sequence With Item Being Null In The Middle +brief: | + You can specify a list in YAML by placing each + member of the list on a new line with an opening + dash. These lists are called sequences. +yaml: | + - apple + - + - carrot +php: | + array('apple', null, 'carrot') +--- +test: Sequence With Last Item Being Null +brief: | + You can specify a list in YAML by placing each + member of the list on a new line with an opening + dash. These lists are called sequences. +yaml: | + - apple + - banana + - +php: | + array('apple', 'banana', null) +--- +test: Nested Sequences +brief: | + You can include a sequence within another + sequence by giving the sequence an empty + dash, followed by an indented list. +yaml: | + - + - foo + - bar + - baz +php: | + array(array('foo', 'bar', 'baz')) +--- +test: Mixed Sequences +brief: | + Sequences can contain any YAML data, + including strings and other sequences. +yaml: | + - apple + - + - foo + - bar + - x123 + - banana + - carrot +php: | + array('apple', array('foo', 'bar', 'x123'), 'banana', 'carrot') +--- +test: Deeply Nested Sequences +brief: | + Sequences can be nested even deeper, with each + level of indentation representing a level of + depth. +yaml: | + - + - + - uno + - dos +php: | + array(array(array('uno', 'dos'))) +--- +test: Simple Mapping +brief: | + You can add a keyed list (also known as a dictionary or + hash) to your document by placing each member of the + list on a new line, with a colon separating the key + from its value. In YAML, this type of list is called + a mapping. +yaml: | + foo: whatever + bar: stuff +php: | + array('foo' => 'whatever', 'bar' => 'stuff') +--- +test: Sequence in a Mapping +brief: | + A value in a mapping can be a sequence. +yaml: | + foo: whatever + bar: + - uno + - dos +php: | + array('foo' => 'whatever', 'bar' => array('uno', 'dos')) +--- +test: Nested Mappings +brief: | + A value in a mapping can be another mapping. +yaml: | + foo: whatever + bar: + fruit: apple + name: steve + sport: baseball +php: | + array( + 'foo' => 'whatever', + 'bar' => array( + 'fruit' => 'apple', + 'name' => 'steve', + 'sport' => 'baseball' + ) + ) +--- +test: Mixed Mapping +brief: | + A mapping can contain any assortment + of mappings and sequences as values. +yaml: | + foo: whatever + bar: + - + fruit: apple + name: steve + sport: baseball + - more + - + python: rocks + perl: papers + ruby: scissorses +php: | + array( + 'foo' => 'whatever', + 'bar' => array( + array( + 'fruit' => 'apple', + 'name' => 'steve', + 'sport' => 'baseball' + ), + 'more', + array( + 'python' => 'rocks', + 'perl' => 'papers', + 'ruby' => 'scissorses' + ) + ) + ) +--- +test: Mapping-in-Sequence Shortcut +todo: true +brief: | + If you are adding a mapping to a sequence, you + can place the mapping on the same line as the + dash as a shortcut. +yaml: | + - work on YAML.py: + - work on Store +php: | + array(array('work on YAML.py' => array('work on Store'))) +--- +test: Sequence-in-Mapping Shortcut +todo: true +brief: | + The dash in a sequence counts as indentation, so + you can add a sequence inside of a mapping without + needing spaces as indentation. +yaml: | + allow: + - 'localhost' + - '%.sourceforge.net' + - '%.freepan.org' +php: | + array('allow' => array('localhost', '%.sourceforge.net', '%.freepan.org')) +--- +todo: true +test: Merge key +brief: | + A merge key ('<<') can be used in a mapping to insert other mappings. If + the value associated with the merge key is a mapping, each of its key/value + pairs is inserted into the current mapping. +yaml: | + mapping: + name: Joe + job: Accountant + <<: + age: 38 +php: | + array( + 'mapping' => + array( + 'name' => 'Joe', + 'job' => 'Accountant', + 'age' => 38 + ) + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBlockMapping.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsBlockMapping.yml @@ -0,0 +1,51 @@ +--- +test: One Element Mapping +brief: | + A mapping with one key/value pair +yaml: | + foo: bar +php: | + array('foo' => 'bar') +--- +test: Multi Element Mapping +brief: | + More than one key/value pair +yaml: | + red: baron + white: walls + blue: berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) +--- +test: Values aligned +brief: | + Often times human editors of documents will align the values even + though YAML emitters generally don't. +yaml: | + red: baron + white: walls + blue: berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) +--- +test: Colons aligned +brief: | + Spaces can come before the ': ' key/value separator. +yaml: | + red : baron + white : walls + blue : berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsDocumentSeparator.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsDocumentSeparator.yml @@ -0,0 +1,85 @@ +--- %YAML:1.0 +test: Trailing Document Separator +todo: true +brief: > + You can separate YAML documents + with a string of three dashes. +yaml: | + - foo: 1 + bar: 2 + --- + more: stuff +python: | + [ + [ { 'foo': 1, 'bar': 2 } ], + { 'more': 'stuff' } + ] +ruby: | + [ { 'foo' => 1, 'bar' => 2 } ] + +--- +test: Leading Document Separator +todo: true +brief: > + You can explicitly give an opening + document separator to your YAML stream. +yaml: | + --- + - foo: 1 + bar: 2 + --- + more: stuff +python: | + [ + [ {'foo': 1, 'bar': 2}], + {'more': 'stuff'} + ] +ruby: | + [ { 'foo' => 1, 'bar' => 2 } ] + +--- +test: YAML Header +todo: true +brief: > + The opening separator can contain directives + to the YAML parser, such as the version + number. +yaml: | + --- %YAML:1.0 + foo: 1 + bar: 2 +php: | + array('foo' => 1, 'bar' => 2) +documents: 1 + +--- +test: Red Herring Document Separator +brief: > + Separators included in blocks or strings + are treated as blocks or strings, as the + document separator should have no indentation + preceding it. +yaml: | + foo: | + --- +php: | + array('foo' => "---\n") + +--- +test: Multiple Document Separators in Block +brief: > + This technique allows you to embed other YAML + documents within literal blocks. +yaml: | + foo: | + --- + foo: bar + --- + yo: baz + bar: | + fooness +php: | + array( + 'foo' => "---\nfoo: bar\n---\nyo: baz\n", + 'bar' => "fooness\n" + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsErrorTests.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsErrorTests.yml @@ -0,0 +1,25 @@ +--- +test: Missing value for hash item +todo: true +brief: | + Third item in this hash doesn't have a value +yaml: | + okay: value + also okay: ~ + causes error because no value specified + last key: value okay here too +python-error: causes error because no value specified + +--- +test: Not indenting enough +brief: | + There was a bug in PyYaml where it was off by one + in the indentation check. It was allowing the YAML + below. +# This is actually valid YAML now. Someone should tell showell. +yaml: | + foo: + firstline: 1 + secondline: 2 +php: | + array('foo' => null, 'firstline' => 1, 'secondline' => 2) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFlowCollections.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFlowCollections.yml @@ -0,0 +1,60 @@ +--- +test: Simple Inline Array +brief: > + Sequences can be contained on a + single line, using the inline syntax. + Separate each entry with commas and + enclose in square brackets. +yaml: | + seq: [ a, b, c ] +php: | + array('seq' => array('a', 'b', 'c')) +--- +test: Simple Inline Hash +brief: > + Mapping can also be contained on + a single line, using the inline + syntax. Each key-value pair is + separated by a colon, with a comma + between each entry in the mapping. + Enclose with curly braces. +yaml: | + hash: { name: Steve, foo: bar } +php: | + array('hash' => array('name' => 'Steve', 'foo' => 'bar')) +--- +test: Multi-line Inline Collections +todo: true +brief: > + Both inline sequences and inline mappings + can span multiple lines, provided that you + indent the additional lines. +yaml: | + languages: [ Ruby, + Perl, + Python ] + websites: { YAML: yaml.org, + Ruby: ruby-lang.org, + Python: python.org, + Perl: use.perl.org } +php: | + array( + 'languages' => array('Ruby', 'Perl', 'Python'), + 'websites' => array( + 'YAML' => 'yaml.org', + 'Ruby' => 'ruby-lang.org', + 'Python' => 'python.org', + 'Perl' => 'use.perl.org' + ) + ) +--- +test: Commas in Values (not in the spec!) +todo: true +brief: > + List items in collections are delimited by commas, but + there must be a space after each comma. This allows you + to add numbers without quoting. +yaml: | + attendances: [ 45,123, 70,000, 17,222 ] +php: | + array('attendances' => array(45123, 70000, 17222)) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFoldedScalars.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsFoldedScalars.yml @@ -0,0 +1,176 @@ +--- %YAML:1.0 +test: Single ending newline +brief: > + A pipe character, followed by an indented + block of text is treated as a literal + block, in which newlines are preserved + throughout the block, including the final + newline. +yaml: | + --- + this: | + Foo + Bar +php: | + array('this' => "Foo\nBar\n") +--- +test: The '+' indicator +brief: > + The '+' indicator says to keep newlines at the end of text + blocks. +yaml: | + normal: | + extra new lines not kept + + preserving: |+ + extra new lines are kept + + + dummy: value +php: | + array( + 'normal' => "extra new lines not kept\n", + 'preserving' => "extra new lines are kept\n\n\n", + 'dummy' => 'value' + ) +--- +test: Three trailing newlines in literals +brief: > + To give you more control over how space + is preserved in text blocks, YAML has + the keep '+' and chomp '-' indicators. + The keep indicator will preserve all + ending newlines, while the chomp indicator + will strip all ending newlines. +yaml: | + clipped: | + This has one newline. + + + + same as "clipped" above: "This has one newline.\n" + + stripped: |- + This has no newline. + + + + same as "stripped" above: "This has no newline." + + kept: |+ + This has four newlines. + + + + same as "kept" above: "This has four newlines.\n\n\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has four newlines.\n\n\n\n", + 'same as "kept" above' => "This has four newlines.\n\n\n\n" + ) +--- +test: Extra trailing newlines with spaces +todo: true +brief: > + Normally, only a single newline is kept + from the end of a literal block, unless the + keep '+' character is used in combination + with the pipe. The following example + will preserve all ending whitespace + since the last line of both literal blocks + contains spaces which extend past the indentation + level. +yaml: | + --- + this: | + Foo + + + kept: |+ + Foo + + +php: | + array('this' => "Foo\n\n \n", + 'kept' => "Foo\n\n \n" ) + +--- +test: Folded Block in a Sequence +brief: > + A greater-then character, followed by an indented + block of text is treated as a folded block, in + which lines of text separated by a single newline + are concatenated as a single line. +yaml: | + --- + - apple + - banana + - > + can't you see + the beauty of yaml? + hmm + - dog +php: | + array( + 'apple', + 'banana', + "can't you see the beauty of yaml? hmm\n", + 'dog' + ) +--- +test: Folded Block as a Mapping Value +brief: > + Both literal and folded blocks can be + used in collections, as values in a + sequence or a mapping. +yaml: | + --- + quote: > + Mark McGwire's + year was crippled + by a knee injury. + source: espn +php: | + array( + 'quote' => "Mark McGwire's year was crippled by a knee injury.\n", + 'source' => 'espn' + ) +--- +test: Three trailing newlines in folded blocks +brief: > + The keep and chomp indicators can also + be applied to folded blocks. +yaml: | + clipped: > + This has one newline. + + + + same as "clipped" above: "This has one newline.\n" + + stripped: >- + This has no newline. + + + + same as "stripped" above: "This has no newline." + + kept: >+ + This has four newlines. + + + + same as "kept" above: "This has four newlines.\n\n\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has four newlines.\n\n\n\n", + 'same as "kept" above' => "This has four newlines.\n\n\n\n" + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsNullsAndEmpties.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsNullsAndEmpties.yml @@ -0,0 +1,45 @@ +--- %YAML:1.0 +test: Empty Sequence +brief: > + You can represent the empty sequence + with an empty inline sequence. +yaml: | + empty: [] +php: | + array('empty' => array()) +--- +test: Empty Mapping +brief: > + You can represent the empty mapping + with an empty inline mapping. +yaml: | + empty: {} +php: | + array('empty' => array()) +--- +test: Empty Sequence as Entire Document +yaml: | + [] +php: | + array() +--- +test: Empty Mapping as Entire Document +yaml: | + {} +php: | + array() +--- +test: Null as Document +yaml: | + ~ +php: | + null +--- +test: Empty String +brief: > + You can represent an empty string + with a pair of quotes. +yaml: | + '' +php: | + '' diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsSpecificationExamples.yml @@ -0,0 +1,1697 @@ +--- %YAML:1.0 +test: Sequence of scalars +spec: 2.1 +yaml: | + - Mark McGwire + - Sammy Sosa + - Ken Griffey +php: | + array('Mark McGwire', 'Sammy Sosa', 'Ken Griffey') +--- +test: Mapping of scalars to scalars +spec: 2.2 +yaml: | + hr: 65 + avg: 0.278 + rbi: 147 +php: | + array('hr' => 65, 'avg' => 0.278, 'rbi' => 147) +--- +test: Mapping of scalars to sequences +spec: 2.3 +yaml: | + american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees + national: + - New York Mets + - Chicago Cubs + - Atlanta Braves +php: | + array('american' => + array( 'Boston Red Sox', 'Detroit Tigers', + 'New York Yankees' ), + 'national' => + array( 'New York Mets', 'Chicago Cubs', + 'Atlanta Braves' ) + ) +--- +test: Sequence of mappings +spec: 2.4 +yaml: | + - + name: Mark McGwire + hr: 65 + avg: 0.278 + - + name: Sammy Sosa + hr: 63 + avg: 0.288 +php: | + array( + array('name' => 'Mark McGwire', 'hr' => 65, 'avg' => 0.278), + array('name' => 'Sammy Sosa', 'hr' => 63, 'avg' => 0.288) + ) +--- +test: Legacy A5 +todo: true +spec: legacy_A5 +yaml: | + ? + - New York Yankees + - Atlanta Braves + : + - 2001-07-02 + - 2001-08-12 + - 2001-08-14 + ? + - Detroit Tigers + - Chicago Cubs + : + - 2001-07-23 +perl-busted: > + YAML.pm will be able to emulate this behavior soon. In this regard + it may be somewhat more correct than Python's native behaviour which + can only use tuples as mapping keys. PyYAML will also need to figure + out some clever way to roundtrip structured keys. +python: | + [ + { + ('New York Yankees', 'Atlanta Braves'): + [yaml.timestamp('2001-07-02'), + yaml.timestamp('2001-08-12'), + yaml.timestamp('2001-08-14')], + ('Detroit Tigers', 'Chicago Cubs'): + [yaml.timestamp('2001-07-23')] + } + ] +ruby: | + { + [ 'New York Yankees', 'Atlanta Braves' ] => + [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ], + [ 'Detroit Tigers', 'Chicago Cubs' ] => + [ Date.new( 2001, 7, 23 ) ] + } +syck: | + struct test_node seq1[] = { + { T_STR, 0, "New York Yankees" }, + { T_STR, 0, "Atlanta Braves" }, + end_node + }; + struct test_node seq2[] = { + { T_STR, 0, "2001-07-02" }, + { T_STR, 0, "2001-08-12" }, + { T_STR, 0, "2001-08-14" }, + end_node + }; + struct test_node seq3[] = { + { T_STR, 0, "Detroit Tigers" }, + { T_STR, 0, "Chicago Cubs" }, + end_node + }; + struct test_node seq4[] = { + { T_STR, 0, "2001-07-23" }, + end_node + }; + struct test_node map[] = { + { T_SEQ, 0, 0, seq1 }, + { T_SEQ, 0, 0, seq2 }, + { T_SEQ, 0, 0, seq3 }, + { T_SEQ, 0, 0, seq4 }, + end_node + }; + struct test_node stream[] = { + { T_MAP, 0, 0, map }, + end_node + }; + +--- +test: Sequence of sequences +spec: 2.5 +yaml: | + - [ name , hr , avg ] + - [ Mark McGwire , 65 , 0.278 ] + - [ Sammy Sosa , 63 , 0.288 ] +php: | + array( + array( 'name', 'hr', 'avg' ), + array( 'Mark McGwire', 65, 0.278 ), + array( 'Sammy Sosa', 63, 0.288 ) + ) +--- +test: Mapping of mappings +todo: true +spec: 2.6 +yaml: | + Mark McGwire: {hr: 65, avg: 0.278} + Sammy Sosa: { + hr: 63, + avg: 0.288 + } +php: | + array( + 'Mark McGwire' => + array( 'hr' => 65, 'avg' => 0.278 ), + 'Sammy Sosa' => + array( 'hr' => 63, 'avg' => 0.288 ) + ) +--- +test: Two documents in a stream each with a leading comment +todo: true +spec: 2.7 +yaml: | + # Ranking of 1998 home runs + --- + - Mark McGwire + - Sammy Sosa + - Ken Griffey + + # Team ranking + --- + - Chicago Cubs + - St Louis Cardinals +ruby: | + y = YAML::Stream.new + y.add( [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] ) + y.add( [ 'Chicago Cubs', 'St Louis Cardinals' ] ) +documents: 2 + +--- +test: Play by play feed from a game +todo: true +spec: 2.8 +yaml: | + --- + time: 20:03:20 + player: Sammy Sosa + action: strike (miss) + ... + --- + time: 20:03:47 + player: Sammy Sosa + action: grand slam + ... +perl: | + [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] +documents: 2 + +--- +test: Single document with two comments +spec: 2.9 +yaml: | + hr: # 1998 hr ranking + - Mark McGwire + - Sammy Sosa + rbi: + # 1998 rbi ranking + - Sammy Sosa + - Ken Griffey +php: | + array( + 'hr' => array( 'Mark McGwire', 'Sammy Sosa' ), + 'rbi' => array( 'Sammy Sosa', 'Ken Griffey' ) + ) +--- +test: Node for Sammy Sosa appears twice in this document +spec: 2.10 +yaml: | + --- + hr: + - Mark McGwire + # Following node labeled SS + - &SS Sammy Sosa + rbi: + - *SS # Subsequent occurrence + - Ken Griffey +php: | + array( + 'hr' => + array('Mark McGwire', 'Sammy Sosa'), + 'rbi' => + array('Sammy Sosa', 'Ken Griffey') + ) +--- +test: Mapping between sequences +todo: true +spec: 2.11 +yaml: | + ? # PLAY SCHEDULE + - Detroit Tigers + - Chicago Cubs + : + - 2001-07-23 + + ? [ New York Yankees, + Atlanta Braves ] + : [ 2001-07-02, 2001-08-12, + 2001-08-14 ] +ruby: | + { + [ 'Detroit Tigers', 'Chicago Cubs' ] => [ Date.new( 2001, 7, 23 ) ], + [ 'New York Yankees', 'Atlanta Braves' ] => [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ] + } +syck: | + struct test_node seq1[] = { + { T_STR, 0, "New York Yankees" }, + { T_STR, 0, "Atlanta Braves" }, + end_node + }; + struct test_node seq2[] = { + { T_STR, 0, "2001-07-02" }, + { T_STR, 0, "2001-08-12" }, + { T_STR, 0, "2001-08-14" }, + end_node + }; + struct test_node seq3[] = { + { T_STR, 0, "Detroit Tigers" }, + { T_STR, 0, "Chicago Cubs" }, + end_node + }; + struct test_node seq4[] = { + { T_STR, 0, "2001-07-23" }, + end_node + }; + struct test_node map[] = { + { T_SEQ, 0, 0, seq3 }, + { T_SEQ, 0, 0, seq4 }, + { T_SEQ, 0, 0, seq1 }, + { T_SEQ, 0, 0, seq2 }, + end_node + }; + struct test_node stream[] = { + { T_MAP, 0, 0, map }, + end_node + }; + +--- +test: Sequence key shortcut +spec: 2.12 +yaml: | + --- + # products purchased + - item : Super Hoop + quantity: 1 + - item : Basketball + quantity: 4 + - item : Big Shoes + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'item' => 'Basketball', + 'quantity' => 4, + ), + array ( + 'item' => 'Big Shoes', + 'quantity' => 1, + ) + ) +perl: | + [ + { item => 'Super Hoop', quantity => 1 }, + { item => 'Basketball', quantity => 4 }, + { item => 'Big Shoes', quantity => 1 } + ] + +ruby: | + [ + { 'item' => 'Super Hoop', 'quantity' => 1 }, + { 'item' => 'Basketball', 'quantity' => 4 }, + { 'item' => 'Big Shoes', 'quantity' => 1 } + ] +python: | + [ + { 'item': 'Super Hoop', 'quantity': 1 }, + { 'item': 'Basketball', 'quantity': 4 }, + { 'item': 'Big Shoes', 'quantity': 1 } + ] +syck: | + struct test_node map1[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Super Hoop" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "1" }, + end_node + }; + struct test_node map2[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Basketball" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "4" }, + end_node + }; + struct test_node map3[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Big Shoes" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "1" }, + end_node + }; + struct test_node seq[] = { + { T_MAP, 0, 0, map1 }, + { T_MAP, 0, 0, map2 }, + { T_MAP, 0, 0, map3 }, + end_node + }; + struct test_node stream[] = { + { T_SEQ, 0, 0, seq }, + end_node + }; + + +--- +test: Literal perserves newlines +todo: true +spec: 2.13 +yaml: | + # ASCII Art + --- | + \//||\/|| + // || ||_ +perl: | + "\\//||\\/||\n// || ||_\n" +ruby: | + "\\//||\\/||\n// || ||_\n" +python: | + [ + flushLeft( + """ + \//||\/|| + // || ||_ + """ + ) + ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "\\//||\\/||\n// || ||_\n" }, + end_node + }; + +--- +test: Folded treats newlines as a space +todo: true +spec: 2.14 +yaml: | + --- + Mark McGwire's + year was crippled + by a knee injury. +perl: | + "Mark McGwire's year was crippled by a knee injury." +ruby: | + "Mark McGwire's year was crippled by a knee injury." +python: | + [ "Mark McGwire's year was crippled by a knee injury." ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "Mark McGwire's year was crippled by a knee injury." }, + end_node + }; + +--- +test: Newlines preserved for indented and blank lines +todo: true +spec: 2.15 +yaml: | + --- > + Sammy Sosa completed another + fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! +perl: | + "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" +ruby: | + "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" +python: | + [ + flushLeft( + """ + Sammy Sosa completed another fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! + """ + ) + ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" }, + end_node + }; + + +--- +test: Indentation determines scope +spec: 2.16 +yaml: | + name: Mark McGwire + accomplishment: > + Mark set a major league + home run record in 1998. + stats: | + 65 Home Runs + 0.278 Batting Average +php: | + array( + 'name' => 'Mark McGwire', + 'accomplishment' => "Mark set a major league home run record in 1998.\n", + 'stats' => "65 Home Runs\n0.278 Batting Average\n" + ) +--- +test: Quoted scalars +todo: true +spec: 2.17 +yaml: | + unicode: "Sosa did fine.\u263A" + control: "\b1998\t1999\t2000\n" + hexesc: "\x0D\x0A is \r\n" + + single: '"Howdy!" he cried.' + quoted: ' # not a ''comment''.' + tie-fighter: '|\-*-/|' +ruby: | + { + "tie-fighter" => "|\\-*-/|", + "control"=>"\0101998\t1999\t2000\n", + "unicode"=>"Sosa did fine." + ["263A".hex ].pack('U*'), + "quoted"=>" # not a 'comment'.", + "single"=>"\"Howdy!\" he cried.", + "hexesc"=>"\r\n is \r\n" + } +--- +test: Multiline flow scalars +todo: true +spec: 2.18 +yaml: | + plain: + This unquoted scalar + spans many lines. + + quoted: "So does this + quoted scalar.\n" +ruby: | + { + 'plain' => 'This unquoted scalar spans many lines.', + 'quoted' => "So does this quoted scalar.\n" + } +--- +test: Integers +spec: 2.19 +yaml: | + canonical: 12345 + decimal: +12,345 + octal: 014 + hexadecimal: 0xC +php: | + array( + 'canonical' => 12345, + 'decimal' => 12345, + 'octal' => 014, + 'hexadecimal' => 0xC + ) +--- +# FIX: spec shows parens around -inf and NaN +test: Floating point +spec: 2.20 +yaml: | + canonical: 1.23015e+3 + exponential: 12.3015e+02 + fixed: 1,230.15 + negative infinity: -.inf + not a number: .NaN + float as whole number: !!float 1 +php: | + array( + 'canonical' => 1230.15, + 'exponential' => 1230.15, + 'fixed' => 1230.15, + 'negative infinity' => log(0), + 'not a number' => -log(0), + 'float as whole number' => (float) 1 + ) +--- +test: Miscellaneous +spec: 2.21 +yaml: | + null: ~ + true: true + false: false + string: '12345' +php: | + array( + '' => null, + 1 => true, + 0 => false, + 'string' => '12345' + ) +--- +test: Timestamps +todo: true +spec: 2.22 +yaml: | + canonical: 2001-12-15T02:59:43.1Z + iso8601: 2001-12-14t21:59:43.10-05:00 + spaced: 2001-12-14 21:59:43.10 -05:00 + date: 2002-12-14 # Time is noon UTC +php: | + array( + 'canonical' => YAML::mktime( 2001, 12, 15, 2, 59, 43, 0.10 ), + 'iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'spaced' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'date' => Date.new( 2002, 12, 14 ) + ) +--- +test: legacy Timestamps test +todo: true +spec: legacy D4 +yaml: | + canonical: 2001-12-15T02:59:43.00Z + iso8601: 2001-02-28t21:59:43.00-05:00 + spaced: 2001-12-14 21:59:43.00 -05:00 + date: 2002-12-14 +php: | + array( + 'canonical' => Time::utc( 2001, 12, 15, 2, 59, 43, 0 ), + 'iso8601' => YAML::mktime( 2001, 2, 28, 21, 59, 43, 0, "-05:00" ), + 'spaced' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0, "-05:00" ), + 'date' => Date.new( 2002, 12, 14 ) + ) +--- +test: Various explicit families +todo: true +spec: 2.23 +yaml: | + not-date: !str 2002-04-28 + picture: !binary | + R0lGODlhDAAMAIQAAP//9/X + 17unp5WZmZgAAAOfn515eXv + Pz7Y6OjuDg4J+fn5OTk6enp + 56enmleECcgggoBADs= + + application specific tag: !!something | + The semantics of the tag + above may be different for + different documents. + +ruby-setup: | + YAML.add_private_type( "something" ) do |type, val| + "SOMETHING: #{val}" + end +ruby: | + { + 'not-date' => '2002-04-28', + 'picture' => "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236i^\020' \202\n\001\000;", + 'application specific tag' => "SOMETHING: The semantics of the tag\nabove may be different for\ndifferent documents.\n" + } +--- +test: Application specific family +todo: true +spec: 2.24 +yaml: | + # Establish a tag prefix + --- !clarkevans.com,2002/graph/^shape + # Use the prefix: shorthand for + # !clarkevans.com,2002/graph/circle + - !^circle + center: &ORIGIN {x: 73, 'y': 129} + radius: 7 + - !^line # !clarkevans.com,2002/graph/line + start: *ORIGIN + finish: { x: 89, 'y': 102 } + - !^label + start: *ORIGIN + color: 0xFFEEBB + value: Pretty vector drawing. +ruby-setup: | + YAML.add_domain_type( "clarkevans.com,2002", 'graph/shape' ) { |type, val| + if Array === val + val << "Shape Container" + val + else + raise YAML::Error, "Invalid graph of class #{ val.class }: " + val.inspect + end + } + one_shape_proc = Proc.new { |type, val| + scheme, domain, type = type.split( /:/, 3 ) + if val.is_a? ::Hash + val['TYPE'] = "Shape: #{type}" + val + else + raise YAML::Error, "Invalid graph of class #{ val.class }: " + val.inspect + end + } + YAML.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc ) + YAML.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc ) + YAML.add_domain_type( "clarkevans.com,2002", 'graph/label', &one_shape_proc ) +ruby: | + [ + { + "radius" => 7, + "center"=> + { + "x" => 73, + "y" => 129 + }, + "TYPE" => "Shape: graph/circle" + }, { + "finish" => + { + "x" => 89, + "y" => 102 + }, + "TYPE" => "Shape: graph/line", + "start" => + { + "x" => 73, + "y" => 129 + } + }, { + "TYPE" => "Shape: graph/label", + "value" => "Pretty vector drawing.", + "start" => + { + "x" => 73, + "y" => 129 + }, + "color" => 16772795 + }, + "Shape Container" + ] +# --- +# test: Unordered set +# spec: 2.25 +# yaml: | +# # sets are represented as a +# # mapping where each key is +# # associated with the empty string +# --- !set +# ? Mark McGwire +# ? Sammy Sosa +# ? Ken Griff +--- +test: Ordered mappings +todo: true +spec: 2.26 +yaml: | + # ordered maps are represented as + # a sequence of mappings, with + # each mapping having one key + --- !omap + - Mark McGwire: 65 + - Sammy Sosa: 63 + - Ken Griffy: 58 +ruby: | + YAML::Omap[ + 'Mark McGwire', 65, + 'Sammy Sosa', 63, + 'Ken Griffy', 58 + ] +--- +test: Invoice +dump_skip: true +spec: 2.27 +yaml: | + --- !clarkevans.com,2002/^invoice + invoice: 34843 + date : 2001-01-23 + bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 + ship-to: *id001 + product: + - + sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - + sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 + tax : 251.42 + total: 4443.52 + comments: > + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. +php: | + array( + 'invoice' => 34843, 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'bill-to' => + array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) ) + , 'ship-to' => + array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) ) + , 'product' => + array( + array( 'sku' => 'BL394D', 'quantity' => 4, 'description' => 'Basketball', 'price' => 450.00 ), + array( 'sku' => 'BL4438H', 'quantity' => 1, 'description' => 'Super Hoop', 'price' => 2392.00 ) + ), + 'tax' => 251.42, 'total' => 4443.52, + 'comments' => "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.\n" + ) +--- +test: Log file +todo: true +spec: 2.28 +yaml: | + --- + Time: 2001-11-23 15:01:42 -05:00 + User: ed + Warning: > + This is an error message + for the log file + --- + Time: 2001-11-23 15:02:31 -05:00 + User: ed + Warning: > + A slightly different error + message. + --- + Date: 2001-11-23 15:03:17 -05:00 + User: ed + Fatal: > + Unknown variable "bar" + Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar +ruby: | + y = YAML::Stream.new + y.add( { 'Time' => YAML::mktime( 2001, 11, 23, 15, 01, 42, 00, "-05:00" ), + 'User' => 'ed', 'Warning' => "This is an error message for the log file\n" } ) + y.add( { 'Time' => YAML::mktime( 2001, 11, 23, 15, 02, 31, 00, "-05:00" ), + 'User' => 'ed', 'Warning' => "A slightly different error message.\n" } ) + y.add( { 'Date' => YAML::mktime( 2001, 11, 23, 15, 03, 17, 00, "-05:00" ), + 'User' => 'ed', 'Fatal' => "Unknown variable \"bar\"\n", + 'Stack' => [ + { 'file' => 'TopClass.py', 'line' => 23, 'code' => "x = MoreObject(\"345\\n\")\n" }, + { 'file' => 'MoreClass.py', 'line' => 58, 'code' => "foo = bar" } ] } ) +documents: 3 + +--- +test: Throwaway comments +yaml: | + ### These are four throwaway comment ### + + ### lines (the second line is empty). ### + this: | # Comments may trail lines. + contains three lines of text. + The third one starts with a + # character. This isn't a comment. + + # These are three throwaway comment + # lines (the first line is empty). +php: | + array( + 'this' => "contains three lines of text.\nThe third one starts with a\n# character. This isn't a comment.\n" + ) +--- +test: Document with a single value +todo: true +yaml: | + --- > + This YAML stream contains a single text value. + The next stream is a log file - a sequence of + log entries. Adding an entry to the log is a + simple matter of appending it at the end. +ruby: | + "This YAML stream contains a single text value. The next stream is a log file - a sequence of log entries. Adding an entry to the log is a simple matter of appending it at the end.\n" +--- +test: Document stream +todo: true +yaml: | + --- + at: 2001-08-12 09:25:00.00 Z + type: GET + HTTP: '1.0' + url: '/index.html' + --- + at: 2001-08-12 09:25:10.00 Z + type: GET + HTTP: '1.0' + url: '/toc.html' +ruby: | + y = YAML::Stream.new + y.add( { + 'at' => Time::utc( 2001, 8, 12, 9, 25, 00 ), + 'type' => 'GET', + 'HTTP' => '1.0', + 'url' => '/index.html' + } ) + y.add( { + 'at' => Time::utc( 2001, 8, 12, 9, 25, 10 ), + 'type' => 'GET', + 'HTTP' => '1.0', + 'url' => '/toc.html' + } ) +documents: 2 + +--- +test: Top level mapping +yaml: | + # This stream is an example of a top-level mapping. + invoice : 34843 + date : 2001-01-23 + total : 4443.52 +php: | + array( + 'invoice' => 34843, + 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'total' => 4443.52 + ) +--- +test: Single-line documents +todo: true +yaml: | + # The following is a sequence of three documents. + # The first contains an empty mapping, the second + # an empty sequence, and the last an empty string. + --- {} + --- [ ] + --- '' +ruby: | + y = YAML::Stream.new + y.add( {} ) + y.add( [] ) + y.add( '' ) +documents: 3 + +--- +test: Document with pause +todo: true +yaml: | + # A communication channel based on a YAML stream. + --- + sent at: 2002-06-06 11:46:25.10 Z + payload: Whatever + # Receiver can process this as soon as the following is sent: + ... + # Even if the next message is sent long after: + --- + sent at: 2002-06-06 12:05:53.47 Z + payload: Whatever + ... +ruby: | + y = YAML::Stream.new + y.add( + { 'sent at' => YAML::mktime( 2002, 6, 6, 11, 46, 25, 0.10 ), + 'payload' => 'Whatever' } + ) + y.add( + { "payload" => "Whatever", "sent at" => YAML::mktime( 2002, 6, 6, 12, 5, 53, 0.47 ) } + ) +documents: 2 + +--- +test: Explicit typing +yaml: | + integer: 12 + also int: ! "12" + string: !str 12 +php: | + array( 'integer' => 12, 'also int' => 12, 'string' => '12' ) +--- +test: Private types +todo: true +yaml: | + # Both examples below make use of the 'x-private:ball' + # type family URI, but with different semantics. + --- + pool: !!ball + number: 8 + color: black + --- + bearing: !!ball + material: steel +ruby: | + y = YAML::Stream.new + y.add( { 'pool' => + YAML::PrivateType.new( 'ball', + { 'number' => 8, 'color' => 'black' } ) } + ) + y.add( { 'bearing' => + YAML::PrivateType.new( 'ball', + { 'material' => 'steel' } ) } + ) +documents: 2 + +--- +test: Type family under yaml.org +yaml: | + # The URI is 'tag:yaml.org,2002:str' + - !str a Unicode string +php: | + array( 'a Unicode string' ) +--- +test: Type family under perl.yaml.org +todo: true +yaml: | + # The URI is 'tag:perl.yaml.org,2002:Text::Tabs' + - !perl/Text::Tabs {} +ruby: | + [ YAML::DomainType.new( 'perl.yaml.org,2002', 'Text::Tabs', {} ) ] +--- +test: Type family under clarkevans.com +todo: true +yaml: | + # The URI is 'tag:clarkevans.com,2003-02:timesheet' + - !clarkevans.com,2003-02/timesheet {} +ruby: | + [ YAML::DomainType.new( 'clarkevans.com,2003-02', 'timesheet', {} ) ] +--- +test: URI Escaping +todo: true +yaml: | + same: + - !domain.tld,2002/type\x30 value + - !domain.tld,2002/type0 value + different: # As far as the YAML parser is concerned + - !domain.tld,2002/type%30 value + - !domain.tld,2002/type0 value +ruby-setup: | + YAML.add_domain_type( "domain.tld,2002", "type0" ) { |type, val| + "ONE: #{val}" + } + YAML.add_domain_type( "domain.tld,2002", "type%30" ) { |type, val| + "TWO: #{val}" + } +ruby: | + { 'same' => [ 'ONE: value', 'ONE: value' ], 'different' => [ 'TWO: value', 'ONE: value' ] } +--- +test: URI Prefixing +todo: true +yaml: | + # 'tag:domain.tld,2002:invoice' is some type family. + invoice: !domain.tld,2002/^invoice + # 'seq' is shorthand for 'tag:yaml.org,2002:seq'. + # This does not effect '^customer' below + # because it is does not specify a prefix. + customers: !seq + # '^customer' is shorthand for the full + # notation 'tag:domain.tld,2002:customer'. + - !^customer + given : Chris + family : Dumars +ruby-setup: | + YAML.add_domain_type( "domain.tld,2002", /(invoice|customer)/ ) { |type, val| + if val.is_a? ::Hash + scheme, domain, type = type.split( /:/, 3 ) + val['type'] = "domain #{type}" + val + else + raise YAML::Error, "Not a Hash in domain.tld/invoice: " + val.inspect + end + } +ruby: | + { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } } + +--- +test: Overriding anchors +yaml: | + anchor : &A001 This scalar has an anchor. + override : &A001 > + The alias node below is a + repeated use of this value. + alias : *A001 +php: | + array( 'anchor' => 'This scalar has an anchor.', + 'override' => "The alias node below is a repeated use of this value.\n", + 'alias' => "The alias node below is a repeated use of this value.\n" ) +--- +test: Flow and block formatting +todo: true +yaml: | + empty: [] + flow: [ one, two, three # May span lines, + , four, # indentation is + five ] # mostly ignored. + block: + - First item in top sequence + - + - Subordinate sequence entry + - > + A folded sequence entry + - Sixth item in top sequence +ruby: | + { 'empty' => [], 'flow' => [ 'one', 'two', 'three', 'four', 'five' ], + 'block' => [ 'First item in top sequence', [ 'Subordinate sequence entry' ], + "A folded sequence entry\n", 'Sixth item in top sequence' ] } +--- +test: Complete mapping test +todo: true +yaml: | + empty: {} + flow: { one: 1, two: 2 } + spanning: { one: 1, + two: 2 } + block: + first : First entry + second: + key: Subordinate mapping + third: + - Subordinate sequence + - { } + - Previous mapping is empty. + - A key: value pair in a sequence. + A second: key:value pair. + - The previous entry is equal to the following one. + - + A key: value pair in a sequence. + A second: key:value pair. + !float 12 : This key is a float. + ? > + ? + : This key had to be protected. + "\a" : This key had to be escaped. + ? > + This is a + multi-line + folded key + : Whose value is + also multi-line. + ? this also works as a key + : with a value at the next line. + ? + - This key + - is a sequence + : + - With a sequence value. + ? + This: key + is a: mapping + : + with a: mapping value. +ruby: | + { 'empty' => {}, 'flow' => { 'one' => 1, 'two' => 2 }, + 'spanning' => { 'one' => 1, 'two' => 2 }, + 'block' => { 'first' => 'First entry', 'second' => + { 'key' => 'Subordinate mapping' }, 'third' => + [ 'Subordinate sequence', {}, 'Previous mapping is empty.', + { 'A key' => 'value pair in a sequence.', 'A second' => 'key:value pair.' }, + 'The previous entry is equal to the following one.', + { 'A key' => 'value pair in a sequence.', 'A second' => 'key:value pair.' } ], + 12.0 => 'This key is a float.', "?\n" => 'This key had to be protected.', + "\a" => 'This key had to be escaped.', + "This is a multi-line folded key\n" => "Whose value is also multi-line.", + 'this also works as a key' => 'with a value at the next line.', + [ 'This key', 'is a sequence' ] => [ 'With a sequence value.' ] } } + # Couldn't recreate map exactly, so we'll do a detailed check to be sure it's entact + obj_y['block'].keys.each { |k| + if Hash === k + v = obj_y['block'][k] + if k['This'] == 'key' and k['is a'] == 'mapping' and v['with a'] == 'mapping value.' + obj_r['block'][k] = v + end + end + } +--- +test: Literal explicit indentation +yaml: | + # Explicit indentation must + # be given in all the three + # following cases. + leading spaces: |2 + This value starts with four spaces. + + leading line break: |2 + + This value starts with a line break. + + leading comment indicator: |2 + # first line starts with a + # character. + + # Explicit indentation may + # also be given when it is + # not required. + redundant: |2 + This value is indented 2 spaces. +php: | + array( + 'leading spaces' => " This value starts with four spaces.\n", + 'leading line break' => "\nThis value starts with a line break.\n", + 'leading comment indicator' => "# first line starts with a\n# character.\n", + 'redundant' => "This value is indented 2 spaces.\n" + ) +--- +test: Chomping and keep modifiers +yaml: | + clipped: | + This has one newline. + + same as "clipped" above: "This has one newline.\n" + + stripped: |- + This has no newline. + + same as "stripped" above: "This has no newline." + + kept: |+ + This has two newlines. + + same as "kept" above: "This has two newlines.\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has two newlines.\n\n", + 'same as "kept" above' => "This has two newlines.\n\n" + ) +--- +test: Literal combinations +todo: true +yaml: | + empty: | + + literal: | + The \ ' " characters may be + freely used. Leading white + space is significant. + + Line breaks are significant. + Thus this value contains one + empty line and ends with a + single line break, but does + not start with one. + + is equal to: "The \\ ' \" characters may \ + be\nfreely used. Leading white\n space \ + is significant.\n\nLine breaks are \ + significant.\nThus this value contains \ + one\nempty line and ends with a\nsingle \ + line break, but does\nnot start with one.\n" + + # Comments may follow a block + # scalar value. They must be + # less indented. + + # Modifiers may be combined in any order. + indented and chomped: |2- + This has no newline. + + also written as: |-2 + This has no newline. + + both are equal to: " This has no newline." +php: | + array( + 'empty' => '', + 'literal' => "The \\ ' \" characters may be\nfreely used. Leading white\n space " + + "is significant.\n\nLine breaks are significant.\nThus this value contains one\n" + + "empty line and ends with a\nsingle line break, but does\nnot start with one.\n", + 'is equal to' => "The \\ ' \" characters may be\nfreely used. Leading white\n space " + + "is significant.\n\nLine breaks are significant.\nThus this value contains one\n" + + "empty line and ends with a\nsingle line break, but does\nnot start with one.\n", + 'indented and chomped' => ' This has no newline.', + 'also written as' => ' This has no newline.', + 'both are equal to' => ' This has no newline.' + ) +--- +test: Folded combinations +todo: true +yaml: | + empty: > + + one paragraph: > + Line feeds are converted + to spaces, so this value + contains no line breaks + except for the final one. + + multiple paragraphs: >2 + + An empty line, either + at the start or in + the value: + + Is interpreted as a + line break. Thus this + value contains three + line breaks. + + indented text: > + This is a folded + paragraph followed + by a list: + * first entry + * second entry + Followed by another + folded paragraph, + another list: + + * first entry + + * second entry + + And a final folded + paragraph. + + above is equal to: | + This is a folded paragraph followed by a list: + * first entry + * second entry + Followed by another folded paragraph, another list: + + * first entry + + * second entry + + And a final folded paragraph. + + # Explicit comments may follow + # but must be less indented. +php: | + array( + 'empty' => '', + 'one paragraph' => 'Line feeds are converted to spaces, so this value'. + " contains no line breaks except for the final one.\n", + 'multiple paragraphs' => "\nAn empty line, either at the start or in the value:\n". + "Is interpreted as a line break. Thus this value contains three line breaks.\n", + 'indented text' => "This is a folded paragraph followed by a list:\n". + " * first entry\n * second entry\nFollowed by another folded paragraph, ". + "another list:\n\n * first entry\n\n * second entry\n\nAnd a final folded paragraph.\n", + 'above is equal to' => "This is a folded paragraph followed by a list:\n". + " * first entry\n * second entry\nFollowed by another folded paragraph, ". + "another list:\n\n * first entry\n\n * second entry\n\nAnd a final folded paragraph.\n" + ) +--- +test: Single quotes +todo: true +yaml: | + empty: '' + second: '! : \ etc. can be used freely.' + third: 'a single quote '' must be escaped.' + span: 'this contains + six spaces + + and one + line break' + is same as: "this contains six spaces\nand one line break" +php: | + array( + 'empty' => '', + 'second' => '! : \\ etc. can be used freely.', + 'third' => "a single quote ' must be escaped.", + 'span' => "this contains six spaces\nand one line break", + 'is same as' => "this contains six spaces\nand one line break" + ) +--- +test: Double quotes +todo: true +yaml: | + empty: "" + second: "! : etc. can be used freely." + third: "a \" or a \\ must be escaped." + fourth: "this value ends with an LF.\n" + span: "this contains + four \ + spaces" + is equal to: "this contains four spaces" +php: | + array( + 'empty' => '', + 'second' => '! : etc. can be used freely.', + 'third' => 'a " or a \\ must be escaped.', + 'fourth' => "this value ends with an LF.\n", + 'span' => "this contains four spaces", + 'is equal to' => "this contains four spaces" + ) +--- +test: Unquoted strings +todo: true +yaml: | + first: There is no unquoted empty string. + + second: 12 ## This is an integer. + + third: !str 12 ## This is a string. + + span: this contains + six spaces + + and one + line break + + indicators: this has no comments. + #:foo and bar# are + both text. + + flow: [ can span + lines, # comment + like + this ] + + note: { one-line keys: but multi-line values } + +php: | + array( + 'first' => 'There is no unquoted empty string.', + 'second' => 12, + 'third' => '12', + 'span' => "this contains six spaces\nand one line break", + 'indicators' => "this has no comments. #:foo and bar# are both text.", + 'flow' => [ 'can span lines', 'like this' ], + 'note' => { 'one-line keys' => 'but multi-line values' } + ) +--- +test: Spanning sequences +todo: true +yaml: | + # The following are equal seqs + # with different identities. + flow: [ one, two ] + spanning: [ one, + two ] + block: + - one + - two +php: | + array( + 'flow' => [ 'one', 'two' ], + 'spanning' => [ 'one', 'two' ], + 'block' => [ 'one', 'two' ] + ) +--- +test: Flow mappings +yaml: | + # The following are equal maps + # with different identities. + flow: { one: 1, two: 2 } + block: + one: 1 + two: 2 +php: | + array( + 'flow' => array( 'one' => 1, 'two' => 2 ), + 'block' => array( 'one' => 1, 'two' => 2 ) + ) +--- +test: Representations of 12 +todo: true +yaml: | + - 12 # An integer + # The following scalars + # are loaded to the + # string value '1' '2'. + - !str 12 + - '12' + - "12" + - "\ + 1\ + 2\ + " + # Strings containing paths and regexps can be unquoted: + - /foo/bar + - d:/foo/bar + - foo/bar + - /a.*b/ +php: | + array( 12, '12', '12', '12', '12', '/foo/bar', 'd:/foo/bar', 'foo/bar', '/a.*b/' ) +--- +test: "Null" +todo: true +yaml: | + canonical: ~ + + english: null + + # This sequence has five + # entries, two with values. + sparse: + - ~ + - 2nd entry + - Null + - 4th entry + - + + four: This mapping has five keys, + only two with values. + +php: | + array ( + 'canonical' => null, + 'english' => null, + 'sparse' => array( null, '2nd entry', null, '4th entry', null ]), + 'four' => 'This mapping has five keys, only two with values.' + ) +--- +test: Omap +todo: true +yaml: | + # Explicitly typed dictionary. + Bestiary: !omap + - aardvark: African pig-like ant eater. Ugly. + - anteater: South-American ant eater. Two species. + - anaconda: South-American constrictor snake. Scary. + # Etc. +ruby: | + { + 'Bestiary' => YAML::Omap[ + 'aardvark', 'African pig-like ant eater. Ugly.', + 'anteater', 'South-American ant eater. Two species.', + 'anaconda', 'South-American constrictor snake. Scary.' + ] + } + +--- +test: Pairs +todo: true +yaml: | + # Explicitly typed pairs. + tasks: !pairs + - meeting: with team. + - meeting: with boss. + - break: lunch. + - meeting: with client. +ruby: | + { + 'tasks' => YAML::Pairs[ + 'meeting', 'with team.', + 'meeting', 'with boss.', + 'break', 'lunch.', + 'meeting', 'with client.' + ] + } + +--- +test: Set +todo: true +yaml: | + # Explicitly typed set. + baseball players: !set + Mark McGwire: + Sammy Sosa: + Ken Griffey: +ruby: | + { + 'baseball players' => YAML::Set[ + 'Mark McGwire', nil, + 'Sammy Sosa', nil, + 'Ken Griffey', nil + ] + } + +--- +test: Boolean +yaml: | + false: used as key + logical: true + answer: false +php: | + array( + false => 'used as key', + 'logical' => true, + 'answer' => false + ) +--- +test: Integer +yaml: | + canonical: 12345 + decimal: +12,345 + octal: 014 + hexadecimal: 0xC +php: | + array( + 'canonical' => 12345, + 'decimal' => 12345, + 'octal' => 12, + 'hexadecimal' => 12 + ) +--- +test: Float +yaml: | + canonical: 1.23015e+3 + exponential: 12.3015e+02 + fixed: 1,230.15 + negative infinity: -.inf + not a number: .NaN +php: | + array( + 'canonical' => 1230.15, + 'exponential' => 1230.15, + 'fixed' => 1230.15, + 'negative infinity' => log(0), + 'not a number' => -log(0) + ) +--- +test: Timestamp +todo: true +yaml: | + canonical: 2001-12-15T02:59:43.1Z + valid iso8601: 2001-12-14t21:59:43.10-05:00 + space separated: 2001-12-14 21:59:43.10 -05:00 + date (noon UTC): 2002-12-14 +ruby: | + array( + 'canonical' => YAML::mktime( 2001, 12, 15, 2, 59, 43, 0.10 ), + 'valid iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'space separated' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'date (noon UTC)' => Date.new( 2002, 12, 14 ) + ) +--- +test: Binary +todo: true +yaml: | + canonical: !binary "\ + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" + base64: !binary | + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= + description: > + The binary value above is a tiny arrow + encoded as a gif image. +ruby-setup: | + arrow_gif = "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236iiiccc\243\243\243\204\204\204\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371!\376\016Made with GIMP\000,\000\000\000\000\f\000\f\000\000\005, \216\2010\236\343@\024\350i\020\304\321\212\010\034\317\200M$z\357\3770\205p\270\2601f\r\e\316\001\303\001\036\020' \202\n\001\000;" +ruby: | + { + 'canonical' => arrow_gif, + 'base64' => arrow_gif, + 'description' => "The binary value above is a tiny arrow encoded as a gif image.\n" + } + +--- +test: Merge key +todo: true +yaml: | + --- + - &CENTER { x: 1, y: 2 } + - &LEFT { x: 0, y: 2 } + - &BIG { r: 10 } + - &SMALL { r: 1 } + + # All the following maps are equal: + + - # Explicit keys + x: 1 + y: 2 + r: 10 + label: center/big + + - # Merge one map + << : *CENTER + r: 10 + label: center/big + + - # Merge multiple maps + << : [ *CENTER, *BIG ] + label: center/big + + - # Override + << : [ *BIG, *LEFT, *SMALL ] + x: 1 + label: center/big + +ruby-setup: | + center = { 'x' => 1, 'y' => 2 } + left = { 'x' => 0, 'y' => 2 } + big = { 'r' => 10 } + small = { 'r' => 1 } + node1 = { 'x' => 1, 'y' => 2, 'r' => 10, 'label' => 'center/big' } + node2 = center.dup + node2.update( { 'r' => 10, 'label' => 'center/big' } ) + node3 = big.dup + node3.update( center ) + node3.update( { 'label' => 'center/big' } ) + node4 = small.dup + node4.update( left ) + node4.update( big ) + node4.update( { 'x' => 1, 'label' => 'center/big' } ) + +ruby: | + [ + center, left, big, small, node1, node2, node3, node4 + ] + +--- +test: Default key +todo: true +yaml: | + --- # Old schema + link with: + - library1.dll + - library2.dll + --- # New schema + link with: + - = : library1.dll + version: 1.2 + - = : library2.dll + version: 2.3 +ruby: | + y = YAML::Stream.new + y.add( { 'link with' => [ 'library1.dll', 'library2.dll' ] } ) + obj_h = Hash[ 'version' => 1.2 ] + obj_h.default = 'library1.dll' + obj_h2 = Hash[ 'version' => 2.3 ] + obj_h2.default = 'library2.dll' + y.add( { 'link with' => [ obj_h, obj_h2 ] } ) +documents: 2 + +--- +test: Special keys +todo: true +yaml: | + "!": These three keys + "&": had to be quoted + "=": and are normal strings. + # NOTE: the following node should NOT be serialized this way. + encoded node : + !special '!' : '!type' + !special|canonical '&' : 12 + = : value + # The proper way to serialize the above node is as follows: + node : !!type &12 value +ruby: | + { '!' => 'These three keys', '&' => 'had to be quoted', + '=' => 'and are normal strings.', + 'encoded node' => YAML::PrivateType.new( 'type', 'value' ), + 'node' => YAML::PrivateType.new( 'type', 'value' ) } diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsTypeTransfers.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/YtsTypeTransfers.yml @@ -0,0 +1,244 @@ +--- %YAML:1.0 +test: Strings +brief: > + Any group of characters beginning with an + alphabetic or numeric character is a string, + unless it belongs to one of the groups below + (such as an Integer or Time). +yaml: | + String +php: | + 'String' +--- +test: String characters +brief: > + A string can contain any alphabetic or + numeric character, along with many + punctuation characters, including the + period, dash, space, quotes, exclamation, and + question mark. +yaml: | + - What's Yaml? + - It's for writing data structures in plain text. + - And? + - And what? That's not good enough for you? + - No, I mean, "And what about Yaml?" + - Oh, oh yeah. Uh.. Yaml for Ruby. +php: | + array( + "What's Yaml?", + "It's for writing data structures in plain text.", + "And?", + "And what? That's not good enough for you?", + "No, I mean, \"And what about Yaml?\"", + "Oh, oh yeah. Uh.. Yaml for Ruby." + ) +--- +test: Indicators in Strings +brief: > + Be careful using indicators in strings. In particular, + the comma, colon, and pound sign must be used carefully. +yaml: | + the colon followed by space is an indicator: but is a string:right here + same for the pound sign: here we have it#in a string + the comma can, honestly, be used in most cases: [ but not in, inline collections ] +php: | + array( + 'the colon followed by space is an indicator' => 'but is a string:right here', + 'same for the pound sign' => 'here we have it#in a string', + 'the comma can, honestly, be used in most cases' => array('but not in', 'inline collections') + ) +--- +test: Forcing Strings +brief: > + Any YAML type can be forced into a string using the + explicit !str method. +yaml: | + date string: !str 2001-08-01 + number string: !str 192 +php: | + array( + 'date string' => '2001-08-01', + 'number string' => '192' + ) +--- +test: Single-quoted Strings +brief: > + You can also enclose your strings within single quotes, + which allows use of slashes, colons, and other indicators + freely. Inside single quotes, you can represent a single + quote in your string by using two single quotes next to + each other. +yaml: | + all my favorite symbols: '#:!/%.)' + a few i hate: '&(*' + why do i hate them?: 'it''s very hard to explain' + entities: '&pound; me' +php: | + array( + 'all my favorite symbols' => '#:!/%.)', + 'a few i hate' => '&(*', + 'why do i hate them?' => 'it\'s very hard to explain', + 'entities' => '&pound; me' + ) +--- +test: Double-quoted Strings +brief: > + Enclosing strings in double quotes allows you + to use escapings to represent ASCII and + Unicode characters. +yaml: | + i know where i want my line breaks: "one here\nand another here\n" +php: | + array( + 'i know where i want my line breaks' => "one here\nand another here\n" + ) +--- +test: Multi-line Quoted Strings +todo: true +brief: > + Both single- and double-quoted strings may be + carried on to new lines in your YAML document. + They must be indented a step and indentation + is interpreted as a single space. +yaml: | + i want a long string: "so i'm going to + let it go on and on to other lines + until i end it with a quote." +php: | + array('i want a long string' => "so i'm going to ". + "let it go on and on to other lines ". + "until i end it with a quote." + ) + +--- +test: Plain scalars +todo: true +brief: > + Unquoted strings may also span multiple lines, if they + are free of YAML space indicators and indented. +yaml: | + - My little toe is broken in two places; + - I'm crazy to have skied this way; + - I'm not the craziest he's seen, since there was always the German guy + who skied for 3 hours on a broken shin bone (just below the kneecap); + - Nevertheless, second place is respectable, and he doesn't + recommend going for the record; + - He's going to put my foot in plaster for a month; + - This would impair my skiing ability somewhat for the + duration, as can be imagined. +php: | + array( + "My little toe is broken in two places;", + "I'm crazy to have skied this way;", + "I'm not the craziest he's seen, since there was always ". + "the German guy who skied for 3 hours on a broken shin ". + "bone (just below the kneecap);", + "Nevertheless, second place is respectable, and he doesn't ". + "recommend going for the record;", + "He's going to put my foot in plaster for a month;", + "This would impair my skiing ability somewhat for the duration, ". + "as can be imagined." + ) +--- +test: 'Null' +brief: > + You can use the tilde '~' character for a null value. +yaml: | + name: Mr. Show + hosted by: Bob and David + date of next season: ~ +php: | + array( + 'name' => 'Mr. Show', + 'hosted by' => 'Bob and David', + 'date of next season' => null + ) +--- +test: Boolean +brief: > + You can use 'true' and 'false' for Boolean values. +yaml: | + Is Gus a Liar?: true + Do I rely on Gus for Sustenance?: false +php: | + array( + 'Is Gus a Liar?' => true, + 'Do I rely on Gus for Sustenance?' => false + ) +--- +test: Integers +dump_skip: true +brief: > + An integer is a series of numbers, optionally + starting with a positive or negative sign. Integers + may also contain commas for readability. +yaml: | + zero: 0 + simple: 12 + one-thousand: 1,000 + negative one-thousand: -1,000 +php: | + array( + 'zero' => 0, + 'simple' => 12, + 'one-thousand' => 1000, + 'negative one-thousand' => -1000 + ) +--- +test: Integers as Map Keys +brief: > + An integer can be used a dictionary key. +yaml: | + 1: one + 2: two + 3: three +php: | + array( + 1 => 'one', + 2 => 'two', + 3 => 'three' + ) +--- +test: Floats +dump_skip: true +brief: > + Floats are represented by numbers with decimals, + allowing for scientific notation, as well as + positive and negative infinity and "not a number." +yaml: | + a simple float: 2.00 + larger float: 1,000.09 + scientific notation: 1.00009e+3 +php: | + array( + 'a simple float' => 2.0, + 'larger float' => 1000.09, + 'scientific notation' => 1000.09 + ) +--- +test: Time +todo: true +brief: > + You can represent timestamps by using + ISO8601 format, or a variation which + allows spaces between the date, time and + time zone. +yaml: | + iso8601: 2001-12-14t21:59:43.10-05:00 + space separated: 2001-12-14 21:59:43.10 -05:00 +php: | + array( + 'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'space separated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ) + ) +--- +test: Date +todo: true +brief: > + A date can be represented by its year, + month and day in ISO8601 order. +yaml: | + 1976-07-31 +php: | + date( 1976, 7, 31 ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/embededPhp.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/embededPhp.yml @@ -0,0 +1 @@ +value: <?php echo 1 + 2 + 3 ?> diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/escapedCharacters.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/escapedCharacters.yml @@ -0,0 +1,147 @@ +test: outside double quotes +yaml: | + \0 \ \a \b \n +php: | + "\\0 \\ \\a \\b \\n" +--- +test: null +yaml: | + "\0" +php: | + "\x00" +--- +test: bell +yaml: | + "\a" +php: | + "\x07" +--- +test: backspace +yaml: | + "\b" +php: | + "\x08" +--- +test: horizontal tab (1) +yaml: | + "\t" +php: | + "\x09" +--- +test: horizontal tab (2) +yaml: | + "\ " +php: | + "\x09" +--- +test: line feed +yaml: | + "\n" +php: | + "\x0a" +--- +test: vertical tab +yaml: | + "\v" +php: | + "\x0b" +--- +test: form feed +yaml: | + "\f" +php: | + "\x0c" +--- +test: carriage return +yaml: | + "\r" +php: | + "\x0d" +--- +test: escape +yaml: | + "\e" +php: | + "\x1b" +--- +test: space +yaml: | + "\ " +php: | + "\x20" +--- +test: slash +yaml: | + "\/" +php: | + "\x2f" +--- +test: backslash +yaml: | + "\\" +php: | + "\\" +--- +test: Unicode next line +yaml: | + "\N" +php: | + "\xc2\x85" +--- +test: Unicode non-breaking space +yaml: | + "\_" +php: | + "\xc2\xa0" +--- +test: Unicode line separator +yaml: | + "\L" +php: | + "\xe2\x80\xa8" +--- +test: Unicode paragraph separator +yaml: | + "\P" +php: | + "\xe2\x80\xa9" +--- +test: Escaped 8-bit Unicode +yaml: | + "\x42" +php: | + "B" +--- +test: Escaped 16-bit Unicode +yaml: | + "\u20ac" +php: | + "\xe2\x82\xac" +--- +test: Escaped 32-bit Unicode +yaml: | + "\U00000043" +php: | + "C" +--- +test: Example 5.13 Escaped Characters +note: | + Currently throws an error parsing first line. Maybe Symfony Yaml doesn't support + continuation of string across multiple lines? Keeping test here but disabled. +todo: true +yaml: | + "Fun with \\ + \" \a \b \e \f \ + \n \r \t \v \0 \ + \ \_ \N \L \P \ + \x41 \u0041 \U00000041" +php: | + "Fun with \x5C\n\x22 \x07 \x08 \x1B \x0C\n\x0A \x0D \x09 \x0B \x00\n\x20 \xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9\nA A A" +--- +test: Double quotes with a line feed +yaml: | + { double: "some value\n \"some quoted string\" and 'some single quotes one'" } +php: | + array( + 'double' => "some value\n \"some quoted string\" and 'some single quotes one'" + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/index.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/index.yml @@ -0,0 +1,18 @@ +- escapedCharacters +- sfComments +- sfCompact +- sfTests +- sfObjects +- sfMergeKey +- sfQuotes +- YtsAnchorAlias +- YtsBasicTests +- YtsBlockMapping +- YtsDocumentSeparator +- YtsErrorTests +- YtsFlowCollections +- YtsFoldedScalars +- YtsNullsAndEmpties +- YtsSpecificationExamples +- YtsTypeTransfers +- unindentedCollections diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfComments.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfComments.yml @@ -0,0 +1,73 @@ +--- %YAML:1.0 +test: Comments at the end of a line +brief: > + Comments at the end of a line +yaml: | + ex1: "foo # bar" + ex2: "foo # bar" # comment + ex3: 'foo # bar' # comment + ex4: foo # comment +php: | + array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo') +--- +test: Comments in the middle +brief: > + Comments in the middle +yaml: | + foo: + # some comment + # some comment + bar: foo + # some comment + # some comment +php: | + array('foo' => array('bar' => 'foo')) +--- +test: Comments on a hash line +brief: > + Comments on a hash line +yaml: | + foo: # a comment + foo: bar # a comment +php: | + array('foo' => array('foo' => 'bar')) +--- +test: 'Value starting with a #' +brief: > + 'Value starting with a #' +yaml: | + foo: '#bar' +php: | + array('foo' => '#bar') +--- +test: Document starting with a comment and a separator +brief: > + Commenting before document start is allowed +yaml: | + # document comment + --- + foo: bar # a comment +php: | + array('foo' => 'bar') +--- +test: Comment containing a colon on a hash line +brief: > + Comment containing a colon on a scalar line +yaml: 'foo # comment: this is also part of the comment' +php: | + 'foo' +--- +test: 'Hash key containing a #' +brief: > + 'Hash key containing a #' +yaml: 'foo#bar: baz' +php: | + array('foo#bar' => 'baz') +--- +test: 'Hash key ending with a space and a #' +brief: > + 'Hash key ending with a space and a #' +yaml: | + 'foo #': baz +php: | + array('foo #' => 'baz') diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfCompact.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfCompact.yml @@ -0,0 +1,159 @@ +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfMergeKey.yml @@ -0,0 +1,58 @@ +--- %YAML:1.0 +test: Simple In Place Substitution +brief: > + If you want to reuse an entire alias, only overwriting what is different + you can use a << in place substitution. This is not part of the official + YAML spec, but a widely implemented extension. See the following URL for + details: http://yaml.org/type/merge.html +yaml: | + foo: &foo + a: Steve + b: Clark + c: Brian + bar: + a: before + d: other + <<: *foo + b: new + x: Oren + c: + foo: bar + foo: ignore + bar: foo + duplicate: + foo: bar + foo: ignore + foo2: &foo2 + a: Ballmer + ding: &dong [ fi, fei, fo, fam] + check: + <<: + - *foo + - *dong + isit: tested + head: + <<: [ *foo , *dong , *foo2 ] + taz: &taz + a: Steve + w: + p: 1234 + nested: + <<: *taz + d: Doug + w: &nestedref + p: 12345 + z: + <<: *nestedref +php: | + array( + 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian'), + 'bar' => array('a' => 'before', 'd' => 'other', 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'), + 'duplicate' => array('foo' => 'bar'), + 'foo2' => array('a' => 'Ballmer'), + 'ding' => array('fi', 'fei', 'fo', 'fam'), + 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'), + 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam'), + 'taz' => array('a' => 'Steve', 'w' => array('p' => 1234)), + 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345)) + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfObjects.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfObjects.yml @@ -0,0 +1,11 @@ +--- %YAML:1.0 +test: Objects +brief: > + Comments at the end of a line +yaml: | + ex1: "foo # bar" + ex2: "foo # bar" # comment + ex3: 'foo # bar' # comment + ex4: foo # comment +php: | + array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo') diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfQuotes.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfQuotes.yml @@ -0,0 +1,33 @@ +--- %YAML:1.0 +test: Some characters at the beginning of a string must be escaped +brief: > + Some characters at the beginning of a string must be escaped +yaml: | + foo: | bar +php: | + array('foo' => '| bar') +--- +test: A key can be a quoted string +brief: > + A key can be a quoted string +yaml: | + "foo1": bar + 'foo2': bar + "foo \" bar": bar + 'foo '' bar': bar + 'foo3: ': bar + "foo4: ": bar + foo5: { "foo \" bar: ": bar, 'foo '' bar: ': bar } +php: | + array( + 'foo1' => 'bar', + 'foo2' => 'bar', + 'foo " bar' => 'bar', + 'foo \' bar' => 'bar', + 'foo3: ' => 'bar', + 'foo4: ' => 'bar', + 'foo5' => array( + 'foo " bar: ' => 'bar', + 'foo \' bar: ' => 'bar', + ), + ) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml @@ -0,0 +1,135 @@ +--- %YAML:1.0 +test: Multiple quoted string on one line +brief: > + Multiple quoted string on one line +yaml: | + stripped_title: { name: "foo bar", help: "bar foo" } +php: | + array('stripped_title' => array('name' => 'foo bar', 'help' => 'bar foo')) +--- +test: Empty sequence +yaml: | + foo: [ ] +php: | + array('foo' => array()) +--- +test: Empty value +yaml: | + foo: +php: | + array('foo' => null) +--- +test: Inline string parsing +brief: > + Inline string parsing +yaml: | + test: ['complex: string', 'another [string]'] +php: | + array('test' => array('complex: string', 'another [string]')) +--- +test: Boolean +brief: > + Boolean +yaml: | + - false + - true + - null + - ~ + - 'false' + - 'true' + - 'null' + - '~' +php: | + array( + false, + true, + null, + null, + 'false', + 'true', + 'null', + '~', + ) +--- +test: Empty lines in folded blocks +brief: > + Empty lines in folded blocks +yaml: | + foo: + bar: | + foo + + + + bar +php: | + array('foo' => array('bar' => "foo\n\n\n \nbar\n")) +--- +test: IP addresses +brief: > + IP addresses +yaml: | + foo: 10.0.0.2 +php: | + array('foo' => '10.0.0.2') +--- +test: A sequence with an embedded mapping +brief: > + A sequence with an embedded mapping +yaml: | + - foo + - bar: { bar: foo } +php: | + array('foo', array('bar' => array('bar' => 'foo'))) +--- +test: A sequence with an unordered array +brief: > + A sequence with an unordered array +yaml: | + 1: foo + 0: bar +php: | + array(1 => 'foo', 0 => 'bar') +--- +test: Octal +brief: as in spec example 2.19, octal value is converted +yaml: | + foo: 0123 +php: | + array('foo' => 83) +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: "0123" +php: | + array('foo' => '0123') +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: '0123' +php: | + array('foo' => '0123') +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: | + 0123 +php: | + array('foo' => "0123\n") +--- +test: Document as a simple hash +brief: Document as a simple hash +yaml: | + { foo: bar } +php: | + array('foo' => 'bar') +--- +test: Document as a simple array +brief: Document as a simple array +yaml: | + [ foo, bar ] +php: | + array('foo', 'bar') diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/unindentedCollections.yml b/libs/php-ssh/vendor/symfony/yaml/Tests/Fixtures/unindentedCollections.yml @@ -0,0 +1,82 @@ +--- %YAML:1.0 +test: Unindented collection +brief: > + Unindented collection +yaml: | + collection: + - item1 + - item2 + - item3 +php: | + array('collection' => array('item1', 'item2', 'item3')) +--- +test: Nested unindented collection (two levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + - a + - b + - c +php: | + array('collection' => array('key' => array('a', 'b', 'c'))) +--- +test: Nested unindented collection (three levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + subkey: + - one + - two + - three +php: | + array('collection' => array('key' => array('subkey' => array('one', 'two', 'three')))) +--- +test: Key/value after unindented collection (1) +brief: > + Key/value after unindented collection (1) +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c')), 'foo' => 'bar') +--- +test: Key/value after unindented collection (at the same level) +brief: > + Key/value after unindented collection +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar')) +--- +test: Shortcut Key after unindented collection +brief: > + Key/value after unindented collection +yaml: | + collection: + - key: foo + foo: bar +php: | + array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) +--- +test: Shortcut Key after unindented collection with custom spaces +brief: > + Key/value after unindented collection +yaml: | + collection: + - key: foo + foo: bar +php: | + array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/InlineTest.php b/libs/php-ssh/vendor/symfony/yaml/Tests/InlineTest.php @@ -0,0 +1,384 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Inline; + +class InlineTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getTestsForParse + */ + public function testParse($yaml, $value) + { + $this->assertSame($value, Inline::parse($yaml), sprintf('::parse() converts an inline YAML to a PHP structure (%s)', $yaml)); + } + + /** + * @dataProvider getTestsForParseWithMapObjects + */ + public function testParseWithMapObjects($yaml, $value) + { + $actual = Inline::parse($yaml, false, false, true); + + $this->assertSame(serialize($value), serialize($actual)); + } + + /** + * @dataProvider getTestsForDump + */ + public function testDump($yaml, $value) + { + $this->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml)); + + $this->assertSame($value, Inline::parse(Inline::dump($value)), 'check consistency'); + } + + public function testDumpNumericValueWithLocale() + { + $locale = setlocale(LC_NUMERIC, 0); + if (false === $locale) { + $this->markTestSkipped('Your platform does not support locales.'); + } + + try { + $requiredLocales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); + if (false === setlocale(LC_NUMERIC, $requiredLocales)) { + $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $requiredLocales)); + } + + $this->assertEquals('1.2', Inline::dump(1.2)); + $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); + setlocale(LC_NUMERIC, $locale); + } catch (\Exception $e) { + setlocale(LC_NUMERIC, $locale); + throw $e; + } + } + + public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF() + { + $value = '686e444'; + + $this->assertSame($value, Inline::parse(Inline::dump($value))); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyQuotedStringShouldThrowException() + { + $value = "'don't do somthin' like that'"; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyDoubleQuotedStringShouldThrowException() + { + $value = '"don"t do somthin" like that"'; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseInvalidMappingKeyShouldThrowException() + { + $value = '{ "foo " bar": "bar" }'; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseInvalidMappingShouldThrowException() + { + Inline::parse('[foo] bar'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseInvalidSequenceShouldThrowException() + { + Inline::parse('{ foo: bar } bar'); + } + + public function testParseScalarWithCorrectlyQuotedStringShouldReturnString() + { + $value = "'don''t do somthin'' like that'"; + $expect = "don't do somthin' like that"; + + $this->assertSame($expect, Inline::parseScalar($value)); + } + + /** + * @dataProvider getDataForParseReferences + */ + public function testParseReferences($yaml, $expected) + { + $this->assertSame($expected, Inline::parse($yaml, false, false, false, array('var' => 'var-value'))); + } + + public function getDataForParseReferences() + { + return array( + 'scalar' => array('*var', 'var-value'), + 'list' => array('[ *var ]', array('var-value')), + 'list-in-list' => array('[[ *var ]]', array(array('var-value'))), + 'map-in-list' => array('[ { key: *var } ]', array(array('key' => 'var-value'))), + 'embedded-mapping-in-list' => array('[ key: *var ]', array(array('key' => 'var-value'))), + 'map' => array('{ key: *var }', array('key' => 'var-value')), + 'list-in-map' => array('{ key: [*var] }', array('key' => array('var-value'))), + 'map-in-map' => array('{ foo: { bar: *var } }', array('foo' => array('bar' => 'var-value'))), + ); + } + + public function testParseMapReferenceInSequence() + { + $foo = array( + 'a' => 'Steve', + 'b' => 'Clark', + 'c' => 'Brian', + ); + $this->assertSame(array($foo), Inline::parse('[*foo]', false, false, false, array('foo' => $foo))); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage A reference must contain at least one character. + */ + public function testParseUnquotedAsterisk() + { + Inline::parse('{ foo: * }'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage A reference must contain at least one character. + */ + public function testParseUnquotedAsteriskFollowedByAComment() + { + Inline::parse('{ foo: * #foo }'); + } + + public function getTestsForParse() + { + return array( + array('', ''), + array('null', null), + array('false', false), + array('true', true), + array('12', 12), + array('-12', -12), + array('"quoted string"', 'quoted string'), + array("'quoted string'", 'quoted string'), + array('12.30e+02', 12.30e+02), + array('0x4D2', 0x4D2), + array('02333', 02333), + array('.Inf', -log(0)), + array('-.Inf', log(0)), + array("'686e444'", '686e444'), + array('686e444', 646e444), + array('123456789123456789123456789123456789', '123456789123456789123456789123456789'), + array('"foo\r\nbar"', "foo\r\nbar"), + array("'foo#bar'", 'foo#bar'), + array("'foo # bar'", 'foo # bar'), + array("'#cfcfcf'", '#cfcfcf'), + array('::form_base.html.twig', '::form_base.html.twig'), + + // Pre-YAML-1.2 booleans + array("'y'", 'y'), + array("'n'", 'n'), + array("'yes'", 'yes'), + array("'no'", 'no'), + array("'on'", 'on'), + array("'off'", 'off'), + + array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), + array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), + array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), + array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)), + array('1730-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 1730)), + + array('"a \\"string\\" with \'quoted strings inside\'"', 'a "string" with \'quoted strings inside\''), + array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), + + // sequences + // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon + array('[foo, http://urls.are/no/mappings, false, null, 12]', array('foo', 'http://urls.are/no/mappings', false, null, 12)), + array('[ foo , bar , false , null , 12 ]', array('foo', 'bar', false, null, 12)), + array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), + + // mappings + array('{foo:bar,bar:foo,false:false,null:null,integer:12}', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), + array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), + array('{foo: \'bar\', bar: \'foo: bar\'}', array('foo' => 'bar', 'bar' => 'foo: bar')), + array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', array('foo' => 'bar', 'bar' => 'foo: bar')), + array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', array('foo\'' => 'bar', 'bar"' => 'foo: bar')), + array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', array('foo: ' => 'bar', 'bar: ' => 'foo: bar')), + + // nested sequences and mappings + array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), + array('[foo, {bar: foo}]', array('foo', array('bar' => 'foo'))), + array('{ foo: {bar: foo} }', array('foo' => array('bar' => 'foo'))), + array('{ foo: [bar, foo] }', array('foo' => array('bar', 'foo'))), + + array('[ foo, [ bar, foo ] ]', array('foo', array('bar', 'foo'))), + + array('[{ foo: {bar: foo} }]', array(array('foo' => array('bar' => 'foo')))), + + array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), + + array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo')))), + + array('[foo, bar: { foo: bar }]', array('foo', '1' => array('bar' => array('foo' => 'bar')))), + array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), + ); + } + + public function getTestsForParseWithMapObjects() + { + return array( + array('', ''), + array('null', null), + array('false', false), + array('true', true), + array('12', 12), + array('-12', -12), + array('"quoted string"', 'quoted string'), + array("'quoted string'", 'quoted string'), + array('12.30e+02', 12.30e+02), + array('0x4D2', 0x4D2), + array('02333', 02333), + array('.Inf', -log(0)), + array('-.Inf', log(0)), + array("'686e444'", '686e444'), + array('686e444', 646e444), + array('123456789123456789123456789123456789', '123456789123456789123456789123456789'), + array('"foo\r\nbar"', "foo\r\nbar"), + array("'foo#bar'", 'foo#bar'), + array("'foo # bar'", 'foo # bar'), + array("'#cfcfcf'", '#cfcfcf'), + array('::form_base.html.twig', '::form_base.html.twig'), + + array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), + array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), + array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), + array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)), + array('1730-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 1730)), + + array('"a \\"string\\" with \'quoted strings inside\'"', 'a "string" with \'quoted strings inside\''), + array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), + + // sequences + // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon + array('[foo, http://urls.are/no/mappings, false, null, 12]', array('foo', 'http://urls.are/no/mappings', false, null, 12)), + array('[ foo , bar , false , null , 12 ]', array('foo', 'bar', false, null, 12)), + array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), + + // mappings + array('{foo:bar,bar:foo,false:false,null:null,integer:12}', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), + array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), + array('{foo: \'bar\', bar: \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), + array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), + array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', (object) array('foo\'' => 'bar', 'bar"' => 'foo: bar')), + array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', (object) array('foo: ' => 'bar', 'bar: ' => 'foo: bar')), + + // nested sequences and mappings + array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), + array('[foo, {bar: foo}]', array('foo', (object) array('bar' => 'foo'))), + array('{ foo: {bar: foo} }', (object) array('foo' => (object) array('bar' => 'foo'))), + array('{ foo: [bar, foo] }', (object) array('foo' => array('bar', 'foo'))), + + array('[ foo, [ bar, foo ] ]', array('foo', array('bar', 'foo'))), + + array('[{ foo: {bar: foo} }]', array((object) array('foo' => (object) array('bar' => 'foo')))), + + array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), + + array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', (object) array('bar' => 'foo', 'foo' => array('foo', (object) array('bar' => 'foo'))), array('foo', (object) array('bar' => 'foo')))), + + array('[foo, bar: { foo: bar }]', array('foo', '1' => (object) array('bar' => (object) array('foo' => 'bar')))), + array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', (object) array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), + + array('{}', new \stdClass()), + array('{ foo : bar, bar : {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), + array('{ foo : [], bar : {} }', (object) array('foo' => array(), 'bar' => new \stdClass())), + array('{foo: \'bar\', bar: {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), + array('{\'foo\': \'bar\', "bar": {}}', (object) array('foo' => 'bar', 'bar' => new \stdClass())), + array('{\'foo\': \'bar\', "bar": \'{}\'}', (object) array('foo' => 'bar', 'bar' => '{}')), + + array('[foo, [{}, {}]]', array('foo', array(new \stdClass(), new \stdClass()))), + array('[foo, [[], {}]]', array('foo', array(array(), new \stdClass()))), + array('[foo, [[{}, {}], {}]]', array('foo', array(array(new \stdClass(), new \stdClass()), new \stdClass()))), + array('[foo, {bar: {}}]', array('foo', '1' => (object) array('bar' => new \stdClass()))), + ); + } + + public function getTestsForDump() + { + return array( + array('null', null), + array('false', false), + array('true', true), + array('12', 12), + array("'quoted string'", 'quoted string'), + array('!!float 1230', 12.30e+02), + array('1234', 0x4D2), + array('1243', 02333), + array('.Inf', -log(0)), + array('-.Inf', log(0)), + array("'686e444'", '686e444'), + array('"foo\r\nbar"', "foo\r\nbar"), + array("'foo#bar'", 'foo#bar'), + array("'foo # bar'", 'foo # bar'), + array("'#cfcfcf'", '#cfcfcf'), + + array("'a \"string\" with ''quoted strings inside'''", 'a "string" with \'quoted strings inside\''), + + array("'-dash'", '-dash'), + array("'-'", '-'), + + // Pre-YAML-1.2 booleans + array("'y'", 'y'), + array("'n'", 'n'), + array("'yes'", 'yes'), + array("'no'", 'no'), + array("'on'", 'on'), + array("'off'", 'off'), + + // sequences + array('[foo, bar, false, null, 12]', array('foo', 'bar', false, null, 12)), + array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), + + // mappings + array('{ foo: bar, bar: foo, \'false\': false, \'null\': null, integer: 12 }', array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), + array('{ foo: bar, bar: \'foo: bar\' }', array('foo' => 'bar', 'bar' => 'foo: bar')), + + // nested sequences and mappings + array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), + + array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), + + array('{ foo: { bar: foo } }', array('foo' => array('bar' => 'foo'))), + + array('[foo, { bar: foo }]', array('foo', array('bar' => 'foo'))), + + array('[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]', array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo')))), + + array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), + ); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/ParseExceptionTest.php b/libs/php-ssh/vendor/symfony/yaml/Tests/ParseExceptionTest.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Exception\ParseException; + +class ParseExceptionTest extends \PHPUnit_Framework_TestCase +{ + public function testGetMessage() + { + $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml'); + if (PHP_VERSION_ID >= 50400) { + $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")'; + } else { + $message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")'; + } + + $this->assertEquals($message, $exception->getMessage()); + } + + public function testGetMessageWithUnicodeInFilename() + { + $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml'); + if (PHP_VERSION_ID >= 50400) { + $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")'; + } else { + $message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")'; + } + + $this->assertEquals($message, $exception->getMessage()); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/ParserTest.php b/libs/php-ssh/vendor/symfony/yaml/Tests/ParserTest.php @@ -0,0 +1,773 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Yaml\Parser; + +class ParserTest extends \PHPUnit_Framework_TestCase +{ + protected $parser; + + protected function setUp() + { + $this->parser = new Parser(); + } + + protected function tearDown() + { + $this->parser = null; + } + + /** + * @dataProvider getDataFormSpecifications + */ + public function testSpecifications($file, $expected, $yaml, $comment) + { + $this->assertEquals($expected, var_export($this->parser->parse($yaml), true), $comment); + } + + public function getDataFormSpecifications() + { + $parser = new Parser(); + $path = __DIR__.'/Fixtures'; + + $tests = array(); + $files = $parser->parse(file_get_contents($path.'/index.yml')); + foreach ($files as $file) { + $yamls = file_get_contents($path.'/'.$file.'.yml'); + + // split YAMLs documents + foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { + if (!$yaml) { + continue; + } + + $test = $parser->parse($yaml); + if (isset($test['todo']) && $test['todo']) { + // TODO + } else { + eval('$expected = '.trim($test['php']).';'); + + $tests[] = array($file, var_export($expected, true), $test['yaml'], $test['test']); + } + } + } + + return $tests; + } + + public function testTabsInYaml() + { + // test tabs in YAML + $yamls = array( + "foo:\n bar", + "foo:\n bar", + "foo:\n bar", + "foo:\n bar", + ); + + foreach ($yamls as $yaml) { + try { + $content = $this->parser->parse($yaml); + + $this->fail('YAML files must not contain tabs'); + } catch (\Exception $e) { + $this->assertInstanceOf('\Exception', $e, 'YAML files must not contain tabs'); + $this->assertEquals('A YAML file cannot contain tabs as indentation at line 2 (near "'.strpbrk($yaml, "\t").'").', $e->getMessage(), 'YAML files must not contain tabs'); + } + } + } + + public function testEndOfTheDocumentMarker() + { + $yaml = <<<EOF +--- %YAML:1.0 +foo +... +EOF; + + $this->assertEquals('foo', $this->parser->parse($yaml)); + } + + public function getBlockChompingTests() + { + $tests = array(); + + $yaml = <<<'EOF' +foo: |- + one + two +bar: |- + one + two + +EOF; + $expected = array( + 'foo' => "one\ntwo", + 'bar' => "one\ntwo", + ); + $tests['Literal block chomping strip with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: |- + one + two + +bar: |- + one + two + + +EOF; + $expected = array( + 'foo' => "one\ntwo", + 'bar' => "one\ntwo", + ); + $tests['Literal block chomping strip with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +{} + + +EOF; + $expected = array(); + $tests['Literal block chomping strip with multiple trailing newlines after a 1-liner'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: |- + one + two +bar: |- + one + two +EOF; + $expected = array( + 'foo' => "one\ntwo", + 'bar' => "one\ntwo", + ); + $tests['Literal block chomping strip without trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: | + one + two +bar: | + one + two + +EOF; + $expected = array( + 'foo' => "one\ntwo\n", + 'bar' => "one\ntwo\n", + ); + $tests['Literal block chomping clip with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: | + one + two + +bar: | + one + two + + +EOF; + $expected = array( + 'foo' => "one\ntwo\n", + 'bar' => "one\ntwo\n", + ); + $tests['Literal block chomping clip with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: | + one + two +bar: | + one + two +EOF; + $expected = array( + 'foo' => "one\ntwo\n", + 'bar' => "one\ntwo", + ); + $tests['Literal block chomping clip without trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: |+ + one + two +bar: |+ + one + two + +EOF; + $expected = array( + 'foo' => "one\ntwo\n", + 'bar' => "one\ntwo\n", + ); + $tests['Literal block chomping keep with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: |+ + one + two + +bar: |+ + one + two + + +EOF; + $expected = array( + 'foo' => "one\ntwo\n\n", + 'bar' => "one\ntwo\n\n", + ); + $tests['Literal block chomping keep with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: |+ + one + two +bar: |+ + one + two +EOF; + $expected = array( + 'foo' => "one\ntwo\n", + 'bar' => "one\ntwo", + ); + $tests['Literal block chomping keep without trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >- + one + two +bar: >- + one + two + +EOF; + $expected = array( + 'foo' => 'one two', + 'bar' => 'one two', + ); + $tests['Folded block chomping strip with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >- + one + two + +bar: >- + one + two + + +EOF; + $expected = array( + 'foo' => 'one two', + 'bar' => 'one two', + ); + $tests['Folded block chomping strip with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >- + one + two +bar: >- + one + two +EOF; + $expected = array( + 'foo' => 'one two', + 'bar' => 'one two', + ); + $tests['Folded block chomping strip without trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: > + one + two +bar: > + one + two + +EOF; + $expected = array( + 'foo' => "one two\n", + 'bar' => "one two\n", + ); + $tests['Folded block chomping clip with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: > + one + two + +bar: > + one + two + + +EOF; + $expected = array( + 'foo' => "one two\n", + 'bar' => "one two\n", + ); + $tests['Folded block chomping clip with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: > + one + two +bar: > + one + two +EOF; + $expected = array( + 'foo' => "one two\n", + 'bar' => 'one two', + ); + $tests['Folded block chomping clip without trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >+ + one + two +bar: >+ + one + two + +EOF; + $expected = array( + 'foo' => "one two\n", + 'bar' => "one two\n", + ); + $tests['Folded block chomping keep with single trailing newline'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >+ + one + two + +bar: >+ + one + two + + +EOF; + $expected = array( + 'foo' => "one two\n\n", + 'bar' => "one two\n\n", + ); + $tests['Folded block chomping keep with multiple trailing newlines'] = array($expected, $yaml); + + $yaml = <<<'EOF' +foo: >+ + one + two +bar: >+ + one + two +EOF; + $expected = array( + 'foo' => "one two\n", + 'bar' => 'one two', + ); + $tests['Folded block chomping keep without trailing newline'] = array($expected, $yaml); + + return $tests; + } + + /** + * @dataProvider getBlockChompingTests + */ + public function testBlockChomping($expected, $yaml) + { + $this->assertSame($expected, $this->parser->parse($yaml)); + } + + /** + * Regression test for issue #7989. + * + * @see https://github.com/symfony/symfony/issues/7989 + */ + public function testBlockLiteralWithLeadingNewlines() + { + $yaml = <<<'EOF' +foo: |- + + + bar + +EOF; + $expected = array( + 'foo' => "\n\nbar", + ); + + $this->assertSame($expected, $this->parser->parse($yaml)); + } + + public function testObjectSupportEnabled() + { + $input = <<<EOF +foo: !!php/object:O:30:"Symfony\Component\Yaml\Tests\B":1:{s:1:"b";s:3:"foo";} +bar: 1 +EOF; + $this->assertEquals(array('foo' => new B(), 'bar' => 1), $this->parser->parse($input, false, true), '->parse() is able to parse objects'); + } + + public function testObjectSupportDisabledButNoExceptions() + { + $input = <<<EOF +foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";} +bar: 1 +EOF; + + $this->assertEquals(array('foo' => null, 'bar' => 1), $this->parser->parse($input), '->parse() does not parse objects'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testObjectsSupportDisabledWithExceptions() + { + $this->parser->parse('foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";}', true, false); + } + + public function testNonUtf8Exception() + { + if (!function_exists('iconv')) { + $this->markTestSkipped('Exceptions for non-utf8 charsets require the iconv() function.'); + + return; + } + + $yamls = array( + iconv('UTF-8', 'ISO-8859-1', "foo: 'äöüß'"), + iconv('UTF-8', 'ISO-8859-15', "euro: '€'"), + iconv('UTF-8', 'CP1252', "cp1252: '©ÉÇáñ'"), + ); + + foreach ($yamls as $yaml) { + try { + $this->parser->parse($yaml); + + $this->fail('charsets other than UTF-8 are rejected.'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); + } + } + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testUnindentedCollectionException() + { + $yaml = <<<EOF + +collection: +-item1 +-item2 +-item3 + +EOF; + + $this->parser->parse($yaml); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testShortcutKeyUnindentedCollectionException() + { + $yaml = <<<EOF + +collection: +- key: foo + foo: bar + +EOF; + + $this->parser->parse($yaml); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage Multiple documents are not supported. + */ + public function testMultipleDocumentsNotSupportedException() + { + Yaml::parse(<<<EOL +# Ranking of 1998 home runs +--- +- Mark McGwire +- Sammy Sosa +- Ken Griffey + +# Team ranking +--- +- Chicago Cubs +- St Louis Cardinals +EOL + ); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testSequenceInAMapping() + { + Yaml::parse(<<<EOF +yaml: + hash: me + - array stuff +EOF + ); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testMappingInASequence() + { + Yaml::parse(<<<EOF +yaml: + - array stuff + hash: me +EOF + ); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage missing colon + */ + public function testScalarInSequence() + { + Yaml::parse(<<<EOF +foo: + - bar +"missing colon" + foo: bar +EOF + ); + } + + /** + * > It is an error for two equal keys to appear in the same mapping node. + * > In such a case the YAML processor may continue, ignoring the second + * > `key: value` pair and issuing an appropriate warning. This strategy + * > preserves a consistent information model for one-pass and random access + * > applications. + * + * @see http://yaml.org/spec/1.2/spec.html#id2759572 + * @see http://yaml.org/spec/1.1/#id932806 + * + * @covers \Symfony\Component\Yaml\Parser::parse + */ + public function testMappingDuplicateKeyBlock() + { + $input = <<<EOD +parent: + child: first + child: duplicate +parent: + child: duplicate + child: duplicate +EOD; + $expected = array( + 'parent' => array( + 'child' => 'first', + ), + ); + $this->assertSame($expected, Yaml::parse($input)); + } + + /** + * @covers \Symfony\Component\Yaml\Inline::parseMapping + */ + public function testMappingDuplicateKeyFlow() + { + $input = <<<EOD +parent: { child: first, child: duplicate } +parent: { child: duplicate, child: duplicate } +EOD; + $expected = array( + 'parent' => array( + 'child' => 'first', + ), + ); + $this->assertSame($expected, Yaml::parse($input)); + } + + public function testEmptyValue() + { + $input = <<<EOF +hash: +EOF; + + $this->assertEquals(array('hash' => null), Yaml::parse($input)); + } + + public function testStringBlockWithComments() + { + $this->assertEquals(array('content' => <<<EOT +# comment 1 +header + + # comment 2 + <body> + <h1>title</h1> + </body> + +footer # comment3 +EOT + ), Yaml::parse(<<<EOF +content: | + # comment 1 + header + + # comment 2 + <body> + <h1>title</h1> + </body> + + footer # comment3 +EOF + )); + } + + public function testFoldedStringBlockWithComments() + { + $this->assertEquals(array(array('content' => <<<EOT +# comment 1 +header + + # comment 2 + <body> + <h1>title</h1> + </body> + +footer # comment3 +EOT + )), Yaml::parse(<<<EOF +- + content: | + # comment 1 + header + + # comment 2 + <body> + <h1>title</h1> + </body> + + footer # comment3 +EOF + )); + } + + public function testNestedFoldedStringBlockWithComments() + { + $this->assertEquals(array(array( + 'title' => 'some title', + 'content' => <<<EOT +# comment 1 +header + + # comment 2 + <body> + <h1>title</h1> + </body> + +footer # comment3 +EOT + )), Yaml::parse(<<<EOF +- + title: some title + content: | + # comment 1 + header + + # comment 2 + <body> + <h1>title</h1> + </body> + + footer # comment3 +EOF + )); + } + + public function testReferenceResolvingInInlineStrings() + { + $this->assertEquals(array( + 'var' => 'var-value', + 'scalar' => 'var-value', + 'list' => array('var-value'), + 'list_in_list' => array(array('var-value')), + 'map_in_list' => array(array('key' => 'var-value')), + 'embedded_mapping' => array(array('key' => 'var-value')), + 'map' => array('key' => 'var-value'), + 'list_in_map' => array('key' => array('var-value')), + 'map_in_map' => array('foo' => array('bar' => 'var-value')), + ), Yaml::parse(<<<EOF +var: &var var-value +scalar: *var +list: [ *var ] +list_in_list: [[ *var ]] +map_in_list: [ { key: *var } ] +embedded_mapping: [ key: *var ] +map: { key: *var } +list_in_map: { key: [*var] } +map_in_map: { foo: { bar: *var } } +EOF + )); + } + + public function testYamlDirective() + { + $yaml = <<<EOF +%YAML 1.2 +--- +foo: 1 +bar: 2 +EOF; + $this->assertEquals(array('foo' => 1, 'bar' => 2), $this->parser->parse($yaml)); + } + + public function testFloatKeys() + { + $yaml = <<<EOF +foo: + 1.2: "bar" + 1.3: "baz" +EOF; + + $expected = array( + 'foo' => array( + '1.2' => 'bar', + '1.3' => 'baz', + ), + ); + + $this->assertEquals($expected, $this->parser->parse($yaml)); + } +} + +class B +{ + public $b = 'foo'; +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Tests/YamlTest.php b/libs/php-ssh/vendor/symfony/yaml/Tests/YamlTest.php @@ -0,0 +1,37 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; + +class YamlTest extends \PHPUnit_Framework_TestCase +{ + public function testParseAndDump() + { + $data = array('lorem' => 'ipsum', 'dolor' => 'sit'); + $yml = Yaml::dump($data); + $parsed = Yaml::parse($yml); + $this->assertEquals($data, $parsed); + } + + /** + * @group legacy + */ + public function testLegacyParseFromFile() + { + $filename = __DIR__.'/Fixtures/index.yml'; + $contents = file_get_contents($filename); + $parsedByFilename = Yaml::parse($filename); + $parsedByContents = Yaml::parse($contents); + $this->assertEquals($parsedByFilename, $parsedByContents); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Unescaper.php b/libs/php-ssh/vendor/symfony/yaml/Unescaper.php @@ -0,0 +1,147 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +/** + * Unescaper encapsulates unescaping rules for single and double-quoted + * YAML strings. + * + * @author Matthew Lewinski <matthew@lewinski.org> + */ +class Unescaper +{ + /** + * Parser and Inline assume UTF-8 encoding, so escaped Unicode characters + * must be converted to that encoding. + * + * @deprecated since version 2.5, to be removed in 3.0 + * + * @internal + */ + const ENCODING = 'UTF-8'; + + /** + * Regex fragment that matches an escaped character in a double quoted string. + */ + const REGEX_ESCAPED_CHARACTER = "\\\\([0abt\tnvfre \\\"\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})"; + + /** + * Unescapes a single quoted string. + * + * @param string $value A single quoted string. + * + * @return string The unescaped string. + */ + public function unescapeSingleQuotedString($value) + { + return str_replace('\'\'', '\'', $value); + } + + /** + * Unescapes a double quoted string. + * + * @param string $value A double quoted string. + * + * @return string The unescaped string. + */ + public function unescapeDoubleQuotedString($value) + { + $self = $this; + $callback = function ($match) use ($self) { + return $self->unescapeCharacter($match[0]); + }; + + // evaluate the string + return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); + } + + /** + * Unescapes a character that was found in a double-quoted string. + * + * @param string $value An escaped character + * + * @return string The unescaped character + */ + public function unescapeCharacter($value) + { + switch ($value{1}) { + case '0': + return "\x0"; + case 'a': + return "\x7"; + case 'b': + return "\x8"; + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return "\xB"; + case 'f': + return "\xC"; + case 'r': + return "\r"; + case 'e': + return "\x1B"; + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + // U+0085 NEXT LINE + return "\xC2\x85"; + case '_': + // U+00A0 NO-BREAK SPACE + return "\xC2\xA0"; + case 'L': + // U+2028 LINE SEPARATOR + return "\xE2\x80\xA8"; + case 'P': + // U+2029 PARAGRAPH SEPARATOR + return "\xE2\x80\xA9"; + case 'x': + return self::utf8chr(hexdec(substr($value, 2, 2))); + case 'u': + return self::utf8chr(hexdec(substr($value, 2, 4))); + case 'U': + return self::utf8chr(hexdec(substr($value, 2, 8))); + } + } + + /** + * Get the UTF-8 character for the given code point. + * + * @param int $c The unicode code point + * + * @return string The corresponding UTF-8 character + */ + private static function utf8chr($c) + { + if (0x80 > $c %= 0x200000) { + return chr($c); + } + if (0x800 > $c) { + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); + } + if (0x10000 > $c) { + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } + + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/Yaml.php b/libs/php-ssh/vendor/symfony/yaml/Yaml.php @@ -0,0 +1,105 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml; + +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * Yaml offers convenience methods to load and dump YAML. + * + * @author Fabien Potencier <fabien@symfony.com> + * + * @api + */ +class Yaml +{ + /** + * Parses YAML into a PHP array. + * + * The parse method, when supplied with a YAML stream (string or file), + * will do its best to convert YAML in a file into a PHP array. + * + * Usage: + * <code> + * $array = Yaml::parse(file_get_contents('config.yml')); + * print_r($array); + * </code> + * + * As this method accepts both plain strings and file names as an input, + * you must validate the input before calling this method. Passing a file + * as an input is a deprecated feature and will be removed in 3.0. + * + * Note: the ability to pass file names to the Yaml::parse method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead. + * + * @param string $input Path to a YAML file or a string containing YAML + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() + * + * @return array The YAML converted to a PHP array + * + * @throws ParseException If the YAML is not valid + * + * @api + */ + public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) + { + // if input is a file, process it + $file = ''; + if (strpos($input, "\n") === false && is_file($input)) { + @trigger_error('The ability to pass file names to the '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead.', E_USER_DEPRECATED); + + if (false === is_readable($input)) { + throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); + } + + $file = $input; + $input = file_get_contents($file); + } + + $yaml = new Parser(); + + try { + return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport, $objectForMap); + } catch (ParseException $e) { + if ($file) { + $e->setParsedFile($file); + } + + throw $e; + } + } + + /** + * Dumps a PHP array to a YAML string. + * + * The dump method, when supplied with an array, will do its best + * to convert the array into friendly YAML. + * + * @param array $array PHP array + * @param int $inline The level where you switch to inline YAML + * @param int $indent The amount of spaces to use for indentation of nested nodes. + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * + * @return string A YAML string representing the original PHP array + * + * @api + */ + public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) + { + $yaml = new Dumper(); + $yaml->setIndentation($indent); + + return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport); + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/composer.json b/libs/php-ssh/vendor/symfony/yaml/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/yaml", + "type": "library", + "description": "Symfony Yaml Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\Yaml\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + } +} diff --git a/libs/php-ssh/vendor/symfony/yaml/phpunit.xml.dist b/libs/php-ssh/vendor/symfony/yaml/phpunit.xml.dist @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" + backupGlobals="false" + colors="true" + bootstrap="vendor/autoload.php" +> + <php> + <ini name="error_reporting" value="-1" /> + </php> + + <testsuites> + <testsuite name="Symfony Yaml Component Test Suite"> + <directory>./Tests/</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>./</directory> + <exclude> + <directory>./vendor</directory> + <directory>./Tests</directory> + </exclude> + </whitelist> + </filter> +</phpunit>