diff --git a/.github/workflows/Nightly-Image.yml b/.github/workflows/Nightly-Image.yml index 1bcaaa9344..812ca83799 100644 --- a/.github/workflows/Nightly-Image.yml +++ b/.github/workflows/Nightly-Image.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - php-versions: ['7.4'] + php-versions: ['8.1'] arch: ['x64', 'aarch64'] steps: diff --git a/.github/workflows/Test-Build.yml b/.github/workflows/Test-Build.yml index 1eb2dd21da..e780ff6ec5 100644 --- a/.github/workflows/Test-Build.yml +++ b/.github/workflows/Test-Build.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: - php-versions: ['7.4'] + php-versions: ['8.1'] database: ['mysql', 'postgres', 'sqlite'] env: @@ -91,7 +91,7 @@ jobs: strategy: matrix: - php-versions: ['7.4'] + php-versions: ['8.1'] database: ['sqlite'] env: diff --git a/.travis.yml b/.travis.yml index 5a2fb268bd..cbb5fb4f5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,9 @@ php: #- '5.6' #- '7.0' #- '7.1' - - '7.2' - - '7.3' - - '7.4' + # - '7.2' + # - '7.3' + # - '7.4' - '8.0' - '8.1' @@ -44,7 +44,7 @@ after_script: # unit test coverage reporting after_success: - - if [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then php coveralls.phar -v; fi + - if [ "$TRAVIS_PHP_VERSION" = "8.1" ] && [ "$DB" = "mysql" ]; then php coveralls.phar -v; fi # use browserstack addons: diff --git a/.travis/phpunit.xml b/.travis/phpunit.xml index 8c67ef0c2e..7e78646d11 100644 --- a/.travis/phpunit.xml +++ b/.travis/phpunit.xml @@ -1,4 +1,7 @@ + + + ./session.php diff --git a/.travis/run.sh b/.travis/run.sh index 8c93c179d2..548148e868 100644 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -10,7 +10,7 @@ selenium_tests() { BUILD="$DB$TRAVIS_PHP_VERSION" case "$BUILD" in - postgresql7.4) + postgresql8.1) #phpunit_tests && selenium_tests phpunit_tests ;; diff --git a/.travis/setup.sh b/.travis/setup.sh index e5b3d6ee46..bb602b7b22 100644 --- a/.travis/setup.sh +++ b/.travis/setup.sh @@ -23,8 +23,8 @@ setup_memcached() { # PHP tweaks based on versions setup_php() { - if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then - sudo apt-get install php7.4-gd + if [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then + sudo apt-get install php8.1-gd fi } @@ -245,7 +245,7 @@ setup_all_tests() { BUILD="$DB$TRAVIS_PHP_VERSION" case "$BUILD" in - postgresql7.4) + postgresql8.1) #setup_all_tests setup_unit_tests ;; diff --git a/INSTALL b/INSTALL index 0210ae418e..073ce7f872 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ Requirements ------------ -Cypht requires at least PHP 7.4, with the OpenSSL and cURL extensions. You will +Cypht requires at least PHP 8.1, with the OpenSSL and cURL extensions. You will also need PDO support if using any database features. Testing is done on Debian and Ubuntu platforms with Nginx, Apache, standard PHP, and HHVM. We also use Composer to manage our few PHP dependencies. diff --git a/composer.json b/composer.json index 88dd999418..6e4993990d 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "henrique-borba/php-sieve-manager": "^1.0", "league/commonmark": "^2.4", "paragonie/random_compat": "^2.0.18", - "php": ">=7.4", + "php": ">=8.1", "symfony/dotenv": "^4.3 || 5.4", "thomaspark/bootswatch": "^5.3", "twbs/bootstrap": "^5.3", @@ -58,7 +58,7 @@ "zbateson/mail-mime-parser": "^2.4" }, "require-dev": { - "phpunit/phpunit": "^9.3.0" + "phpunit/phpunit": "^10.5" }, "suggest": { "ext-pdo": "To use database features, this needs to be installed", @@ -70,7 +70,7 @@ }, "config": { "platform": { - "php": "7.4" + "php": "8.1" }, "optimize-autoloader": true, "allow-plugins": { diff --git a/composer.lock b/composer.lock index 72d3aa3ab8..8124541100 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74bf15aae5f035fe60666720af3d2bc4", + "content-hash": "8de6d181041346fe7a32bd3994050781", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1944,76 +1944,6 @@ } ], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "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 || ^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.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -2250,16 +2180,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "10.1.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", "shasum": "" }, "require": { @@ -2267,18 +2197,18 @@ "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", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -2287,7 +2217,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -2316,7 +2246,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" }, "funding": [ { @@ -2324,32 +2254,32 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-03-12T15:33:41+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2376,7 +2306,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -2384,28 +2315,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -2413,7 +2344,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2439,7 +2370,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -2447,32 +2378,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2498,7 +2429,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -2506,32 +2438,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2557,7 +2489,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -2565,24 +2497,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "10.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/547d314dc24ec1e177720d45c6263fb226cc2ae3", + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -2592,27 +2523,26 @@ "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" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.5", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "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" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -2620,7 +2550,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2652,7 +2582,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.20" }, "funding": [ { @@ -2668,32 +2598,32 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2024-04-24T06:32:35+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2716,7 +2646,8 @@ "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" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -2724,32 +2655,32 @@ "type": "github" } ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2772,7 +2703,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -2780,32 +2711,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2827,7 +2758,7 @@ "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" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -2835,34 +2766,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2901,7 +2834,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -2909,33 +2843,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -2958,7 +2892,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -2966,33 +2901,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3024,7 +2959,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -3032,27 +2968,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -3060,7 +2996,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -3079,7 +3015,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -3087,7 +3023,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -3095,34 +3032,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -3164,7 +3101,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -3172,38 +3110,35 @@ "type": "github" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3222,13 +3157,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -3236,33 +3172,33 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -3285,7 +3221,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -3293,34 +3230,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3342,7 +3279,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -3350,32 +3287,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -3397,7 +3334,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -3405,32 +3342,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3460,61 +3397,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -3522,32 +3405,32 @@ "type": "github" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3570,7 +3453,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -3578,29 +3461,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3623,7 +3506,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -3631,7 +3514,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "theseer/tokenizer", @@ -3698,11 +3581,11 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-session": "*", - "php": ">=7.4" + "php": ">=8.1" }, "platform-dev": [], "platform-overrides": { - "php": "7.4" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/lib/auth.php b/lib/auth.php index f6f8df346b..251f5ef139 100644 --- a/lib/auth.php +++ b/lib/auth.php @@ -132,7 +132,10 @@ public function create($user, $pass) { $result = 0; $res = Hm_DB::execute($this->dbh, 'select username from hm_user where username = ?', [$user]); if (!empty($res)) { - print("user {$user} already exists\n"); + //this var will prevent showing print in phpuni tests + if(!defined('CYPHT_PHPUNIT_TEST_MODE')) { + print("user {$user} already exists\n"); + } $result = 1; } else { diff --git a/lib/ini_set.php b/lib/ini_set.php index 79a1be2847..1cd1347f6e 100644 --- a/lib/ini_set.php +++ b/lib/ini_set.php @@ -42,7 +42,7 @@ ini_set('session.cache_limiter', 'nocache'); /* session hash mechanism */ -if (version_compare(PHP_VERSION, 7.4, '==')) { +if (version_compare(PHP_VERSION, 8.1, '==')) { ini_set('session.hash_function', 1); } else { ini_set('session.hash_function', 'sha256'); diff --git a/scripts/config_gen.php b/scripts/config_gen.php index b3bbee4307..aed5c01dd0 100644 --- a/scripts/config_gen.php +++ b/scripts/config_gen.php @@ -37,7 +37,7 @@ * @return void * */ function check_php() { - $minVersion = 7.4; + $minVersion = 8.1; $version = phpversion(); if (substr($version, 0, 3) < $minVersion) { die("Cypht requires PHP version $minVersion or greater"); diff --git a/scripts/create_config.php b/scripts/create_config.php index c6600d2bef..0e91d1df42 100644 --- a/scripts/create_config.php +++ b/scripts/create_config.php @@ -26,7 +26,7 @@ function read_config($source) { function check_php() { $version = phpversion(); - if (substr($version, 0, 3) >= 7.4) { + if (substr($version, 0, 3) >= 8.1) { $version_class = 'yes'; } else { diff --git a/tests/phpunit/api.php b/tests/phpunit/api.php index b0ab206721..3da65190de 100644 --- a/tests/phpunit/api.php +++ b/tests/phpunit/api.php @@ -2,7 +2,7 @@ use PHPUnit\Framework\TestCase; -class Hm_Test_API_Curl extends TestCase { +class Hm_Test_API extends TestCase { public function setUp(): void { require 'bootstrap.php'; diff --git a/tests/phpunit/cache.php b/tests/phpunit/cache.php index 31b7d7be7a..20701bfa87 100644 --- a/tests/phpunit/cache.php +++ b/tests/phpunit/cache.php @@ -60,332 +60,3 @@ public function tearDown(): void { Test_Uid_Cache::load(array(),array()); } } - -/** - * tests for Hm_Memcached - */ -class Hm_Test_Hm_Memcache extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $this->config = new Hm_Mock_Config(); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_set() { - $this->config->set('enable_memcached', true); - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $this->config->set('enable_memcached', true); - - Hm_Functions::$exists = false; - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - - Hm_Functions::$exists = true; - $cache = new Hm_Memcached($this->config); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - - $this->assertTrue($cache->set('foo', array('bar'), 100, 'asdf')); - $this->assertEquals(array('bar'), $cache->get('foo', 'asdf')); - - Hm_Functions::$memcache = false; - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - Hm_Functions::$memcache = true; - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get() { - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->get('asdf')); - Hm_Functions::$exists = false; - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->get('asdf')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_auth() { - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->close()); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $this->config->set('enable_memcached', true); - $this->config->set('memcached_auth', true); - $cache = new Hm_Memcached($this->config); - $this->assertTrue($cache->close()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_close() { - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->close()); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $this->config->set('enable_memcached', true); - $cache = new Hm_Memcached($this->config); - $this->assertTrue($cache->close()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_del() { - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->del('foo')); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $this->config->set('enable_memcached', true); - $cache = new Hm_Memcached($this->config); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $cache->del('foo'); - $this->assertFalse($cache->get('foo')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_result_code() { - $cache = new Hm_Memcached($this->config); - $this->assertFalse($cache->last_err()); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $this->config->set('enable_memcached', true); - $cache = new Hm_Memcached($this->config); - $this->assertEquals(16, $cache->last_err()); - } -} - -/** - * tests for Hm_Redis - */ -class Hm_Test_Hm_Redis extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $this->config = new Hm_Mock_Config(); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_set() { - $this->config->set('enable_redis', true); - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $this->config->set('enable_redis', true); - $this->config->set('redis_pass', 'foo'); - - Hm_Functions::$exists = false; - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - - Hm_Functions::$exists = true; - $cache = new Hm_Redis($this->config); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - - $this->assertTrue($cache->set('foo', array('bar'), 100, 'asdf')); - $this->assertEquals(array('bar'), $cache->get('foo', 'asdf')); - - Hm_Functions::$redis_on = false; - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - Hm_Functions::$redis_on = true; - - Hm_Functions::$redis_on = false; - Hm_Mock_Redis_No::$fail_type = false; - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->set('foo', 'bar')); - Hm_Functions::$redis_on = true; - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get() { - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->get('asdf')); - Hm_Functions::$exists = false; - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->get('asdf')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_auth() { - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->close()); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $this->config->set('enable_redis', true); - $this->config->set('redis_auth', true); - $cache = new Hm_Redis($this->config); - $this->assertTrue($cache->close()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_close() { - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->close()); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $this->config->set('enable_redis', true); - $cache = new Hm_Redis($this->config); - $this->assertTrue($cache->close()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_del() { - $cache = new Hm_Redis($this->config); - $this->assertFalse($cache->del('foo')); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $this->config->set('enable_redis', true); - $cache = new Hm_Redis($this->config); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $cache->del('foo'); - $this->assertFalse($cache->get('foo')); - } -} - -/** - * tests for generica cache - */ -class Hm_Test_Hm_Cache extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $this->config = new Hm_Mock_Config(); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_start() { - $session = new Hm_Mock_Session(); - $cache = new Hm_Cache($this->config, $session); - $this->assertEquals('noop', $cache->type); - $session = new Hm_Mock_Session(); - $this->config->set('allow_session_cache', true); - $cache = new Hm_Cache($this->config, $session); - $this->assertEquals('session', $cache->type); - $this->config->set('enable_memcached', true); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertEquals('memcache', $cache->type); - $this->config->set('enable_redis', true); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertEquals('redis', $cache->type); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_set() { - $session = new Hm_Mock_Session(); - $cache = new Hm_Cache($this->config, $session); - $this->assertFalse($cache->set('foo', 'bar')); - $this->config->set('allow_session_cache', true); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->config->set('enable_memcached', true); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->config->set('enable_redis', true); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get() { - $session = new Hm_Mock_Session(); - $cache = new Hm_Cache($this->config, $session); - $this->assertEquals('baz', $cache->get('bar', 'baz')); - $this->config->set('allow_session_cache', true); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $this->assertEquals('baz', $cache->get('bar', 'baz')); - $this->config->set('enable_memcached', true); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $this->config->set('enable_redis', true); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_del() { - $session = new Hm_Mock_Session(); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->del('foo')); - - $this->config->set('allow_session_cache', true); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $cache->del('foo'); - $this->assertFalse($cache->get('foo', false)); - - $this->config->set('enable_memcached', true); - $this->config->set('memcached_server', 'asdf'); - $this->config->set('memcached_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $cache->del('foo'); - $this->assertFalse($cache->get('foo', false)); - - $this->config->set('enable_redis', true); - $this->config->set('redis_server', 'asdf'); - $this->config->set('redis_port', 10); - $cache = new Hm_Cache($this->config, $session); - $this->assertTrue($cache->set('foo', 'bar')); - $this->assertEquals('bar', $cache->get('foo')); - $cache->del('foo'); - $this->assertFalse($cache->get('foo', false)); - } -} diff --git a/tests/phpunit/config.php b/tests/phpunit/config.php index 2b993d9528..8ef3d0de1f 100644 --- a/tests/phpunit/config.php +++ b/tests/phpunit/config.php @@ -3,9 +3,9 @@ use PHPUnit\Framework\TestCase; /** - * tests for Hm_User_Config_File + * tests for Hm_Test_User_File_Config */ -class Hm_Test_User_Config_File extends TestCase { +class Hm_Test_User_File_Config extends TestCase { public $config; public function setUp(): void { @@ -156,177 +156,3 @@ public function tearDown(): void { unset($this->config); } } - -/** - * tests for Hm_Site_Config_File - */ -class Hm_Test_Site_Config_File extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $mock_config = new Hm_Mock_Config(); - $this->config = new Hm_User_Config_File($mock_config); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get_modules() { - $config = new Hm_Site_Config_File(merge_config_files(APP_PATH.'tests/phpunit/data')); - $this->assertFalse($config->get_modules()); - $config->set('modules', 'asdf'); - $this->assertEquals(array('asdf'), $config->get_modules()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_site_load() { - $config = new Hm_Site_Config_File(merge_config_files(APP_PATH.'tests/phpunit/data')); - $this->assertEquals(array('version' => VERSION, 'foo' => 'bar', 'default_setting_foo' => 'bar'), $config->dump()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get_user_defaults() { - $config = new Hm_Site_Config_File(merge_config_files(APP_PATH.'tests/phpunit/data')); - $this->assertEquals(array('version' => VERSION, 'foo' => 'bar', 'default_setting_foo' => 'bar'), $config->dump()); - } - public function tearDown(): void { - unset($this->config); - } -} - -/** - * tests for Hm_User_Config_DB - */ -class Hm_Test_User_Config_DB extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $mock_config = new Hm_Mock_Config(); - $this->config = new Hm_User_Config_File($mock_config); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_db_connect() { - $site_config = new Hm_Mock_Config(); - setup_db($site_config); - $user_config = new Hm_User_Config_DB($site_config); - $this->assertTrue($user_config->connect()); - } - - /*public function test_db_load() { - $site_config = new Hm_Mock_Config(); - setup_db($site_config); - $user_config = new Hm_User_Config_DB($site_config); - $this->assertEquals(array('version' => VERSION), $user_config->dump()); - $user_config->load('testuser', 'testkey'); - $this->assertEquals(array('version' => VERSION, 'foo' => 'bar'), $user_config->dump()); - $user_config->reload(array()); - $user_config->load('testuser', 'testpass'); - $this->assertEquals(array(), $user_config->dump()); - $user_config->reload(array()); - $user_config->load(uniqid(), 'blah'); - $this->assertEquals(array(), $user_config->dump()); - $site_config->set('auth_type', 'IMAP'); - $site_config->set('single_server_mode', true); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->load('testuser', 'testkey'); - $this->assertTrue(array_key_exists('version', $user_config->dump())); - }*/ - - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_db_reload() { - $site_config = new Hm_Mock_Config(); - setup_db($site_config); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->reload(array('foo' => 'bar')); - $this->assertEquals(array('foo' => 'bar'), $user_config->dump()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_db_save() { - $site_config = new Hm_Mock_Config(); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->reload(array('foo' => 'bar')); - $this->assertFalse($user_config->save('testuser', 'testkey')); - - $site_config = new Hm_Mock_Config(); - setup_db($site_config); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->reload(array('foo' => 'bar')); - $this->assertTrue($user_config->save('testuser', 'testkey')); - $this->assertEquals(1, $user_config->save(uniqid(), 'testkey')); - //$this->assertFalse($user_config->save(NULL, 'blah')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_db_set() { - $site_config = new Hm_Mock_Config(); - setup_db($site_config); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->set('foo', 'bar'); - $this->assertEquals('bar', $user_config->get('foo')); - $site_config->set('auth_type', 'IMAP'); - $site_config->set('single_server_mode', true); - $user_config = new Hm_User_Config_DB($site_config); - $user_config->load('foo', 'foo'); - $user_config->set('foo', 'bar'); - $this->assertEquals('bar', $user_config->get('foo')); - } - public function tearDown(): void { - unset($this->config); - } -} - -class Hm_Test_User_Config_Functions extends TestCase { - - public $config; - public function setUp(): void { - require 'bootstrap.php'; - $mock_config = new Hm_Mock_Config(); - $this->config = new Hm_User_Config_File($mock_config); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_load_user_config_object() { - /* TODO assertions */ - $mock_config = new Hm_Mock_Config(); - load_user_config_object($mock_config); - $this->assertEquals('Hm_User_Config_File', get_class(load_user_config_object($mock_config))); - $mock_config->set('user_config_type', 'DB'); - $this->assertEquals('Hm_User_Config_DB', get_class(load_user_config_object($mock_config))); - $mock_config->set('user_config_type', 'custom:Hm_Mock_Config'); - $this->assertEquals('Hm_Mock_Config', get_class(load_user_config_object($mock_config))); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_crypt_state() { - $site_config = new Hm_Mock_Config(); - $this->assertTrue(crypt_state($site_config)); - $site_config->set('auth_type', 'IMAP'); - $site_config->set('single_server_mode', true); - $this->assertFalse(crypt_state($site_config)); - } - - public function tearDown(): void { - unset($this->config); - } -} diff --git a/tests/phpunit/crypt.php b/tests/phpunit/crypt.php index ea4672b08d..e58ac9294d 100644 --- a/tests/phpunit/crypt.php +++ b/tests/phpunit/crypt.php @@ -51,153 +51,3 @@ public function test_hash_password() { $this->assertTrue(Hm_Crypt::check_password('test', $hash)); } } - -/** - * tests for Hm_Crypt - */ -class Hm_Test_Crypt_Base extends TestCase { - - public function setUp(): void { - define('LIBSODIUM', false); - require 'bootstrap.php'; - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_random() { - $bytes = Hm_Crypt::random(10); - $this->assertTrue(strlen($bytes) == 10); - Hm_Functions::$rand_bytes = 'bad'; - try { - Hm_Crypt::random(10); - } - catch(Error $e) { - $this->assertTrue(true); - } - Hm_Functions::$rand_bytes = 'ugly'; - try { - Hm_Crypt::random(10); - } - catch(Exception $e) { - $this->assertTrue(true); - } - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_ciphertext() { - $cipher = Hm_Crypt::ciphertext('test', 'testkey'); - $this->assertFalse($cipher == 'test'); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_plaintext() { - $this->assertFalse(Hm_Crypt::plaintext('asdf', 'testkey')); - $this->assertFalse(Hm_Crypt::plaintext(base64_encode(str_repeat('a', 201)), 'testkey')); - $cipher = Hm_Crypt::ciphertext('test', 'testkey'); - $plain = rtrim(Hm_Crypt::plaintext($cipher, 'testkey'), "\0"); - $this->assertEquals('test', $plain); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_check_password() { - $this->assertFalse(Hm_Crypt::check_password('test', 'asdf')); - $hash = Hm_Crypt::hash_password('test'); - $this->assertTrue(Hm_Crypt::check_password('test', $hash)); - - $hash = Hm_Crypt::hash_password('test', false, false, 'sha512', 'pbkdf2'); - $this->assertTrue(Hm_Crypt::check_password('test', $hash)); - $this->assertFalse(Hm_Crypt::check_password('asdf', 'sha512asdf')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_hash_password() { - $hash = Hm_Crypt::hash_password('test'); - $this->assertTrue(Hm_Crypt::check_password('test', $hash)); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_hash_compare() { - $this->assertFalse(Hm_Crypt::hash_compare('asdf', 'xcvb')); - $this->assertFalse(Hm_Crypt::hash_compare('asdf', false)); - $this->assertFalse(Hm_Crypt::hash_compare('0', false)); - $this->assertTrue(Hm_Crypt::hash_compare('asdf', 'asdf')); - Hm_Functions::$exists = false; - $this->assertFalse(Hm_Crypt::hash_compare('asdf', 'xcvb')); - $this->assertFalse(Hm_Crypt::hash_compare('asdf', false)); - $this->assertFalse(Hm_Crypt::hash_compare('0', false)); - $this->assertTrue(Hm_Crypt::hash_compare('asdf', 'asdf')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_pbkdf2() { - $this->assertEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), '8RSGqH63sWwLtwAssCsc01AIweWJW/f8Mf36zDCFN7E='); - $this->assertNotEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), 'asdf'); - Hm_Functions::$exists = false; - $this->assertEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), '8RSGqH63sWwLtwAssCsc01AIweWJW/f8Mf36zDCFN7E='); - $this->assertNotEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), 'asdf'); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_unique_id() { - $this->assertEquals(24, strlen(base64_decode(Hm_Crypt::unique_id(24)))); - $this->assertEquals(48, strlen(base64_decode(Hm_Crypt::unique_id(48)))); - $this->assertEquals(128, strlen(base64_decode(Hm_Crypt::unique_id()))); - } -} - -/** - * tests for Hm_Request_Key - */ -class Hm_Test_Request_Key extends TestCase { - - public function setUp(): void { - require 'bootstrap.php'; - $session = new Hm_Mock_Session(); - $request = new Hm_Mock_Request('AJAX'); - Hm_Request_Key::load($session, $request, false); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_key_load() { - $this->assertEquals('fakefingerprint', Hm_Request_Key::generate()); - $session = new Hm_Mock_Session(); - $request = new Hm_Mock_Request('AJAX'); - Hm_Request_Key::load($session, $request, false); - $this->assertEquals('fakefingerprint', Hm_Request_Key::generate()); - Hm_Request_Key::load($session, $request, true); - $this->assertEquals('fakefingerprint', Hm_Request_Key::generate()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_key_generate() { - $this->assertEquals('fakefingerprint', Hm_Request_Key::generate()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_key_validate() { - $this->assertTrue(Hm_Request_Key::validate('fakefingerprint')); - } - public function tearDown(): void { - } -} diff --git a/tests/phpunit/crypt_base.php b/tests/phpunit/crypt_base.php new file mode 100644 index 0000000000..5860a0c59d --- /dev/null +++ b/tests/phpunit/crypt_base.php @@ -0,0 +1,111 @@ +assertTrue(strlen($bytes) == 10); + Hm_Functions::$rand_bytes = 'bad'; + try { + Hm_Crypt::random(10); + } + catch(Error $e) { + $this->assertTrue(true); + } + Hm_Functions::$rand_bytes = 'ugly'; + try { + Hm_Crypt::random(10); + } + catch(Exception $e) { + $this->assertTrue(true); + } + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_ciphertext() { + $cipher = Hm_Crypt::ciphertext('test', 'testkey'); + $this->assertFalse($cipher == 'test'); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_plaintext() { + $this->assertFalse(Hm_Crypt::plaintext('asdf', 'testkey')); + $this->assertFalse(Hm_Crypt::plaintext(base64_encode(str_repeat('a', 201)), 'testkey')); + $cipher = Hm_Crypt::ciphertext('test', 'testkey'); + $plain = rtrim(Hm_Crypt::plaintext($cipher, 'testkey'), "\0"); + $this->assertEquals('test', $plain); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_check_password() { + $this->assertFalse(Hm_Crypt::check_password('test', 'asdf')); + $hash = Hm_Crypt::hash_password('test'); + $this->assertTrue(Hm_Crypt::check_password('test', $hash)); + + $hash = Hm_Crypt::hash_password('test', false, false, 'sha512', 'pbkdf2'); + $this->assertTrue(Hm_Crypt::check_password('test', $hash)); + $this->assertFalse(Hm_Crypt::check_password('asdf', 'sha512asdf')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_hash_password() { + $hash = Hm_Crypt::hash_password('test'); + $this->assertTrue(Hm_Crypt::check_password('test', $hash)); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_hash_compare() { + $this->assertFalse(Hm_Crypt::hash_compare('asdf', 'xcvb')); + $this->assertFalse(Hm_Crypt::hash_compare('asdf', false)); + $this->assertFalse(Hm_Crypt::hash_compare('0', false)); + $this->assertTrue(Hm_Crypt::hash_compare('asdf', 'asdf')); + Hm_Functions::$exists = false; + $this->assertFalse(Hm_Crypt::hash_compare('asdf', 'xcvb')); + $this->assertFalse(Hm_Crypt::hash_compare('asdf', false)); + $this->assertFalse(Hm_Crypt::hash_compare('0', false)); + $this->assertTrue(Hm_Crypt::hash_compare('asdf', 'asdf')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_pbkdf2() { + $this->assertEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), '8RSGqH63sWwLtwAssCsc01AIweWJW/f8Mf36zDCFN7E='); + $this->assertNotEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), 'asdf'); + Hm_Functions::$exists = false; + $this->assertEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), '8RSGqH63sWwLtwAssCsc01AIweWJW/f8Mf36zDCFN7E='); + $this->assertNotEquals(base64_encode(Hm_Crypt::pbkdf2('testkey', 'testsalt', 32, 2, 'sha512')), 'asdf'); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_unique_id() { + $this->assertEquals(24, strlen(base64_decode(Hm_Crypt::unique_id(24)))); + $this->assertEquals(48, strlen(base64_decode(Hm_Crypt::unique_id(48)))); + $this->assertEquals(128, strlen(base64_decode(Hm_Crypt::unique_id()))); + } +} diff --git a/tests/phpunit/db_session.php b/tests/phpunit/db_session.php new file mode 100644 index 0000000000..212c313df8 --- /dev/null +++ b/tests/phpunit/db_session.php @@ -0,0 +1,164 @@ +config = new Hm_Mock_Config(); + setup_db($this->config); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_connect() { + $_POST['user'] = 'unittestusers'; + $_POST['pass'] = 'unittestpass'; + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $this->assertTrue($session->connect()); + $session->destroy($request); + $config = new Hm_Mock_Config(); + $session = new Hm_DB_Session($config, 'Hm_Auth_DB'); + $this->assertFalse($session->connect()); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_end() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->end(); + $this->assertFalse($session->is_active()); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_start() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $this->assertTrue($session->is_active()); + $session->destroy($request); + + $request->cookie['hm_session'] = 'test'; + $session->loaded = false; + $session->start($request); + $this->assertFalse($session->is_active()); + $session->destroy($request); + + $request->cookie = array(); + $session->loaded = false; + $session->start($request); + $this->assertFalse($session->is_active()); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_start_existing_session() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $this->assertTrue($session->is_active()); + $key = $session->session_key; + $session->end(); + $session->start_existing($key); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_close_early() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->close_early(); + $this->assertFalse($session->is_active()); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_db_save_data() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $this->assertEquals(1, $session->save_data()); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_plaintext() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $this->assertEquals(array('data'), ($session->plaintext($session->ciphertext(array('data'))))); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_get_key() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $request->cookie['hm_id'] = 'test'; + $session->get_key($request); + $this->assertEquals('test', $session->enc_key); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_secure_cookie() { + $session = new Hm_DB_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $request->tls = true; + $request->path = 'test'; + $this->assertTrue($session->secure_cookie($request, 'name', 'value')); + $this->assertTrue($session->secure_cookie($request, 'name', 'value', '/', 'http://localhost:123')); + $session->destroy($request); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_insert_session_row() { + $request = new Hm_Mock_Request('HTTP'); + $session = new Hm_DB_Session($this->config, 'Hm_Auth_None'); + $this->assertFalse($session->insert_session_row()); + $session->connect(); + $this->assertEquals(1, $session->insert_session_row()); + $session->destroy($request); + + $config = new Hm_Mock_Config(); + $session = new Hm_DB_Session($config, 'Hm_Auth_DB'); + $session->connect(); + $this->assertFalse($session->insert_session_row()); + $session->destroy($request); + + } + public function tearDown(): void { + unset($this->config); + } +} diff --git a/tests/phpunit/debug.php b/tests/phpunit/debug.php new file mode 100644 index 0000000000..515733713a --- /dev/null +++ b/tests/phpunit/debug.php @@ -0,0 +1,25 @@ +assertTrue(count(Hm_Debug::get()) > 4); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ +} diff --git a/tests/phpunit/dispatch.php b/tests/phpunit/dispatch.php index 32d880c340..e01fd5753c 100644 --- a/tests/phpunit/dispatch.php +++ b/tests/phpunit/dispatch.php @@ -16,7 +16,7 @@ public function setUp(): void { * @runInSeparateProcess */ public function test_is_php_setup() { - if ((float) substr(phpversion(), 0, 3) >= 7.4) { + if ((float) substr(phpversion(), 0, 3) >= 8.1) { $this->assertTrue(Hm_Dispatch::is_php_setup()); } Hm_Functions::$exists = false; @@ -137,19 +137,3 @@ public function test_validate_ajax_request() { $this->assertFalse($router->validate_ajax_request($request, array())); } } - -class Hm_Test_Debug_Page_Redirect extends TestCase { - - public function setUp(): void { - define('DEBUG_MODE', true); - require 'bootstrap.php'; - define('CONFIG_FILE', merge_config_files(APP_PATH.'config')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_debug_page_redirect() { - $this->assertEquals(null, Hm_Dispatch::page_redirect('test', 200)); - } -} diff --git a/tests/phpunit/elog.php b/tests/phpunit/elog.php new file mode 100644 index 0000000000..8756818d55 --- /dev/null +++ b/tests/phpunit/elog.php @@ -0,0 +1,20 @@ +assertEquals('string: test', elog('test')); + } +} diff --git a/tests/phpunit/environment.php b/tests/phpunit/environment.php index 9d44bd2050..25123e6665 100644 --- a/tests/phpunit/environment.php +++ b/tests/phpunit/environment.php @@ -5,7 +5,7 @@ /** * tests for Hm_Environment */ -class Hm_Test_Environment_Variable extends TestCase { +class Hm_Test_Environment extends TestCase { public function setUp(): void { require 'bootstrap.php'; diff --git a/tests/phpunit/format.php b/tests/phpunit/format.php index 5564b070e8..64d249af68 100644 --- a/tests/phpunit/format.php +++ b/tests/phpunit/format.php @@ -43,31 +43,3 @@ public function tearDown(): void { Hm_Output_Modules::del('test', 'blah'); } } -class Hm_Test_Transform extends TestCase { - public function setUp(): void { - require 'bootstrap.php'; - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_stringify() { - $this->assertEquals('{"foo":"YmFy"}', Hm_Transform::stringify(array('foo' => 'bar'))); - $this->assertEquals('', Hm_Transform::stringify(NULL)); - $this->assertEquals('asdf', Hm_Transform::stringify('asdf')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_unstringify() { - $test = Hm_Transform::stringify(array('foo' => 'bar', 'baz' => array('test' => 'asdf'))); - $this->assertEquals(array('foo' => 'bar', 'baz' => array('test' => 'asdf')), Hm_Transform::unstringify($test)); - $this->assertFalse(Hm_Transform::unstringify(array())); - $this->assertFalse(Hm_Transform::unstringify('asdf')); - $this->assertEquals('asdf', Hm_Transform::unstringify('asdf', false, true)); - $this->assertEquals(array('foo' => 'bar'), Hm_Transform::unstringify('a:1:{s:3:"foo";s:4:"YmFy";}')); - $int_test = Hm_Transform::stringify(array('foo' => 1)); - $this->assertEquals(array('foo' => 1), Hm_Transform::unstringify($int_test)); - } -} diff --git a/tests/phpunit/handler_module_debug.php b/tests/phpunit/handler_module_debug.php new file mode 100644 index 0000000000..b96f1406f6 --- /dev/null +++ b/tests/phpunit/handler_module_debug.php @@ -0,0 +1,26 @@ +parent = build_parent_mock(); + $this->handler_mod = new Hm_Handler_Test($this->parent, 'home'); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_process_key_debug() { + $this->handler_mod->request->type = 'AJAX'; + $this->assertEquals('exit', $this->handler_mod->process_key()); + } +} diff --git a/tests/phpunit/hm_cache.php b/tests/phpunit/hm_cache.php new file mode 100644 index 0000000000..1b23bd642b --- /dev/null +++ b/tests/phpunit/hm_cache.php @@ -0,0 +1,120 @@ +config = new Hm_Mock_Config(); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_start() { + $session = new Hm_Mock_Session(); + $cache = new Hm_Cache($this->config, $session); + $this->assertEquals('noop', $cache->type); + $session = new Hm_Mock_Session(); + $this->config->set('allow_session_cache', true); + $cache = new Hm_Cache($this->config, $session); + $this->assertEquals('session', $cache->type); + $this->config->set('enable_memcached', true); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertEquals('memcache', $cache->type); + $this->config->set('enable_redis', true); + $this->config->set('redis_server', 'asdf'); + $this->config->set('redis_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertEquals('redis', $cache->type); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_set() { + $session = new Hm_Mock_Session(); + $cache = new Hm_Cache($this->config, $session); + $this->assertFalse($cache->set('foo', 'bar')); + $this->config->set('allow_session_cache', true); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->config->set('enable_memcached', true); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->config->set('enable_redis', true); + $this->config->set('redis_server', 'asdf'); + $this->config->set('redis_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_get() { + $session = new Hm_Mock_Session(); + $cache = new Hm_Cache($this->config, $session); + $this->assertEquals('baz', $cache->get('bar', 'baz')); + $this->config->set('allow_session_cache', true); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $this->assertEquals('baz', $cache->get('bar', 'baz')); + $this->config->set('enable_memcached', true); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $this->config->set('enable_redis', true); + $this->config->set('redis_server', 'asdf'); + $this->config->set('redis_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_del() { + $session = new Hm_Mock_Session(); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->del('foo')); + + $this->config->set('allow_session_cache', true); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $cache->del('foo'); + $this->assertFalse($cache->get('foo', false)); + + $this->config->set('enable_memcached', true); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $cache->del('foo'); + $this->assertFalse($cache->get('foo', false)); + + $this->config->set('enable_redis', true); + $this->config->set('redis_server', 'asdf'); + $this->config->set('redis_port', 10); + $cache = new Hm_Cache($this->config, $session); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $cache->del('foo'); + $this->assertFalse($cache->get('foo', false)); + } +} diff --git a/tests/phpunit/memcache.php b/tests/phpunit/memcache.php new file mode 100644 index 0000000000..31a06c197f --- /dev/null +++ b/tests/phpunit/memcache.php @@ -0,0 +1,112 @@ +config = new Hm_Mock_Config(); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_set() { + $this->config->set('enable_memcached', true); + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->set('foo', 'bar')); + + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + + Hm_Functions::$exists = false; + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->set('foo', 'bar')); + + Hm_Functions::$exists = true; + $cache = new Hm_Memcached($this->config); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + + $this->assertTrue($cache->set('foo', array('bar'), 100, 'asdf')); + $this->assertEquals(array('bar'), $cache->get('foo', 'asdf')); + + Hm_Functions::$memcache = false; + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->set('foo', 'bar')); + Hm_Functions::$memcache = true; + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_get() { + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->get('asdf')); + Hm_Functions::$exists = false; + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->get('asdf')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_auth() { + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->close()); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + $this->config->set('memcached_auth', true); + $cache = new Hm_Memcached($this->config); + $this->assertTrue($cache->close()); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_close() { + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->close()); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + $cache = new Hm_Memcached($this->config); + $this->assertTrue($cache->close()); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_del() { + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->del('foo')); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + $cache = new Hm_Memcached($this->config); + $this->assertTrue($cache->set('foo', 'bar')); + $this->assertEquals('bar', $cache->get('foo')); + $cache->del('foo'); + $this->assertFalse($cache->get('foo')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_result_code() { + $cache = new Hm_Memcached($this->config); + $this->assertFalse($cache->last_err()); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + $cache = new Hm_Memcached($this->config); + $this->assertEquals(16, $cache->last_err()); + } +} diff --git a/tests/phpunit/memcached_session.php b/tests/phpunit/memcached_session.php new file mode 100644 index 0000000000..56077458a7 --- /dev/null +++ b/tests/phpunit/memcached_session.php @@ -0,0 +1,106 @@ +config = new Hm_Mock_Config(); + $this->config->set('memcached_server', 'asdf'); + $this->config->set('memcached_port', 10); + $this->config->set('enable_memcached', true); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_memcached_connect() { + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $session->connect(); + $this->assertEquals('Hm_Memcached', get_class($session->conn)); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_memcached_start_existing() { + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $session->set('foo', 'bar'); + $session->save_data(); + $session->start_existing($session->session_key); + $this->assertEquals('bar', $session->get('foo')); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_memcached_start() { + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $this->assertTrue($session->is_active()); + $session->destroy($request); + + $request->cookie['hm_session'] = 'test'; + $session->loaded = false; + $session->start($request); + $this->assertFalse($session->is_active()); + $session->destroy($request); + + $request->cookie = array(); + $session->loaded = false; + $session->start($request); + $this->assertFalse($session->is_active()); + $session->destroy($request); + + Hm_Mock_Memcached::$set_failure = true; + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $this->assertFalse($session->is_active()); + $session->destroy($request); + + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_memcached_end() { + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->connect(); + $session->end(); + $this->assertFalse($session->is_active()); + $session->destroy($request); + + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->loaded = true; + $session->start($request); + $session->end(); + } + /** + * @preserveGlobalState disabled + * @runInSeparateProcess + */ + public function test_memcached_close_early() { + $session = new Hm_Memcached_Session($this->config, 'Hm_Auth_DB'); + $request = new Hm_Mock_Request('HTTP'); + $session->connect(); + $session->close_early(); + $this->assertFalse($session->is_active()); + $session->destroy($request); + } +} diff --git a/tests/phpunit/mocks.php b/tests/phpunit/mocks.php index 34d649408d..95253a2fdc 100644 --- a/tests/phpunit/mocks.php +++ b/tests/phpunit/mocks.php @@ -264,7 +264,7 @@ public static function c_setopt() { return true; } public static function c_status() { return 200; } public static function c_exec() { return self::$exec_res; } public static function function_exists($func) { - if ((float) substr(phpversion(), 0, 3) < 7.4) { + if ((float) substr(phpversion(), 0, 3) < 8.1) { return false; } return self::$exists; diff --git a/tests/phpunit/module.php b/tests/phpunit/module.php index ab1d852c7e..8e41f0ac13 100644 --- a/tests/phpunit/module.php +++ b/tests/phpunit/module.php @@ -2,101 +2,6 @@ use PHPUnit\Framework\TestCase; -/** - * tests for the Hm_Module_Output trait - */ -class Hm_Test_Modules_Output extends TestCase { - - public $parent; - public $handler_mod; - public function setUp(): void { - require 'bootstrap.php'; - $this->parent = build_parent_mock(); - $this->handler_mod = new Hm_Handler_Test($this->parent, 'home'); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_out() { - $this->assertTrue($this->handler_mod->out('foo', 'bar')); - $this->assertFalse($this->handler_mod->out('foo', 'foo')); - $this->assertTrue($this->handler_mod->append('name', 'value')); - $this->assertFalse($this->handler_mod->out('name', 'value2')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_get() { - $this->handler_mod->out('foo', 'bar'); - $this->assertEquals('bar', $this->handler_mod->get('foo')); - $this->assertEquals('bar', $this->handler_mod->get('foo', '')); - $this->assertEquals(0, $this->handler_mod->get('foo', 3)); - $this->assertEquals(array('bar'), $this->handler_mod->get('foo', array())); - $this->assertEquals('default', $this->handler_mod->get('bar', 'default')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_append() { - $this->assertTrue($this->handler_mod->append('test', 'value')); - $this->assertTrue($this->handler_mod->append('test', 'value')); - $this->assertEquals(array('value', 'value'), $this->handler_mod->get('test')); - $this->assertTrue($this->handler_mod->out('no_append', 'blah', true)); - $this->assertFalse($this->handler_mod->append('no_append', 'blah')); - $this->assertTrue($this->handler_mod->out('scaler', 'blah', false)); - $this->assertFalse($this->handler_mod->append('scaler', 'blah')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_concat() { - $this->assertTrue($this->handler_mod->out('concat_test', array())); - $this->assertFalse($this->handler_mod->concat('concat_test', 'test')); - $this->assertTrue($this->handler_mod->concat('concat', 'start')); - $this->assertTrue($this->handler_mod->concat('concat', 'start')); - $this->assertEquals('startstart', $this->handler_mod->get('concat')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_module_output() { - $this->handler_mod->out('foo', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $this->handler_mod->module_output()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_output_protected() { - $this->handler_mod->out('foo', 'bar', true); - $this->handler_mod->out('bar', 'foo', false); - $this->assertEquals(array('foo'), $this->handler_mod->output_protected()); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_exists() { - $this->handler_mod->out('foo', 'bar'); - $this->assertTrue($this->handler_mod->exists('foo')); - $this->assertFalse($this->handler_mod->exists('blah')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_in() { - $this->handler_mod->out('foo', 'bar'); - $this->assertTrue($this->handler_mod->in('foo', array('bar', 'baz'))); - $this->assertFalse($this->handler_mod->in('foo', array('baz', 'blah'))); - } -} - /** * tests for the Hm_Handler_Module class */ @@ -189,67 +94,3 @@ public function test_process_form() { $this->assertEquals(array(), $form); } } - -/** - * DEBUG_MODE tests for the Hm_Handler_Module class - */ -class Hm_Test_Handler_Module_Debug extends TestCase { - - public $parent; - public $handler_mod; - public function setUp(): void { - define('DEBUG_MODE', true); - require 'bootstrap.php'; - $this->parent = build_parent_mock(); - $this->handler_mod = new Hm_Handler_Test($this->parent, 'home'); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_process_key_debug() { - $this->handler_mod->request->type = 'AJAX'; - $this->assertEquals('exit', $this->handler_mod->process_key()); - } -} - -/** - * tests for the Hm_Output_Module class - */ -class Hm_Test_Output_Module extends TestCase { - - public $output_mod; - public function setUp(): void { - require 'bootstrap.php'; - $this->output_mod = new Hm_Output_Test(array('foo' => 'bar', 'bar' => 'foo'), array('bar')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_output_content() { - $this->output_mod->output_content('HTML5', array('Main' => false, 'Test' => 'Translated', 'interface_lang' => 'en', 'interface_direction' => 'ltr'), array()); - $this->assertEquals('Main', $this->output_mod->trans('Main')); - $this->assertEquals('Translated', $this->output_mod->trans('Test')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_trans() { - $this->assertEquals('inbox', $this->output_mod->trans('inbox')); - $this->assertEquals('Main', $this->output_mod->trans('Main')); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_html_safe() { - $this->assertEquals('<script>', $this->output_mod->html_safe(''), $res->output_response); - $test->handler_response = array('encrypt_ajax_requests' => true, 'router_module_list' => array('imap')); - $res = $test->run(); - $this->assertEquals(array(''), $res->output_response); - } - /** - * @preserveGlobalState disabled - * @runInSeparateProcess - */ - public function test_main_menu_start_debug() { - $test = new Output_Test('main_menu_start', 'core'); - $res = $test->run(); - $this->assertEquals(array('