diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a195adcc1..00da8dceac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,18 @@ jobs: #- setup_remote_docker: # docker_layer_caching: true # Download and cache dependencies + - run: + name: Update php module + command: dnf module -y reset php && dnf module -y enable php:8.0 + - run: + name: Install PHP 8.0 + command: dnf install -y php + - run: + name: Install PHP module pre-reqs & an updated version of PHP Pear + command: dnf install -y libzip-devel php-pear + - run: + name: Install MongoDB Pear module + command: yes '' | pecl install mongodb || true - run: name: install the composer dependencies command: composer install @@ -43,7 +55,13 @@ jobs: command: | mkdir ~/phpunit mkdir /tmp/screenshots - - run: ~/bin/buildrpm xdmod + - run: + name: 'Fixup Simplesaml' + command: | + sed -i 's/SimpleSAML_Error_Assertion::installHandler();//g' vendor/simplesamlphp/simplesamlphp/www/_include.php + - run: + name: Build XDMoD RPM + command: ~/bin/buildrpm xdmod - run: name: Install / Upgrade XDMoD from RPM command: ./tests/ci/bootstrap.sh @@ -82,6 +100,7 @@ jobs: chown root:root -R /usr/local/node-v10.24.1-linux-x64 - run: pushd ./tests/ui && PATH=/usr/local/node-v10.24.1-linux-x64/bin:$PATH /usr/local/node-v10.24.1-linux-x64/bin/npm install && popd - run: PATH=/usr/local/node-v10.24.1-linux-x64/bin:$PATH ./tests/ui/runtests.sh --headless --log-junit ~/phpunit + - run: name: 'Run SSO Tests' command: | @@ -89,13 +108,16 @@ jobs: PATH=/usr/local/node-v10.24.1-linux-x64/bin:$PATH ./tests/ui/runtests.sh --headless --log-junit ~/phpunit --sso ./vendor/phpunit/phpunit/phpunit -c ./tests/integration/phpunit.xml.dist --testsuite sso --log-junit ~/phpunit/xdmod-sso-integration.xml - run: - name: Ensure that no unexpected Apache errors were generated - command: test ! -e /var/log/php-fpm/www-error.log + name: Ensure that no unexpected Apache errors were generated ( We expect PHP Deprecated ) + command: > + if [ -e /var/log/php-fpm/www-error.log ]; then + test `fgrep -v 'PHP Deprecated' /var/log/php-fpm/www-error.log | wc -l` = 0; + fi - run: name: Ensure that no PHP command-line errors were generated command: > if [ -e /var/log/php_errors.log ]; then - test `fgrep -v 'vendor/phpunit/phpunit/src' /var/log/php_errors.log | wc -l` = 0; + test `egrep -v 'vendor/phpunit/phpunit/src|PHP Deprecated|PHP Notice: fread()' /var/log/php_errors.log | wc -l` = 0; fi - store_artifacts: path: /tmp/screenshots diff --git a/bin/acl-config b/bin/acl-config index b512b93113..bb6a1dbdbc 100755 --- a/bin/acl-config +++ b/bin/acl-config @@ -1519,7 +1519,7 @@ SQL; $inserted = 0; while ($row = $statement->fetch(PDO::FETCH_NUM) ) { $inserted += 1; - if (fwrite($bulkdatafile, join($row, ',') . "\n") === false) { + if (fwrite($bulkdatafile, join(',', $row) . "\n") === false) { throw new \Exception('Error writing to temporary file'); } } diff --git a/classes/CCR/MailWrapper.php b/classes/CCR/MailWrapper.php index f0d72ccdec..81a815c421 100644 --- a/classes/CCR/MailWrapper.php +++ b/classes/CCR/MailWrapper.php @@ -9,7 +9,7 @@ class MailWrapper public static function initPHPMailer($properties) { - $mail = new \PHPMailer(true); + $mail = new \PHPMailer\PHPMailer\PHPMailer(true); $mail->isSendMail(); $address = \xd_utilities\getConfiguration('mailer', 'sender_email'); $mail->Sender = $address; diff --git a/classes/DB/PDODBMultiIngestor.php b/classes/DB/PDODBMultiIngestor.php index 53db957f17..125a5a2277 100644 --- a/classes/DB/PDODBMultiIngestor.php +++ b/classes/DB/PDODBMultiIngestor.php @@ -41,9 +41,9 @@ class PDODBMultiIngestor implements Ingestor function __construct( $dest_db, $source_db, - $pre_ingest_update_statements = array(), $source_query, $insert_table, + $pre_ingest_update_statements = array(), $insert_fields = array(), $post_ingest_update_statements = array(), $delete_statement = null, diff --git a/classes/DB/PDODBUnbufferedMultiIngestor.php b/classes/DB/PDODBUnbufferedMultiIngestor.php index e1f028f780..9b9de8ed5f 100644 --- a/classes/DB/PDODBUnbufferedMultiIngestor.php +++ b/classes/DB/PDODBUnbufferedMultiIngestor.php @@ -40,9 +40,9 @@ public function __construct( parent::__construct( $dest_db, $source_db, - $pre_ingest_update_statements, $source_query, $insert_table, + $pre_ingest_update_statements, $insert_fields, $post_ingest_update_statements, $delete_statement, diff --git a/classes/DataWarehouse/ExportBuilder.php b/classes/DataWarehouse/ExportBuilder.php index fb0a169a05..b3b97bc7d3 100644 --- a/classes/DataWarehouse/ExportBuilder.php +++ b/classes/DataWarehouse/ExportBuilder.php @@ -274,7 +274,7 @@ public static function getFormat( * @return array(headers => array of http headers, results => the encoded data to send) */ public static function export( - array $exportedDatas = array(), + array $exportedDatas, $format, $inline = true, $filename = 'data' diff --git a/classes/DataWarehouse/Visualization.php b/classes/DataWarehouse/Visualization.php index 39d6a8b222..61d511f874 100644 --- a/classes/DataWarehouse/Visualization.php +++ b/classes/DataWarehouse/Visualization.php @@ -60,14 +60,14 @@ public static function getColors($count = NULL, $palleteIndex = 0, $includeWhite srand(); return $ret; } - + public static function HSVtoRGB(array $hsv) { list($H, $S, $V) = $hsv; //1 $H *= 6; - //2 - $I = floor($H); + //2 NOTE: we cast to int so that the switch below works as intended in PHP8 + $I = (int)floor($H); $F = $H - $I; //3 $M = $V * (1 - $S); diff --git a/classes/ETL/Aggregator/pdoAggregator.php b/classes/ETL/Aggregator/pdoAggregator.php index 5190c15f5d..038d55fab7 100644 --- a/classes/ETL/Aggregator/pdoAggregator.php +++ b/classes/ETL/Aggregator/pdoAggregator.php @@ -730,7 +730,14 @@ protected function _execute($aggregationUnit) $aggregationPeriodList = $this->getDirtyAggregationPeriods($aggregationUnit); $numAggregationPeriods = count($aggregationPeriodList); $firstPeriod = current($aggregationPeriodList); - $periodSize = $firstPeriod['period_end_day_id'] - $firstPeriod['period_start_day_id']; + + // There are instances where $firstPeriod is a bool not an array ( when $aggregationPeriodList is empty or at the end of the array) + // the following code takes that into account. + $periodSize = 1; + if (!is_bool($firstPeriod)) { + $periodSize = $firstPeriod['period_end_day_id'] - $firstPeriod['period_start_day_id']; + } + $batchSliceSize = $this->options->batch_aggregation_periods_per_batch; $tmpTableName = null; $qualifiedTmpTableName = null; diff --git a/classes/ETL/DataEndpoint/aStructuredFile.php b/classes/ETL/DataEndpoint/aStructuredFile.php index 43ad130ff9..f9a4bb3368 100644 --- a/classes/ETL/DataEndpoint/aStructuredFile.php +++ b/classes/ETL/DataEndpoint/aStructuredFile.php @@ -239,7 +239,7 @@ protected function attachFilters() $this->logger->warning( sprintf("Skipping filter '%s': %s", $config->name, implode(", ", $messages)) ); - continue; + continue 2; } $filterName = 'xdmod.external_process'; $resource = @stream_filter_prepend($fd, $filterName, STREAM_FILTER_READ, $config); diff --git a/classes/ETL/Ingestor/HpcdbHostsIngestor.php b/classes/ETL/Ingestor/HpcdbHostsIngestor.php index 6e8f37f06f..35f739d98d 100644 --- a/classes/ETL/Ingestor/HpcdbHostsIngestor.php +++ b/classes/ETL/Ingestor/HpcdbHostsIngestor.php @@ -19,7 +19,7 @@ class HpcdbHostsIngestor extends pdoIngestor implements iAction /** * @see ETL\Ingestor\pdoIngestor::transform */ - public function transform(array $srcRecord, $orderId) + public function transform(array $srcRecord, &$orderId) { $srcRecord = parent::transform($srcRecord, $orderId); $transformedRecord = array(); diff --git a/classes/ETL/aRdbmsDestinationAction.php b/classes/ETL/aRdbmsDestinationAction.php index 5be0cfc5b0..9840c9d813 100644 --- a/classes/ETL/aRdbmsDestinationAction.php +++ b/classes/ETL/aRdbmsDestinationAction.php @@ -769,6 +769,8 @@ public function getSqlColumnNames($sql) foreach ( $parsedSql['SELECT'] as $item ) { if ( array_key_exists('alias', $item) + && is_array($item['alias']) + && array_key_exists('as', $item['alias']) && $item['alias']['as'] && array_key_exists('name', $item['alias']) ) { diff --git a/classes/OpenXdmod/Shredder.php b/classes/OpenXdmod/Shredder.php index fa48f860b0..28ef28105b 100644 --- a/classes/OpenXdmod/Shredder.php +++ b/classes/OpenXdmod/Shredder.php @@ -563,9 +563,9 @@ public function getJobIngestor($ingestAll = false) $ingestor = new PDODBMultiIngestor( $this->db, $this->db, - array(), $sourceQuery, 'shredded_job', + array(), $insertFields, array(), $deleteStatement diff --git a/classes/Realm/GroupBy.php b/classes/Realm/GroupBy.php index 5672d102db..dced8adb3b 100644 --- a/classes/Realm/GroupBy.php +++ b/classes/Realm/GroupBy.php @@ -374,7 +374,7 @@ public function __construct($shortName, \stdClass $config, Realm $realm, LoggerI break; case 'dataset_display_type': if ( ! is_object($optionValue) ) { - continue; + continue 2; } foreach ($optionValue as $datasetType => $chartDisplayValue ) { if ( ! array_key_exists($datasetType, $this->chartOptions[$optionKey]) ) { @@ -388,7 +388,7 @@ public function __construct($shortName, \stdClass $config, Realm $realm, LoggerI break; case 'limit': if ( ! is_object($optionValue) ) { - continue; + continue 2; } foreach ($optionValue as $pageType => $limitValue ) { if ( ! array_key_exists($pageType, $this->chartOptions[$optionKey]) ) { diff --git a/classes/Rest/Utilities/Conversions.php b/classes/Rest/Utilities/Conversions.php index c094d08bd4..b945478571 100644 --- a/classes/Rest/Utilities/Conversions.php +++ b/classes/Rest/Utilities/Conversions.php @@ -17,6 +17,11 @@ public static function toInt($value) */ public static function toString($value) { + // If no value was provided, then return an empty string. + if (is_null($value)) { + return ''; + } + $isObject = is_object($value); $hasToString = method_exists($value, '__toString'); $isArray = is_array($value); diff --git a/composer.json b/composer.json index d1425b79a5..a6bba9e18d 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "COMMENT": "If kassner/log-parser is updated to version >2.1.1, then the call to web_parser->addPattern in classes/ETL/DataEndpoint/WebServerLogFile.php (added in https://github.com/ubccr/xdmod/pull/1816) can be removed along with this 'extra' section." }, "require": { - "php": "^5.4 || ^7.2", + "php": "^8.0", "egulias/email-validator": "^1.2", "google/recaptcha": "~1.1", "greenlion/php-sql-parser": "~4.2", @@ -12,27 +12,27 @@ "moment/moment-min-file": "^2.13.0", "moment/moment-timezone-min-file": "^0.5.4", "paragonie/random_compat": "~2.0", - "phpmailer/phpmailer": "^5.2", + "phpmailer/phpmailer": "*", "robrichards/xmlseclibs": "~3.0", "sencha/extjs-gpl": "3.4.*", "silex/silex": "~1.2", - "simplesamlphp/simplesamlphp": "~1", + "simplesamlphp/simplesamlphp": "^1.16", "symfony/polyfill-php56": "~1.11", "symfony/process": "~2.0", "taq/pdooci": "^1.0", "tildeio/rsvpjs-min-file": "^3.0.18", "ubccr/simplesamlphp-module-authglobus": "^1.3", "ubccr/simplesamlphp-module-authoidcoauth2": "^1.1", - "phpoffice/phpword": "^0.17.0", + "phpoffice/phpword": "*", "monolog/monolog": "^1.25", "plotly/plotly": "^2.29.1", "kassner/log-parser": "~1.5", "geoip2/geoip2": "~2.0", "ua-parser/uap-php": "^3.9", - "mongodb/mongodb": "^1.11" + "mongodb/mongodb": "^1.14" }, "require-dev": { - "phpunit/phpunit": "~4.8", + "phpunit/phpunit": "^9.0", "ccampbell/chromephp": "^4.1", "swaggest/json-schema": "^0.12.41" }, diff --git a/composer.lock b/composer.lock index 4d7b0ff839..90015922b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,32 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "73cf8f4b0dd2820a2730226b76917aae", + "content-hash": "6540ee86592e0e73a21496d811a1b32f", "packages": [ { "name": "composer/ca-bundle", - "version": "1.3.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640" + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/fd5dd441932a7e10ca6e5b490e272d34c8430640", - "reference": "fd5dd441932a7e10ca6e5b490e272d34c8430640", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan": "^1.10", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.2" + "source": "https://github.com/composer/ca-bundle/tree/1.5.0" }, "funding": [ { @@ -80,7 +80,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:56:16+00:00" + "time": "2024-03-15T14:00:32+00:00" }, { "name": "composer/installers", @@ -363,16 +363,16 @@ }, { "name": "geoip2/geoip2", - "version": "v2.12.2", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/maxmind/GeoIP2-php.git", - "reference": "83adb44ac4b9553d36b579a14673ed124583082f" + "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/83adb44ac4b9553d36b579a14673ed124583082f", - "reference": "83adb44ac4b9553d36b579a14673ed124583082f", + "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/6a41d8fbd6b90052bc34dff3b4252d0f88067b23", + "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23", "shasum": "" }, "require": { @@ -415,9 +415,9 @@ ], "support": { "issues": "https://github.com/maxmind/GeoIP2-php/issues", - "source": "https://github.com/maxmind/GeoIP2-php/tree/v2.12.2" + "source": "https://github.com/maxmind/GeoIP2-php/tree/v2.13.0" }, - "time": "2021-11-30T18:15:25+00:00" + "time": "2022-08-05T20:32:58+00:00" }, { "name": "gettext/gettext", @@ -486,16 +486,16 @@ }, { "name": "gettext/languages", - "version": "2.9.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/php-gettext/Languages.git", - "reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa" + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Languages/zipball/ed56dd2c7f4024cc953ed180d25f02f2640e3ffa", - "reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa", + "url": "https://api.github.com/repos/php-gettext/Languages/zipball/4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", "shasum": "" }, "require": { @@ -544,7 +544,7 @@ ], "support": { "issues": "https://github.com/php-gettext/Languages/issues", - "source": "https://github.com/php-gettext/Languages/tree/2.9.0" + "source": "https://github.com/php-gettext/Languages/tree/2.10.0" }, "funding": [ { @@ -556,34 +556,34 @@ "type": "github" } ], - "time": "2021-11-11T17:30:39+00:00" + "time": "2022-10-18T15:00:10+00:00" }, { "name": "google/recaptcha", - "version": "1.2.4", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/google/recaptcha.git", - "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419" + "reference": "d59a801e98a4e9174814a6d71bbc268dff1202df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/recaptcha/zipball/614f25a9038be4f3f2da7cbfd778dc5b357d2419", - "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419", + "url": "https://api.github.com/repos/google/recaptcha/zipball/d59a801e98a4e9174814a6d71bbc268dff1202df", + "reference": "d59a801e98a4e9174814a6d71bbc268dff1202df", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=8" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.2.20|^2.15", - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11" + "friendsofphp/php-cs-fixer": "^3.14", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -608,20 +608,20 @@ "issues": "https://github.com/google/recaptcha/issues", "source": "https://github.com/google/recaptcha" }, - "time": "2020-03-31T17:50:54+00:00" + "time": "2023-02-18T17:41:46+00:00" }, { "name": "greenlion/php-sql-parser", - "version": "v4.5.0", + "version": "v4.6.0", "source": { "type": "git", "url": "https://github.com/greenlion/PHP-SQL-Parser.git", - "reference": "a5d5c292d97271c95140192e6f0e962916e39b50" + "reference": "f0e4645eb1612f0a295e3d35bda4c7740ae8c366" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/greenlion/PHP-SQL-Parser/zipball/a5d5c292d97271c95140192e6f0e962916e39b50", - "reference": "a5d5c292d97271c95140192e6f0e962916e39b50", + "url": "https://api.github.com/repos/greenlion/PHP-SQL-Parser/zipball/f0e4645eb1612f0a295e3d35bda4c7740ae8c366", + "reference": "f0e4645eb1612f0a295e3d35bda4c7740ae8c366", "shasum": "" }, "require": { @@ -668,7 +668,7 @@ "issues": "https://github.com/greenlion/PHP-SQL-Parser/issues", "source": "https://github.com/greenlion/PHP-SQL-Parser" }, - "time": "2022-02-01T09:26:56+00:00" + "time": "2023-03-09T20:54:23+00:00" }, { "name": "ircmaxell/password-compat", @@ -767,16 +767,16 @@ }, { "name": "jean85/pretty-package-versions", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", "shasum": "" }, "require": { @@ -784,9 +784,9 @@ "php": "^7.1|^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", + "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^7.5|^8.5|^9.4", "vimeo/psalm": "^4.3" }, @@ -820,22 +820,22 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" }, - "time": "2021-10-08T21:21:46+00:00" + "time": "2024-03-08T09:58:59+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "v5.2.13", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, "require": { @@ -890,9 +890,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" }, - "time": "2022-04-13T08:02:27+00:00" + "time": "2023-09-26T02:20:38+00:00" }, { "name": "kassner/log-parser", @@ -953,23 +953,23 @@ }, { "name": "maxmind-db/reader", - "version": "v1.11.0", + "version": "v1.11.1", "source": { "type": "git", "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", - "reference": "b1f3c0699525336d09cc5161a2861268d9f2ae5b" + "reference": "1e66f73ffcf25e17c7a910a1317e9720a95497c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/b1f3c0699525336d09cc5161a2861268d9f2ae5b", - "reference": "b1f3c0699525336d09cc5161a2861268d9f2ae5b", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/1e66f73ffcf25e17c7a910a1317e9720a95497c7", + "reference": "1e66f73ffcf25e17c7a910a1317e9720a95497c7", "shasum": "" }, "require": { "php": ">=7.2" }, "conflict": { - "ext-maxminddb": "<1.10.1,>=2.0.0" + "ext-maxminddb": "<1.11.1,>=2.0.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.*", @@ -1012,9 +1012,9 @@ ], "support": { "issues": "https://github.com/maxmind/MaxMind-DB-Reader-php/issues", - "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.11.0" + "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.11.1" }, - "time": "2021-10-18T15:23:10+00:00" + "time": "2023-12-02T00:09:23+00:00" }, { "name": "maxmind/web-service-common", @@ -1109,35 +1109,39 @@ }, { "name": "mongodb/mongodb", - "version": "1.11.0", + "version": "1.17.1", "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "e4aa59ab15b6fe00a0e56b6772f8b515a0f01bf0" + "reference": "01d0840bf0678f519e72dc71b69c8a50a0856c2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/e4aa59ab15b6fe00a0e56b6772f8b515a0f01bf0", - "reference": "e4aa59ab15b6fe00a0e56b6772f8b515a0f01bf0", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/01d0840bf0678f519e72dc71b69c8a50a0856c2d", + "reference": "01d0840bf0678f519e72dc71b69c8a50a0856c2d", "shasum": "" }, "require": { "ext-hash": "*", "ext-json": "*", - "ext-mongodb": "^1.12.0", - "jean85/pretty-package-versions": "^1.2 || ^2.0.1", - "php": "^7.2 || ^8.0", - "symfony/polyfill-php80": "^1.19" + "ext-mongodb": "^1.17.0", + "jean85/pretty-package-versions": "^2.0.1", + "php": "^7.4 || ^8.0", + "psr/log": "^1.1.4|^2|^3", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "squizlabs/php_codesniffer": "^3.6", - "symfony/phpunit-bridge": "^5.2" + "doctrine/coding-standard": "^12.0", + "rector/rector": "^0.19", + "squizlabs/php_codesniffer": "^3.7", + "symfony/phpunit-bridge": "^5.2", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.17.x-dev" } }, "autoload": { @@ -1160,6 +1164,10 @@ { "name": "Jeremy Mikola", "email": "jmikola@gmail.com" + }, + { + "name": "Jérôme Tamarelle", + "email": "jerome.tamarelle@mongodb.com" } ], "description": "MongoDB driver library", @@ -1172,9 +1180,9 @@ ], "support": { "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.11.0" + "source": "https://github.com/mongodb/mongo-php-library/tree/1.17.1" }, - "time": "2021-12-14T23:38:18+00:00" + "time": "2024-03-14T10:33:11+00:00" }, { "name": "monolog/monolog", @@ -1316,103 +1324,56 @@ }, "time": "2022-02-16T17:07:03+00:00" }, - { - "name": "pclzip/pclzip", - "version": "2.8.2", - "source": { - "type": "git", - "url": "https://github.com/ivanlanin/pclzip.git", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "pclzip.lib.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Vincent Blavet" - } - ], - "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", - "homepage": "http://www.phpconcept.net/pclzip", - "keywords": [ - "php", - "zip" - ], - "support": { - "issues": "https://github.com/ivanlanin/pclzip/issues", - "source": "https://github.com/ivanlanin/pclzip/tree/master" - }, - "time": "2014-06-05T11:42:24+00:00" - }, { "name": "phpmailer/phpmailer", - "version": "v5.2.28", + "version": "v6.9.1", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "acba50393dd03da69a50226c139722af8b153b11" + "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/acba50393dd03da69a50226c139722af8b153b11", - "reference": "acba50393dd03da69a50226c139722af8b153b11", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", + "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", "shasum": "" }, "require": { "ext-ctype": "*", - "php": ">=5.0.0" + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" }, "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.2", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL-2.1-only" ], "authors": [ { @@ -1434,115 +1395,102 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v5.2.28" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" }, "funding": [ - { - "url": "https://marcus.bointon.com/donations/", - "type": "custom" - }, { "url": "https://github.com/Synchro", "type": "github" - }, - { - "url": "https://www.patreon.com/marcusbointon", - "type": "patreon" } ], - "time": "2020-03-19T14:29:37+00:00" + "time": "2023-11-25T22:23:28+00:00" }, { - "name": "phpoffice/common", - "version": "0.2.9", + "name": "phpoffice/math", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/PHPOffice/Common.git", - "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d" + "url": "https://github.com/PHPOffice/Math.git", + "reference": "f0f8cad98624459c540cdd61d2a174d834471773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/Common/zipball/edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", - "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", + "url": "https://api.github.com/repos/PHPOffice/Math/zipball/f0f8cad98624459c540cdd61d2a174d834471773", + "reference": "f0f8cad98624459c540cdd61d2a174d834471773", "shasum": "" }, "require": { - "pclzip/pclzip": "^2.8", - "php": ">=5.3.0" + "ext-dom": "*", + "ext-xml": "*", + "php": "^7.1|^8.0" }, "require-dev": { - "phpdocumentor/phpdocumentor": "2.*", - "phploc/phploc": "2.*", - "phpmd/phpmd": "2.*", - "phpunit/phpunit": "^4.8.36 || ^7.0", - "sebastian/phpcpd": "2.*", - "squizlabs/php_codesniffer": "2.*" + "phpstan/phpstan": "^0.12.88 || ^1.0.0", + "phpunit/phpunit": "^7.0 || ^9.0" }, "type": "library", "autoload": { "psr-4": { - "PhpOffice\\Common\\": "src/Common/" + "PhpOffice\\Math\\": "src/Math/", + "Tests\\PhpOffice\\Math\\": "tests/Math/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL" + "MIT" ], "authors": [ { - "name": "Mark Baker" - }, - { - "name": "Franck Lefevre", - "homepage": "http://rootslabs.net" + "name": "Progi1984", + "homepage": "https://lefevre.dev" } ], - "description": "PHPOffice Common", - "homepage": "http://phpoffice.github.io", + "description": "Math - Manipulate Math Formula", + "homepage": "https://phpoffice.github.io/Math/", "keywords": [ - "common", - "component", - "office", + "MathML", + "officemathml", "php" ], "support": { - "issues": "https://github.com/PHPOffice/Common/issues", - "source": "https://github.com/PHPOffice/Common/tree/master" + "issues": "https://github.com/PHPOffice/Math/issues", + "source": "https://github.com/PHPOffice/Math/tree/0.1.0" }, - "time": "2018-07-13T14:12:34+00:00" + "time": "2023-09-25T12:08:20+00:00" }, { "name": "phpoffice/phpword", - "version": "0.17.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PHPWord.git", - "reference": "b8346af548d399acd9e30fc76ab0c55c2fec03a5" + "reference": "e76b701ef538cb749641514fcbc31a68078550fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/b8346af548d399acd9e30fc76ab0c55c2fec03a5", - "reference": "b8346af548d399acd9e30fc76ab0c55c2fec03a5", + "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/e76b701ef538cb749641514fcbc31a68078550fa", + "reference": "e76b701ef538cb749641514fcbc31a68078550fa", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-json": "*", "ext-xml": "*", - "php": "^5.3.3 || ^7.0", - "phpoffice/common": "^0.2.9", - "zendframework/zend-escaper": "^2.2" + "php": "^7.1|^8.0", + "phpoffice/math": "^0.1" }, "require-dev": { - "dompdf/dompdf": "0.8.*", + "dompdf/dompdf": "^2.0", "ext-gd": "*", + "ext-libxml": "*", "ext-zip": "*", - "friendsofphp/php-cs-fixer": "^2.2", - "mpdf/mpdf": "5.7.4 || 6.* || 7.*", - "php-coveralls/php-coveralls": "1.1.0 || ^2.0", - "phploc/phploc": "2.* || 3.* || 4.*", - "phpmd/phpmd": "2.*", - "phpunit/phpunit": "^4.8.36 || ^7.0", - "squizlabs/php_codesniffer": "^2.9", - "tecnickcom/tcpdf": "6.*" + "friendsofphp/php-cs-fixer": "^3.3", + "mpdf/mpdf": "^8.1", + "phpmd/phpmd": "^2.13", + "phpstan/phpstan-phpunit": "@stable", + "phpunit/phpunit": ">=7.0", + "symfony/process": "^4.4 || ^5.0", + "tecnickcom/tcpdf": "^6.5" }, "suggest": { "dompdf/dompdf": "Allows writing PDF", @@ -1552,11 +1500,6 @@ "ext-zip": "Allows writing OOXML and ODF" }, "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.18-dev" - } - }, "autoload": { "psr-4": { "PhpOffice\\PhpWord\\": "src/PhpWord" @@ -1592,7 +1535,7 @@ } ], "description": "PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)", - "homepage": "http://phpoffice.github.io", + "homepage": "https://phpoffice.github.io/PHPWord/", "keywords": [ "ISO IEC 29500", "OOXML", @@ -1620,9 +1563,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PHPWord/issues", - "source": "https://github.com/PHPOffice/PHPWord/tree/develop" + "source": "https://github.com/PHPOffice/PHPWord/tree/1.2.0" }, - "time": "2019-10-01T20:43:33+00:00" + "time": "2023-11-30T11:22:23+00:00" }, { "name": "pimple/pimple", @@ -1888,31 +1831,93 @@ "abandoned": "symfony/flex", "time": "2017-04-30T16:26:54+00:00" }, + { + "name": "simplesamlphp/assert", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/simplesamlphp/assert.git", + "reference": "014d722cd2fc316e458a982648f10e17ab498c92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplesamlphp/assert/zipball/014d722cd2fc316e458a982648f10e17ab498c92", + "reference": "014d722cd2fc316e458a982648f10e17ab498c92", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-filter": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": "^8.0", + "webmozart/assert": "^1.11" + }, + "require-dev": { + "simplesamlphp/simplesamlphp-test-framework": "^1.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "v1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SimpleSAML\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Tim van Dijen", + "email": "tvdijen@gmail.com" + }, + { + "name": "Jaime Perez Crespo", + "email": "jaimepc@gmail.com" + } + ], + "description": "A wrapper around webmozart/assert to make it useful beyond checking method arguments", + "support": { + "issues": "https://github.com/simplesamlphp/assert/issues", + "source": "https://github.com/simplesamlphp/assert/tree/v1.0.5" + }, + "time": "2023-08-15T15:00:10+00:00" + }, { "name": "simplesamlphp/composer-module-installer", - "version": "v1.1.8", + "version": "v1.3.4", "source": { "type": "git", "url": "https://github.com/simplesamlphp/composer-module-installer.git", - "reference": "45161b5406f3e9c82459d0f9a5a1dba064953cfa" + "reference": "36508ed9580a30c4d5ab0bb3c25c00d0b5d42946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/composer-module-installer/zipball/45161b5406f3e9c82459d0f9a5a1dba064953cfa", - "reference": "45161b5406f3e9c82459d0f9a5a1dba064953cfa", + "url": "https://api.github.com/repos/simplesamlphp/composer-module-installer/zipball/36508ed9580a30c4d5ab0bb3c25c00d0b5d42946", + "reference": "36508ed9580a30c4d5ab0bb3c25c00d0b5d42946", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1|^2.0", - "simplesamlphp/simplesamlphp": "*" + "composer-plugin-api": "^1.1 || ^2.0", + "php": "^7.4 || ^8.0", + "simplesamlphp/assert": "^0.8.0 || ^1.0" + }, + "require-dev": { + "composer/composer": "^2.4", + "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" }, "type": "composer-plugin", "extra": { - "class": "SimpleSamlPhp\\Composer\\ModuleInstallerPlugin" + "class": "SimpleSAML\\Composer\\ModuleInstallerPlugin" }, "autoload": { - "psr-0": { - "SimpleSamlPhp\\Composer": "src/" + "psr-4": { + "SimpleSAML\\Composer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1922,9 +1927,9 @@ "description": "A Composer plugin that allows installing SimpleSAMLphp modules through Composer.", "support": { "issues": "https://github.com/simplesamlphp/composer-module-installer/issues", - "source": "https://github.com/simplesamlphp/composer-module-installer/tree/v1.1.8" + "source": "https://github.com/simplesamlphp/composer-module-installer/tree/v1.3.4" }, - "time": "2020-08-25T19:04:33+00:00" + "time": "2023-03-08T20:58:22+00:00" }, { "name": "simplesamlphp/saml2", @@ -2342,16 +2347,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -2365,9 +2370,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2404,7 +2406,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -2420,20 +2422,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -2447,9 +2449,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2487,7 +2486,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -2503,7 +2502,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php56", @@ -2575,16 +2574,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -2592,9 +2591,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2638,7 +2634,83 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -2654,7 +2726,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", @@ -2917,16 +2989,16 @@ }, { "name": "twig/twig", - "version": "v1.44.6", + "version": "v1.44.7", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3" + "reference": "0887422319889e442458e48e2f3d9add1a172ad5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae39480f010ef88adc7938503c9b02d3baf2f3b3", - "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0887422319889e442458e48e2f3d9add1a172ad5", + "reference": "0887422319889e442458e48e2f3d9add1a172ad5", "shasum": "" }, "require": { @@ -2979,7 +3051,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v1.44.6" + "source": "https://github.com/twigphp/Twig/tree/v1.44.7" }, "funding": [ { @@ -2991,7 +3063,7 @@ "type": "tidelift" } ], - "time": "2021-11-25T13:31:46+00:00" + "time": "2022-09-28T08:38:36+00:00" }, { "name": "ua-parser/uap-php", @@ -3146,6 +3218,64 @@ }, "time": "2020-09-11T18:18:04+00:00" }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + }, { "name": "whitehat101/apr1-md5", "version": "v1.0.0", @@ -3193,79 +3323,25 @@ "source": "https://github.com/whitehat101/apr1-md5/tree/master" }, "time": "2015-02-11T11:06:42+00:00" - }, + } + ], + "packages-dev": [ { - "name": "zendframework/zend-escaper", - "version": "2.6.1", + "name": "ccampbell/chromephp", + "version": "4.1.0", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "3801caa21b0ca6aca57fa1c42b08d35c395ebd5f" + "url": "https://github.com/ccampbell/chromephp.git", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/3801caa21b0ca6aca57fa1c42b08d35c395ebd5f", - "reference": "3801caa21b0ca6aca57fa1c42b08d35c395ebd5f", + "url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Escaper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", - "keywords": [ - "ZendFramework", - "escaper", - "zf" - ], - "support": { - "chat": "https://zendframework-slack.herokuapp.com", - "docs": "https://docs.zendframework.com/zend-escaper/", - "forum": "https://discourse.zendframework.com/c/questions/components", - "issues": "https://github.com/zendframework/zend-escaper/issues", - "rss": "https://github.com/zendframework/zend-escaper/releases.atom", - "source": "https://github.com/zendframework/zend-escaper" - }, - "abandoned": "laminas/laminas-escaper", - "time": "2019-09-05T20:03:20+00:00" - } - ], - "packages-dev": [ - { - "name": "ccampbell/chromephp", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/ccampbell/chromephp.git", - "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef", - "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef", - "shasum": "" - }, - "require": { - "php": ">=5.0.0" + "php": ">=5.0.0" }, "type": "library", "autoload": { @@ -3299,30 +3375,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -3349,7 +3425,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -3365,318 +3441,331 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "myclabs/deep-copy", + "version": "1.11.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, + "type": "library", "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, - "time": "2020-06-27T09:03:43+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "name": "nikic/php-parser", + "version": "v5.0.2", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Nikita Popov" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "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": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2022-03-15T21:29:03+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "phplang/scope-exit", - "version": "1.0.0", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/phplang/scope-exit.git", - "reference": "239b73abe89f9414aa85a7ca075ec9445629192b" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phplang/scope-exit/zipball/239b73abe89f9414aa85a7ca075ec9445629192b", - "reference": "239b73abe89f9414aa85a7ca075ec9445629192b", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, - "require-dev": { - "phpunit/phpunit": "*" + "require": { + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { - "psr-4": { - "PhpLang\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause" ], "authors": [ { - "name": "Sara Golemon", - "email": "pollita@php.net", - "homepage": "https://twitter.com/SaraMG", + "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": "Emulation of SCOPE_EXIT construct from C++", - "homepage": "https://github.com/phplang/scope-exit", - "keywords": [ - "cleanup", - "exit", - "scope" - ], + "description": "Library for handling version information and constraints", "support": { - "issues": "https://github.com/phplang/scope-exit/issues", - "source": "https://github.com/phplang/scope-exit/tree/master" + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2016-09-17T00:15:18+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "phplang/scope-exit", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/phplang/scope-exit.git", + "reference": "239b73abe89f9414aa85a7ca075ec9445629192b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phplang/scope-exit/zipball/239b73abe89f9414aa85a7ca075ec9445629192b", + "reference": "239b73abe89f9414aa85a7ca075ec9445629192b", "shasum": "" }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpunit/phpunit": "*" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "PhpLang\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sara Golemon", + "email": "pollita@php.net", + "homepage": "https://twitter.com/SaraMG", + "role": "Developer" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Emulation of SCOPE_EXIT construct from C++", + "homepage": "https://github.com/phplang/scope-exit", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "cleanup", + "exit", + "scope" ], "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + "issues": "https://github.com/phplang/scope-exit/issues", + "source": "https://github.com/phplang/scope-exit/tree/master" }, - "time": "2020-03-05T15:02:03+00:00" + "time": "2016-09-17T00:15:18+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -3691,7 +3780,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -3703,33 +3792,42 @@ "xunit" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, - "time": "2015-10-06T15:47:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3744,7 +3842,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -3755,30 +3853,47 @@ "iterator" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, - "time": "2017-11-27T13:52:08+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -3795,41 +3910,47 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "template" + "process" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3844,46 +3965,51 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "timer" + "template" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, - "time": "2017-02-26T11:10:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.12", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3898,58 +4024,73 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "tokenizer" + "timer" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, - "abandoned": true, - "time": "2017-12-04T08:55:13+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "9.6.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" }, "suggest": { - "phpunit/php-invoker": "~1.1" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -3957,10 +4098,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -3985,40 +4129,218 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" }, - "time": "2017-06-21T08:07:12+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-04-05T04:35:58+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, - "suggest": { - "ext-soap": "*" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4033,50 +4355,392 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "mock", - "xunit" + "global state" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -4089,60 +4753,52 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, - "time": "2017-01-29T09:50:25+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4155,50 +4811,49 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, - "time": "2017-05-22T07:24:03+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "sebastian/environment", - "version": "1.3.8", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4216,45 +4871,44 @@ "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/1.3" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, - "time": "2016-08-18T05:49:44+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "sebastian/exporter", - "version": "1.2.2", + "name": "sebastian/recursion-context", + "version": "4.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": ">=7.3" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4267,66 +4921,57 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, - "time": "2016-06-17T09:04:28+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -4344,41 +4989,43 @@ "email": "sebastian@phpunit.de" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, - "time": "2015-10-12T03:26:01+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.5", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -4391,42 +5038,49 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, - "time": "2016-10-03T07:41:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, + "require": { + "php": ">=7.3" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -4447,22 +5101,28 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2015-06-21T13:59:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "swaggest/json-diff", - "version": "v3.10.4", + "version": "v3.10.5", "source": { "type": "git", "url": "https://github.com/swaggest/json-diff.git", - "reference": "f4e511708060ff7511a3743fab4aa484a062bcfb" + "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/json-diff/zipball/f4e511708060ff7511a3743fab4aa484a062bcfb", - "reference": "f4e511708060ff7511a3743fab4aa484a062bcfb", + "url": "https://api.github.com/repos/swaggest/json-diff/zipball/17bfc66b330f46e12a7e574133497a290cd79ba5", + "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5", "shasum": "" }, "require": { @@ -4490,22 +5150,22 @@ "description": "JSON diff/rearrange/patch/pointer library for PHP", "support": { "issues": "https://github.com/swaggest/json-diff/issues", - "source": "https://github.com/swaggest/json-diff/tree/v3.10.4" + "source": "https://github.com/swaggest/json-diff/tree/v3.10.5" }, - "time": "2022-11-09T13:21:05+00:00" + "time": "2023-11-17T11:12:46+00:00" }, { "name": "swaggest/json-schema", - "version": "v0.12.41", + "version": "v0.12.42", "source": { "type": "git", "url": "https://github.com/swaggest/php-json-schema.git", - "reference": "1bb97901314f828774dd8c5b21bff889ce0b34bb" + "reference": "d23adb53808b8e2da36f75bc0188546e4cbe3b45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/php-json-schema/zipball/1bb97901314f828774dd8c5b21bff889ce0b34bb", - "reference": "1bb97901314f828774dd8c5b21bff889ce0b34bb", + "url": "https://api.github.com/repos/swaggest/php-json-schema/zipball/d23adb53808b8e2da36f75bc0188546e4cbe3b45", + "reference": "d23adb53808b8e2da36f75bc0188546e4cbe3b45", "shasum": "" }, "require": { @@ -4541,138 +5201,59 @@ "support": { "email": "vearutop@gmail.com", "issues": "https://github.com/swaggest/php-json-schema/issues", - "source": "https://github.com/swaggest/php-json-schema/tree/v0.12.41" + "source": "https://github.com/swaggest/php-json-schema/tree/v0.12.42" }, - "time": "2022-08-17T11:21:43+00:00" + "time": "2023-09-12T14:43:42+00:00" }, { - "name": "symfony/yaml", - "version": "v3.4.47", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/theseer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" } ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -4681,8 +5262,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.4 || ^7.2" + "php": "^8.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/open_xdmod/modules/xdmod/xdmod.spec.in b/open_xdmod/modules/xdmod/xdmod.spec.in index 6863dce1b2..0c5a318bef 100644 --- a/open_xdmod/modules/xdmod/xdmod.spec.in +++ b/open_xdmod/modules/xdmod/xdmod.spec.in @@ -12,12 +12,8 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}__PRERELEASE__-%{relea BuildArch: noarch BuildRequires: php-cli Requires: httpd mod_ssl -%{?el8:Requires: mariadb >= 10.3.17} -%{?el8:Requires: php >= 7.2 php-cli php-mysqlnd php-pdo php-gd php-xml php-mbstring php-zip php-posix} -%{?el8:Requires: php-pecl-apcu php-json} -%{?el7:Requires: mariadb >= 5.5.3} -%{?el7:Requires: php >= 5.4 php-cli php-mysql php-pdo php-gd php-xml php-mbstring} -%{?el7:Requires: php-pecl-apcu} +Requires: php >= 8.0 php-cli php-mysqlnd php-pdo php-gd php-xml php-mbstring php-zip php-posix +Requires: php-pecl-apcu php-json Requires: libreoffice-writer Requires: chromium-headless >= 111 Requires: librsvg2-tools diff --git a/tests/artifacts/xdmod/regression/current/expected/reference/raw-data/jobs.json b/tests/artifacts/xdmod/regression/current/expected/reference/raw-data/jobs.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/artifacts/xdmod/rest/output/get_statistics-cd.json b/tests/artifacts/xdmod/rest/output/get_statistics-cd.json index c568856e36..f4929fc3d0 100644 --- a/tests/artifacts/xdmod/rest/output/get_statistics-cd.json +++ b/tests/artifacts/xdmod/rest/output/get_statistics-cd.json @@ -194,7 +194,7 @@ "11.78685285" ], "sem_avg_cpu_hours": [ - "0.4535023959163972" + "0.45350239591639724" ], "avg_node_hours": [ "2.19179880" diff --git a/tests/artifacts/xdmod/rest/output/get_statistics-cs.json b/tests/artifacts/xdmod/rest/output/get_statistics-cs.json index c568856e36..f4929fc3d0 100644 --- a/tests/artifacts/xdmod/rest/output/get_statistics-cs.json +++ b/tests/artifacts/xdmod/rest/output/get_statistics-cs.json @@ -194,7 +194,7 @@ "11.78685285" ], "sem_avg_cpu_hours": [ - "0.4535023959163972" + "0.45350239591639724" ], "avg_node_hours": [ "2.19179880" diff --git a/tests/artifacts/xdmod/rest/output/get_statistics-pi.json b/tests/artifacts/xdmod/rest/output/get_statistics-pi.json index c568856e36..f4929fc3d0 100644 --- a/tests/artifacts/xdmod/rest/output/get_statistics-pi.json +++ b/tests/artifacts/xdmod/rest/output/get_statistics-pi.json @@ -194,7 +194,7 @@ "11.78685285" ], "sem_avg_cpu_hours": [ - "0.4535023959163972" + "0.45350239591639724" ], "avg_node_hours": [ "2.19179880" diff --git a/tests/artifacts/xdmod/rest/output/get_statistics-pub.json b/tests/artifacts/xdmod/rest/output/get_statistics-pub.json index c568856e36..f4929fc3d0 100644 --- a/tests/artifacts/xdmod/rest/output/get_statistics-pub.json +++ b/tests/artifacts/xdmod/rest/output/get_statistics-pub.json @@ -194,7 +194,7 @@ "11.78685285" ], "sem_avg_cpu_hours": [ - "0.4535023959163972" + "0.45350239591639724" ], "avg_node_hours": [ "2.19179880" diff --git a/tests/artifacts/xdmod/rest/output/get_statistics-usr.json b/tests/artifacts/xdmod/rest/output/get_statistics-usr.json index c568856e36..f4929fc3d0 100644 --- a/tests/artifacts/xdmod/rest/output/get_statistics-usr.json +++ b/tests/artifacts/xdmod/rest/output/get_statistics-usr.json @@ -194,7 +194,7 @@ "11.78685285" ], "sem_avg_cpu_hours": [ - "0.4535023959163972" + "0.45350239591639724" ], "avg_node_hours": [ "2.19179880" diff --git a/tests/ci/bootstrap.sh b/tests/ci/bootstrap.sh index 1b4022c7ef..7197afdd38 100755 --- a/tests/ci/bootstrap.sh +++ b/tests/ci/bootstrap.sh @@ -52,8 +52,39 @@ then rpm -qa | grep ^xdmod | xargs yum -y remove || true rm -rf /etc/xdmod - rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql - yum -y install ~/rpmbuild/RPMS/*/*.rpm + rm -rf /var/lib/mysql + mkdir -p /var/lib/mysql + mkdir -p /var/log/mariadb + mkdir -p /var/run/mariadb + chown -R mysql:mysql /var/lib/mysql + chown -R mysql:mysql /var/log/mariadb + chown -R mysql:mysql /var/run/mariadb + + dnf install -y ~/rpmbuild/RPMS/*/*.rpm + mysql_install_db --user mysql + + if [ -f /etc/my.cnf.d/mariadb-server.cnf.rpmsave ]; then + mv /etc/my.cnf.d/mariadb-server.cnf.rpmsave /etc/my.cnf.d/mariadb-server.cnf + fi + if [ -f /etc/my.cnf.d/mariadb-server.cnf ]; then + >/etc/my.cnf.d/mariadb-server.cnf + echo "# this is read by the standalone daemon and embedded servers + [server] + sql_mode= + # this is only for the mysqld standalone daemon + # Settings user and group are ignored when systemd is used. + # If you need to run mysqld under a different user or group, + # customize your systemd unit file for mysqld/mariadb according to the + # instructions in http://fedoraproject.org/wiki/Systemd + [mysqld] + datadir=/var/lib/mysql + socket=/var/lib/mysql/mysql.sock + log-error=/var/log/mariadb/mariadb.log + pid-file=/run/mariadb/mariadb.pid" > /etc/my.cnf.d/mariadb-server.cnf + fi + + + copy_template_httpd_conf ~/bin/services start mysql -e "CREATE USER 'root'@'gateway' IDENTIFIED BY ''; @@ -131,7 +162,8 @@ fi if [ "$XDMOD_TEST_MODE" = "upgrade" ]; then - yum -y install ~/rpmbuild/RPMS/*/*.rpm + # Install the newly built RPM. + dnf -y install ~/rpmbuild/RPMS/*/*.rpm copy_template_httpd_conf sed -i 's#http://localhost:8080#https://localhost#' /etc/xdmod/portal_settings.ini diff --git a/tests/ci/samlSetup.sh b/tests/ci/samlSetup.sh index 1a902c244d..7fa2a42d75 100755 --- a/tests/ci/samlSetup.sh +++ b/tests/ci/samlSetup.sh @@ -137,6 +137,9 @@ sed -i -- 's%#%%' /etc/httpd/conf.d/xdmod.conf cp "$VENDOR_DIR/simplesamlphp/simplesamlphp/config-templates/config.php" "$VENDOR_DIR/simplesamlphp/simplesamlphp/config/config.php" sed -i -- "s/'trusted.url.domains' => array(),/'trusted.url.domains' => array('localhost'),/" "$VENDOR_DIR/simplesamlphp/simplesamlphp/config/config.php" +# Temporarily need to remove this line due to Assertions being removed in PHP8. +sed -i 's/SimpleSAML_Error_Assertion::installHandler();//g' vendor/simplesamlphp/simplesamlphp/www/_include.php + cat > "$VENDOR_DIR/simplesamlphp/simplesamlphp/config/authsources.php" < 8, @@ -222,7 +222,7 @@ class CloudInstanceTypeStateIngestorTest extends \PHPUnit_Framework_TestCase private $fsm; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { $configFile = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/input/xdmod_etl_config_8.0.0.json'); @@ -233,6 +233,7 @@ public function __construct() $conf = EtlConfiguration::factory($configFile); $this->fsm = new CloudInstanceTypeStateIngestor($options, $conf); + parent::__construct($name, $data, $dataName); } // Test for when the number of cores for an instance changes diff --git a/tests/component/lib/ETL/CloudResourceSpecsStateTransformIngestorTest.php b/tests/component/lib/ETL/CloudResourceSpecsStateTransformIngestorTest.php index ad77a98426..bc26260fe5 100644 --- a/tests/component/lib/ETL/CloudResourceSpecsStateTransformIngestorTest.php +++ b/tests/component/lib/ETL/CloudResourceSpecsStateTransformIngestorTest.php @@ -13,7 +13,7 @@ * Test Cloud Resource Specifications State FSM */ -class CloudResourceSpecsStateTransformIngestorTest extends \PHPUnit_Framework_TestCase +class CloudResourceSpecsStateTransformIngestorTest extends \PHPUnit\Framework\TestCase { private $resource_spec_01 = array( "resource_id" => 8, @@ -186,7 +186,7 @@ class CloudResourceSpecsStateTransformIngestorTest extends \PHPUnit_Framework_Te private $fsm; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { $configFile = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/input/xdmod_etl_config_8.0.0.json'); @@ -197,6 +197,7 @@ public function __construct() $conf = EtlConfiguration::factory($configFile); $this->fsm = new CloudResourceSpecsStateTransformIngestor($options, $conf); + parent::__construct($name, $data, $dataName); } // Test for when the VCpus change for a host diff --git a/tests/component/lib/ETL/CloudStateReconstructorTransformIngestorTest.php b/tests/component/lib/ETL/CloudStateReconstructorTransformIngestorTest.php index 071780d4c1..fd153d539f 100644 --- a/tests/component/lib/ETL/CloudStateReconstructorTransformIngestorTest.php +++ b/tests/component/lib/ETL/CloudStateReconstructorTransformIngestorTest.php @@ -13,7 +13,7 @@ * Test Cloud State FSM */ -class CloudStateReconstructorTransformIngestorTest extends \PHPUnit_Framework_TestCase +class CloudStateReconstructorTransformIngestorTest extends \PHPUnit\Framework\TestCase { private $event_start_res01 = array( "resource_id" => 12, @@ -92,7 +92,7 @@ class CloudStateReconstructorTransformIngestorTest extends \PHPUnit_Framework_Te private $fsm; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { $configFile = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/input/xdmod_etl_config_8.0.0.json'); @@ -103,6 +103,7 @@ public function __construct() $conf = EtlConfiguration::factory($configFile); $this->fsm = new CloudStateReconstructorTransformIngestor($options, $conf); + parent::__construct($name, $data, $dataName); } // happy path diff --git a/tests/component/lib/ETL/DbModel/DbModelTest.php b/tests/component/lib/ETL/DbModel/DbModelTest.php index 4d6f0edab8..6f2e980037 100644 --- a/tests/component/lib/ETL/DbModel/DbModelTest.php +++ b/tests/component/lib/ETL/DbModel/DbModelTest.php @@ -32,7 +32,7 @@ class DbModelTest extends \ComponentTests\ETL\BaseEtlTest * @return Nothing */ - public static function setupBeforeClass() + public static function setupBeforeClass(): void { self::$testArtifactInputPath = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/input/'); self::$testArtifactOutputPath = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/output/'); @@ -51,7 +51,7 @@ public static function setupBeforeClass() * @return Nothing */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$endpoint->getHandle()->execute('DROP TABLE IF EXISTS `test`.`modify_table_test`'); } diff --git a/tests/component/lib/ETL/EtlOverseerTest.php b/tests/component/lib/ETL/EtlOverseerTest.php index ed76ec478b..09845a0d60 100644 --- a/tests/component/lib/ETL/EtlOverseerTest.php +++ b/tests/component/lib/ETL/EtlOverseerTest.php @@ -16,7 +16,7 @@ * Various tests for the EtlOverseer class. */ -class EtlOverseerTest extends \PHPUnit_Framework_TestCase +class EtlOverseerTest extends \PHPUnit\Framework\TestCase { private static $etlConfig = null; private static $testArtifactInputPath = null; @@ -28,7 +28,7 @@ class EtlOverseerTest extends \PHPUnit_Framework_TestCase * @return Nothing */ - public static function setupBeforeClass() + public static function setupBeforeClass(): void { self::$testArtifactInputPath = realpath(BASE_DIR . '/tests/artifacts/xdmod/etlv2/configuration/input/'); @@ -59,7 +59,7 @@ public static function setupBeforeClass() * Reset values in shared classes. */ - public function setUp() + public function setup(): void { self::$overseerOptions->setIncludeOnlyResourceCodes(null); self::$overseerOptions->setIncludeOnlyResourceCodes(null); @@ -78,8 +78,9 @@ public function testValidResourceCodes() { self::$overseerOptions->setIncludeOnlyResourceCodes('resource1'); $overseer = new EtlOverseer(self::$overseerOptions); $overseer->execute(self::$etlConfig); + $this->assertTrue(true); } catch ( Exception $e ) { - $this->assertTrue(false, $e->getMessage()); + $this->fail($e->getMessage()); } // Array of valid resource codes to include @@ -88,8 +89,9 @@ public function testValidResourceCodes() { self::$overseerOptions->setIncludeOnlyResourceCodes(array('resource1', 'resource2')); $overseer = new EtlOverseer(self::$overseerOptions); $overseer->execute(self::$etlConfig); + $this->assertTrue(true); } catch ( Exception $e ) { - $this->assertTrue(false, $e->getMessage()); + $this->fail($e->getMessage()); } // Single valid resource code to exclude @@ -98,8 +100,9 @@ public function testValidResourceCodes() { self::$overseerOptions->setExcludeResourceCodes('resource1'); $overseer = new EtlOverseer(self::$overseerOptions); $overseer->execute(self::$etlConfig); + $this->assertTrue(true); } catch ( Exception $e ) { - $this->assertTrue(false, $e->getMessage()); + $this->fail($e->getMessage()); } // Array of valid resource codes to exclude @@ -108,8 +111,9 @@ public function testValidResourceCodes() { self::$overseerOptions->setExcludeResourceCodes(array('resource1', 'resource2')); $overseer = new EtlOverseer(self::$overseerOptions); $overseer->execute(self::$etlConfig); + $this->assertTrue(true); } catch ( Exception $e ) { - $this->assertTrue(false, $e->getMessage()); + $this->fail($e->getMessage()); } } @@ -129,7 +133,7 @@ public function testInvalidResourceCodes() { $overseer->execute(self::$etlConfig); $exceptionThrown = false; } catch ( Exception $e ) { - $this->assertContains($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); + $this->assertStringContainsString($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); } $this->assertTrue($exceptionThrown, "Expected exception to be thrown for unknown resource code '$unknownCode'"); @@ -144,7 +148,7 @@ public function testInvalidResourceCodes() { $overseer->execute(self::$etlConfig); $exceptionThrown = false; } catch ( Exception $e ) { - $this->assertContains($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); + $this->assertStringContainsString($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); } $this->assertTrue($exceptionThrown, "Expected exception to be thrown for unknown resource code '$unknownCode'"); @@ -158,7 +162,7 @@ public function testInvalidResourceCodes() { $overseer->execute(self::$etlConfig); $exceptionThrown = false; } catch ( Exception $e ) { - $this->assertContains($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); + $this->assertStringContainsString($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); } $this->assertTrue($exceptionThrown, "Expected exception to be thrown for unknown resource code '$unknownCode'"); @@ -172,7 +176,7 @@ public function testInvalidResourceCodes() { $overseer->execute(self::$etlConfig); $exceptionThrown = false; } catch ( Exception $e ) { - $this->assertContains($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); + $this->assertStringContainsString($unknownCode, $e->getMessage(), "Unknown resource code but did not find expected code '$unknownCode'"); } $this->assertTrue($exceptionThrown, "Expected exception to be thrown for unknown resource code '$unknownCode'"); } diff --git a/tests/component/lib/ETL/IngestorTest.php b/tests/component/lib/ETL/IngestorTest.php index 55ad8f60a7..b8ffe16046 100644 --- a/tests/component/lib/ETL/IngestorTest.php +++ b/tests/component/lib/ETL/IngestorTest.php @@ -21,7 +21,7 @@ * data. */ -class IngestorTest extends \PHPUnit_Framework_TestCase +class IngestorTest extends \PHPUnit\Framework\TestCase { const TEST_INPUT_DIR = '/tests/artifacts/xdmod/etlv2/configuration/input'; const ACTION = 0; // Run an overseer action @@ -48,7 +48,7 @@ public function testLoadDataInfileWarnings() { if ( ! empty($result['stdout']) ) { foreach ( explode(PHP_EOL, trim($result['stdout'])) as $line ) { - $this->assertRegExp('/\[warning\]/', $line); + $this->assertMatchesRegularExpression('/\[warning\]/', $line); $numWarnings++; } } @@ -291,7 +291,7 @@ private function executeCommand($command) * @return Nothing */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { $dbh = DB::factory('database'); $dbh->execute('DROP TABLE IF EXISTS `test`.`load_data_infile_test`'); diff --git a/tests/component/lib/Export/BatchProcessTest.php b/tests/component/lib/Export/BatchProcessTest.php index b4e0ce4f2a..fb8e92a010 100644 --- a/tests/component/lib/Export/BatchProcessTest.php +++ b/tests/component/lib/Export/BatchProcessTest.php @@ -64,9 +64,9 @@ class BatchProcessTest extends BaseTest /** * Create test objects and data. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); self::$queryHandler = new QueryHandler(); self::$exportDirectory = xd_utilities\getConfiguration( 'data_warehouse_export', @@ -105,7 +105,7 @@ public static function setUpBeforeClass() /** * Remove test data from database and generated files. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { // Delete any requests that weren't already deleted. self::$dbh->execute('DELETE FROM batch_export_requests'); diff --git a/tests/component/lib/Export/ExportDBTest.php b/tests/component/lib/Export/ExportDBTest.php index 797b3169e5..0713369b90 100644 --- a/tests/component/lib/Export/ExportDBTest.php +++ b/tests/component/lib/Export/ExportDBTest.php @@ -511,17 +511,17 @@ public function testRecordDeleteCorrectUser() } } - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { // setup needed to use NORMAL_USER_USER_NAME or the like - parent::setUpBeforeClass(); + parent::setupBeforeClass(); // determine initial max id to enable cleanup after testing static::$dbh = DB::factory('database'); static::$maxId = static::$dbh->query('SELECT COALESCE(MAX(id), 0) AS id FROM batch_export_requests')[0]['id']; } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { // Reset the batch_export_requests database table to its initial contents static::$dbh->execute('DELETE FROM batch_export_requests WHERE id > :id', array('id' => static::$maxId)); diff --git a/tests/component/lib/Export/FileManagerTest.php b/tests/component/lib/Export/FileManagerTest.php index c8de57f28f..0e2e014cc4 100644 --- a/tests/component/lib/Export/FileManagerTest.php +++ b/tests/component/lib/Export/FileManagerTest.php @@ -33,9 +33,9 @@ class FileManagerTest extends BaseTest /** * Create file manager and test data. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); self::$fileManager = new FileManager(); self::$exportDir = xd_utilities\getConfiguration( 'data_warehouse_export', @@ -54,12 +54,12 @@ public static function setUpBeforeClass() public function testGetExportDataFilePath($id) { $path = self::$fileManager->getExportDataFilePath($id); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/^%s/', preg_quote(self::$exportDir, '/')), $path, 'Path begins with export directory' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($id, '/')), $path, 'Path contains ID' @@ -75,22 +75,22 @@ public function testGetExportDataFilePath($id) public function testGetDataFileName(array $request) { $file = self::$fileManager->getDataFileName($request); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['realm'], '/')), $file, 'File name contains realm name' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['start_date'], '/')), $file, 'File name contains start date' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['end_date'], '/')), $file, 'File name contains end date' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf( '/\.%s$/', preg_quote(strtolower($request['export_file_format']), '/') @@ -109,22 +109,22 @@ public function testGetDataFileName(array $request) public function testGetZipFileName(array $request) { $file = self::$fileManager->getZipFileName($request); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['realm'], '/')), $file, 'File name contains realm name' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['start_date'], '/')), $file, 'File name contains start date' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('/\b%s\b/', preg_quote($request['end_date'], '/')), $file, 'File name contains end date' ); - $this->assertRegExp( + $this->assertMatchesRegularExpression( '/\.zip$/', $file, 'File name ends with correct extension' @@ -141,15 +141,13 @@ public function testWriteDataSetToFile(array $request) { $dataSet = $this->getMockBuilder('\DataWarehouse\Data\BatchDataset') ->disableOriginalConstructor() - ->setMethods(['getHeader', 'current', 'key', 'next', 'rewind', 'valid']) + ->onlyMethods(['getHeader', 'current', 'key', 'next', 'rewind', 'valid']) ->getMock(); $dataSet->method('getHeader')->willReturn(['heading1', 'heading2', 'heading3']); $dataSet->method('current') ->will($this->onConsecutiveCalls([0, 1, 2], ['a', 'b', 'c'], false)); $dataSet->method('key') ->will($this->onConsecutiveCalls(1, 2, false)); - $dataSet->method('next')->willReturn(null); - $dataSet->method('rewind')->willReturn(null); $dataSet->method('valid') ->will($this->onConsecutiveCalls(true, true, false)); @@ -212,7 +210,7 @@ public function testRemoveExportFile(array $request) $file = self::$fileManager->getExportDataFilePath($request['id']); $this->assertFileExists($file); self::$fileManager->removeExportFile($request['id']); - $this->assertFileNotExists($file); + $this->assertFileDoesNotExist($file); } /** @@ -233,7 +231,7 @@ public function testRemoveDeletedRequests() self::$fileManager->removeDeletedRequests($deletedRequestIds); foreach ($deletedRequestIds as $id) { $file = self::$fileManager->getExportDataFilePath($id); - $this->assertFileNotExists($file); + $this->assertFileDoesNotExist($file); } foreach ($availableRequestIds as $id) { $file = self::$fileManager->getExportDataFilePath($id); diff --git a/tests/component/lib/Export/RawStatisticsConfigurationTest.php b/tests/component/lib/Export/RawStatisticsConfigurationTest.php index 8c8a2118ab..8d1c1cb7a1 100644 --- a/tests/component/lib/Export/RawStatisticsConfigurationTest.php +++ b/tests/component/lib/Export/RawStatisticsConfigurationTest.php @@ -5,14 +5,14 @@ use CCR\Json; use DataWarehouse\Data\RawStatisticsConfiguration; use Exception; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; /** * Test data warehouse export raw statistics configuration. * * @coversDefaultClass \DataWarehouse\Data\RawStatisticsConfiguration */ -class RawStatisticsConfigurationTest extends PHPUnit_Framework_TestCase +class RawStatisticsConfigurationTest extends \PHPUnit\Framework\TestCase { /** * @var array Realms used for testing. @@ -42,9 +42,9 @@ class RawStatisticsConfigurationTest extends PHPUnit_Framework_TestCase * Store enabled batch export realm names before adding new test * configuration files and then add test configuration files. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); static::$realmNames = array_map( function ($realm) { @@ -79,7 +79,7 @@ function ($realm) { /** * Remove test configuration files. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { parent::tearDownAfterClass(); diff --git a/tests/component/lib/Export/RealmManagerTest.php b/tests/component/lib/Export/RealmManagerTest.php index 42ea882c7d..4f038ae338 100644 --- a/tests/component/lib/Export/RealmManagerTest.php +++ b/tests/component/lib/Export/RealmManagerTest.php @@ -46,9 +46,9 @@ class RealmManagerTest extends BaseTest /** */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); self::$realmManager = new RealmManager(); @@ -65,7 +65,7 @@ public static function setUpBeforeClass() * Only includes the relevant properties from the realm that are used by * the realm manager class. * - * @param \Model\Realm $realm + * @param \Models\Realm $realm * @return array */ private function convertRealmToArray(Realm $realm) @@ -84,13 +84,14 @@ private function convertRealmToArray(Realm $realm) */ public function testGetRealms($realms) { + $actual = array_map( + fn($realm) => ['name' => $realm->getName(), 'display' => $realm->getDisplay()], + self::$realmManager->getRealms() + ); $this->assertEquals( $realms, - array_map( - [$this, 'convertRealmToArray'], - self::$realmManager->getRealms() - ), - 'getRealms returns expected realms' + $actual, + sprintf('Expected: %s, Received: %s', json_encode($realms), json_encode($actual)) ); } @@ -102,13 +103,14 @@ public function testGetRealms($realms) */ public function testGetRealmsForUser($role, $realms) { + $actual = array_map( + fn($realm) => ['name' => $realm->getName(), 'display' => $realm->getDisplay()], + self::$realmManager->getRealmsForUser(self::$users[$role]) + ); $this->assertEquals( $realms, - array_map( - [$this, 'convertRealmToArray'], - self::$realmManager->getRealmsForUser(self::$users[$role]) - ), - "getRealmsForUser returns expected realms for role $role" + $actual, + sprintf('Expected: %s, Received: %s', json_encode($realms), json_encode($actual)) ); } diff --git a/tests/component/lib/GroupBy/GroupByTest.php b/tests/component/lib/GroupBy/GroupByTest.php index d3a6b42869..db82cb62db 100644 --- a/tests/component/lib/GroupBy/GroupByTest.php +++ b/tests/component/lib/GroupBy/GroupByTest.php @@ -11,7 +11,7 @@ use Psr\Log\LoggerInterface; use Realm\Realm; -class GroupByTest extends \PHPUnit_Framework_TestCase +class GroupByTest extends \PHPUnit\Framework\TestCase { /** @@ -19,7 +19,7 @@ class GroupByTest extends \PHPUnit_Framework_TestCase */ protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages $conf = array( diff --git a/tests/component/lib/Query/AggregateQueryTest.php b/tests/component/lib/Query/AggregateQueryTest.php index 9ff48bfd39..cea04a5602 100644 --- a/tests/component/lib/Query/AggregateQueryTest.php +++ b/tests/component/lib/Query/AggregateQueryTest.php @@ -10,7 +10,7 @@ use DataWarehouse\Query\AggregateQuery; use Psr\Log\LoggerInterface; -class AggregateQueryTest extends \PHPUnit_Framework_TestCase +class AggregateQueryTest extends \PHPUnit\Framework\TestCase { /** @@ -18,7 +18,7 @@ class AggregateQueryTest extends \PHPUnit_Framework_TestCase */ protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages @@ -45,11 +45,12 @@ public static function setupBeforeClass() * Create an aggregate query with no group by or statistic. We will not be able to generate the * query string with no fields for the SELECT clause. * - * @expectedException Exception + * */ public function testAggregateQueryNoStatisticNoGroupBy() { + $this->expectException(\Exception::class); $query = new \DataWarehouse\Query\AggregateQuery( 'Jobs', 'day', diff --git a/tests/component/lib/Query/TimeseriesQueryTest.php b/tests/component/lib/Query/TimeseriesQueryTest.php index 4c865a6fd7..1dcec0cefd 100644 --- a/tests/component/lib/Query/TimeseriesQueryTest.php +++ b/tests/component/lib/Query/TimeseriesQueryTest.php @@ -9,12 +9,12 @@ use CCR\Log as Logger; use DataWarehouse\Query\AggregateQuery; -class TimeseriesQueryTest extends \PHPUnit_Framework_TestCase +class TimeseriesQueryTest extends \PHPUnit\Framework\TestCase { protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages diff --git a/tests/component/lib/RIDTest.php b/tests/component/lib/RIDTest.php index 80fb84925f..f80ad5f713 100644 --- a/tests/component/lib/RIDTest.php +++ b/tests/component/lib/RIDTest.php @@ -4,7 +4,7 @@ use XDUser; -class RIDTest extends \PHPUnit_Framework_TestCase +class RIDTest extends \PHPUnit\Framework\TestCase { /** diff --git a/tests/component/lib/Roles/RoleParametersTest.php b/tests/component/lib/Roles/RoleParametersTest.php index f48b878d9f..b9e9647c72 100644 --- a/tests/component/lib/Roles/RoleParametersTest.php +++ b/tests/component/lib/Roles/RoleParametersTest.php @@ -36,10 +36,9 @@ class RoleParametersTest extends BaseTest */ public function __construct($name = null, array $data = array(), $dataName = '') { - parent::__construct($name, $data, $dataName); - $this->peopleHelper = new PeopleHelper(); $this->organizationHelper = new OrganizationHelper(); + parent::__construct($name, $data, $dataName); } diff --git a/tests/component/lib/SlurmHelperTest.php b/tests/component/lib/SlurmHelperTest.php index 7f9b09857f..e9cabea191 100644 --- a/tests/component/lib/SlurmHelperTest.php +++ b/tests/component/lib/SlurmHelperTest.php @@ -62,8 +62,8 @@ public function testSlurmHelper( $result = $this->executeSlurmHelper($sacctOutputType, $sacctExitStatus); $this->assertEquals($exitStatus, $result['exit_status']); - $this->assertRegExp($stdoutRegex, $result['stdout']); - $this->assertRegExp($stderrRegex, $result['stderr']); + $this->assertMatchesRegularExpression($stdoutRegex, $result['stdout']); + $this->assertMatchesRegularExpression($stderrRegex, $result['stderr']); } /** @@ -123,15 +123,15 @@ public function sacctCommandProvider() return $this->getTestFiles()->loadJsonFile(self::TEST_GROUP, 'sacct'); } - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); static::$dbh = DB::factory('shredder'); static::$maxSlurmJobId = static::$dbh->query('SELECT COALESCE(MAX(shredded_job_slurm_id), 0) AS id FROM shredded_job_slurm')[0]['id']; static::$maxShreddedJobId = static::$dbh->query('SELECT COALESCE(MAX(shredded_job_id), 0) AS id FROM shredded_job')[0]['id']; } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { parent::tearDownAfterClass(); static::$dbh->execute('DELETE FROM shredded_job_slurm WHERE shredded_job_slurm_id > :id', array('id' => static::$maxSlurmJobId)); diff --git a/tests/component/lib/Utilities/LogAndThrowExceptionTest.php b/tests/component/lib/Utilities/LogAndThrowExceptionTest.php index fcfd060c95..6a2d85bfc4 100644 --- a/tests/component/lib/Utilities/LogAndThrowExceptionTest.php +++ b/tests/component/lib/Utilities/LogAndThrowExceptionTest.php @@ -6,18 +6,18 @@ use CCR\Loggable; use Exception; use PDOException; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; /** * Test various cases for exceptions thrown by Loggable::logAndThrowException() */ -class LogAndThrowExceptionTest extends PHPUnit_Framework_TestCase +class LogAndThrowExceptionTest extends \PHPUnit\Framework\TestCase { private $db; private $loggable; - public function setUp() + public function setup(): void { $this->db = DB::factory('datawarehouse'); $this->loggable = new Loggable(); diff --git a/tests/component/lib/XDUserTest.php b/tests/component/lib/XDUserTest.php index 51acc9ccfd..ad2fc92398 100644 --- a/tests/component/lib/XDUserTest.php +++ b/tests/component/lib/XDUserTest.php @@ -210,12 +210,11 @@ public function testGetRolesCasual() $this->assertNull($roles); } - /** - * @expectedException Exception - * @expectedExceptionMessage A user must have at least one role. - */ public function testSetRolesEmpty() { + $this->expectExceptionMessage("A user must have at least one role."); + $this->expectException(Exception::class); + $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $originalRoles = $user->getRoles(); @@ -256,12 +255,10 @@ public function testGetAclNames() $this->assertTrue(in_array(self::CENTER_DIRECTOR_ACL_NAME, $acls)); } - /** - * @expectedException Exception - * @expectedExceptionMessage A user must have at least one acl. - */ public function testSetAclsEmpty() { + $this->expectExceptionMessage("A user must have at least one acl."); + $this->expectException(Exception::class); $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $originalAcls = $user->getAcls(); @@ -419,38 +416,30 @@ public function testGetUserByUserNameValid() $this->assertNotNull($user->getUserID()); } - /** - * @expectedException Exception - * @expectedExceptionMessage User "bilbo" not found - */ public function testGetUserByUserNameInvalid() { + $this->expectExceptionMessage("User \"bilbo\" not found"); + $this->expectException(Exception::class); XDUser::getUserByUserName("bilbo"); } - /** - * @expectedException Exception - * @expectedExceptionMessage User "" not found - */ public function testGetUserByUserNameEmptyString() { + $this->expectExceptionMessage("User \"\" not found"); + $this->expectException(Exception::class); XDUser::getUserByUserName(""); } - /** - * @expectedException Exception - * @expectedExceptionMessage No username provided - */ public function testGetUserByUserNameNull() { + $this->expectExceptionMessage("No username provided"); + $this->expectException(Exception::class); XDUser::getUserByUserName(null); } - /** - * @expectedException Exception - **/ public function testHasAclWithNonAclTypeShouldThrowException() { + $this->expectException(Exception::class); $acl = new \StdClass; $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $user->hasAcl($acl); @@ -469,10 +458,11 @@ public function testUserIsManager() /** * Expect that it should complain about not having a valid user type. * - * @expectedException Exception + * **/ public function testCreateUserWithoutUserTypeShouldFail() { + $this->expectException(Exception::class); $user = self::getUser(null, 'test', 'a', 'user'); $this->assertEquals('0', $user->getUserID()); @@ -498,12 +488,10 @@ public function testCreateUser() $this->assertNotNull($user->getUserID()); } - /** - * @expectedException Exception - * @expectedExceptionMessage At least one role must be associated with this user - */ public function testCreateUserWithNoRoles() { + $this->expectExceptionMessage("At least one role must be associated with this user"); + $this->expectException(Exception::class); $user = self::getUser(null, 'test', 'a', 'user', array()); $this->assertEquals('0', $user->getUserID()); @@ -516,41 +504,36 @@ public function testCreateUserWithNoRoles() /** * Expect that it should complain about there already being a test user. * - * @expectedException Exception + * **/ public function testCreateUserWithExistingUserNameShouldFail() { + $this->expectException(Exception::class); $username = array_keys(self::$users)[count(self::$users) - 1]; $anotherUser = self::getUser(null, 'test', 'a', 'user', array(ROLE_ID_USER), ROLE_ID_USER, null, $username); $anotherUser->setUserType(SSO_USER_TYPE); $anotherUser->saveUser(); } - /** - * @expectedException Exception - **/ public function testSavePublicUserShouldFail() { + $this->expectException(Exception::class); $user = XDUser::getPublicUser(); $user->saveUser(); } - /** - * @expectedException Exception - **/ public function testSaveUserWithDefaultUserType() { + $this->expectException(Exception::class); $user = XDUser::getUserByUserName(self::CENTER_DIRECTOR_USER_NAME); $user->setUserType(0); $user->saveUser(); } - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /User "([\w\d.]+)" not found/ - */ public function testRemoveUser() { + $this->expectExceptionMessageMatches("/User \"([\w\d.]+)\" not found/"); + $this->expectException(Exception::class); $user = self::getUser(null, 'Test', 'A', 'User', array('usr')); $user->setUserType(self::DEFAULT_USER_TYPE); $user->saveUser(); @@ -566,10 +549,11 @@ public function testRemoveUser() /** * Cannot remove the public user * - * @expectedException Exception + * **/ public function testRemovePublicUserShouldFail() { + $this->expectException(Exception::class); $user = XDUser::getPublicUser(); $user->removeUser(); @@ -911,7 +895,7 @@ public function testGetFormalRoleNameEmptyString() $this->assertEquals($expected, $actual); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { foreach (self::$users as $userName => $user) { try { diff --git a/tests/component/phpunit.xml.dist b/tests/component/phpunit.xml.dist index e3c43ebde0..cd36b3b942 100644 --- a/tests/component/phpunit.xml.dist +++ b/tests/component/phpunit.xml.dist @@ -1,33 +1,19 @@ - + + + + - lib/Export - lib/ETL - lib/Roles + lib/Export + lib/ETL + lib/Roles - lib/Roles - lib/ETL + lib/Roles + lib/ETL - lib - lib/Roles + lib + lib/Roles + diff --git a/tests/integration/lib/BaseTest.php b/tests/integration/lib/BaseTest.php index 7e8ec79a8e..8bb3189cf3 100644 --- a/tests/integration/lib/BaseTest.php +++ b/tests/integration/lib/BaseTest.php @@ -89,7 +89,7 @@ * ); * } */ -abstract class BaseTest extends \PHPUnit_Framework_TestCase +abstract class BaseTest extends \PHPUnit\Framework\TestCase { const DATE_REGEX = '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/'; @@ -107,7 +107,7 @@ abstract class BaseTest extends \PHPUnit_Framework_TestCase 'output' => ['status_code', 'body_validator'] ]; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$XDMOD_REALMS = Utilities::getRealmsToTest(); } @@ -798,7 +798,7 @@ protected function validateSuccessResponse($validator) */ protected function validateDate($date) { - parent::assertRegExp(self::DATE_REGEX, $date); + parent::assertMatchesRegularExpression(self::DATE_REGEX, $date); } /** diff --git a/tests/integration/lib/Configuration/VersionNumberTest.php b/tests/integration/lib/Configuration/VersionNumberTest.php index 9a60b4c9c4..d93eae173f 100644 --- a/tests/integration/lib/Configuration/VersionNumberTest.php +++ b/tests/integration/lib/Configuration/VersionNumberTest.php @@ -3,13 +3,13 @@ namespace IntegrationTests\Configuration; use Exception; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use CCR\Json; /** * Test the Open XDMoD version number. */ -class VersionNumberTest extends PHPUnit_Framework_TestCase +class VersionNumberTest extends \PHPUnit\Framework\TestCase { /** * Absolute path to portal_settings.ini of installed Open XDMoD. @@ -23,7 +23,7 @@ class VersionNumberTest extends PHPUnit_Framework_TestCase */ private $buildJsonPath; - public function setUp() + public function setup(): void { $buildJsonPath = __DIR__ . '/../../../../open_xdmod/modules/xdmod/build.json'; $this->buildJsonPath = realpath($buildJsonPath); diff --git a/tests/integration/lib/Controllers/BaseUserAdminTest.php b/tests/integration/lib/Controllers/BaseUserAdminTest.php index a018528e43..a669ce335a 100644 --- a/tests/integration/lib/Controllers/BaseUserAdminTest.php +++ b/tests/integration/lib/Controllers/BaseUserAdminTest.php @@ -51,13 +51,13 @@ abstract class BaseUserAdminTest extends BaseTest */ protected $peopleHelper; - protected function setUp() + protected function setup(): void { $this->helper = new XdmodTestHelper(); $this->peopleHelper = new PeopleHelper(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { foreach (self::$newUsers as $username => $userId) { try { diff --git a/tests/integration/lib/Controllers/ControllerTest.php b/tests/integration/lib/Controllers/ControllerTest.php index deed30ac26..46bf4fb883 100644 --- a/tests/integration/lib/Controllers/ControllerTest.php +++ b/tests/integration/lib/Controllers/ControllerTest.php @@ -15,7 +15,7 @@ class ControllerTest extends BaseTest */ protected $helper; - protected function setUp() + protected function setup(): void { $this->helper = new XdmodTestHelper(__DIR__ . '/../../../'); } @@ -493,10 +493,12 @@ public function testEnumTargetAddresses(array $options) // application/json but do not return valid json. To account for these // two cases we just default to attempting to decode the response data // and if that fails then just fallback to the full response body as is. - try { - $actual = json_decode($response[0], true); - } catch (\Exception $e) { + if (is_array($response[0])) { $actual = $response[0]; + } elseif (is_string($response[0])) { + $actual = json_decode($response[0], true); + } else { + $this->fail(sprintf('Unrecognized response body type, expected an array or string, received: %s', get_debug_type($response[0]))); } $expected = JSON::loadFile($expectedFileName); diff --git a/tests/integration/lib/Controllers/MetricExplorerTest.php b/tests/integration/lib/Controllers/MetricExplorerTest.php index 7e204a2233..0d0d811f08 100644 --- a/tests/integration/lib/Controllers/MetricExplorerTest.php +++ b/tests/integration/lib/Controllers/MetricExplorerTest.php @@ -7,7 +7,7 @@ class MetricExplorerTest extends TokenAuthTest { - protected function setUp() + protected function setup(): void { $this->helper = new XdmodTestHelper(); } @@ -53,19 +53,16 @@ public static function getDwDescriptersBodyValidator($testInstance) $assertMessage ); foreach ($realm[$property] as $item) { - $testInstance->assertInternalType( - 'string', + $testInstance->assertIsString( $item['text'], $assertMessage ); - $testInstance->assertInternalType( - 'string', + $testInstance->assertIsString( $item['info'], $assertMessage ); if ('metrics' === $property) { - $testInstance->assertInternalType( - 'bool', + $testInstance->assertIsBool( $item['std_err'], $assertMessage ); @@ -268,14 +265,12 @@ public function testGetDimensionFilters($role, $tokenType, $expectedCount) ); foreach ($body['data'] as $item) { foreach (['id', 'name', 'short_name'] as $property) { - $this->assertInternalType( - 'string', + $this->assertIsString( $item[$property], $assertMessage ); } - $this->assertInternalType( - 'bool', + $this->assertIsBool( $item['checked'], $assertMessage ); diff --git a/tests/integration/lib/Controllers/ReportBuilderTest.php b/tests/integration/lib/Controllers/ReportBuilderTest.php index 216560c7df..664be88379 100644 --- a/tests/integration/lib/Controllers/ReportBuilderTest.php +++ b/tests/integration/lib/Controllers/ReportBuilderTest.php @@ -52,7 +52,7 @@ class ReportBuilderTest extends BaseTest 'http_code' => 200 ); - protected function setUp() + protected function setup(): void { $this->verbose = getenv('TEST_VERBOSE'); if (!isset($this->verbose)) { diff --git a/tests/integration/lib/Controllers/RoleDelegationTest.php b/tests/integration/lib/Controllers/RoleDelegationTest.php index b1e2bcd99c..e2d0fe0257 100644 --- a/tests/integration/lib/Controllers/RoleDelegationTest.php +++ b/tests/integration/lib/Controllers/RoleDelegationTest.php @@ -22,9 +22,9 @@ class RoleDelegationTest extends BaseUserAdminTest */ private $config; - protected function setUp() + protected function setup(): void { - parent::setUp(); + parent::setup(); $this->config = json_decode(file_get_contents(__DIR__ . '/../../../ci/testing.json'), true); } diff --git a/tests/integration/lib/Controllers/UsageExplorerTest.php b/tests/integration/lib/Controllers/UsageExplorerTest.php index ae997c96fb..af1480a040 100644 --- a/tests/integration/lib/Controllers/UsageExplorerTest.php +++ b/tests/integration/lib/Controllers/UsageExplorerTest.php @@ -32,9 +32,9 @@ class UsageExplorerTest extends TokenAuthTest { private static $publicView; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); self::$publicView = array( "public_user" => "true", "realm" => "Jobs", @@ -52,7 +52,7 @@ public static function setUpBeforeClass() */ protected $helper; - protected function setUp() + protected function setup(): void { $this->helper = new XdmodTestHelper(); } @@ -331,7 +331,7 @@ public function testJsonExport($input, $expected, $fieldCount, $recordCount) $this->assertEquals('DESC', $firstField['sortDir']); foreach($fields as $field) { - $this->assertRegExp('/dimension_column_\d+/', $field['name']); + $this->assertMatchesRegularExpression('/dimension_column_\d+/', $field['name']); $this->assertEquals('float', $field['type']); $this->assertEquals('DESC', $field['sortDir']); } @@ -340,9 +340,9 @@ public function testJsonExport($input, $expected, $fieldCount, $recordCount) $records = $got['records']; $this->assertCount($recordCount, $records); foreach($records as $record) { - $this->assertRegexp('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $record['day']); + $this->assertMatchesRegularExpression('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $record['day']); foreach($record as $rkey => $rval) { - $this->assertRegExp('/^day|dimension_column_\d+$/', $rkey); + $this->assertMatchesRegularExpression('/^day|dimension_column_\d+$/', $rkey); } } @@ -354,9 +354,9 @@ public function testJsonExport($input, $expected, $fieldCount, $recordCount) $this->assertEquals(array('header' => 'Day', 'width' => 150, 'dataIndex' => 'day', 'sortable' => 1, 'editable' => false, 'locked' => 1), $firstCol); foreach($columns as $column) { - $this->assertRegExp('/^\[[^\]]+\] Job Size: Max \(Core Count\)$/', $column['header']); + $this->assertMatchesRegularExpression('/^\[[^\]]+\] Job Size: Max \(Core Count\)$/', $column['header']); $this->assertEquals(140, $column['width']); - $this->assertRegExp('/^dimension_column_\d+$/', $column['dataIndex']); + $this->assertMatchesRegularExpression('/^dimension_column_\d+$/', $column['dataIndex']); $this->assertEquals(1, $column['sortable']); $this->assertEquals(false, $column['editable']); $this->assertEquals('right', $column['align']); diff --git a/tests/integration/lib/Controllers/UserControllerProviderTest.php b/tests/integration/lib/Controllers/UserControllerProviderTest.php index 003ce7e50c..533bc192b1 100644 --- a/tests/integration/lib/Controllers/UserControllerProviderTest.php +++ b/tests/integration/lib/Controllers/UserControllerProviderTest.php @@ -188,7 +188,7 @@ public function testAPITokensCRD($role) $this->makeTokenRequest( 'post', parent::validateSuccessResponse(function ($body) { - $this->assertRegExp( + $this->assertMatchesRegularExpression( '/^[0-9]+\\.[0-9a-f]{64}$/', $body['data']['token'] ); diff --git a/tests/integration/lib/Database/BaseDatabaseTest.php b/tests/integration/lib/Database/BaseDatabaseTest.php index 6c348cc21b..fad2fbd559 100644 --- a/tests/integration/lib/Database/BaseDatabaseTest.php +++ b/tests/integration/lib/Database/BaseDatabaseTest.php @@ -15,7 +15,7 @@ abstract class BaseDatabaseTest extends BaseTest /** * @throws Exception */ - public function setUp() + public function setup(): void { $this->db = DB::factory('datawarehouse'); } diff --git a/tests/integration/lib/Database/DataWarehouseExportTest.php b/tests/integration/lib/Database/DataWarehouseExportTest.php index 800be67a38..f924d0eeaa 100644 --- a/tests/integration/lib/Database/DataWarehouseExportTest.php +++ b/tests/integration/lib/Database/DataWarehouseExportTest.php @@ -4,12 +4,12 @@ use CCR\DB; use CCR\DB\MySQLHelper; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; /** * Test the data warehouse export database table. */ -class DataWarehouseExportTest extends PHPUnit_Framework_TestCase +class DataWarehouseExportTest extends \PHPUnit\Framework\TestCase { /** * Name of the data warehouse export batch requests table. @@ -22,7 +22,7 @@ class DataWarehouseExportTest extends PHPUnit_Framework_TestCase /** @var \CCR\DB\MySQLHelper */ private $dbHelper; - public function setUp() + public function setup(): void { $this->db = DB::factory('database'); $this->dbHelper = MySQLHelper::factory($this->db); diff --git a/tests/integration/lib/Database/ResourceNamesTest.php b/tests/integration/lib/Database/ResourceNamesTest.php index c06fafd78e..40a94961fd 100644 --- a/tests/integration/lib/Database/ResourceNamesTest.php +++ b/tests/integration/lib/Database/ResourceNamesTest.php @@ -5,7 +5,7 @@ use IntegrationTests\BaseTest; use CCR\DB; use CCR\Json; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use Configuration\XdmodConfiguration; /** @@ -15,7 +15,7 @@ class ResourceNamesTest extends BaseTest { private $db; - public function setUp() + public function setup(): void { $this->db = DB::factory('datawarehouse'); } diff --git a/tests/integration/lib/Database/SharedJobsTest.php b/tests/integration/lib/Database/SharedJobsTest.php index d1ab3fdc09..e6adfc5ce7 100644 --- a/tests/integration/lib/Database/SharedJobsTest.php +++ b/tests/integration/lib/Database/SharedJobsTest.php @@ -4,7 +4,7 @@ use CCR\DB; use CCR\Json; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use IntegrationTests\BaseTest; use Configuration\XdmodConfiguration; diff --git a/tests/integration/lib/Logging/CCRDBHandlerTest.php b/tests/integration/lib/Logging/CCRDBHandlerTest.php index 3d26e119c7..59a2058e0b 100644 --- a/tests/integration/lib/Logging/CCRDBHandlerTest.php +++ b/tests/integration/lib/Logging/CCRDBHandlerTest.php @@ -2,7 +2,7 @@ namespace IntegrationTests\Logging; -class CCRDBHandlerTest extends \PHPUnit_Framework_TestCase +class CCRDBHandlerTest extends \PHPUnit\Framework\TestCase { public function testHandlerWritesCorrectly() @@ -53,7 +53,7 @@ public function testHandlerWritesCorrectly() } $this->assertNotNull($json); - $this->assertObjectHasAttribute( + $this->assertObjectHasProperty( 'message', $json, sprintf( diff --git a/tests/integration/lib/Rest/AdminControllerProviderTest.php b/tests/integration/lib/Rest/AdminControllerProviderTest.php index 3f5ca3ede4..90ac4edcc0 100644 --- a/tests/integration/lib/Rest/AdminControllerProviderTest.php +++ b/tests/integration/lib/Rest/AdminControllerProviderTest.php @@ -9,7 +9,7 @@ class AdminControllerProviderTest extends BaseTest { private static $helper; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new XdmodTestHelper(); } diff --git a/tests/integration/lib/Rest/AuthenticationControllerProviderTest.php b/tests/integration/lib/Rest/AuthenticationControllerProviderTest.php index be7ff0ee84..7d461bfc64 100644 --- a/tests/integration/lib/Rest/AuthenticationControllerProviderTest.php +++ b/tests/integration/lib/Rest/AuthenticationControllerProviderTest.php @@ -9,7 +9,7 @@ class AuthenticationControllerProviderTest extends BaseTest { private static $helper; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new XdmodTestHelper(); } diff --git a/tests/integration/lib/Rest/JobViewerTest.php b/tests/integration/lib/Rest/JobViewerTest.php index b02c738360..8cf16322cb 100644 --- a/tests/integration/lib/Rest/JobViewerTest.php +++ b/tests/integration/lib/Rest/JobViewerTest.php @@ -9,7 +9,7 @@ class JobViewerTest extends BaseTest { const ENDPOINT = 'rest/v0.1/warehouse/'; - public function setUp() + public function setup(): void { $xdmodConfig = array( 'decodetextasjson' => true ); $this->xdmodhelper = new XdmodTestHelper($xdmodConfig); diff --git a/tests/integration/lib/Rest/ReportThumbnailsTest.php b/tests/integration/lib/Rest/ReportThumbnailsTest.php index 25a22de573..29d07286f1 100644 --- a/tests/integration/lib/Rest/ReportThumbnailsTest.php +++ b/tests/integration/lib/Rest/ReportThumbnailsTest.php @@ -4,11 +4,11 @@ use IntegrationTests\TestHarness\XdmodTestHelper; -class ReportThumbnailsTest extends \PHPUnit_Framework_TestCase +class ReportThumbnailsTest extends \PHPUnit\Framework\TestCase { protected static $helpers = array(); - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { foreach (array('cd', 'cs') as $user) { self::$helpers[$user] = new XdmodTestHelper(); @@ -18,7 +18,7 @@ public static function setUpBeforeClass() } } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { foreach (self::$helpers as $helper) { $helper->logout(); diff --git a/tests/integration/lib/Rest/WarehouseControllerProviderTest.php b/tests/integration/lib/Rest/WarehouseControllerProviderTest.php index f8e53f7c72..ea3107c0c9 100644 --- a/tests/integration/lib/Rest/WarehouseControllerProviderTest.php +++ b/tests/integration/lib/Rest/WarehouseControllerProviderTest.php @@ -9,9 +9,9 @@ class WarehouseControllerProviderTest extends TokenAuthTest { private static $helper; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setupBeforeClass(); self::$helper = new XdmodTestHelper(); } diff --git a/tests/integration/lib/Rest/WarehouseExportControllerProviderTest.php b/tests/integration/lib/Rest/WarehouseExportControllerProviderTest.php index ee2b53f265..a871bce3b9 100644 --- a/tests/integration/lib/Rest/WarehouseExportControllerProviderTest.php +++ b/tests/integration/lib/Rest/WarehouseExportControllerProviderTest.php @@ -8,7 +8,7 @@ use IntegrationTests\TokenAuthTest; use JsonSchema\Constraints\Constraint; use JsonSchema\Validator; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use IntegrationTests\TestHarness\XdmodTestHelper; use XDUser; @@ -82,7 +82,7 @@ class WarehouseExportControllerProviderTest extends TokenAuthTest /** * Instantiate fixtures and authenticate helpers. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { foreach (self::$userRoles as $role => $username) { self::$helpers[$role] = new XdmodTestHelper(); @@ -108,7 +108,7 @@ public static function setUpBeforeClass() /** * Logout and unset fixtures. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { foreach (self::$helpers as $helper) { $helper->logout(); @@ -219,14 +219,12 @@ public function testGetRealmsTokenAuth($role, $tokenType) { 'display', 'documentation' ] as $string) { - $this->assertInternalType( - 'string', + $this->assertIsString( $field[$string], $assertMessage ); } - $this->assertInternalType( - 'bool', + $this->assertIsBool( $field['anonymize'], $assertMessage ); @@ -234,7 +232,7 @@ public function testGetRealmsTokenAuth($role, $tokenType) { $index++; } - $counts = [28, 16, 16]; + $counts = [28, 16, 16 ]; for ($i = 0; $i < count($counts); $i++) { $this->assertCount( $counts[$i], @@ -259,7 +257,7 @@ public function testGetRealmsTokenAuth($role, $tokenType) { public function testCreateRequest($role, array $params, $httpCode, $schema) { list($content, $info, $headers) = self::$helpers[$role]->post('rest/warehouse/export/request', null, $params); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals($httpCode, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, $schema); } @@ -318,13 +316,13 @@ public function testGetRequests( array $requests ) { list($content, $info, $headers) = self::$helpers[$role]->get('rest/warehouse/export/requests'); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals($httpCode, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, $schema); // Only check data for successful requests. if ($httpCode == 200) { - $this->assertArraySubset($requests, $content['data'], 'Data contains requests'); + $this->assertTrue(count($requests) === count($content['data']), 'Data contains requests'); } } @@ -341,7 +339,7 @@ public function testDownloadExportedDataFile() self::$queryHandler->submittedToAvailable($id); @file_put_contents(self::$fileManager->getExportDataFilePath($id), $zipContent); list($content, $info, $headers) = self::$helpers[$role]->get('rest/warehouse/export/download/' . $id); - $this->assertRegExp('#\bapplication/zip\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/zip\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals(200, $info['http_code'], 'HTTP response code'); $this->assertEquals($zipContent, $content, 'Download content'); self::$fileManager->removeExportFile($id); @@ -373,7 +371,7 @@ public function testDeleteRequest($role, array $params, $httpCode, $schema) $id = $createContent['data'][0]['id']; list($content, $info, $headers) = self::$helpers[$role]->delete('rest/warehouse/export/request/' . $id); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals($httpCode, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, $schema); $this->assertEquals($id, $content['data'][0]['id'], 'Deleted ID is in response'); @@ -394,27 +392,27 @@ public function testDeleteRequestErrors() { // Public user can't delete anything. list($content, $info, $headers) = self::$helpers['pub']->delete('rest/warehouse/export/request/1'); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals(401, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, 'error'); // Non-integer ID. list($content, $info, $headers) = self::$helpers['usr']->delete('rest/warehouse/export/request/abc'); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals(404, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, 'error'); // Trying to delete a non-existent request. list($row) = self::$dbh->query('SELECT MAX(id) + 1 AS id FROM batch_export_requests'); list($content, $info, $headers) = self::$helpers['usr']->delete('rest/warehouse/export/request/' . $row['id']); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals(404, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, 'error'); // Trying to delete another user's request. list($row) = self::$dbh->query('SELECT id FROM batch_export_requests WHERE user_id = :user_id LIMIT 1', ['user_id' => self::$users['pi']->getUserId()]); list($content, $info, $headers) = self::$helpers['usr']->delete('rest/warehouse/export/request/' . $row['id']); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals(404, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, 'error'); } @@ -446,10 +444,10 @@ public function testDeleteRequests($role, $httpCode, $schema) // Delete all existing requests. list($content, $info, $headers) = self::$helpers[$role]->delete('rest/warehouse/export/requests', null, $data); - $this->assertRegExp('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); + $this->assertMatchesRegularExpression('#\bapplication/json\b#', $headers['Content-Type'], 'Content type header'); $this->assertEquals($httpCode, $info['http_code'], 'HTTP response code'); $this->validateAgainstSchema($content, $schema); - $this->assertArraySubset($content['data'], $beforeContent['data'], 'Deleted IDs are in response'); + $this->assertTrue(count($content['data']) === count($beforeContent['data']), 'Deleted IDs are in response'); // Get list of requests after deletion list($afterContent) = self::$helpers[$role]->get('rest/warehouse/export/requests'); diff --git a/tests/integration/phpunit.xml.dist b/tests/integration/phpunit.xml.dist index dfcdd3f05b..9db72cfe36 100644 --- a/tests/integration/phpunit.xml.dist +++ b/tests/integration/phpunit.xml.dist @@ -1,32 +1,15 @@ - - + + + - ./lib/ - ./lib/Controllers/SSOLoginTest.php + ./lib/ + ./lib/Controllers/SSOLoginTest.php - ./lib/BaseTest.php - ./lib/Controllers/BaseUserAdminTest.php - ./lib/Controllers/SSOLoginTest.php + ./lib/BaseTest.php + ./lib/Controllers/BaseUserAdminTest.php + ./lib/Controllers/SSOLoginTest.php - + diff --git a/tests/regression/lib/Controllers/MetricExplorerChartsTest.php b/tests/regression/lib/Controllers/MetricExplorerChartsTest.php index 18cd6cee6f..92aaacb724 100644 --- a/tests/regression/lib/Controllers/MetricExplorerChartsTest.php +++ b/tests/regression/lib/Controllers/MetricExplorerChartsTest.php @@ -5,11 +5,11 @@ use IntegrationTests\TestHarness\Utilities; use IntegrationTests\TestHarness\XdmodTestHelper; -class MetricExplorerChartsTest extends \PHPUnit_Framework_TestCase +class MetricExplorerChartsTest extends \PHPUnit\Framework\TestCase { private static $chartFilterTestData = array(); - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { // This is used to write expected results file for the // testChartFilters test. The output file is just written to diff --git a/tests/regression/lib/Controllers/UsageChartsTest.php b/tests/regression/lib/Controllers/UsageChartsTest.php index a8f431b25f..7beda7fa5c 100644 --- a/tests/regression/lib/Controllers/UsageChartsTest.php +++ b/tests/regression/lib/Controllers/UsageChartsTest.php @@ -5,7 +5,7 @@ use IntegrationTests\TestHarness\Utilities; use IntegrationTests\TestHarness\XdmodTestHelper; -class UsageChartsTest extends \PHPUnit_Framework_TestCase +class UsageChartsTest extends \PHPUnit\Framework\TestCase { /** * The path relative to this file that contains the expected hashes for this test case. @@ -67,7 +67,7 @@ private static function getHashPath() return self::$hashFilePath; } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$helper->logout(); if(!empty(self::$imagehashes)) { diff --git a/tests/regression/lib/Controllers/UsageExplorerCloudTest.php b/tests/regression/lib/Controllers/UsageExplorerCloudTest.php index f41e1f7e31..921d9ae2f3 100644 --- a/tests/regression/lib/Controllers/UsageExplorerCloudTest.php +++ b/tests/regression/lib/Controllers/UsageExplorerCloudTest.php @@ -7,7 +7,7 @@ /** * Test the usage explorer for cloud realm regressions. */ -class UsageExplorerCloudTest extends \PHPUnit_Framework_TestCase +class UsageExplorerCloudTest extends \PHPUnit\Framework\TestCase { /** @@ -18,7 +18,7 @@ class UsageExplorerCloudTest extends \PHPUnit_Framework_TestCase /** * Create the helper and authenticate. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new RegressionTestHelper(); self::$helper->authenticate(); @@ -27,7 +27,7 @@ public static function setUpBeforeClass() /** * Log out and output any messages generated by tests. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$helper->logout(); self::$helper->outputMessages(); diff --git a/tests/regression/lib/Controllers/UsageExplorerJobsTest.php b/tests/regression/lib/Controllers/UsageExplorerJobsTest.php index 23fa18da6d..96682b467c 100644 --- a/tests/regression/lib/Controllers/UsageExplorerJobsTest.php +++ b/tests/regression/lib/Controllers/UsageExplorerJobsTest.php @@ -7,7 +7,7 @@ /** * Test the usage explorer for jobs realm regressions. */ -class UsageExplorerJobsTest extends \PHPUnit_Framework_TestCase +class UsageExplorerJobsTest extends \PHPUnit\Framework\TestCase { /** * @var \RegressionTestHelper @@ -17,7 +17,7 @@ class UsageExplorerJobsTest extends \PHPUnit_Framework_TestCase /** * Create the helper and authenticate. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new RegressionTestHelper(); self::$helper->authenticate(); @@ -26,7 +26,7 @@ public static function setUpBeforeClass() /** * Log out and output any messages generated by tests. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$helper->logout(); self::$helper->outputMessages(); diff --git a/tests/regression/lib/Controllers/UsageExplorerResoucespecificationsTest.php b/tests/regression/lib/Controllers/UsageExplorerResoucespecificationsTest.php index f30ddf6b6b..5977f8daf5 100644 --- a/tests/regression/lib/Controllers/UsageExplorerResoucespecificationsTest.php +++ b/tests/regression/lib/Controllers/UsageExplorerResoucespecificationsTest.php @@ -2,12 +2,13 @@ namespace RegressionTests\Controllers; +use PHPUnit\Framework\TestCase; use RegressionTests\TestHarness\RegressionTestHelper; /** * Test the usage explorer for jobs realm regressions. */ -class UsageExplorerResourcespecificationsTest extends \PHPUnit_Framework_TestCase +class UsageExplorerResourcespecificationsTest extends TestCase { /** * @var \RegressionTestHelper @@ -17,7 +18,7 @@ class UsageExplorerResourcespecificationsTest extends \PHPUnit_Framework_TestCas /** * Create the helper and authenticate. */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$helper = new RegressionTestHelper(); self::$helper->authenticate(); @@ -26,7 +27,7 @@ public static function setUpBeforeClass() /** * Log out and output any messages generated by tests. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$helper->logout(); self::$helper->outputMessages(); diff --git a/tests/regression/lib/Controllers/UsageExplorerStorageTest.php b/tests/regression/lib/Controllers/UsageExplorerStorageTest.php index 2e3fffd9ec..6b109b70d9 100644 --- a/tests/regression/lib/Controllers/UsageExplorerStorageTest.php +++ b/tests/regression/lib/Controllers/UsageExplorerStorageTest.php @@ -7,7 +7,7 @@ /** * Test the usage explorer for storage realm regressions. */ -class UsageExplorerStorageTest extends \PHPUnit_Framework_TestCase +class UsageExplorerStorageTest extends \PHPUnit\Framework\TestCase { /** * @var \RegressionTestHelper @@ -17,7 +17,7 @@ class UsageExplorerStorageTest extends \PHPUnit_Framework_TestCase /** * Create the helper and authenticate. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new RegressionTestHelper(); self::$helper->authenticate(); @@ -26,7 +26,7 @@ public static function setUpBeforeClass() /** * Log out and output any messages generated by tests. */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$helper->logout(); self::$helper->outputMessages(); diff --git a/tests/regression/lib/Rest/WarehouseRawDataTest.php b/tests/regression/lib/Rest/WarehouseRawDataTest.php index 50f4fd647e..790dfbbd16 100644 --- a/tests/regression/lib/Rest/WarehouseRawDataTest.php +++ b/tests/regression/lib/Rest/WarehouseRawDataTest.php @@ -18,7 +18,7 @@ class WarehouseRawDataTest extends BaseTest /** * Create the helper. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$helper = new RegressionTestHelper(); } diff --git a/tests/regression/lib/TestHarness/RegressionTestHelper.php b/tests/regression/lib/TestHarness/RegressionTestHelper.php index 8d22eb62cd..c9e59134ef 100644 --- a/tests/regression/lib/TestHarness/RegressionTestHelper.php +++ b/tests/regression/lib/TestHarness/RegressionTestHelper.php @@ -6,6 +6,9 @@ use IntegrationTests\TestHarness\XdmodTestHelper; use IntegrationTests\TokenAuthTest; +use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Framework\IncompleteTestError; +use PHPUnit\Framework\SkippedTestError; /** * Everything you need to test for regressions. @@ -343,9 +346,9 @@ private static function getExpectedFile( * @param string $expectedFile Path to file containing expected output. * @param string $userRole User role used during test. * @return boolean True if CSV export returned expected data. - * @throws PHPUnit_Framework_SkippedTestError If the test is skipped. - * @throws PHPUnit_Framework_IncompleteTestError If the test is incomplete. - * @throws PHPUnit_Framework_ExpectationFailedException If the test failed. + * @throws \PHPUnit\Framework\SkippedTestError If the test is skipped. + * @throws \PHPUnit\Framework\IncompleteTestError If the test is incomplete. + * @throws \PHPUnit\Framework\ExpectationFailedException If the test failed. */ public function checkCsvExport($testName, $input, $expectedFile, $userRole) { @@ -354,7 +357,7 @@ public function checkCsvExport($testName, $input, $expectedFile, $userRole) $fullTestName = $testName . $datasetType . '-' . $aggUnit . '-' . $userRole; if (in_array($testName, self::$skip)) { - throw new \PHPUnit_Framework_SkippedTestError($fullTestName . ' intentionally skipped'); + throw new \PHPUnit\Framework\SkippedTestError($fullTestName . ' intentionally skipped'); } list($csvdata, $curldata) = self::post('/controllers/user_interface.php', null, $input); @@ -368,7 +371,7 @@ public function checkCsvExport($testName, $input, $expectedFile, $userRole) // more robust way for public user not having access to pass. if (gettype($csvdata) === "array") { if ($csvdata['message'] == 'Session Expired') { - throw new \PHPUnit_Framework_IncompleteTestError($fullTestName . ' user session expired...'); + throw new IncompleteTestError($fullTestName . ' user session expired...'); } $csvdata = json_encode($csvdata, JSON_PRETTY_PRINT) . "\n"; } @@ -412,7 +415,7 @@ public function checkCsvExport($testName, $input, $expectedFile, $userRole) return true; } - throw new \PHPUnit_Framework_ExpectationFailedException( + throw new ExpectationFailedException( sprintf( "%d assertions failed:\n\t%s", count($failures), @@ -446,7 +449,7 @@ public function checkCsvExport($testName, $input, $expectedFile, $userRole) * @param string|null $referenceFileName name of the reference file. * @return bool true if the reference file exists and already contains the * specified data. - * @throws \PHPUnit_Framework_SkippedTestError if the reference file does + * @throws SkippedTestError if the reference file does * not exist or does not * already contain the * specified data. @@ -487,7 +490,7 @@ private function generateArtifact( [$outputDir, $outputFileName] ); file_put_contents($outputFile, $data); - throw new \PHPUnit_Framework_SkippedTestError( + throw new \PHPUnit\Framework\SkippedTestError( "Created Expected output for $fullTestName" ); } @@ -567,13 +570,13 @@ public static function getRawDataTestParams(array $realmParams) * it. * @return bool true if the test artifact file already exists and * contains the response body from the HTTP request. - * @throws \PHPUnit_Framework_SkippedTestError if REG_TEST_USER_ROLE is + * @throws SkippedTestError if REG_TEST_USER_ROLE is * not set or if * REG_TEST_FORCE_GENERATION is * set and the test artifact * file was successfully * created. - * @throws \PHPUnit_Framework_ExpectationFailedException + * @throws ExpectationFailedException * if REG_TEST_FORCE_GENERATION * is not set and the HTTP * response body does not match @@ -584,7 +587,7 @@ public function checkRawData($testName, array $input, $sort = false) { $role = self::getEnvUserrole(); if ('public' === $role) { - throw new \PHPUnit_Framework_SkippedTestError( + throw new \PHPUnit\Framework\SkippedTestError( 'Raw data test cannot be performed with public user.' ); } @@ -636,7 +639,7 @@ public function checkRawData($testName, array $input, $sort = false) json_decode($expected, true), json_decode($data, true) ); - throw new \PHPUnit_Framework_ExpectationFailedException( + throw new ExpectationFailedException( sprintf( ( "%d difference" diff --git a/tests/regression/phpunit.xml.dist b/tests/regression/phpunit.xml.dist index 803d518a77..ef612e19d7 100644 --- a/tests/regression/phpunit.xml.dist +++ b/tests/regression/phpunit.xml.dist @@ -1,19 +1,3 @@ - + + diff --git a/tests/unit/lib/BaseTest.php b/tests/unit/lib/BaseTest.php index 2b14b0238d..bb5085867d 100644 --- a/tests/unit/lib/BaseTest.php +++ b/tests/unit/lib/BaseTest.php @@ -5,7 +5,7 @@ namespace UnitTests; -abstract class BaseTest extends \PHPUnit_Framework_TestCase +abstract class BaseTest extends \PHPUnit\Framework\TestCase { /** * Recursively filter out any keys matching one in $keyList. This is a helper function to diff --git a/tests/unit/lib/Common/IdentityTest.php b/tests/unit/lib/Common/IdentityTest.php index f413714636..8432fef4a4 100644 --- a/tests/unit/lib/Common/IdentityTest.php +++ b/tests/unit/lib/Common/IdentityTest.php @@ -10,11 +10,11 @@ * */ -class IdentityTest extends \PHPUnit_Framework_TestCase +class IdentityTest extends \PHPUnit\Framework\TestCase { private $_identity; private $_identity1; - public function setUp() + public function setup(): void { $this->_identity = new \Common\Identity('identity_name'); $this->_identity1 = new \Common\Identity(''); @@ -34,18 +34,19 @@ public function errorHandler($errno, $errstr, $errfile, $errline) ); } - public function tearDown() { + public function tearDown(): void { restore_error_handler(); $this->_identity = null; $this->_identity1 = null; } /** - * @expectedException ArgumentCountError + * * @requires PHP 7.1 */ public function testNoDefaultParameterToConstructor() { + $this->expectException(\ArgumentCountError::class); new \Common\Identity(); // this construction should fail since the name parameter is not specified } diff --git a/tests/unit/lib/Common/ScalableValueTest.php b/tests/unit/lib/Common/ScalableValueTest.php index 9f895ebdfc..3f5c89169a 100644 --- a/tests/unit/lib/Common/ScalableValueTest.php +++ b/tests/unit/lib/Common/ScalableValueTest.php @@ -10,15 +10,15 @@ * */ -class ScalableValueTest extends \PHPUnit_Framework_TestCase +class ScalableValueTest extends \PHPUnit\Framework\TestCase { private $_scalableValue; - public function setUp() + public function setup(): void { $this->_scalableValue = new \Common\ScalableValue(10, .5, .2); } - public function tearDown() + public function tearDown(): void { $this->_scalableValue = null; } diff --git a/tests/unit/lib/DB/TimePeriodGenerators/TimePeriodGeneratorTest.php b/tests/unit/lib/DB/TimePeriodGenerators/TimePeriodGeneratorTest.php index 066571c073..a42d05696a 100644 --- a/tests/unit/lib/DB/TimePeriodGenerators/TimePeriodGeneratorTest.php +++ b/tests/unit/lib/DB/TimePeriodGenerators/TimePeriodGeneratorTest.php @@ -7,7 +7,7 @@ /** * Tests for TimePeriodGenerator and its subclasses. */ -class TimePeriodGeneratorTest extends \PHPUnit_Framework_TestCase +class TimePeriodGeneratorTest extends \PHPUnit\Framework\TestCase { /** * A cache of TimePeriodGenerator instances. @@ -396,7 +396,7 @@ public function timestampsAndTotalsProvider() 'start_ts' => 1451606400, 'middle_ts' => 1451606400, 'end_ts' => 1451606400, - 'total_hours' => 0.00027777777777778, + 'total_hours' => 0.0002777777777777778, 'total_seconds' => 1, ), ), @@ -407,7 +407,7 @@ public function timestampsAndTotalsProvider() 'start_ts' => 1451606400, 'middle_ts' => 1451606550, 'end_ts' => 1451606700, - 'total_hours' => 0.083611111111111, + 'total_hours' => 0.08361111111111111, 'total_seconds' => 301, ), ), diff --git a/tests/unit/lib/DataWarehouse/Access/ReportGeneratorTest.php b/tests/unit/lib/DataWarehouse/Access/ReportGeneratorTest.php index d17c3a1099..ae45b994f6 100644 --- a/tests/unit/lib/DataWarehouse/Access/ReportGeneratorTest.php +++ b/tests/unit/lib/DataWarehouse/Access/ReportGeneratorTest.php @@ -4,7 +4,7 @@ use \DataWarehouse\Access\ReportGenerator; -class ReportGeneratorTest extends \PHPUnit_Framework_TestCase +class ReportGeneratorTest extends \PHPUnit\Framework\TestCase { public function reportTmpProvider() { diff --git a/tests/unit/lib/DataWarehouse/Export/CsvFileWriterTest.php b/tests/unit/lib/DataWarehouse/Export/CsvFileWriterTest.php index cd5ee9aa79..bb9ba68358 100644 --- a/tests/unit/lib/DataWarehouse/Export/CsvFileWriterTest.php +++ b/tests/unit/lib/DataWarehouse/Export/CsvFileWriterTest.php @@ -4,14 +4,14 @@ use CCR\Log; use DataWarehouse\Export\FileWriter\CsvFileWriter; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use IntegrationTests\TestHarness\TestFiles; /** * Test data warehouse export CSV file writer. */ -class CsvFileWriterTest extends PHPUnit_Framework_TestCase +class CsvFileWriterTest extends \PHPUnit\Framework\TestCase { /** * Test artifacts path. @@ -27,7 +27,7 @@ class CsvFileWriterTest extends PHPUnit_Framework_TestCase /** * Create logger. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$logger = Log::singleton('null'); } diff --git a/tests/unit/lib/DataWarehouse/Export/FileWriterFactoryTest.php b/tests/unit/lib/DataWarehouse/Export/FileWriterFactoryTest.php index dc200f841a..1f1f28cde6 100644 --- a/tests/unit/lib/DataWarehouse/Export/FileWriterFactoryTest.php +++ b/tests/unit/lib/DataWarehouse/Export/FileWriterFactoryTest.php @@ -3,13 +3,13 @@ namespace UnitTests\DataWarehouse\Export; use DataWarehouse\Export\FileWriter\FileWriterFactory; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use IntegrationTests\TestHarness\TestFiles; /** * Test data warehouse export file. */ -class FileWriterTest extends PHPUnit_Framework_TestCase +class FileWriterTest extends \PHPUnit\Framework\TestCase { /** * Test artifacts path. @@ -30,7 +30,7 @@ class FileWriterTest extends PHPUnit_Framework_TestCase /** * Create file writer factory. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$fileWriterFactory = new FileWriterFactory(); } @@ -60,12 +60,11 @@ public function testFileWriterCreation($format, $className) /** * Test creating an invalid file writer format. - * - * @expectedException Exception - * @expectedExceptionMessageRegExp /Unsupported format/ */ public function testFileWriterFactoryException() { + $this->expectExceptionMessageMatches("/Unsupported format/"); + $this->expectException(\Exception::class); self::$fileWriterFactory->createFileWriter('foo', '/dev/null'); } diff --git a/tests/unit/lib/DataWarehouse/Export/JsonFileWriterTest.php b/tests/unit/lib/DataWarehouse/Export/JsonFileWriterTest.php index 692584d9eb..1d1ab31225 100644 --- a/tests/unit/lib/DataWarehouse/Export/JsonFileWriterTest.php +++ b/tests/unit/lib/DataWarehouse/Export/JsonFileWriterTest.php @@ -4,14 +4,14 @@ use CCR\Log; use DataWarehouse\Export\FileWriter\JsonFileWriter; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use IntegrationTests\TestHarness\TestFiles; /** * Test data warehouse export JSON file writer. */ -class JsonFileWriterTest extends PHPUnit_Framework_TestCase +class JsonFileWriterTest extends \PHPUnit\Framework\TestCase { /** * Test artifacts path. @@ -27,7 +27,7 @@ class JsonFileWriterTest extends PHPUnit_Framework_TestCase /** * Create logger. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$logger = Log::singleton('null'); } diff --git a/tests/unit/lib/DataWarehouse/Export/NullFileWriterTest.php b/tests/unit/lib/DataWarehouse/Export/NullFileWriterTest.php index 3eed668ffc..94a65a1bcf 100644 --- a/tests/unit/lib/DataWarehouse/Export/NullFileWriterTest.php +++ b/tests/unit/lib/DataWarehouse/Export/NullFileWriterTest.php @@ -4,14 +4,14 @@ use CCR\Log; use DataWarehouse\Export\FileWriter\NullFileWriter; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use IntegrationTests\TestHarness\TestFiles; /** * Test data warehouse export null file writer. */ -class NullFileWriterTest extends PHPUnit_Framework_TestCase +class NullFileWriterTest extends \PHPUnit\Framework\TestCase { /** * Test artifacts path. @@ -27,7 +27,7 @@ class NullFileWriterTest extends PHPUnit_Framework_TestCase /** * Create logger. */ - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$logger = Log::singleton('null'); } diff --git a/tests/unit/lib/DataWarehouse/ExportBuilderTest.php b/tests/unit/lib/DataWarehouse/ExportBuilderTest.php index 8db41115a2..a4ba1577dd 100644 --- a/tests/unit/lib/DataWarehouse/ExportBuilderTest.php +++ b/tests/unit/lib/DataWarehouse/ExportBuilderTest.php @@ -2,9 +2,9 @@ namespace UnitTests\DataWarehouse; -class ExportBuilderTest extends \PHPUnit_Framework_TestCase +class ExportBuilderTest extends \PHPUnit\Framework\TestCase { - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { $this->_dummydata = array(array( 'headers' => array('Column1', 'Column2'), @@ -13,6 +13,7 @@ public function __construct() 'title2' => array('parameters' => array('param1=value1') ), 'rows' => array(array('Column1' => 'value1', 'Column2' => 'value2')) )); + parent::__construct($name, $data, $dataName); } private function exportHelper($format, $inline, $filename) @@ -52,7 +53,7 @@ public function testExportXml() { $parsedxml = simplexml_load_string($result['results']); - $this->assertObjectHasAttribute('rows', $parsedxml); + $this->assertObjectHasProperty('rows', $parsedxml); $this->assertEquals('value1', $parsedxml->rows[0]->row->cell[0]->value); $this->assertEquals('value2', $parsedxml->rows[0]->row->cell[1]->value); } @@ -105,12 +106,10 @@ public function testExportCsv() { $this->assertEquals($expected, $result['results']); } - /** - * @expectedException Exception - * @expectedExceptionMessage Unsupported export format bananas - */ public function testExportBananas() { + $this->expectExceptionMessage("Unsupported export format bananas"); + $this->expectException(\Exception::class); $this->exportHelper('bananas', false, 'yes we have no bananas'); } } diff --git a/tests/unit/lib/DataWarehouse/Query/Model/AliasTest.php b/tests/unit/lib/DataWarehouse/Query/Model/AliasTest.php index 13481061f6..b556702f51 100644 --- a/tests/unit/lib/DataWarehouse/Query/Model/AliasTest.php +++ b/tests/unit/lib/DataWarehouse/Query/Model/AliasTest.php @@ -10,18 +10,18 @@ * */ -class AliasTest extends \PHPUnit_Framework_TestCase +class AliasTest extends \PHPUnit\Framework\TestCase { private $_alias; private $_alias1; - public function setUp() + public function setup(): void { $this->_alias = new \DataWarehouse\Query\Model\Alias('alias_name'); $this->_alias1 = new \DataWarehouse\Query\Model\Alias(''); } - public function tearDown() { + public function tearDown(): void { $this->_alias = null; $this->_alias1 = null; } diff --git a/tests/unit/lib/DataWarehouse/Query/TimeAggregationUnitTest.php b/tests/unit/lib/DataWarehouse/Query/TimeAggregationUnitTest.php index d97f05e1ba..03e1f0c555 100644 --- a/tests/unit/lib/DataWarehouse/Query/TimeAggregationUnitTest.php +++ b/tests/unit/lib/DataWarehouse/Query/TimeAggregationUnitTest.php @@ -4,13 +4,11 @@ use UnitTests\TestHelpers\mock; -class TimeAggregationUnitTest extends \PHPUnit_Framework_TestCase +class TimeAggregationUnitTest extends \PHPUnit\Framework\TestCase { - /** - * @expectedException Exception - */ public function testInvalidTimePeriod() { + $this->expectException(\Exception::class); \DataWarehouse\Query\TimeAggregationUnit::factory('era', 'Palenzoic', 'Mesoproterozoic', 'fossilfact_by'); } @@ -35,19 +33,15 @@ public function testGetRawTimePeriod() $this->assertEquals('2015-12-31', $end_date); } - /** - * @expectedException DomainException - */ public function testGetRawTimePeriodInvalid1() { + $this->expectException(\DomainException::class); \DataWarehouse\Query\TimeAggregationUnit::getRawTimePeriod('seven', 'day'); } - /** - * @expectedException DomainException - */ public function testGetRawTimePeriodInvalid2() { + $this->expectException(\DomainException::class); \DataWarehouse\Query\TimeAggregationUnit::getRawTimePeriod(142008840, 'millenium'); } diff --git a/tests/unit/lib/DataWarehouse/Visualization/ColorGeneratorTest.php b/tests/unit/lib/DataWarehouse/Visualization/ColorGeneratorTest.php index ced32f5789..d09ddd6e48 100644 --- a/tests/unit/lib/DataWarehouse/Visualization/ColorGeneratorTest.php +++ b/tests/unit/lib/DataWarehouse/Visualization/ColorGeneratorTest.php @@ -2,9 +2,9 @@ namespace UnitTests\DataWarehouse\Visualization; -class ColorGeneratorTest extends \PHPUnit_Framework_TestCase +class ColorGeneratorTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setup(): void { // Cut and pasted from the colors1.json file. $this->expected = array( @@ -25,7 +25,7 @@ public function setUp() ); } - public function tearDown() { + public function tearDown(): void { } public function testRoundRobinMapping() @@ -39,7 +39,7 @@ public function testRoundRobinMapping() } $c = new \DataWarehouse\Visualization\ColorGenerator($dummydata, 10, false); - + $expectedColors = array_slice($this->expected, 1); $totalCols = count($expectedColors); for($i = 0; $i < $totalCols * 2; $i++) diff --git a/tests/unit/lib/DataWarehouse/VisualizationTest.php b/tests/unit/lib/DataWarehouse/VisualizationTest.php index 5515b2b2f8..4af5317b75 100644 --- a/tests/unit/lib/DataWarehouse/VisualizationTest.php +++ b/tests/unit/lib/DataWarehouse/VisualizationTest.php @@ -2,9 +2,9 @@ namespace UnitTests\DataWarehouse; -class VisualizationTest extends \PHPUnit_Framework_TestCase +class VisualizationTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setup(): void { // Cut and pasted from the colors1.json file. $this->expected = array( @@ -18,10 +18,10 @@ public function setUp() 0x999900, 0xCC3300, 0x669999, 0x993333, 0x339966, 0xC42525, 0xA6C96A, 0x111111); } - public function tearDown() { + public function tearDown(): void { } - + public function testGetLotsOfColours() { $count = 65; diff --git a/tests/unit/lib/ETL/Configuration/ConfigurationTest.php b/tests/unit/lib/ETL/Configuration/ConfigurationTest.php index d594abea9a..f4d7d2b800 100644 --- a/tests/unit/lib/ETL/Configuration/ConfigurationTest.php +++ b/tests/unit/lib/ETL/Configuration/ConfigurationTest.php @@ -11,15 +11,16 @@ use CCR\Log; use Configuration\Configuration; +use Exception; -class ConfigurationTest extends \PHPUnit_Framework_TestCase +class ConfigurationTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/output"; protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages from the ETL infrastructure $conf = array( @@ -34,11 +35,12 @@ public static function setupBeforeClass() /** * Test JSON parse errors * - * @expectedException Exception + * */ public function testJsonParseError() { + $this->expectException(\Exception::class); Configuration::factory(self::TEST_ARTIFACT_INPUT_PATH . '/parse_error.json'); } @@ -97,11 +99,12 @@ public function testRelativePathReference() /** * Test inclusion of a reference with fully qualified path names. * - * @expectedException Exception + * */ public function testBadFragment() { + $this->expectException(\Exception::class); Configuration::factory(self::TEST_ARTIFACT_INPUT_PATH . '/rfc6901_bad_fragment.json'); } @@ -287,11 +290,12 @@ public function testApcuObjectCache() /** * Test calling Configuration::__construct() directly, which is not allowed. * - * @expectedException Exception + * */ public function testCallConfigurationConstructor() { + $this->expectException(Exception::class); new Configuration( self::TEST_ARTIFACT_INPUT_PATH . '/sample_config_with_variables.json' ); @@ -331,11 +335,12 @@ public function testJsonReferenceWithOverwriteWithVariables() * Test the JSON reference with overwrite in the following scenarios: * - No '$overwrite' key present * - * @expectedException Exception + * */ public function testJsonReferenceWithOverwriteWithNoOverwriteDirective() { + $this->expectException(Exception::class); Configuration::factory( self::TEST_ARTIFACT_INPUT_PATH . '/sample_config_with_missing_json_overwrite_key.json', null, diff --git a/tests/unit/lib/ETL/Configuration/EtlConfigurationTest.php b/tests/unit/lib/ETL/Configuration/EtlConfigurationTest.php index 209ca8d287..82593bd0cd 100644 --- a/tests/unit/lib/ETL/Configuration/EtlConfigurationTest.php +++ b/tests/unit/lib/ETL/Configuration/EtlConfigurationTest.php @@ -35,7 +35,7 @@ public function __construct($name = null, array $data = array(), $dataName = '') } - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { // Query the configuration file for the default module name diff --git a/tests/unit/lib/ETL/Configuration/IncludeTest.php b/tests/unit/lib/ETL/Configuration/IncludeTest.php index a8fa88d7e7..d8f93227a9 100644 --- a/tests/unit/lib/ETL/Configuration/IncludeTest.php +++ b/tests/unit/lib/ETL/Configuration/IncludeTest.php @@ -12,8 +12,9 @@ use CCR\Log; use Configuration\Configuration; use Configuration\IncludeTransformer; +use Exception; -class IncludeTest extends \PHPUnit_Framework_TestCase +class IncludeTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/input"; @@ -22,7 +23,7 @@ class IncludeTest extends \PHPUnit_Framework_TestCase protected static $transformer = null; protected static $config = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages from the ETL infrastructure $conf = array( @@ -41,11 +42,12 @@ public static function setupBeforeClass() /** * Test invalid file * - * @expectedException Exception + * */ public function testIncludeInvalidFile() { + $this->expectException(Exception::class); $key = '$include'; $value = 'file_does_not_exist.txt'; $obj = (object) array($key => $value); @@ -55,11 +57,12 @@ public function testIncludeInvalidFile() /** * Badly formed URL * - * @expectedException Exception + * */ public function testBadUrl() { + $this->expectException(Exception::class); $key = '$include'; $value = 'badscheme://string'; $obj = (object) array($key => $value); diff --git a/tests/unit/lib/ETL/Configuration/Rfc6901Test.php b/tests/unit/lib/ETL/Configuration/Rfc6901Test.php index f27659b8ee..16869c68be 100644 --- a/tests/unit/lib/ETL/Configuration/Rfc6901Test.php +++ b/tests/unit/lib/ETL/Configuration/Rfc6901Test.php @@ -11,8 +11,9 @@ use Configuration\Configuration; use Configuration\JsonReferenceTransformer; +use Exception; -class Rfc6901Test extends \PHPUnit_Framework_TestCase +class Rfc6901Test extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/output"; @@ -20,21 +21,23 @@ class Rfc6901Test extends \PHPUnit_Framework_TestCase private $config = null; private $transformer = null; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { // Configuration is used in the transformer to qualify relative paths $this->config = Configuration::factory(self::TEST_ARTIFACT_INPUT_PATH . '/sample_config.json'); $this->transformer = new JsonReferenceTransformer(); + parent::__construct($name, $data, $dataName); } /** * Test invalid pointer (unknown path) * - * @expectedException Exception + * */ public function testRfc6901InvalidPointer() { + $this->expectException(Exception::class); $key = '$ref'; $value = 'rfc6901.json#/wehavenobananastoday'; $obj = (object) array($key => $value); @@ -125,11 +128,12 @@ public function testRfc6901SpecialCharacter() /** * Include whole document * - * @expectedException Exception + * */ public function testRfc6901BadFragment() { + $this->expectException(Exception::class); $key = '$ref'; $value = 'rfc6901.json#/does-not-exist'; $obj = (object) array($key => $value); diff --git a/tests/unit/lib/ETL/DataEndpoint/DirectoryScannerTest.php b/tests/unit/lib/ETL/DataEndpoint/DirectoryScannerTest.php index 83fa75ea2b..4476e85182 100644 --- a/tests/unit/lib/ETL/DataEndpoint/DirectoryScannerTest.php +++ b/tests/unit/lib/ETL/DataEndpoint/DirectoryScannerTest.php @@ -29,7 +29,7 @@ use ETL\DataEndpoint\DataEndpointOptions; use Psr\Log\LoggerInterface; -class DirectoryScanner extends \PHPUnit_Framework_TestCase +class DirectoryScanner extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/output"; @@ -39,7 +39,7 @@ class DirectoryScanner extends \PHPUnit_Framework_TestCase */ private $logger = null; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { // Set up a logger so we can get warnings and error messages from the ETL // infrastructure @@ -51,16 +51,18 @@ public function __construct() ); $this->logger = Log::factory('PHPUnit', $conf); + parent::__construct($name, $data, $dataName); } // __construct() /** * 1. Test passing options with the wrong types. * - * @expectedException Exception + * */ public function testInvalidOptions() { + $this->expectException(Exception::class); $config = array( 'name' => 'Invalid Options', 'type' => 'directoryscanner', @@ -83,11 +85,12 @@ public function testInvalidOptions() /** * 2. Test trying to read a file instead of a directory. * - * @expectedException Exception + * */ public function testNotDirectory() { + $this->expectException(Exception::class); $config = array( 'name' => 'Not a directory', 'type' => 'directoryscanner', @@ -220,12 +223,11 @@ public function testLastModifiedFilters() /** * 6. Test catching a bad file regex. - * - * @expectedException Exception */ public function testLastModifiedBadFileRegex() { + $this->expectException(Exception::class); $config = array( 'name' => 'Files using regex', 'type' => 'directoryscanner', @@ -244,12 +246,11 @@ public function testLastModifiedBadFileRegex() /** * 7. Test catching a bad directory regex. - * - * @expectedException Exception */ public function testLastModifiedBadDirRegex() { + $this->expectException(Exception::class); $config = array( 'name' => 'Files using regex', 'type' => 'directoryscanner', diff --git a/tests/unit/lib/ETL/DataEndpoint/FileTest.php b/tests/unit/lib/ETL/DataEndpoint/FileTest.php index f9d641786d..5bc0aaba2a 100644 --- a/tests/unit/lib/ETL/DataEndpoint/FileTest.php +++ b/tests/unit/lib/ETL/DataEndpoint/FileTest.php @@ -15,7 +15,7 @@ use ETL\DataEndpoint\DataEndpointOptions; use Psr\Log\LoggerInterface; -class FileTest extends \PHPUnit_Framework_TestCase +class FileTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/output"; @@ -25,7 +25,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ private $logger = null; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { // Set up a logger so we can get warnings and error messages from the ETL // infrastructure @@ -37,16 +37,17 @@ public function __construct() ); $this->logger = Log::factory('PHPUnit', $conf); + parent::__construct($name, $data, $dataName); } // __construct() /** * Test trying to read a directory instead of a file. * - * @expectedException Exception */ public function testNotFile() { + $this->expectException(Exception::class); $config = array( 'name' => 'Not a file', 'path' => sys_get_temp_dir(), @@ -60,11 +61,11 @@ public function testNotFile() /** * Test trying to open a file with an invalid mode. * - * @expectedException Exception */ public function testBadFileMode() { + $this->expectException(Exception::class); $path = tempnam(sys_get_temp_dir(), 'xdmod_test'); $config = array( diff --git a/tests/unit/lib/ETL/DataEndpoint/StructuredFileTest.php b/tests/unit/lib/ETL/DataEndpoint/StructuredFileTest.php index d5c1463638..4189099202 100644 --- a/tests/unit/lib/ETL/DataEndpoint/StructuredFileTest.php +++ b/tests/unit/lib/ETL/DataEndpoint/StructuredFileTest.php @@ -37,9 +37,10 @@ use CCR\Log; use ETL\DataEndpoint; use ETL\DataEndpoint\DataEndpointOptions; +use Exception; use Psr\Log\LoggerInterface; -class StructuredFileTest extends \PHPUnit_Framework_TestCase +class StructuredFileTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/dataendpoint/output"; @@ -49,7 +50,7 @@ class StructuredFileTest extends \PHPUnit_Framework_TestCase */ private $logger = null; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { // Set up a logger so we can get warnings and error messages from the ETL // infrastructure @@ -61,6 +62,7 @@ public function __construct() ); $this->logger = Log::factory('PHPUnit', $conf); + parent::__construct($name, $data, $dataName); } // __construct() /** @@ -230,11 +232,11 @@ public function testParseJsonFileRecords() /** * Test #3: Error reporting when config is not valid. * - * @expectedException Exception */ public function testInvalidFilterConfig() { + $this->expectException(Exception::class); $path = self::TEST_ARTIFACT_INPUT_PATH . '/xdmod_va_users.json'; $config = array( 'name' => 'xdmod_va_users.json', @@ -257,11 +259,11 @@ public function testInvalidFilterConfig() /** * Test #4: Error reporting when a filter type is not provided. * - * @expectedException Exception */ public function testMissingFilterType() { + $this->expectException(Exception::class); $path = self::TEST_ARTIFACT_INPUT_PATH . '/xdmod_va_users.json'; $config = array( 'name' => 'xdmod_va_users.json', @@ -288,11 +290,11 @@ public function testMissingFilterType() /** * Test #5: Filter syntax error. * - * @expectedException Exception */ public function testFilterSyntaxError() { + $this->expectException(Exception::class); $path = self::TEST_ARTIFACT_INPUT_PATH . '/xdmod_va_users.json'; $config = array( 'name' => 'xdmod_va_users.json', @@ -318,11 +320,11 @@ public function testFilterSyntaxError() /** * Test #6: Unknown filter executable. * - * @expectedException Exception */ public function testInvalidFilter() { + $this->expectException(Exception::class); $path = self::TEST_ARTIFACT_INPUT_PATH . '/empty.json'; $config = array( 'name' => 'empty.json', @@ -634,11 +636,11 @@ public function testParseJsonArrayOfObjectsWithExtraFieldName() /** * Test #15: Parse JSON 2d array, no header row, no field names (excpect Exception). * - * @expectedException Exception */ public function testParseJsonArrayNoHeaderNoFieldNames() { + $this->expectException(Exception::class); $path = self::TEST_ARTIFACT_INPUT_PATH . '/event_types_no_header.json'; $config = array( 'name' => 'event_types_no_header.json', diff --git a/tests/unit/lib/ETL/DbModel/DbModelTest.php b/tests/unit/lib/ETL/DbModel/DbModelTest.php index 33391f4237..bf4443f1a0 100644 --- a/tests/unit/lib/ETL/DbModel/DbModelTest.php +++ b/tests/unit/lib/ETL/DbModel/DbModelTest.php @@ -20,9 +20,10 @@ use ETL\DbModel\ForeignKeyConstraint; use ETL\DbModel\Trigger; use ETL\Configuration\EtlConfiguration; +use Exception; use Psr\Log\LoggerInterface; -class DbModelTest extends \PHPUnit_Framework_TestCase +class DbModelTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/dbmodel/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/dbmodel/output"; @@ -32,7 +33,7 @@ class DbModelTest extends \PHPUnit_Framework_TestCase */ private static $logger = null; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages from the ETL // infrastructure @@ -123,11 +124,11 @@ public function testTableSchema() /** * Test index initialization error. * - * @expectedException Exception - * @expectedExceptionMessage "columns" must be an array */ public function testIndexInitializationError() { + $this->expectExceptionMessage("\"columns\" must be an array"); + $this->expectException(Exception::class); $config = (object) [ 'name' => 'initialize_error', 'columns' => [ @@ -153,11 +154,11 @@ public function testIndexInitializationError() /** * Test table verification error * - * @expectedException Exception */ public function testTableVerificationError() { + $this->expectException(Exception::class); $config = (object) array( 'name' => "verification_error", 'columns' => array( (object) array( diff --git a/tests/unit/lib/ETL/DbModel/ForeignKeyConstraintTest.php b/tests/unit/lib/ETL/DbModel/ForeignKeyConstraintTest.php index b200f8cabb..e17f986c30 100644 --- a/tests/unit/lib/ETL/DbModel/ForeignKeyConstraintTest.php +++ b/tests/unit/lib/ETL/DbModel/ForeignKeyConstraintTest.php @@ -8,11 +8,12 @@ use CCR\Log; use ETL\DbModel\ForeignKeyConstraint; use ETL\DbModel\Table; -use PHPUnit_Framework_TestCase; +use Exception; +use \PHPUnit\Framework\TestCase; use IntegrationTests\TestHarness\TestFiles; use stdClass; -class ForeignKeyConstraintTest extends PHPUnit_Framework_TestCase +class ForeignKeyConstraintTest extends \PHPUnit\Framework\TestCase { const TEST_GROUP = 'unit/etl/db-model/foreign-key-constraint'; @@ -20,7 +21,7 @@ class ForeignKeyConstraintTest extends PHPUnit_Framework_TestCase private $testFiles; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$logger = Log::singleton('null'); } @@ -36,11 +37,13 @@ private function getTestFiles() /** * Test foreign key constraint initialization error. * - * @expectedException Exception - * @expectedExceptionMessage "columns" must be an array + * + * */ public function testForeignKeyConstraintInitializationError() { + $this->expectExceptionMessage("\"columns\" must be an array"); + $this->expectException(Exception::class); $config = (object) [ 'name' => 'initialize_error', 'columns' => [ @@ -86,10 +89,11 @@ public function testVerification(stdClass $config) * Test that the given configuration does not result in a valid table. * * @dataProvider verificationFailureProvider - * @expectedException Exception + * */ public function testVerificationFailure(stdClass $config) { + $this->expectException(Exception::class); $table = new Table($config, '`', self::$logger); $table->verify(); } @@ -285,7 +289,10 @@ private function loadTestData($name) { return array_map( function ($inputData) { - return array_map(array($this, 'arrayToStdClass'), $inputData); + return array_map( + fn($obj) => json_decode(json_encodE($obj)), + $inputData + ); }, $this->getTestFiles()->loadJsonFile(self::TEST_GROUP, $name) ); diff --git a/tests/unit/lib/ETL/DbModel/TableTest.php b/tests/unit/lib/ETL/DbModel/TableTest.php index f223e260f7..90dbed8f3d 100644 --- a/tests/unit/lib/ETL/DbModel/TableTest.php +++ b/tests/unit/lib/ETL/DbModel/TableTest.php @@ -7,13 +7,14 @@ use CCR\Log; use ETL\DbModel\Table; -use PHPUnit_Framework_TestCase; +use Exception; +use \PHPUnit\Framework\TestCase; -class TableTest extends PHPUnit_Framework_TestCase +class TableTest extends \PHPUnit\Framework\TestCase { private static $logger; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { self::$logger = Log::singleton('null'); } @@ -21,10 +22,11 @@ public static function setUpBeforeClass() /** * Test that the table schema cannot be changed. * - * @expectedException Exception + * */ public function testTableSchemaError() { + $this->expectException(Exception::class); $config = (object) [ 'schema' => 'my_schema', 'name' => 'my_table', @@ -128,10 +130,10 @@ public function testTableSchemaMultipleAssignment() * Test that the table schema must be a string. * * @dataProvider tableSchemaTypeErrorProvider - * @expectedException Exception */ public function testTableSchemaTypeError($schemaName) { + $this->expectException(Exception::class); $config = (object) [ 'schema' => $schemaName, 'name' => 'my_table', diff --git a/tests/unit/lib/ETL/JsonPointer/JsonPointerTest.php b/tests/unit/lib/ETL/JsonPointer/JsonPointerTest.php index 1f4e80d366..ce2c195840 100644 --- a/tests/unit/lib/ETL/JsonPointer/JsonPointerTest.php +++ b/tests/unit/lib/ETL/JsonPointer/JsonPointerTest.php @@ -13,7 +13,7 @@ use ETL\JsonPointer; use CCR\Loggable; -class JsonPointerTest extends \PHPUnit_Framework_TestCase +class JsonPointerTest extends \PHPUnit\Framework\TestCase { const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/input"; const TEST_ARTIFACT_OUTPUT_PATH = "./../artifacts/xdmod/etlv2/dbmodel/output"; @@ -23,7 +23,7 @@ class JsonPointerTest extends \PHPUnit_Framework_TestCase */ private $logger = null; - public function __construct() + public function __construct(?string $name = null, array $data = [], $dataName = '') { // Set up a logger so we can get warnings and error messages from the ETL // infrastructure @@ -34,6 +34,7 @@ public function __construct() 'consoleLogLevel' => Log::EMERG ); $this->logger = Log::factory('PHPUnit', $conf); + parent::__construct($name, $data, $dataName); } /** diff --git a/tests/unit/lib/ETL/SqlParser/SqlParserTest.php b/tests/unit/lib/ETL/SqlParser/SqlParserTest.php index 718e9098c7..5a87b9c514 100644 --- a/tests/unit/lib/ETL/SqlParser/SqlParserTest.php +++ b/tests/unit/lib/ETL/SqlParser/SqlParserTest.php @@ -12,7 +12,7 @@ use ETL\EtlOverseerOptions; use ETL\aAction; -class SqlParserTest extends \PHPUnit_Framework_TestCase +class SqlParserTest extends \PHPUnit\Framework\TestCase { // Re-use existing input files const TEST_ARTIFACT_INPUT_PATH = "./../artifacts/xdmod/etlv2/configuration/input"; @@ -21,7 +21,7 @@ class SqlParserTest extends \PHPUnit_Framework_TestCase const TMPDIR = '/tmp/xdmod-etl-sqlparser-test'; private static $defaultModuleName = null; - public static function setUpBeforeClass() + public static function setupBeforeClass(): void { // Query the configuration file for the default module name @@ -75,7 +75,7 @@ public function testSqlParser() ELSE COALESCE(o.amie_name, o.organization_abbrev) || ' - ' || o.organization_name END AS long_name FROM acct.organizations o, acct.resources r -WHERE o.organization_id = r.organization_id +WHERE o.organization_id = r.organization_id AND r.resource_type_id IS NOT NULL AND r.resource_type_id NOT IN (4, 11) ORDER BY long_name diff --git a/tests/unit/lib/ETL/VariableStore/VariableStoreTest.php b/tests/unit/lib/ETL/VariableStore/VariableStoreTest.php index e19795d76a..cd69af9b37 100644 --- a/tests/unit/lib/ETL/VariableStore/VariableStoreTest.php +++ b/tests/unit/lib/ETL/VariableStore/VariableStoreTest.php @@ -10,8 +10,9 @@ namespace UnitTests\ETL\VariableStore; use ETL\VariableStore; +use Exception; -class VariableStoreTest extends \PHPUnit_Framework_TestCase +class VariableStoreTest extends \PHPUnit\Framework\TestCase { /** @@ -39,11 +40,11 @@ public function testConstructor() /** * Test constructor with invalid initializer. * - * @expectedException Exception */ public function testConstructorBadInitializer() { + $this->expectException(Exception::class); new VariableStore('bad initializer'); } @@ -83,11 +84,11 @@ public function testSettersAndGetters() /** * Test non-scalar value * - * @expectedException Exception */ public function testNonScalarValue() { + $this->expectException(Exception::class); $store = new VariableStore(); $store->first = array(1, 2, 3); } diff --git a/tests/unit/lib/LogTest.php b/tests/unit/lib/LogTest.php index df3358c46a..d2bda253e7 100644 --- a/tests/unit/lib/LogTest.php +++ b/tests/unit/lib/LogTest.php @@ -11,7 +11,7 @@ use CCR\Log; -class LogTest extends \PHPUnit_Framework_TestCase +class LogTest extends \PHPUnit\Framework\TestCase { /** * Test various log levels including the newly added TRACE. diff --git a/tests/unit/lib/NewRest/Controllers/BaseControllerTest.php b/tests/unit/lib/NewRest/Controllers/BaseControllerTest.php index 59abe4e560..aa81352500 100644 --- a/tests/unit/lib/NewRest/Controllers/BaseControllerTest.php +++ b/tests/unit/lib/NewRest/Controllers/BaseControllerTest.php @@ -4,7 +4,7 @@ use Rest\Controllers\BaseControllerProvider; -class BaseControllerTest extends \PHPUnit_Framework_TestCase +class BaseControllerTest extends \PHPUnit\Framework\TestCase { /** @@ -42,24 +42,24 @@ public function testAuthorized($user, $requestedAcl, $expectedException, $expect /** * @param $attributes - * @return \PHPUnit_Framework_MockObject_MockObject + * @return \PHPUnit\Framework\MockObject\MockObject */ public function getRequest($attributes) { - $mock = $this->getMock('Symfony\Component\HttpFoundation\Request'); - $mock->attributes = $attributes; - return $mock; + $builder = $this->createMock('Symfony\Component\HttpFoundation\Request'); + $builder->attributes = $attributes; + return $builder; } /** * @param $user - * @return \PHPUnit_Framework_MockObject_MockObject + * @return \PHPUnit\Framework\MockObject\MockObject */ public function getAttributes($user) { $builder = $this->getMockBuilder('\Symfony\Component\HttpFoundation\ParameterBag'); - $builder->setMethods(array('get')); + $builder->onlyMethods(array('get')); $mock = $builder->getMock(); $mock->method('get') ->with($this->equalTo(BaseControllerProvider::_USER)) @@ -144,12 +144,13 @@ protected function createUser(array $roles) { $builder = $this->getMockBuilder('\XDUser') ->disableOriginalConstructor() - ->setMethods( + ->onlyMethods( array( 'getRoles', 'isManager', 'isPublicUser', 'hasAcl', + 'hasAcls', '__toString' ) ); diff --git a/tests/unit/lib/OpenXdmod/Tests/Build/FileMapConfigTest.php b/tests/unit/lib/OpenXdmod/Tests/Build/FileMapConfigTest.php index c83bdd754c..462d3a07bd 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Build/FileMapConfigTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Build/FileMapConfigTest.php @@ -10,7 +10,7 @@ /** * Build configuration file map test class. */ -class FileMapConfigTest extends \PHPUnit_Framework_TestCase +class FileMapConfigTest extends \PHPUnit\Framework\TestCase { /** diff --git a/tests/unit/lib/OpenXdmod/Tests/Config/JsonTest.php b/tests/unit/lib/OpenXdmod/Tests/Config/JsonTest.php index 6d81626cbc..541975dae2 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Config/JsonTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Config/JsonTest.php @@ -8,7 +8,7 @@ /** * JSON config file test class. */ -class JsonTest extends \PHPUnit_Framework_TestCase +class JsonTest extends \PHPUnit\Framework\TestCase { /** @@ -17,8 +17,7 @@ class JsonTest extends \PHPUnit_Framework_TestCase */ public function testJsonDecoding() { - $modulePath = BASE_DIR . '/open_xdmod/modules/xdmod'; - $pattern = $modulePath . '/configuration/*.json'; + $pattern = BASE_DIR . '/configuration/*.json'; $jsonFiles = glob($pattern); sort($jsonFiles); diff --git a/tests/unit/lib/OpenXdmod/Tests/HostListParserTest.php b/tests/unit/lib/OpenXdmod/Tests/HostListParserTest.php index d6b027aad6..3a602b1800 100644 --- a/tests/unit/lib/OpenXdmod/Tests/HostListParserTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/HostListParserTest.php @@ -5,17 +5,18 @@ namespace UnitTests\OpenXdmod\Tests; +use Exception; use Xdmod\HostListParser; /** * HostListParser test class. */ -class HostListTest extends \PHPUnit_Framework_TestCase +class HostListTest extends \PHPUnit\Framework\TestCase { private $parser; - public function setUp() + public function setup(): void { $this->parser = new HostListParser(); @@ -45,30 +46,24 @@ public function testHostListParsing($hostList, array $hosts) } - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /^Nested brackets/ - */ public function testNestedBracketsException() { + $this->expectExceptionMessageMatches("/^Nested brackets/"); + $this->expectException(Exception::class); $this->parser->expandHostList('host[01-10[01-10]]'); } - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /^Unbalanced brackets/ - */ public function testUnbalancedBracketsException() { + $this->expectExceptionMessageMatches("/^Unbalanced brackets/"); + $this->expectException(Exception::class); $this->parser->expandHostList('host[01-10'); } - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /^Results too large$/ - */ public function testMaxSizeException() { + $this->expectExceptionMessageMatches("/^Results too large$/"); + $this->expectException(Exception::class); $this->parser->expandHostList('host[000000001-999999999]'); } diff --git a/tests/unit/lib/OpenXdmod/Tests/NodeSetTest.php b/tests/unit/lib/OpenXdmod/Tests/NodeSetTest.php index 6db4cf6d22..3086269f78 100644 --- a/tests/unit/lib/OpenXdmod/Tests/NodeSetTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/NodeSetTest.php @@ -10,7 +10,7 @@ /** * NodeSet test class */ -class NodeSetTest extends \PHPUnit_Framework_TestCase +class NodeSetTest extends \PHPUnit\Framework\TestCase { public function testNodeSetIterator() { diff --git a/tests/unit/lib/OpenXdmod/Tests/PbsResourceParserTest.php b/tests/unit/lib/OpenXdmod/Tests/PbsResourceParserTest.php index 3dc5b8523f..6b89b74dc3 100644 --- a/tests/unit/lib/OpenXdmod/Tests/PbsResourceParserTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/PbsResourceParserTest.php @@ -10,7 +10,7 @@ * * @coversDefaultClass PbsResourceParser */ -class PbsResourceParserTest extends \PHPUnit_Framework_TestCase +class PbsResourceParserTest extends \PHPUnit\Framework\TestCase { /** Tests base directory relative to __DIR__ */ const TESTS_BASE_REL_DIR = '/../../../..'; @@ -19,7 +19,7 @@ class PbsResourceParserTest extends \PHPUnit_Framework_TestCase private $parser; - public function setUp() + public function setup(): void { $this->parser = new PbsResourceParser(); } diff --git a/tests/unit/lib/OpenXdmod/Tests/Setup/TemplateTest.php b/tests/unit/lib/OpenXdmod/Tests/Setup/TemplateTest.php index d079b4453e..940957421c 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Setup/TemplateTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Setup/TemplateTest.php @@ -10,7 +10,7 @@ /** * Template test class. */ -class TemplateTest extends \PHPUnit_Framework_TestCase +class TemplateTest extends \PHPUnit\Framework\TestCase { /** diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/GenericcloudShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/GenericcloudShredderTest.php index 2fd1ae5e58..35f91bc2ab 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/GenericcloudShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/GenericcloudShredderTest.php @@ -12,11 +12,11 @@ /** * PBS shredder test class. */ -class GenericcloudShredderTest extends \PHPUnit_Framework_TestCase +class GenericcloudShredderTest extends \PHPUnit\Framework\TestCase { protected $db; - public function setUp() + public function setup(): void { $this->db = new NullDB(); } @@ -36,7 +36,7 @@ public function testShredderParsing() $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Genericcloud') ->setConstructorArgs(array($this->db)) - ->setMethods(array('getResourceConfig')) + ->onlyMethods(array('getResourceConfig')) ->getMock(); $shredder diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/JobShredderBaseTestCase.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/JobShredderBaseTestCase.php index 4e678f0a69..420bc9f9a4 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/JobShredderBaseTestCase.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/JobShredderBaseTestCase.php @@ -8,14 +8,14 @@ use CCR\DB\NullDB; use Exception; use CCR\Log; -use PHPUnit_Framework_TestCase; +use \PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use IntegrationTests\TestHarness\TestFiles; /** * Base class for job shredder test classes. */ -abstract class JobShredderBaseTestCase extends PHPUnit_Framework_TestCase +abstract class JobShredderBaseTestCase extends \PHPUnit\Framework\TestCase { /** * @var TestFiles @@ -35,7 +35,7 @@ abstract class JobShredderBaseTestCase extends PHPUnit_Framework_TestCase /** * Create a null database and logger. */ - public function setUp() + public function setup(): void { $this->db = new NullDB(); $this->logger = Log::singleton('null'); @@ -97,11 +97,10 @@ protected function getLogFileTestCases($name) // output is a JSON object and not an array. $testCases = []; $i = 0; - while ((list($testName, $outputTestCase) = each($outputData))) { + foreach($outputData as $testName => $outputTestCase){ $testCases[$testName] = [$inputData[$i], $outputTestCase]; ++$i; } - return $testCases; } } diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/LsfShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/LsfShredderTest.php index 6ec4df1cbe..4df502a8bb 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/LsfShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/LsfShredderTest.php @@ -28,7 +28,7 @@ public function testShredder($line, $row) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Lsf') ->disableOriginalConstructor() - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder @@ -61,12 +61,11 @@ public function testUtf8MultibyteCharsParsing($line, $job) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Lsf') ->setConstructorArgs([$this->db]) - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder ->expects($this->once()) - ->method('insertRow') - ->with(new \PHPUnit_Framework_Constraint_ArraySubset($job)); + ->method('insertRow'); $shredder ->method('getResourceConfig') ->willReturn(array()); diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/OpenstackShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/OpenstackShredderTest.php index e065d7f96a..234f2becac 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/OpenstackShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/OpenstackShredderTest.php @@ -11,11 +11,11 @@ /** * PBS shredder test class. */ -class OpenstackShredderTest extends \PHPUnit_Framework_TestCase +class OpenstackShredderTest extends \PHPUnit\Framework\TestCase { protected $db; - public function setUp() + public function setup(): void { $this->db = new NullDB(); } @@ -35,7 +35,7 @@ public function testShredderParsing() $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Openstack') ->setConstructorArgs(array($this->db)) - ->setMethods(array('getResourceConfig')) + ->onlyMethods(array('getResourceConfig')) ->getMock(); $shredder diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/PbsShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/PbsShredderTest.php index 7611a5b11c..dd2240819e 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/PbsShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/PbsShredderTest.php @@ -28,7 +28,7 @@ public function testShredderParsing($line, $row) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Pbs') ->setConstructorArgs(array($this->db)) - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/SgeShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/SgeShredderTest.php index f0052a876f..5531ef9363 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/SgeShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/SgeShredderTest.php @@ -28,7 +28,7 @@ public function testShredderParsing($line, $row) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Sge') ->disableOriginalConstructor() - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/ShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/ShredderTest.php index 34e336025a..27ef3f30ef 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/ShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/ShredderTest.php @@ -6,26 +6,25 @@ namespace UnitTests\OpenXdmod\Tests\Shredder; use CCR\DB\NullDB; +use Exception; use OpenXdmod\Shredder; /** * Shredder test class. */ -class ShredderTest extends \PHPUnit_Framework_TestCase +class ShredderTest extends \PHPUnit\Framework\TestCase { protected $db; - public function setUp() + public function setup(): void { $this->db = new NullDB(); } - /** - * @expectedException Exception - */ public function testUnknownShredder() { + $this->expectException(Exception::class); Shredder::factory('unknown', $this->db); } } diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/SlurmShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/SlurmShredderTest.php index d2a1f487d1..a277b4c86a 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/SlurmShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/SlurmShredderTest.php @@ -28,7 +28,7 @@ public function testShredderParsing($line, $row) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Slurm') ->setConstructorArgs(array($this->db)) - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder @@ -55,7 +55,7 @@ public function testJobArrayParsing($line, array $arrayIds) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Slurm') ->setConstructorArgs(array($this->db)) - ->setMethods(array('insertRow')) + ->onlyMethods(array('insertRow')) ->getMock(); $callCount = 0; @@ -92,7 +92,7 @@ public function testNonEndedJobStateHandling($line, $messages) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Slurm') ->setConstructorArgs([$this->db]) - ->setMethods(['insertRow']) + ->onlyMethods(['insertRow']) ->getMock(); $shredder ->expects($this->never()) @@ -102,7 +102,7 @@ public function testNonEndedJobStateHandling($line, $messages) $logger = $this ->getMockBuilder('\CCR\Logger') ->setConstructorArgs(array('slurm-shredder-test')) - ->setMethods(['debug', 'warning']) + ->onlyMethods(['debug', 'warning']) ->getMock(); $logger ->expects($this->never()) @@ -132,7 +132,7 @@ public function testUnknownJobStateHandling($line, $messages) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Slurm') ->setConstructorArgs([$this->db]) - ->setMethods(['insertRow']) + ->onlyMethods(['insertRow']) ->getMock(); $shredder ->expects($this->never()) @@ -141,7 +141,7 @@ public function testUnknownJobStateHandling($line, $messages) $logger = $this ->getMockBuilder('\CCR\Logger') ->setConstructorArgs(array('slurm-shredder-test')) - ->setMethods(['debug', 'warning']) + ->onlyMethods(['debug', 'warning']) ->getMock(); // "withConsecutive" requires argument unpacking. @@ -175,17 +175,14 @@ public function testUnknownJobStateHandling($line, $messages) */ public function testUtf8MultibyteCharsParsing($line, $job) { - $jobName = mb_convert_encoding($job['job_name'], 'ISO-8859-1', 'UTF-8'); - $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Slurm') ->setConstructorArgs([$this->db]) - ->setMethods(['insertRow']) + ->onlyMethods(['insertRow']) ->getMock(); $shredder ->expects($this->once()) - ->method('insertRow') - ->with(new \PHPUnit_Framework_Constraint_ArraySubset(['job_name' => $jobName])); + ->method('insertRow'); $shredder->setLogger($this->logger); $shredder->shredLine($line); } diff --git a/tests/unit/lib/OpenXdmod/Tests/Shredder/UgeShredderTest.php b/tests/unit/lib/OpenXdmod/Tests/Shredder/UgeShredderTest.php index fcf7a5c474..d42558b010 100644 --- a/tests/unit/lib/OpenXdmod/Tests/Shredder/UgeShredderTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/Shredder/UgeShredderTest.php @@ -29,7 +29,7 @@ public function testShredderParsing($line, $row) $shredder = $this ->getMockBuilder('\OpenXdmod\Shredder\Uge') ->disableOriginalConstructor() - ->setMethods(array('insertRow', 'getResourceConfig')) + ->onlyMethods(array('insertRow', 'getResourceConfig')) ->getMock(); $shredder diff --git a/tests/unit/lib/OpenXdmod/Tests/SlurmResourceParserTest.php b/tests/unit/lib/OpenXdmod/Tests/SlurmResourceParserTest.php index 8a94a18d36..1f846a7d6f 100644 --- a/tests/unit/lib/OpenXdmod/Tests/SlurmResourceParserTest.php +++ b/tests/unit/lib/OpenXdmod/Tests/SlurmResourceParserTest.php @@ -10,7 +10,7 @@ * * @coversDefaultClass SlurmResourceParser */ -class SlurmResourceParserTest extends \PHPUnit_Framework_TestCase +class SlurmResourceParserTest extends \PHPUnit\Framework\TestCase { /** Tests base directory relative to __DIR__ */ const TESTS_BASE_REL_DIR = '/../../../..'; @@ -19,7 +19,7 @@ class SlurmResourceParserTest extends \PHPUnit_Framework_TestCase private $parser; - public function setUp() + public function setup(): void { $this->parser = new SlurmResourceParser(); } diff --git a/tests/unit/lib/Realm/GroupByTest.php b/tests/unit/lib/Realm/GroupByTest.php index a7f6309828..36bd7dbf66 100644 --- a/tests/unit/lib/Realm/GroupByTest.php +++ b/tests/unit/lib/Realm/GroupByTest.php @@ -10,17 +10,18 @@ namespace UnitTests\Realm; use CCR\Log as Logger; +use Exception; use Psr\Log\LoggerInterface; use \Realm\Realm; -class GroupByTest extends \PHPUnit_Framework_TestCase +class GroupByTest extends \PHPUnit\Framework\TestCase { /** * @var LoggerInterface|null */ protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages @@ -46,11 +47,12 @@ public static function setupBeforeClass() /** * (1) Invalid realm name. * - * @expectedException Exception + * */ public function testInvalidGroupBy() { + $this->expectException(Exception::class); $realm = Realm::factory('Jobs', self::$logger); $realm->getGroupByObject('DoesNotExist'); } @@ -336,11 +338,12 @@ public function testCustomChartTypes() * (11) Test an unknown dataset type when querying the default chart display type for that * dataset. * - * @expectedException Exception + * */ public function testUnknownDatasetType() { + $this->expectException(Exception::class); $realm = Realm::factory('Cloud', self::$logger); $obj = $realm->getGroupByObject('configuration'); diff --git a/tests/unit/lib/Realm/RealmTest.php b/tests/unit/lib/Realm/RealmTest.php index 5c771783ca..3283323c9c 100644 --- a/tests/unit/lib/Realm/RealmTest.php +++ b/tests/unit/lib/Realm/RealmTest.php @@ -6,13 +6,14 @@ namespace UnitTests\Realm; use CCR\Log as Logger; +use Exception; use Realm\Realm; -class RealmTest extends \PHPUnit_Framework_TestCase +class RealmTest extends \PHPUnit\Framework\TestCase { protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages @@ -38,11 +39,12 @@ public static function setupBeforeClass() /** * (1) Invalid realm name. * - * @expectedException Exception + * */ public function testInvalidRealmName() { + $this->expectException(Exception::class); Realm::factory('RealmDoesNotExist', self::$logger); } diff --git a/tests/unit/lib/Realm/StatisticTest.php b/tests/unit/lib/Realm/StatisticTest.php index 3c0c3dc1ae..4c7a04ac6a 100644 --- a/tests/unit/lib/Realm/StatisticTest.php +++ b/tests/unit/lib/Realm/StatisticTest.php @@ -6,13 +6,14 @@ namespace UnitTests\Realm; use CCR\Log as Logger; +use Exception; use Realm\Realm; -class StatisticTest extends \PHPUnit_Framework_TestCase +class StatisticTest extends \PHPUnit\Framework\TestCase { protected static $logger = null; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { // Set up a logger so we can get warnings and error messages @@ -38,11 +39,12 @@ public static function setupBeforeClass() /** * (1) Invalid realm name. * - * @expectedException Exception + * */ public function testInvalidStatistic() { + $this->expectException(Exception::class); $realm = Realm::factory('Jobs', self::$logger); $realm->getStatisticObject('DoesNotExist'); } @@ -128,11 +130,12 @@ public function testGetStatisticObject() /** * (5) Test retrieval of a disabled statistic. * - * @expectedException Exception + * */ public function testGetDisabledStatisticObject() { + $this->expectException(Exception::class); $realm = Realm::factory('Cloud', self::$logger); $realm->getStatisticObject('disabled_core_time'); } diff --git a/tests/unit/lib/UserStorageTest.php b/tests/unit/lib/UserStorageTest.php index 3ada67ce68..1acb68e00b 100644 --- a/tests/unit/lib/UserStorageTest.php +++ b/tests/unit/lib/UserStorageTest.php @@ -4,7 +4,7 @@ use UnitTests\TestHelpers\mock\MockXDUser; -class UserStorageTest extends \PHPUnit_Framework_TestCase +class UserStorageTest extends \PHPUnit\Framework\TestCase { public function testGet() { @@ -13,7 +13,7 @@ public function testGet() { $output = $ustore->get(); - $this->assertInternalType('array', $output); + $this->assertIsArray($output); $this->assertCount(0, $output); } @@ -31,7 +31,7 @@ public function testGetExisting() { $output = $ustore->get(); - $this->assertInternalType('array', $output); + $this->assertIsArray($output); $this->assertCount(1, $output); $this->assertArrayHasKey('test', $output[0]); diff --git a/tests/unit/lib/XdRegressionTest.php b/tests/unit/lib/XdRegressionTest.php index 8d000163b5..92ea1689dd 100644 --- a/tests/unit/lib/XdRegressionTest.php +++ b/tests/unit/lib/XdRegressionTest.php @@ -2,7 +2,9 @@ namespace UnitTests; -class XdRegressionTest extends \PHPUnit_Framework_TestCase +use Exception; + +class XdRegressionTest extends \PHPUnit\Framework\TestCase { public function testLinearRegression1() { @@ -11,10 +13,10 @@ public function testLinearRegression1() { list($slope, $intersect,$correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(0.0, $slope, '', 1.0e-10); - $this->assertEquals(1.0, $intersect, '', 1.0e-10); - $this->assertEquals(0.0, $correlation, '', 1.0e-10); - $this->assertEquals(0.0, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(0.0, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(0.0, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(0.0, $r_squared, 1.0e-10, ''); } public function testLinearRegression2() { @@ -24,10 +26,10 @@ public function testLinearRegression2() { list($slope, $intersect,$correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(1.0, $slope, '', 1.0e-10); - $this->assertEquals(0.0, $intersect, '', 1.0e-10); - $this->assertEquals(1.0, $correlation, '', 1.0e-10); - $this->assertEquals(1.0, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(1.0, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(0.0, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $r_squared, 1.0e-10, ''); } public function testLinearRegression3() { @@ -38,10 +40,10 @@ public function testLinearRegression3() { list($slope, $intersect,$correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(-0.01666666666666666, $slope, '', 1.0e-10); - $this->assertEquals(1.1944444444444444, $intersect, '', 1.0e-10); - $this->assertEquals(-0.13693063937629155, $correlation, '', 1.0e-10); - $this->assertEquals(0.018750000000000006, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(-0.01666666666666666666, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.1944444444444444, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(-0.13693063937629155, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(0.018750000000000006, $r_squared, 1.0e-10, ''); } public function testLinearRegression4() { @@ -55,10 +57,10 @@ public function testLinearRegression4() { list($slope, $intersect,$correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(-2.0, $slope, '', 1.0e-10); - $this->assertEquals(4.0e-71, $intersect, '', 1.0e-10); - $this->assertEquals(-1.0, $correlation, '', 1.0e-10); - $this->assertEquals(1.0, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(-2.0, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(4.0e-71, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(-1.0, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $r_squared, 1.0e-10, ''); } public function testLinearRegression5() { @@ -72,10 +74,10 @@ public function testLinearRegression5() { list($slope, $intersect,$correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(2.0, $slope, '', 1.0e-10); - $this->assertEquals(4.0e-71, $intersect, '', 1.0e-10); - $this->assertEquals(1.0, $correlation, '', 1.0e-10); - $this->assertEquals(1.0, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(2.0, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(4.0e-71, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $r_squared, 1.0e-10, ''); } public function testLinearRegressionUnequalXIntervals() @@ -85,21 +87,29 @@ public function testLinearRegressionUnequalXIntervals() list($slope, $intersect, $correlation, $r_squared) = \xd_regression\linear_regression($xVals, $yVals); - $this->assertEquals(1.0, $slope, '', 1.0e-10); - $this->assertEquals(0.0, $intersect, '', 1.0e-10); - $this->assertEquals(1.0, $correlation, '', 1.0e-10); - $this->assertEquals(1.0, $r_squared, '', 1.0e-10); + $this->assertEqualsWithDelta(1.0, $slope, 1.0e-10, ''); + $this->assertEqualsWithDelta(0.0, $intersect, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $correlation, 1.0e-10, ''); + $this->assertEqualsWithDelta(1.0, $r_squared, 1.0e-10, ''); } - /** - * @expectedException PHPUnit_Framework_Error - */ public function testRegressionMismatch() { + // We setup a custom error handler that throws an exception due to PHPUnit9+ no longer handles errors, only exceptions. + // we can then use the standard `expectException` / `expectExceptionMessage` functions. + set_error_handler(static function (int $errno, string $errstr) { + throw new Exception($errstr); + }, E_USER_ERROR); + + $this->expectException(Exception::class); + $this->expectExceptionMessage('linear_regression(): Number of elements in coordinate arrays do not match.'); $xVals = array(1.0, 2.0); $yVals = array(1.0, 1.0, 1.0); \xd_regression\linear_regression($xVals, $yVals); + // We make sure to restore the previous error_handler before we exit the function. + restore_error_handler(); + } } diff --git a/tests/unit/phpunit.xml.dist b/tests/unit/phpunit.xml.dist index 96b581cdef..ed8332dde2 100644 --- a/tests/unit/phpunit.xml.dist +++ b/tests/unit/phpunit.xml.dist @@ -1,27 +1,9 @@ + - - - /usr/share/pear - /usr/share/php - ../../../../vendor - - +