diff --git a/.travis.yml b/.travis.yml index 654258590c8..5139a7c543f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ language: php php: # We only run the highest and lowest supported versions to reduce the load on travis-ci.org. - - 7.1 + - 7.2 - 7.0 addons: @@ -30,7 +30,7 @@ env: # Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to # start first so that the total run time is not too high. # - # We only run MySQL on PHP 7.1, so run that first. + # We only run MySQL on PHP 7.2, so run that first. # CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances. # Postgres is significantly is pretty reasonable in its run-time. @@ -54,12 +54,12 @@ matrix: include: # Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.) - - php: 7.1 + - php: 7.2 env: DB=none TASK=GRUNT NVM_VERSION='8.9' exclude: # MySQL - it's just too slow. - # Exclude it on all versions except for 7.1 + # Exclude it on all versions except for 7.2 - env: DB=mysqli TASK=PHPUNIT php: 7.0 diff --git a/admin/tool/phpunit/cli/util.php b/admin/tool/phpunit/cli/util.php index a4da37456fe..6bda8483c5e 100644 --- a/admin/tool/phpunit/cli/util.php +++ b/admin/tool/phpunit/cli/util.php @@ -74,7 +74,7 @@ if ($options['run']) { } } $_SERVER['argv'] = array_values($_SERVER['argv']); - PHPUnit_TextUI_Command::main(); + PHPUnit\TextUI\Command::main(); exit(0); } diff --git a/composer.json b/composer.json index a656ec17362..6203b8a30ea 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,8 @@ "type": "project", "homepage": "https://moodle.org", "require-dev": { - "phpunit/phpunit": "5.5.*", - "phpunit/dbUnit": "1.4.*", + "phpunit/phpunit": "6.4.*", + "phpunit/dbUnit": "3.0.*", "moodlehq/behat-extension": "3.34.1", "mikey179/vfsStream": "^1.6" } diff --git a/composer.lock b/composer.lock index 1150efe2ab7..d69ba0b0c37 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1906bd3ac810927fb8084fe4e2967d36", + "content-hash": "b36746ace2486c033136c855a63f3793", "packages": [], "packages-dev": [ { @@ -953,37 +953,40 @@ }, { "name": "myclabs/deep-copy", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -991,7 +994,109 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1204,99 +1309,93 @@ }, { "name": "phpunit/dbunit", - "version": "1.4.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/dbunit.git", - "reference": "9aaee6447663ff1b0cd50c23637e04af74c5e2ae" + "reference": "6b9cec80dca8694243aade33bceb425ccafbbd0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/9aaee6447663ff1b0cd50c23637e04af74c5e2ae", - "reference": "9aaee6447663ff1b0cd50c23637e04af74c5e2ae", + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/6b9cec80dca8694243aade33bceb425ccafbbd0d", + "reference": "6b9cec80dca8694243aade33bceb425ccafbbd0d", "shasum": "" }, "require": { "ext-pdo": "*", "ext-simplexml": "*", - "php": ">=5.3.3", - "phpunit/phpunit": "~4|~5", - "symfony/yaml": "~2.1|~3.0" + "php": "^7.0", + "phpunit/phpunit": "^6.0", + "symfony/yaml": "^3.0" }, - "bin": [ - "composer/bin/dbunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.", + "description": "PHPUnit extension for database interaction testing", "homepage": "https://github.com/sebastianbergmann/dbunit/", "keywords": [ "database", "testing", "xunit" ], - "time": "2015-08-07T04:57:38+00:00" + "time": "2017-10-19T13:21:48+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.2.x-dev" } }, "autoload": { @@ -1322,7 +1421,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-08-03T12:40:43+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1512,16 +1611,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.5.7", + "version": "6.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3f67cee782c9abfaee5e32fd2f57cdd54bc257ba" + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3f67cee782c9abfaee5e32fd2f57cdd54bc257ba", - "reference": "3f67cee782c9abfaee5e32fd2f57cdd54bc257ba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", "shasum": "" }, "require": { @@ -1530,34 +1629,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "^1.3 || ^2.0", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", - "symfony/yaml": "~2.1|~3.0" + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { - "ext-tidy": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1565,7 +1665,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.5.x-dev" + "dev-master": "6.4.x-dev" } }, "autoload": { @@ -1591,33 +1691,33 @@ "testing", "xunit" ], - "time": "2016-10-03T13:04:15+00:00" + "time": "2017-10-16T13:18:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -1625,7 +1725,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -1650,7 +1750,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2017-08-03T14:08:16+00:00" }, { "name": "psr/container", @@ -1845,30 +1945,30 @@ }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1905,32 +2005,32 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-08-03T07:14:59+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1957,32 +2057,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2007,34 +2107,34 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2074,27 +2174,27 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -2102,7 +2202,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2125,33 +2225,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "1.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~1.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2171,32 +2272,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28T13:25:10+00:00" + "time": "2017-08-03T12:35:26+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.5", + "name": "sebastian/object-reflector", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2224,7 +2370,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -2313,16 +2459,16 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "aee7120b058c268363e606ff5fe8271da849a1b5" + "reference": "317d5bdf0127f06db7ea294186132b4f5b036839" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/aee7120b058c268363e606ff5fe8271da849a1b5", - "reference": "aee7120b058c268363e606ff5fe8271da849a1b5", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/317d5bdf0127f06db7ea294186132b4f5b036839", + "reference": "317d5bdf0127f06db7ea294186132b4f5b036839", "shasum": "" }, "require": { @@ -2366,20 +2512,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/class-loader", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "9c69968ce57924e9e93550895cd2b0477edf0e19" + "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/9c69968ce57924e9e93550895cd2b0477edf0e19", - "reference": "9c69968ce57924e9e93550895cd2b0477edf0e19", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/7572c904b209fa9907c69a6a9a68243c265a4d01", + "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01", "shasum": "" }, "require": { @@ -2422,20 +2568,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/config", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "f9f19a39ee178f61bb2190f51ff7c517c2159315" + "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/f9f19a39ee178f61bb2190f51ff7c517c2159315", - "reference": "f9f19a39ee178f61bb2190f51ff7c517c2159315", + "url": "https://api.github.com/repos/symfony/config/zipball/4ab62407bff9cd97c410a7feaef04c375aaa5cfd", + "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd", "shasum": "" }, "require": { @@ -2484,20 +2630,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-09-04T16:28:07+00:00" + "time": "2017-10-04T18:56:58+00:00" }, { "name": "symfony/console", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf" + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf", - "reference": "a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf", + "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", "shasum": "" }, "require": { @@ -2552,20 +2698,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-09-06T16:40:18+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/css-selector", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "c5f5263ed231f164c58368efbce959137c7d9488" + "reference": "07447650225ca9223bd5c97180fe7c8267f7d332" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/c5f5263ed231f164c58368efbce959137c7d9488", - "reference": "c5f5263ed231f164c58368efbce959137c7d9488", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332", + "reference": "07447650225ca9223bd5c97180fe7c8267f7d332", "shasum": "" }, "require": { @@ -2605,20 +2751,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/debug", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "8beb24eec70b345c313640962df933499373a944" + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/8beb24eec70b345c313640962df933499373a944", - "reference": "8beb24eec70b345c313640962df933499373a944", + "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", "shasum": "" }, "require": { @@ -2661,20 +2807,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-09-01T13:23:39+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e593f06dd90a81c7b70ac1c49862a061b0ec06d2" + "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e593f06dd90a81c7b70ac1c49862a061b0ec06d2", - "reference": "e593f06dd90a81c7b70ac1c49862a061b0ec06d2", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8ebad929aee3ca185b05f55d9cc5521670821ad1", + "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1", "shasum": "" }, "require": { @@ -2731,20 +2877,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-09-05T20:39:38+00:00" + "time": "2017-10-04T17:15:30+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "6b511d7329b203a620f09a2288818d27dcc915ae" + "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/6b511d7329b203a620f09a2288818d27dcc915ae", - "reference": "6b511d7329b203a620f09a2288818d27dcc915ae", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1", + "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1", "shasum": "" }, "require": { @@ -2787,20 +2933,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-09-11T15:55:22+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "54ca9520a00386f83bca145819ad3b619aaa2485" + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54ca9520a00386f83bca145819ad3b619aaa2485", - "reference": "54ca9520a00386f83bca145819ad3b619aaa2485", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", "shasum": "" }, "require": { @@ -2850,20 +2996,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/filesystem", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb" + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", - "reference": "b32a0e5f928d0fa3d1dd03c78d020777e50c10cb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", "shasum": "" }, "require": { @@ -2899,20 +3045,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-03T13:33:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", - "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -2924,7 +3070,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -2958,20 +3104,20 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/process", - "version": "v2.8.27", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8" + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", - "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "url": "https://api.github.com/repos/symfony/process/zipball/26c9fb02bf06bd6b90f661a5bd17e510810d0176", + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176", "shasum": "" }, "require": { @@ -3007,20 +3153,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-03T08:04:30+00:00" + "time": "2017-10-01T21:00:16+00:00" }, { "name": "symfony/translation", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "add53753d978f635492dfe8cd6953f6a7361ef90" + "reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/add53753d978f635492dfe8cd6953f6a7361ef90", - "reference": "add53753d978f635492dfe8cd6953f6a7361ef90", + "url": "https://api.github.com/repos/symfony/translation/zipball/409bf229cd552bf7e3faa8ab7e3980b07672073f", + "reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f", "shasum": "" }, "require": { @@ -3072,20 +3218,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-02T06:42:24+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.9", + "version": "v3.3.10", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0" + "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0", - "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", "shasum": "" }, "require": { @@ -3127,7 +3273,47 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-10-05T14:43:42+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", diff --git a/lib/filestorage/tests/file_system_filedir_test.php b/lib/filestorage/tests/file_system_filedir_test.php index 6f4ee6401a9..fa4c6c29b27 100644 --- a/lib/filestorage/tests/file_system_filedir_test.php +++ b/lib/filestorage/tests/file_system_filedir_test.php @@ -149,7 +149,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase { ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); // This should generate an exception. - $this->setExpectedExceptionRegexp('file_exception', + $this->expectException('file_exception'); + $this->expectExceptionMessageRegExp( '/Can not create local file pool directories, please verify permissions in dataroot./'); new file_system_filedir(); @@ -170,7 +171,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase { ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); // This should generate an exception. - $this->setExpectedExceptionRegexp('file_exception', + $this->expectException('file_exception'); + $this->expectExceptionMessageRegExp( '/Can not create local file pool directories, please verify permissions in dataroot./'); new file_system_filedir(); @@ -693,7 +695,8 @@ class core_files_file_system_filedir_testcase extends advanced_testcase { // Setup the filedir. $vfileroot = $this->setup_vfile_root(); - $this->setExpectedExceptionRegexp('file_exception', + $this->expectException('file_exception'); + $this->expectExceptionMessageRegExp( '/Cannot read file\. Either the file does not exist or there is a permission problem\./'); $fs = new file_system_filedir(); @@ -785,10 +788,9 @@ class core_files_file_system_filedir_testcase extends advanced_testcase { ->chmod(0444) ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); - $this->setExpectedException( - 'file_exception', - "Can not create local file pool directories, please verify permissions in dataroot." - ); + $this->expectException('file_exception'); + $this->expectExceptionMessageRegExp( + "/Can not create local file pool directories, please verify permissions in dataroot./"); // Attempt to add the file to the file pool. $fs = new file_system_filedir(); @@ -840,10 +842,9 @@ class core_files_file_system_filedir_testcase extends advanced_testcase { ->chmod(0444) ->chown(\org\bovigo\vfs\vfsStream::OWNER_USER_2); - $this->setExpectedException( - 'file_exception', - "Can not create local file pool directories, please verify permissions in dataroot." - ); + $this->expectException('file_exception'); + $this->expectExceptionMessageRegExp( + "/Can not create local file pool directories, please verify permissions in dataroot./"); // Attempt to add the file to the file pool. $fs = new file_system_filedir(); diff --git a/lib/filestorage/tests/zip_packer_test.php b/lib/filestorage/tests/zip_packer_test.php index d7f25004866..860b8afb504 100644 --- a/lib/filestorage/tests/zip_packer_test.php +++ b/lib/filestorage/tests/zip_packer_test.php @@ -463,7 +463,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $result = $zip_archive->close(); } catch (Exception $e) { // New PHP versions print PHP Warning. - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); $this->assertContains('ZipArchive::close', $e->getMessage()); } // This is crazy, but it shows how some PHP versions do return true. @@ -472,7 +472,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $this->assertFalse($result); } catch (Exception $e) { // But others do insist into returning true (5.6.13...). Only can accept them. - $this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e); + $this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e); $this->assertTrue($result); } $this->assertFileNotExists($archive); diff --git a/lib/phpunit/bootstrap.php b/lib/phpunit/bootstrap.php index 5ad0bfe8e7e..3e88f506f83 100644 --- a/lib/phpunit/bootstrap.php +++ b/lib/phpunit/bootstrap.php @@ -72,7 +72,7 @@ if (defined('CLI_SCRIPT')) { } define('CLI_SCRIPT', true); -$phpunitversion = PHPUnit_Runner_Version::id(); +$phpunitversion = PHPUnit\Runner\Version::id(); if ($phpunitversion === '@package_version@') { // library checked out from git, let's hope dev knows that 3.6.0 is required } else if (version_compare($phpunitversion, '3.6.0', 'lt')) { @@ -80,10 +80,6 @@ if ($phpunitversion === '@package_version@') { } unset($phpunitversion); -if (!include_once('PHPUnit/Extensions/Database/Autoload.php')) { - phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITEXTMISSING, 'phpunit/DbUnit'); -} - define('NO_OUTPUT_BUFFERING', true); // only load CFG from config.php, stop ASAP in lib/setup.php diff --git a/lib/phpunit/classes/advanced_testcase.php b/lib/phpunit/classes/advanced_testcase.php index ee05a32506b..a0ec58912e1 100644 --- a/lib/phpunit/classes/advanced_testcase.php +++ b/lib/phpunit/classes/advanced_testcase.php @@ -135,9 +135,9 @@ abstract class advanced_testcase extends base_testcase { // make sure test did not forget to close transaction if ($DB->is_transaction_started()) { self::resetAllData(); - if ($this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_PASSED - or $this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED - or $this->getStatus() == PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE) { + if ($this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_PASSED + or $this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED + or $this->getStatus() == PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE) { throw new coding_exception('Test '.$this->getName().' did not close database transaction'); } } @@ -147,20 +147,20 @@ abstract class advanced_testcase extends base_testcase { * Creates a new FlatXmlDataSet with the given $xmlFile. (absolute path.) * * @param string $xmlFile - * @return PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet + * @return PHPUnit\DbUnit\DataSet\FlatXmlDataSet */ protected function createFlatXMLDataSet($xmlFile) { - return new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($xmlFile); + return new PHPUnit\DbUnit\DataSet\FlatXmlDataSet($xmlFile); } /** * Creates a new XMLDataSet with the given $xmlFile. (absolute path.) * * @param string $xmlFile - * @return PHPUnit_Extensions_Database_DataSet_XmlDataSet + * @return PHPUnit\DbUnit\DataSet\XmlDataSet */ protected function createXMLDataSet($xmlFile) { - return new PHPUnit_Extensions_Database_DataSet_XmlDataSet($xmlFile); + return new PHPUnit\DbUnit\DataSet\XmlDataSet($xmlFile); } /** @@ -170,10 +170,10 @@ abstract class advanced_testcase extends base_testcase { * @param string $delimiter * @param string $enclosure * @param string $escape - * @return PHPUnit_Extensions_Database_DataSet_CsvDataSet + * @return PHPUnit\DbUnit\DataSet\CsvDataSet */ protected function createCsvDataSet($files, $delimiter = ',', $enclosure = '"', $escape = '"') { - $dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet($delimiter, $enclosure, $escape); + $dataSet = new PHPUnit\DbUnit\DataSet\CsvDataSet($delimiter, $enclosure, $escape); foreach($files as $table=>$file) { $dataSet->addTable($table, $file); } @@ -195,10 +195,10 @@ abstract class advanced_testcase extends base_testcase { * * Note: it is usually better to use data generators * - * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataset + * @param PHPUnit\DbUnit\DataSet\IDataSet $dataset * @return void */ - protected function loadDataSet(PHPUnit_Extensions_Database_DataSet_IDataSet $dataset) { + protected function loadDataSet(PHPUnit\DbUnit\DataSet\IDataSet $dataset) { global $DB; $structure = phpunit_util::get_tablestructure(); diff --git a/lib/phpunit/classes/arraydataset.php b/lib/phpunit/classes/arraydataset.php index d4148f95f0c..c735be4a2ac 100644 --- a/lib/phpunit/classes/arraydataset.php +++ b/lib/phpunit/classes/arraydataset.php @@ -33,7 +33,7 @@ * @copyright 2012 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractDataSet { +class phpunit_ArrayDataSet extends PHPUnit\DbUnit\DataSet\AbstractDataSet { /** * @var array */ @@ -58,8 +58,8 @@ class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractD $columns = array_keys($firstrow); } - $metaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($tableName, $columns); - $table = new PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData); + $metaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetaData($tableName, $columns); + $table = new PHPUnit\DbUnit\DataSet\DefaultTable($metaData); foreach ($rows AS $row) { if ($columnsInFirstRow) { @@ -72,7 +72,7 @@ class phpunit_ArrayDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractD } protected function createIterator($reverse = FALSE) { - return new PHPUnit_Extensions_Database_DataSet_DefaultTableIterator($this->tables, $reverse); + return new PHPUnit\DbUnit\DataSet\DefaultTableIterator($this->tables, $reverse); } public function getTable($tableName) { diff --git a/lib/phpunit/classes/autoloader.php b/lib/phpunit/classes/autoloader.php index 611512b3d31..c39ec4aac48 100644 --- a/lib/phpunit/classes/autoloader.php +++ b/lib/phpunit/classes/autoloader.php @@ -42,7 +42,7 @@ * @copyright 2013 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { +class phpunit_autoloader implements \PHPUnit\Runner\TestSuiteLoader { public function load($suiteClassName, $suiteClassFile = '') { global $CFG; @@ -66,13 +66,13 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { } if ($suiteClassFile) { - PHPUnit_Util_Fileloader::checkAndLoad($suiteClassFile); + PHPUnit\Util\Fileloader::checkAndLoad($suiteClassFile); if (class_exists($suiteClassName, false)) { $class = new ReflectionClass($suiteClassName); return $class; } - throw new PHPUnit_Framework_Exception( + throw new PHPUnit\Framework\Exception( sprintf("Class '%s' could not be found in '%s'.", $suiteClassName, $suiteClassFile) ); } @@ -155,7 +155,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { } } - throw new PHPUnit_Framework_Exception( + throw new PHPUnit\Framework\Exception( sprintf("Class '%s' could not be found in '%s'.", $suiteClassName, $suiteClassFile) ); } @@ -165,7 +165,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { // class name. Let's throw fatal error if there are more testcases in one file. $classes = get_declared_classes(); - PHPUnit_Util_Fileloader::checkAndLoad($file); + PHPUnit\Util\Fileloader::checkAndLoad($file); $includePathFilename = stream_resolve_include_path($file); $loadedClasses = array_diff(get_declared_classes(), $classes); @@ -174,7 +174,7 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { foreach ($loadedClasses as $loadedClass) { $class = new ReflectionClass($loadedClass); - if ($class->isSubclassOf('PHPUnit_Framework_TestCase') and !$class->isAbstract()) { + if ($class->isSubclassOf('PHPUnit\Framework\TestCase') and !$class->isAbstract()) { if (realpath($includePathFilename) === realpath($class->getFileName())) { $candidates[] = $loadedClass; } @@ -182,13 +182,13 @@ class phpunit_autoloader implements PHPUnit_Runner_TestSuiteLoader { } if (count($candidates) == 0) { - throw new PHPUnit_Framework_Exception( + throw new PHPUnit\Framework\Exception( sprintf("File '%s' does not contain any test cases.", $file) ); } if (count($candidates) > 1) { - throw new PHPUnit_Framework_Exception( + throw new PHPUnit\Framework\Exception( sprintf("File '%s' contains multiple test cases: ".implode(', ', $candidates), $file) ); } diff --git a/lib/phpunit/classes/base_testcase.php b/lib/phpunit/classes/base_testcase.php index 8f78f4cfb35..f24c5624e2f 100644 --- a/lib/phpunit/classes/base_testcase.php +++ b/lib/phpunit/classes/base_testcase.php @@ -36,7 +36,7 @@ * @copyright 2015 Blackboard (http://www.blackboard.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -abstract class base_testcase extends PHPUnit_Framework_TestCase { +abstract class base_testcase extends PHPUnit\Framework\TestCase { // @codingStandardsIgnoreStart // Following code is legacy code from phpunit to support assertTag // and assertNotTag. @@ -53,7 +53,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase { * @deprecated 3.0 */ public static function assertTag($matcher, $actual, $message = '', $ishtml = true) { - $dom = PHPUnit_Util_XML::load($actual, $ishtml); + $dom = PHPUnit\Util\XML::load($actual, $ishtml); $tags = self::findNodes($dom, $matcher, $ishtml); $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; self::assertTrue($matched, $message); @@ -71,7 +71,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase { * @deprecated 3.0 */ public static function assertNotTag($matcher, $actual, $message = '', $ishtml = true) { - $dom = PHPUnit_Util_XML::load($actual, $ishtml); + $dom = PHPUnit\Util\XML::load($actual, $ishtml); $tags = self::findNodes($dom, $matcher, $ishtml); $matched = (is_array($tags) && count($tags) > 0) && $tags[0] instanceof DOMNode; self::assertFalse($matched, $message); @@ -85,7 +85,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase { * * @return array * - * @throws PHPUnit_Framework_Exception + * @throws PHPUnit\Framework\Exception */ public static function assertValidKeys(array $hash, array $validKeys) { $valids = array(); @@ -106,7 +106,7 @@ abstract class base_testcase extends PHPUnit_Framework_TestCase { } if (!empty($unknown)) { - throw new PHPUnit_Framework_Exception( + throw new PHPUnit\Framework\Exception( 'Unknown key(s): ' . implode(', ', $unknown) ); } diff --git a/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php b/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php index fc5ac7a8a64..9407b7a2b91 100644 --- a/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php +++ b/lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php @@ -32,7 +32,7 @@ * @copyright 2015 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framework_Constraint_IsEqual { +class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit\Framework\Constraint\IsEqual { /** * @var array $keys The list of exceptions. @@ -41,7 +41,7 @@ class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framewo /** * Add an exception for the named key to use a different comparison - * method. Any assertion provided by PHPUnit_Framework_Assert is + * method. Any assertion provided by PHPUnit\Framework\Assert is * acceptable. * * @param string $key The key to except. @@ -65,13 +65,13 @@ class phpunit_constraint_object_is_equal_with_exceptions extends PHPUnit_Framewo * @param string $description Additional information about the test * @param bool $shouldreturnesult Whether to return a result or throw an exception * @return mixed - * @throws PHPUnit_Framework_ExpectationFailedException + * @throws PHPUnit\Framework\ExpectationFailedException */ public function evaluate($other, $description = '', $shouldreturnesult = false) { foreach ($this->keys as $key => $comparison) { if (isset($other->$key) || isset($this->value->$key)) { // One of the keys is present, therefore run the comparison. - PHPUnit_Framework_Assert::$comparison($this->value->$key, $other->$key); + PHPUnit\Framework\Assert::$comparison($this->value->$key, $other->$key); // Unset the keys, otherwise the standard evaluation will take place. unset($other->$key); diff --git a/lib/phpunit/classes/hint_resultprinter.php b/lib/phpunit/classes/hint_resultprinter.php index 4a06814b7e4..a21ca517a25 100644 --- a/lib/phpunit/classes/hint_resultprinter.php +++ b/lib/phpunit/classes/hint_resultprinter.php @@ -33,12 +33,12 @@ * @copyright 2012 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter { +class Hint_ResultPrinter extends PHPUnit\TextUI\ResultPrinter { public function __construct() { // ARRGH - PHPUnit does not give us commandline arguments or xml config, so let's hack hard! if (defined('DEBUG_BACKTRACE_PROVIDE_OBJECT')) { $backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT); - if (isset($backtrace[2]['object']) and ($backtrace[2]['object'] instanceof PHPUnit_TextUI_Command)) { + if (isset($backtrace[2]['object']) and ($backtrace[2]['object'] instanceof PHPUnit\TextUI\Command)) { list($verbose, $colors, $debug) = Hacky_TextUI_Command_reader::get_settings_hackery($backtrace[2]['object']); parent::__construct(null, $verbose, $colors, $debug); return; @@ -48,7 +48,7 @@ class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter { parent::__construct(null, false, self::COLOR_DEFAULT, false); } - protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect) { + protected function printDefectTrace(PHPUnit\Framework\TestFailure $defect) { global $CFG; parent::printDefectTrace($defect); @@ -129,10 +129,10 @@ class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter { * @copyright 2012 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class Hacky_TextUI_Command_reader extends PHPUnit_TextUI_Command { - public static function get_settings_hackery(PHPUnit_TextUI_Command $toread) { +class Hacky_TextUI_Command_reader extends PHPUnit\TextUI\Command { + public static function get_settings_hackery(PHPUnit\TextUI\Command $toread) { $arguments = $toread->arguments; - $config = PHPUnit_Util_Configuration::getInstance($arguments['configuration'])->getPHPUnitConfiguration(); + $config = PHPUnit\Util\Configuration::getInstance($arguments['configuration'])->getPHPUnitConfiguration(); $verbose = isset($config['verbose']) ? $config['verbose'] : false; $verbose = isset($arguments['verbose']) ? $arguments['verbose'] : $verbose; diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 240777a869c..d5cfd9462d2 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -621,7 +621,7 @@ class phpunit_util extends testing_util { foreach ($backtrace as $bt) { if (isset($bt['object']) and is_object($bt['object']) - && $bt['object'] instanceof PHPUnit_Framework_TestCase) { + && $bt['object'] instanceof PHPUnit\Framework\TestCase) { $debug = new stdClass(); $debug->message = $message; $debug->level = $level; diff --git a/lib/phpunit/phpunit.xsd b/lib/phpunit/phpunit.xsd index 1ffa321ef65..7612ee3b435 100644 --- a/lib/phpunit/phpunit.xsd +++ b/lib/phpunit/phpunit.xsd @@ -199,7 +199,7 @@ - + @@ -221,7 +221,7 @@ - + diff --git a/lib/phpunit/tests/advanced_test.php b/lib/phpunit/tests/advanced_test.php index a69477edaf9..2aaa254002a 100644 --- a/lib/phpunit/tests/advanced_test.php +++ b/lib/phpunit/tests/advanced_test.php @@ -223,7 +223,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { self::resetAllData(true); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); } $this->assertEquals(1, $DB->get_field('user', 'confirmed', array('id'=>2))); @@ -234,7 +234,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { self::resetAllData(true); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); $this->assertContains('xx', $e->getMessage()); $this->assertContains('admin', $e->getMessage()); $this->assertContains('rolesactive', $e->getMessage()); @@ -276,7 +276,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { self::resetAllData(true); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); $this->assertEquals(1, $SITE->id); $this->assertSame($SITE, $COURSE); $this->assertSame($SITE, $COURSE); @@ -287,7 +287,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { self::resetAllData(true); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); $this->assertEquals(0, $USER->id); } } @@ -377,7 +377,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { $this->assertTimeCurrent(time()+10); $this->fail('Failed assert expected'); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e); + $this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e); } try { @@ -385,7 +385,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { $this->assertTimeCurrent(time()-10); $this->fail('Failed assert expected'); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e); + $this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e); } } @@ -600,19 +600,19 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { $this->setTimezone('Pacific/Auckland', ''); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); } try { $this->setTimezone('Pacific/Auckland', 'xxxx'); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); } try { $this->setTimezone('Pacific/Auckland', null); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); } } @@ -637,7 +637,7 @@ class core_phpunit_advanced_testcase extends advanced_testcase { try { self::resetAllData(true); } catch (Exception $e) { - $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e); + $this->assertInstanceOf('PHPUnit\Framework\Error\Warning', $e); } if ($CFG->ostype === 'WINDOWS') { diff --git a/lib/tests/event_test.php b/lib/tests/event_test.php index a2f2c2f1780..a2b0df2d76d 100644 --- a/lib/tests/event_test.php +++ b/lib/tests/event_test.php @@ -851,7 +851,7 @@ class core_event_testcase extends advanced_testcase { } /** - * @expectedException PHPUnit_Framework_Error_Notice + * @expectedException PHPUnit\Framework\Error\Notice */ public function test_context_not_used() { $event = \core_tests\event\context_used_in_event::create(array('other' => array('sample' => 1, 'xx' => 10))); diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index 257f82be305..faa63fb9b59 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -1824,7 +1824,7 @@ class core_moodlelib_testcase extends advanced_testcase { } /** - * @expectedException PHPUnit_Framework_Error_Warning + * @expectedException PHPUnit\Framework\Error\Warning */ public function test_get_string_limitation() { // This is one of the limitations to the lang_string class. It can't be diff --git a/lib/tests/session_redis_test.php b/lib/tests/session_redis_test.php index 8bc12029e0c..8b32e759fed 100644 --- a/lib/tests/session_redis_test.php +++ b/lib/tests/session_redis_test.php @@ -55,6 +55,12 @@ class core_session_redis_testcase extends advanced_testcase { if (!defined('TEST_SESSION_REDIS_HOST')) { $this->markTestSkipped('Session test server not set. define: TEST_SESSION_REDIS_HOST'); } + $version = phpversion('Redis'); + if (!$version) { + $this->markTestSkipped('Redis extension version missing'); + } else if (version_compare($version, '2.0') <= 0) { + $this->markTestSkipped('Redis extension version must be at least 2.0: now running "' . $version . '"'); + } $this->resetAfterTest(); diff --git a/lib/tests/statslib_test.php b/lib/tests/statslib_test.php index 31b99d10a47..f8ced493736 100644 --- a/lib/tests/statslib_test.php +++ b/lib/tests/statslib_test.php @@ -188,16 +188,16 @@ class core_statslib_testcase extends advanced_testcase { static $replacements = null; $raw = $this->createXMLDataSet($file); - $clean = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($raw); + $clean = new PHPUnit\DbUnit\DataSet\ReplacementDataSet($raw); foreach ($this->replacements as $placeholder => $value) { $clean->addFullReplacement($placeholder, $value); } - $logs = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($clean); + $logs = new PHPUnit\DbUnit\DataSet\Filter($clean); $logs->addIncludeTables(array('log')); - $stats = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($clean); + $stats = new PHPUnit\DbUnit\DataSet\Filter($clean); $stats->addIncludeTables(array('stats_daily', 'stats_user_daily')); return array($logs, $stats); diff --git a/mod/feedback/tests/external_test.php b/mod/feedback/tests/external_test.php index 5ca229aa03e..813810765a8 100644 --- a/mod/feedback/tests/external_test.php +++ b/mod/feedback/tests/external_test.php @@ -264,7 +264,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase { */ public function test_view_feedback_invalid_id() { // Test invalid instance id. - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_feedback_external::view_feedback(0); } /** @@ -273,7 +273,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase { public function test_view_feedback_not_enrolled_user() { $usernotenrolled = self::getDataGenerator()->create_user(); $this->setUser($usernotenrolled); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_feedback_external::view_feedback(0); } /** @@ -284,7 +284,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase { // We need a explicit prohibit since this capability is allowed for students by default. assign_capability('mod/feedback:view', CAP_PROHIBIT, $this->studentrole->id, $this->context->id); accesslib_clear_all_caches_for_unit_testing(); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_feedback_external::view_feedback(0); } /** @@ -671,7 +671,7 @@ class mod_feedback_external_testcase extends externallib_advanced_testcase { */ public function test_get_non_respondents_no_permissions() { $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_feedback_external::get_non_respondents($this->feedback->id); } diff --git a/mod/lesson/tests/external_test.php b/mod/lesson/tests/external_test.php index 64c5be97f1d..27ae4ae8ea6 100644 --- a/mod/lesson/tests/external_test.php +++ b/mod/lesson/tests/external_test.php @@ -360,7 +360,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { * Test test_view_lesson invalid id. */ public function test_view_lesson_invalid_id() { - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_lesson_external::view_lesson(0); } @@ -371,7 +371,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { // Test not-enrolled user. $usernotenrolled = self::getDataGenerator()->create_user(); $this->setUser($usernotenrolled); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_lesson_external::view_lesson($this->lesson->id); } @@ -414,7 +414,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { course_modinfo::clear_instance_cache(); $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_lesson_external::view_lesson($this->lesson->id); } @@ -814,7 +814,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { // Should fails as student. $this->setUser($this->student); // Now, try to review this attempt. We should not be able because is a non-finished attempt. - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_lesson_external::launch_attempt($this->lesson->id, '', 1, true); } @@ -893,7 +893,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { // Fail as student. $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_lesson_external::launch_attempt($this->lesson->id, '', 1, true); } @@ -966,7 +966,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { // Now check using a normal student account. $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); $result = mod_lesson_external::get_page_data($this->lesson->id, $this->page2->id, '', false, true); } @@ -1245,7 +1245,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase { $this->assertEquals(1, $result['userstats']['gradeinfo']['total']); // Total correct answers. $this->assertEquals(100, $result['userstats']['gradeinfo']['grade']); // Correct answer. - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); $result = mod_lesson_external::get_user_attempt($this->lesson->id, $this->teacher->id, 0); } diff --git a/mod/quiz/report/responses/tests/responses_from_steps_walkthrough_test.php b/mod/quiz/report/responses/tests/responses_from_steps_walkthrough_test.php index 20224d0a112..2b63724e056 100644 --- a/mod/quiz/report/responses/tests/responses_from_steps_walkthrough_test.php +++ b/mod/quiz/report/responses/tests/responses_from_steps_walkthrough_test.php @@ -53,7 +53,7 @@ class quiz_report_responses_from_steps_testcase extends mod_quiz_attempt_walkthr * Create a quiz add questions to it, walk through quiz attempts and then check results. * * @param array $quizsettings settings to override default settings for quiz created by generator. Taken from quizzes.csv. - * @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata of data read from csv file "questionsXX.csv", + * @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata of data read from csv file "questionsXX.csv", * "stepsXX.csv" and "responsesXX.csv". * @dataProvider get_data_for_walkthrough */ diff --git a/mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php b/mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php index 9d5f3bb3a29..53cb2170c7e 100644 --- a/mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php +++ b/mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php @@ -66,7 +66,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth /** * Create a quiz add questions to it, walk through quiz attempts and then check results. * - * @param PHPUnit_Extensions_Database_DataSet_ITable[] of data read from csv file "questionsXX.csv", + * @param PHPUnit\DbUnit\DataSet\ITable[] of data read from csv file "questionsXX.csv", * "stepsXX.csv" and "resultsXX.csv". * @dataProvider get_data_for_walkthrough */ @@ -89,7 +89,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth /** * Check actual question stats are the same as that found in csv file. * - * @param $qstats PHPUnit_Extensions_Database_DataSet_ITable data from csv file. + * @param $qstats PHPUnit\DbUnit\DataSet\ITable data from csv file. * @param $questionstats \core_question\statistics\questions\all_calculated_for_qubaid_condition Calculated stats. */ protected function check_question_stats($qstats, $questionstats) { @@ -358,7 +358,7 @@ class quiz_report_statistics_from_steps_testcase extends mod_quiz_attempt_walkth /** * Check the question stats and the response counts used in the statistics report. If the appropriate files exist in fixtures/. * - * @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata Data loaded from csv files for this test. + * @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata Data loaded from csv files for this test. * @param string $whichattempts * @param string $whichtries * @param \core\dml\sql_join $groupstudentsjoins diff --git a/mod/quiz/tests/attempt_walkthrough_from_csv_test.php b/mod/quiz/tests/attempt_walkthrough_from_csv_test.php index 25387dbcec8..3556793f612 100644 --- a/mod/quiz/tests/attempt_walkthrough_from_csv_test.php +++ b/mod/quiz/tests/attempt_walkthrough_from_csv_test.php @@ -57,7 +57,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase { * directory. * * @param array $quizsettings of settings read from csv file quizzes.csv - * @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata of data read from csv file "questionsXX.csv", + * @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata of data read from csv file "questionsXX.csv", * "stepsXX.csv" and "resultsXX.csv". * @dataProvider get_data_for_walkthrough */ @@ -141,7 +141,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase { * Create quiz, simulate attempts and check results (if resultsXX.csv exists). * * @param array $quizsettings Quiz overrides for this quiz. - * @param PHPUnit_Extensions_Database_DataSet_ITable[] $csvdata Data loaded from csv files for this test. + * @param PHPUnit\DbUnit\DataSet\ITable[] $csvdata Data loaded from csv files for this test. */ protected function create_quiz_simulate_attempts_and_check_results($quizsettings, $csvdata) { $this->resetAfterTest(true); @@ -172,7 +172,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase { * * @param string $setname * @param string $test - * @return \PHPUnit_Extensions_Database_DataSet_ITable + * @return PHPUnit\DbUnit\DataSet\ITable */ protected function load_csv_data_file($setname, $test='') { $files = array($setname => $this->get_full_path_of_csv_file($setname, $test)); @@ -228,7 +228,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase { } /** - * @param $steps PHPUnit_Extensions_Database_DataSet_ITable the step data from the csv file. + * @param $steps PHPUnit\DbUnit\DataSet\ITable the step data from the csv file. * @return array attempt no as in csv file => the id of the quiz_attempt as stored in the db. */ protected function walkthrough_attempts($steps) { @@ -289,7 +289,7 @@ class mod_quiz_attempt_walkthrough_from_csv_testcase extends advanced_testcase { } /** - * @param $results PHPUnit_Extensions_Database_DataSet_ITable the results data from the csv file. + * @param $results PHPUnit\DbUnit\DataSet\ITable the results data from the csv file. * @param $attemptids array attempt no as in csv file => the id of the quiz_attempt as stored in the db. */ protected function check_attempts_results($results, $attemptids) { diff --git a/mod/workshop/tests/external_test.php b/mod/workshop/tests/external_test.php index a725af50ea3..bb27c19182a 100644 --- a/mod/workshop/tests/external_test.php +++ b/mod/workshop/tests/external_test.php @@ -1260,7 +1260,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase { // Switch to closed phase. $this->setUser($this->anotherstudentg1); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_workshop_external::get_assessment($assessmentid); } @@ -1283,7 +1283,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase { $DB->set_field('workshop', 'phase', workshop::PHASE_CLOSED, array('id' => $this->workshop->id)); $this->setUser($this->anotherstudentg2); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_workshop_external::get_assessment($assessmentid); } @@ -1359,7 +1359,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase { $DB->set_field('workshop', 'phase', workshop::PHASE_EVALUATION, array('id' => $this->workshop->id)); $this->setUser($this->student); // Since we are not reviewers we can't see the assessment until the workshop is closed. - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_workshop_external::get_assessment_form_definition($assessmentid); } @@ -1414,7 +1414,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase { $DB->set_field('workshop', 'phase', workshop::PHASE_ASSESSMENT, array('id' => $this->workshop->id)); // Try to get other user assessments. $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_workshop_external::get_reviewer_assessments($this->workshop->id, $this->anotherstudentg1->id); } @@ -1427,7 +1427,7 @@ class mod_workshop_external_testcase extends externallib_advanced_testcase { $DB->set_field('workshop', 'phase', workshop::PHASE_SUBMISSION, array('id' => $this->workshop->id)); // Try to get other user assessments. $this->setUser($this->student); - $this->setExpectedException('moodle_exception'); + $this->expectException('moodle_exception'); mod_workshop_external::get_reviewer_assessments($this->workshop->id, $this->anotherstudentg1->id); } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 720b79c65dc..963f63cdfb4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -13,6 +13,7 @@ stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" + beStrictAboutTestsThatDoNotTestAnything="false" printerClass="Hint_ResultPrinter" testSuiteLoaderClass="phpunit_autoloader" > diff --git a/user/tests/externallib_test.php b/user/tests/externallib_test.php index fcee9e29ecf..53599600271 100644 --- a/user/tests/externallib_test.php +++ b/user/tests/externallib_test.php @@ -1225,7 +1225,7 @@ class core_user_externallib_testcase extends externallib_advanced_testcase { $user2 = self::getDataGenerator()->create_user(); $this->setUser($user1); - $this->setExpectedException('required_capability_exception'); + $this->expectException('required_capability_exception'); // Try to retrieve other user private files info. core_user_external::get_private_files_info($user2->id); }