diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 6333373a..1615b00c 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -14,13 +14,11 @@ jobs: matrix: include: - php: '5.6' - sniff: true - php: '7.0' - sniff: true - php: '7.4' + - php: '8.0' sniff: true jshint: true - - php: '8.0' steps: - uses: actions/checkout@v3 @@ -32,7 +30,7 @@ jobs: - name: Syntax Check run: | - find -L . -name '*.php' -not -path "./vendor/*" -print0 | xargs -0 -n 1 -P 4 php -l + find -L . -name '*.php' -not -path "./vendor/*" -not -path "./tests/*" -print0 | xargs -0 -n 1 -P 4 php -l - name: Install Composer if: 'matrix.sniff' @@ -44,7 +42,7 @@ jobs: - name: WordPress Coding Standards if: 'matrix.sniff' run: | - vendor/bin/phpcs -p -s -v -n . + vendor/bin/phpcs -p -s -v -n . -d error_reporting=E_ALL^E_DEPRECATED - name: JSHint if: 'matrix.jshint' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 46872cd7..c83404b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,8 +12,8 @@ jobs: name: Tests on PHP ${{ matrix.php }} strategy: matrix: - php: ['7.4'] - wordpress: ['5.1.2', 'latest'] + php: ['8.2'] + wordpress: ['latest'] steps: - uses: actions/checkout@v3 diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 00000000..fe657927 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"WPDiscourse\\Test\\DiscourseCommentTest::test_sync_comments_handle_error_response":6,"WPDiscourse\\Test\\DiscourseCommentTest::test_get_comment_type_for_post_display_public_comments_only_when_connection_fails":6,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_response_error":6,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_response_error_legacy":6,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_scopes_invalid":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_embed_error":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_category_error":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_response_body_error":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_enqueued_post":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_deleted_topic":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_forbidden":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_unprocessable":6,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_failed_to_connect":6,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_invalid_signature":6,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_invalid_nonce":6,"WPDiscourse\\Test\\DiscourseSSOTest::test_logout_from_discourse_failed_to_get_discourse_user":6,"WPDiscourse\\Test\\DiscourseSSOTest::test_logout_from_discourse_failed_to_logout":6,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_write":6,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_date_rotation":6,"WPDiscourse\\Test\\FileManagerTest::test_validation_uploads_creation":6,"WPDiscourse\\Test\\FileManagerTest::test_validation_logs_creation":6,"WPDiscourse\\Test\\LogViewerTest::test_log_retrieval":4,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_invalid_signature":4,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_get_user_failed":4,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_update_user_failed":4,"WPDiscourse\\Test\\SyncDiscourseUserTest::test_update_user_unable_to_find_user":6,"WPDiscourse\\Test\\SSOClientTest::test_parse_request":4},"times":{"WPDiscourse\\Test\\DiscourseCommentFormatterTest::test_format":0.013,"WPDiscourse\\Test\\DiscourseCommentFormatterTest::test_comment_cache":0.01,"WPDiscourse\\Test\\DiscourseCommentFormatterTest::test_missing_post_meta":0.01,"WPDiscourse\\Test\\DiscourseCommentTest::test_comments_disabled":0.008,"WPDiscourse\\Test\\DiscourseCommentTest::test_sync_comments":0.012,"WPDiscourse\\Test\\DiscourseCommentTest::test_sync_comments_handle_error_response":0.015,"WPDiscourse\\Test\\DiscourseCommentTest::test_get_comment_type_for_post_display_public_comments_only":0.019,"WPDiscourse\\Test\\DiscourseCommentTest::test_get_comment_type_for_post_display_public_comments_only_when_connection_fails":0.022,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status":0.001,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_legacy":0.001,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_response_error":0.003,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_response_error_legacy":0.003,"WPDiscourse\\Test\\DiscourseConnectionTest::test_check_connection_status_scopes_invalid":0.006,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating":0.011,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_embed_error":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_category_error":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_response_body_error":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_enqueued_post":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_direct_db_publication_flags":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_pin_topic":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_discourse_username":0.021,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_discourse_username_with_single_user_api_key":0.019,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_deleted_topic":0.015,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_featured_link":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_direct_db_publication_flags":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_exclude_tags_with_exclusionary_tag":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_exclude_tags_with_non_exclusionary_tag":0.015,"WPDiscourse\\Test\\DiscoursePublishTest::test_wpdc_publish_options":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_allowed_property":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_option":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_max_age_prevents_older_posts_from_being_published":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_wp_discourse_before_xmlrpc_publish_filter":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_xmlrpc_publish_failure_notification":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_success":0,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_forbidden":0.004,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_unprocessable":0.004,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_failed_to_connect":0.003,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_no_user":0.009,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_user":0.007,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_logout":0.007,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_invalid_signature":0.01,"WPDiscourse\\Test\\DiscourseSSOTest::test_sso_parse_request_invalid_nonce":0.011,"WPDiscourse\\Test\\DiscourseSSOTest::test_logout_from_discourse":0.009,"WPDiscourse\\Test\\DiscourseSSOTest::test_logout_from_discourse_failed_to_get_discourse_user":0.011,"WPDiscourse\\Test\\DiscourseSSOTest::test_logout_from_discourse_failed_to_logout":0.011,"WPDiscourse\\Test\\FileHandlerTest::test_construct":0,"WPDiscourse\\Test\\FileHandlerTest::test_enabled":0,"WPDiscourse\\Test\\FileHandlerTest::test_not_enabled":0.001,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_create":0.001,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_write":0.003,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_multiple":0.001,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_date_rotation":0.001,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_size_limit_rotation":0.01,"WPDiscourse\\Test\\FileHandlerTest::test_log_file_number":0.001,"WPDiscourse\\Test\\FileHandlerTest::test_log_max_files":0.003,"WPDiscourse\\Test\\FileManagerTest::test_validation_uploads_creation":0.001,"WPDiscourse\\Test\\FileManagerTest::test_validation_logs_creation":0,"WPDiscourse\\Test\\FileManagerTest::test_validation_ready":0,"WPDiscourse\\Test\\FileManagerTest::test_validation_not_ready":0,"WPDiscourse\\Test\\FileManagerTest::test_validation_when_wp_uploads_not_writable":0,"WPDiscourse\\Test\\FileManagerTest::test_validation_when_folders_partially_restricted":0,"WPDiscourse\\Test\\LogViewerTest::test_file_handler_not_enabled":0.002,"WPDiscourse\\Test\\LogViewerTest::test_logs_not_enabled":0,"WPDiscourse\\Test\\LogViewerTest::test_log_retrieval":0.001,"WPDiscourse\\Test\\LoggerTest::test_create":0,"WPDiscourse\\Test\\LoggerTest::test_create_handler":0,"WPDiscourse\\Test\\LoggerTest::test_create_handler_formatter":0,"WPDiscourse\\Test\\LoggerTest::test_create_file_handler_not_enabled":0.001,"WPDiscourse\\Test\\LoggerTest::test_create_logs_not_enabled":0,"WPDiscourse\\Test\\SSOClientTest::test_parse_request":0.014,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_invalid_signature":0.01,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_get_user_failed":0.011,"WPDiscourse\\Test\\SSOClientTest::test_parse_request_update_user_failed":0.018,"WPDiscourse\\Test\\SyncDiscourseTopicTest::test_update_topic_content":0.01,"WPDiscourse\\Test\\SyncDiscourseTopicTest::test_update_topic_content_invalid_signature":0.009,"WPDiscourse\\Test\\SyncDiscourseUserTest::test_update_user":0.002,"WPDiscourse\\Test\\SyncDiscourseUserTest::test_update_user_using_discourse_sso_user_id":0.008,"WPDiscourse\\Test\\SyncDiscourseUserTest::test_update_user_using_email":0.008,"WPDiscourse\\Test\\SyncDiscourseUserTest::test_update_user_unable_to_find_user":0.01,"WPDiscourse\\Test\\UtilitiesTest::test_get_options":0.007,"WPDiscourse\\Test\\UtilitiesTest::test_validate":0.007,"WPDiscourse\\Test\\UtilitiesTest::test_get_discourse_categories":0.008,"WPDiscourse\\Test\\UtilitiesTest::test_get_discourse_user":0.008,"WPDiscourse\\Test\\UtilitiesTest::test_get_discourse_user_by_email":0.007,"WPDiscourse\\Test\\UtilitiesTest::test_sync_sso_record":0.008,"WPDiscourse\\Test\\UtilitiesTest::test_get_sso_params":0.005,"WPDiscourse\\Test\\UtilitiesTest::test_verify_discourse_webhook_request":0.007,"WPDiscourse\\Test\\UtilitiesTest::test_get_discourse_groups":0.007,"WPDiscourse\\Test\\UtilitiesTest::test_create_discourse_user":0.005,"WPDiscourse\\Test\\UtilitiesTest::test_add_user_to_discourse_group":0.006,"WPDiscourse\\Test\\UtilitiesTest::test_remove_user_from_discourse_group":0.006}} \ No newline at end of file diff --git a/composer.json b/composer.json index 26498186..79f699cd 100644 --- a/composer.json +++ b/composer.json @@ -27,14 +27,15 @@ }, "require-dev": { "squizlabs/php_codesniffer": "3.*", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "10up/wp_mock": "0.4.2", - "phpunit/phpunit": "7.5.20", - "phpunit/php-code-coverage": "^6.1.4", + "phpunit/phpunit": "9.6", + "phpunit/php-code-coverage": "^9.2.13", "phpcompatibility/php-compatibility": "^9.3.5", "wp-coding-standards/wpcs": "^2.3", "monolog/monolog": "^1.25", - "yoast/phpunit-polyfills": "^1.0.1" + "yoast/phpunit-polyfills": "^1.0.1", + "dms/phpunit-arraysubset-asserts": "^0.5.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/composer.lock b/composer.lock index 345f0cf1..1f1c75f1 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": "61fe65fd03c099f2fd40dd724d15d2a1", + "content-hash": "48aaec8e64fa05f3b3ffab6fbcc78479", "packages": [ { "name": "composer/installers", @@ -206,16 +206,16 @@ }, { "name": "antecedent/patchwork", - "version": "2.1.21", + "version": "2.1.26", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d" + "reference": "f2dae0851b2eae4c51969af740fdd0356d7f8f55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/f2dae0851b2eae4c51969af740fdd0356d7f8f55", + "reference": "f2dae0851b2eae4c51969af740fdd0356d7f8f55", "shasum": "" }, "require": { @@ -248,41 +248,44 @@ ], "support": { "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.21" + "source": "https://github.com/antecedent/patchwork/tree/2.1.26" }, - "time": "2022-02-07T07:28:34+00:00" + "time": "2023-09-18T08:18:37+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", + "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -298,7 +301,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -322,37 +325,81 @@ "tests" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2022-02-04T12:51:07+00:00" + "time": "2023-01-05T11:28:13+00:00" + }, + { + "name": "dms/phpunit-arraysubset-asserts", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/rdohms/phpunit-arraysubset-asserts.git", + "reference": "aa6b9e858414e91cca361cac3b2035ee57d212e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rdohms/phpunit-arraysubset-asserts/zipball/aa6b9e858414e91cca361cac3b2035ee57d212e0", + "reference": "aa6b9e858414e91cca361cac3b2035ee57d212e0", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" + }, + "require-dev": { + "dms/coding-standard": "^9" + }, + "type": "library", + "autoload": { + "files": [ + "assertarraysubset-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rafael Dohms", + "email": "rdohms@gmail.com" + } + ], + "description": "This package provides ArraySubset and related asserts once deprecated in PHPUnit 8", + "support": { + "issues": "https://github.com/rdohms/phpunit-arraysubset-asserts/issues", + "source": "https://github.com/rdohms/phpunit-arraysubset-asserts/tree/v0.5.0" + }, + "time": "2023-06-02T17:33:53+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -379,7 +426,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -395,7 +442,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -450,35 +497,40 @@ }, { "name": "mockery/mockery", - "version": "1.3.6", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0" + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/dc206df4fa314a50bbb81cf72239a305c5bbd5c0", - "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0", + "url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e", + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.10", + "psalm/plugin-phpunit": "^0.18.4", + "symplify/easy-coding-standard": "^11.5.0", + "vimeo/psalm": "^4.30" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, "autoload": { - "psr-0": { - "Mockery": "library/" + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -489,12 +541,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -512,10 +572,13 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.3.6" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2022-09-07T15:05:49+00:00" + "time": "2023-08-09T00:03:52+00:00" }, { "name": "monolog/monolog", @@ -605,16 +668,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -652,7 +715,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -660,32 +723,89 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.17.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + }, + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -717,26 +837,26 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2018-07-08T19:23:20+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -768,9 +888,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2018-07-08T19:19:57+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -835,273 +955,171 @@ "time": "2019-12-27T09:44:58+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "phpunit/php-code-coverage", + "version": "9.2.29", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "coverage", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "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.29" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, + "funding": [ { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.6.2", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=7.3" }, "require-dev": { - "ext-tokenizer": "*", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" - }, - "time": "2022-10-14T12:47:21+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, + "funding": [ { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" - }, - "time": "2022-11-29T15:06:56+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1120,43 +1138,47 @@ "role": "lead" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "coverage", - "testing", - "xunit" + "process" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, - "time": "2018-10-31T16:06:48+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1175,15 +1197,14 @@ "role": "lead" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "filesystem", - "iterator" + "template" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { @@ -1191,26 +1212,34 @@ "type": "github" } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1227,44 +1256,83 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "template" + "timer" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.3", + "name": "phpunit/phpunit", + "version": "9.6.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", + "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", "shasum": "" }, "require": { - "php": ">=7.1" + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "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" }, - "require-dev": { - "phpunit/phpunit": "^8.5" + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -1280,140 +1348,107 @@ "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "timer" + "phpunit", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.0" }, "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2023-02-03T07:32:24+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "3.1.3", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "tokenizer" + "log", + "psr", + "psr-3" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2021-07-26T12:15:06+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "phpunit/phpunit", - "version": "7.5.20", + "name": "sebastian/cli-parser", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1432,93 +1467,100 @@ "role": "lead" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" }, - "time": "2020-01-08T08:45:45+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, - "time": "2021-05-03T11:20:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1540,7 +1582,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/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { @@ -1548,34 +1590,34 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.5", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1614,7 +1656,64 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" }, "funding": [ { @@ -1622,33 +1721,33 @@ "type": "github" } ], - "time": "2022-09-14T12:31:48+00:00" + "time": "2020-10-26T15:52:27+00:00" }, { "name": "sebastian/diff", - "version": "3.0.3", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1680,7 +1779,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -1688,27 +1787,27 @@ "type": "github" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", - "version": "4.2.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -1716,7 +1815,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1743,7 +1842,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1751,34 +1850,34 @@ "type": "github" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.5", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1813,14 +1912,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1828,27 +1927,30 @@ "type": "github" } ], - "time": "2022-09-14T06:00:17+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -1856,7 +1958,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1881,36 +1983,99 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-02T09:26:13+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, - "time": "2017-04-27T15:39:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.4", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1932,7 +2097,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/3.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -1940,32 +2105,32 @@ "type": "github" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1987,7 +2152,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/1.1.2" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -1995,32 +2160,32 @@ "type": "github" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.1", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2047,10 +2212,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -2058,29 +2223,32 @@ "type": "github" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2102,7 +2270,63 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -2110,29 +2334,29 @@ "type": "github" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2155,22 +2379,28 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -2206,14 +2436,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "theseer/tokenizer", @@ -2265,64 +2496,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" - }, { "name": "wp-coding-standards/wpcs", "version": "2.3.0", @@ -2376,16 +2549,16 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.4", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3c621ff5429d2b1ff96dc5808ad6cde99d31ea4c" + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3c621ff5429d2b1ff96dc5808ad6cde99d31ea4c", - "reference": "3c621ff5429d2b1ff96dc5808ad6cde99d31ea4c", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { @@ -2393,13 +2566,12 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { - "yoast/yoastcs": "^2.2.1" + "yoast/yoastcs": "^2.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev", - "dev-develop": "1.x-dev" + "dev-main": "2.x-dev" } }, "autoload": { @@ -2433,7 +2605,7 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2022-11-16T09:07:52+00:00" + "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [], diff --git a/docs/FORMATTING.md b/docs/FORMATTING.md index cb814bdf..fd92f472 100644 --- a/docs/FORMATTING.md +++ b/docs/FORMATTING.md @@ -9,6 +9,8 @@ These formatters will be applied on each pull request in Github Actions (via ``. #### PHPCS +> Note: Use -d error_reporting=E_ALL^E_DEPRECATED until https://github.com/PHPCompatibility/PHPCompatibility/issues/1651 is resolved + The ``phpcs`` configuration is handled in the ``.phpcs.xml`` file, a type of [Annotated Ruleset](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset). Install the development composer packages by running ``composer install`` prior to using ``phpcs``, and run it using ``vendor/bin/phpcs``, for example ``` diff --git a/lib/logs/managers/file-manager.php b/lib/logs/managers/file-manager.php index 112ec7d1..220fc2f4 100644 --- a/lib/logs/managers/file-manager.php +++ b/lib/logs/managers/file-manager.php @@ -113,6 +113,10 @@ public function ready() { */ protected function create_files( $files ) { foreach ( $files as $file ) { + if ( ! $file['base'] ) { + continue; + } + $file_path = trailingslashit( $file['base'] ) . $file['file']; $dir_exists = wp_mkdir_p( $file['base'] ); $dir_writable = is_writable( $file['base'] ); @@ -140,6 +144,10 @@ protected function create_files( $files ) { */ protected function files_are_ready( $files ) { foreach ( $files as $file ) { + if ( ! $file['base'] ) { + return false; + } + $directory_path = trailingslashit( $file['base'] ); $file_path = $directory_path . $file['file']; diff --git a/lib/sso-client/nonce.php b/lib/sso-client/nonce.php index 9b7d8f2d..74219fb6 100644 --- a/lib/sso-client/nonce.php +++ b/lib/sso-client/nonce.php @@ -29,6 +29,24 @@ class Nonce { */ private static $instance = null; + /** + * One can override the default nonce life. + * + * The default is set to 10 minutes, which is plenty for most of the cases + * + * @access private + * @var int + */ + private $nonce_life; + + /** + * Wpdb + * + * @access private + * @var mixed + */ + private $wpdb; + /** * Constructor * @@ -36,17 +54,8 @@ class Nonce { */ private function __construct() { global $wpdb; - $this->wpdb = $wpdb; - - /** - * One can override the default nonce life. - * - * The default is set to 10 minutes, which is plenty for most of the cases - * - * @var int - */ + $this->wpdb = $wpdb; $this->nonce_life = intval( apply_filters( 'wpdc_nonce_life', 600 ) ); - $this->maybe_create_db(); } diff --git a/lib/template-functions.php b/lib/template-functions.php index 2ba2dd2b..935dff36 100644 --- a/lib/template-functions.php +++ b/lib/template-functions.php @@ -331,7 +331,10 @@ protected function fix_avatars_in_quotes( $content, $discourse_url ) { $use_internal_errors = libxml_use_internal_errors( true ); $disable_entity_loader = $this->libxml_disable_entity_loader( true ); $doc = new \DOMDocument( '1.0', 'utf-8' ); - $doc->loadHTML( mb_convert_encoding( $content, 'HTML-ENTITIES', 'UTF-8' ) ); + $html = htmlentities( $content, ENT_COMPAT, 'utf-8', false ); + $html = mb_convert_encoding( $html, 'UTF-8', mb_detect_encoding( $html ) ); + $html = htmlspecialchars_decode( $html ); + $doc->loadHTML( $html ); $finder = new \DOMXPath( $doc ); $avatars_in_quotes = $finder->query( "//aside[contains(concat(' ', normalize-space(@class), ' '), ' quote ')]//img[contains(concat(' ', normalize-space(@class), ' '), ' avatar ')]" ); diff --git a/phpunit.xml b/phpunit.xml index 41629bce..1dc824b8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,25 +1,17 @@ - - - - tests/phpunit/ - tests/phpunit/multisite/ - - - - - lib - - - - - + + + + lib + + + + + tests/phpunit/ + tests/phpunit/multisite/ + + + + + diff --git a/phpunit.xml.bak b/phpunit.xml.bak new file mode 100644 index 00000000..41629bce --- /dev/null +++ b/phpunit.xml.bak @@ -0,0 +1,25 @@ + + + + + tests/phpunit/ + tests/phpunit/multisite/ + + + + + lib + + + + + + diff --git a/tests/phpunit/.phpunit.result.cache b/tests/phpunit/.phpunit.result.cache new file mode 100644 index 00000000..e453410c --- /dev/null +++ b/tests/phpunit/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_in_multisite":0.036,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating":0.014,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_with_embed_error":0.017,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_with_category_error":0.015,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_with_response_body_error":0.019,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_with_enqueued_post":0.016,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_creating_with_direct_db_publication_flags":0.014,"DiscoursePublishMultisiteTest::test_sync_to_discourse_pin_topic":0.015,"DiscoursePublishMultisiteTest::test_sync_to_discourse_discourse_username":0.022,"DiscoursePublishMultisiteTest::test_sync_to_discourse_discourse_username_with_single_user_api_key":0.022,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_updating":0.013,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_updating_with_deleted_topic":0.017,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_updating_with_featured_link":0.015,"DiscoursePublishMultisiteTest::test_sync_to_discourse_when_updating_with_direct_db_publication_flags":0.017,"DiscoursePublishMultisiteTest::test_exclude_tags_with_exclusionary_tag":0.016,"DiscoursePublishMultisiteTest::test_exclude_tags_with_non_exclusionary_tag":0.017,"DiscoursePublishMultisiteTest::test_wpdc_publish_options":0.016,"DiscoursePublishMultisiteTest::test_force_publish_allowed_property":0.015,"DiscoursePublishMultisiteTest::test_force_publish_option":0.015,"DiscoursePublishMultisiteTest::test_force_publish_max_age_prevents_older_posts_from_being_published":0.015,"DiscoursePublishMultisiteTest::test_wp_discourse_before_xmlrpc_publish_filter":0.016,"DiscoursePublishMultisiteTest::test_xmlrpc_publish_failure_notification":0.017,"DiscoursePublishMultisiteTest::test_remote_post_success":0.003,"DiscoursePublishMultisiteTest::test_remote_post_forbidden":0.007,"DiscoursePublishMultisiteTest::test_remote_post_unprocessable":0.007,"DiscoursePublishMultisiteTest::test_remote_post_failed_to_connect":0.006,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_embed_error":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_category_error":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_response_body_error":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_enqueued_post":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_creating_with_direct_db_publication_flags":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_pin_topic":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_discourse_username":0.019,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_discourse_username_with_single_user_api_key":0.02,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_deleted_topic":0.015,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_featured_link":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_sync_to_discourse_when_updating_with_direct_db_publication_flags":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_exclude_tags_with_exclusionary_tag":0.013,"WPDiscourse\\Test\\DiscoursePublishTest::test_exclude_tags_with_non_exclusionary_tag":0.016,"WPDiscourse\\Test\\DiscoursePublishTest::test_wpdc_publish_options":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_allowed_property":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_option":0.019,"WPDiscourse\\Test\\DiscoursePublishTest::test_force_publish_max_age_prevents_older_posts_from_being_published":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_wp_discourse_before_xmlrpc_publish_filter":0.014,"WPDiscourse\\Test\\DiscoursePublishTest::test_xmlrpc_publish_failure_notification":0.012,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_success":0,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_forbidden":0.004,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_unprocessable":0.004,"WPDiscourse\\Test\\DiscoursePublishTest::test_remote_post_failed_to_connect":0.004,"SyncDiscourseTopicMultisiteTest::test_update_topic_content":0.016,"SyncDiscourseTopicMultisiteTest::test_update_topic_content_invalid_signature":0.022,"WPDiscourse\\Test\\SyncDiscourseTopicTest::test_update_topic_content":0.01,"WPDiscourse\\Test\\SyncDiscourseTopicTest::test_update_topic_content_invalid_signature":0.01}} \ No newline at end of file diff --git a/tests/phpunit/helpers/multisite.php b/tests/phpunit/helpers/multisite.php index 01986d01..6832f9a8 100644 --- a/tests/phpunit/helpers/multisite.php +++ b/tests/phpunit/helpers/multisite.php @@ -15,7 +15,7 @@ trait Multisite { /** * Setup multisite tests */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->create_topic_blog_table(); } @@ -23,7 +23,7 @@ public function setUp() { /** * Teardown multisite tests */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $this->clear_topic_blog_table(); } diff --git a/tests/phpunit/test-discourse-comment-formatter.php b/tests/phpunit/test-discourse-comment-formatter.php index 9bf1ca40..939c1245 100644 --- a/tests/phpunit/test-discourse-comment-formatter.php +++ b/tests/phpunit/test-discourse-comment-formatter.php @@ -23,10 +23,42 @@ class DiscourseCommentFormatterTest extends UnitTest { */ protected $comment_formatter; + /** + * Discourse post + * + * @access protected + * @var array + */ + protected $discourse_post; + + /** + * Wordpress post id + * + * @access protected + * @var int + */ + protected $post_id; + + /** + * Discourse topic id + * + * @access protected + * @var int + */ + protected $discourse_topic_id; + + /** + * Discourse permalink + * + * @access protected + * @var string + */ + protected $discourse_permalink; + /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->comment_formatter = new DiscourseCommentFormatter(); @@ -49,7 +81,7 @@ public function setUp() { update_post_meta( $this->post_id, 'discourse_topic_id', $this->discourse_topic_id ); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); // Cleanup. @@ -120,8 +152,8 @@ public function test_missing_post_meta() { // TO FIX. Ensure we've made the right logs. // $log = $this->get_last_log(); - // $this->assertRegExp( '/comment_formatter.ERROR: format.missing_post_data/', $log ); - // $this->assertRegExp( '/"keys":"' . $deleted_required_meta_key . '"/', $log ); + // $this->assertMatchesRegularExpression( '/comment_formatter.ERROR: format.missing_post_data/', $log ); + // $this->assertMatchesRegularExpression( '/"keys":"' . $deleted_required_meta_key . '"/', $log ); } protected function sanitize_html( $buffer ) { diff --git a/tests/phpunit/test-discourse-comment.php b/tests/phpunit/test-discourse-comment.php index 9ca9196e..58d9de08 100644 --- a/tests/phpunit/test-discourse-comment.php +++ b/tests/phpunit/test-discourse-comment.php @@ -27,7 +27,7 @@ class DiscourseCommentTest extends UnitTest { /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $comment_formatter = new DiscourseCommentFormatter(); @@ -110,11 +110,11 @@ public function test_sync_comments_handle_error_response() { // Ensure we've made the right logs $log = $this->get_last_log(); - $this->assertRegExp( '/comment.ERROR: sync_comments.response_error/', $log ); - $this->assertRegExp( '/"message":"Not found"/', $log ); - $this->assertRegExp( '/"discourse_topic_id":"' . $discourse_topic_id . '"/', $log ); - $this->assertRegExp( '/"wp_post_id":' . $post_id . '/', $log ); - $this->assertRegExp( '/"http_code":404/', $log ); + $this->assertMatchesRegularExpression( '/comment.ERROR: sync_comments.response_error/', $log ); + $this->assertMatchesRegularExpression( '/"message":"Not found"/', $log ); + $this->assertMatchesRegularExpression( '/"discourse_topic_id":"' . $discourse_topic_id . '"/', $log ); + $this->assertMatchesRegularExpression( '/"wp_post_id":' . $post_id . '/', $log ); + $this->assertMatchesRegularExpression( '/"http_code":404/', $log ); // Cleanup wp_delete_post( $post_id ); @@ -230,8 +230,8 @@ public function test_get_comment_type_for_post_display_public_comments_only_when // Ensure we've made the right logs $log = $this->get_last_log(); - $this->assertRegExp( "/comment.ERROR: $context.get_discourse_category/", $log ); - $this->assertRegExp( '/"message":"An invalid response was returned from Discourse"/', $log ); + $this->assertMatchesRegularExpression( "/comment.ERROR: $context.get_discourse_category/", $log ); + $this->assertMatchesRegularExpression( '/"message":"An invalid response was returned from Discourse"/', $log ); // Cleanup. wp_delete_post( $public_post_id ); diff --git a/tests/phpunit/test-discourse-connection.php b/tests/phpunit/test-discourse-connection.php index 656c7d2e..4e637283 100644 --- a/tests/phpunit/test-discourse-connection.php +++ b/tests/phpunit/test-discourse-connection.php @@ -26,7 +26,7 @@ class DiscourseConnectionTest extends UnitTest { /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->form_helper = FormHelper::get_instance(); self::$plugin_options['connection-logs'] = 1; @@ -78,7 +78,7 @@ public function test_check_connection_status_response_error() { $this->assertFalse( $result ); $log = $this->get_last_log(); - $this->assertRegExp( '/connection.INFO: check_connection_status.failed_to_connect/', $log ); + $this->assertMatchesRegularExpression( '/connection.INFO: check_connection_status.failed_to_connect/', $log ); } /** @@ -101,7 +101,7 @@ public function test_check_connection_status_response_error_legacy() { $this->assertFalse( $result ); $log = $this->get_last_log(); - $this->assertRegExp( '/connection.INFO: check_connection_status.failed_to_connect/', $log ); + $this->assertMatchesRegularExpression( '/connection.INFO: check_connection_status.failed_to_connect/', $log ); } /** @@ -130,7 +130,7 @@ public function test_check_connection_status_scopes_invalid() { $this->assertFalse( $result ); $log = $this->get_last_log(); - $this->assertRegExp( '/connection.INFO: check_connection_status.invalid_scopes/', $log ); + $this->assertMatchesRegularExpression( '/connection.INFO: check_connection_status.invalid_scopes/', $log ); self::$plugin_options['enable-discourse-comments'] = 0; $this->form_helper->setup_options( self::$plugin_options ); @@ -139,6 +139,6 @@ public function test_check_connection_status_scopes_invalid() { $this->assertTrue( $result ); $log = $this->get_last_log(); - $this->assertRegExp( '/connection.INFO: check_connection_status.valid_scopes/', $log ); + $this->assertMatchesRegularExpression( '/connection.INFO: check_connection_status.valid_scopes/', $log ); } } diff --git a/tests/phpunit/test-discourse-publish.php b/tests/phpunit/test-discourse-publish.php index a7ee2916..09b00c8e 100644 --- a/tests/phpunit/test-discourse-publish.php +++ b/tests/phpunit/test-discourse-publish.php @@ -37,7 +37,7 @@ class DiscoursePublishTest extends UnitTest { /** * Setup test class */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); self::initialize_variables(); @@ -46,7 +46,7 @@ public static function setUpBeforeClass() { /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $register_actions = false; $this->email_notifier = \Mockery::mock( EmailNotification::class )->makePartial(); @@ -118,9 +118,9 @@ public function test_sync_to_discourse_when_creating_with_embed_error() { // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.post_error/', $log ); - $this->assertRegExp( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); - $this->assertRegExp( '/"response_message":"' . $error_message . '"/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.post_error/', $log ); + $this->assertMatchesRegularExpression( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); + $this->assertMatchesRegularExpression( '/"response_message":"' . $error_message . '"/', $log ); // Cleanup. wp_delete_post( $post_id ); @@ -159,9 +159,9 @@ public function test_sync_to_discourse_when_creating_with_category_error() { // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.post_error/', $log ); - $this->assertRegExp( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); - $this->assertRegExp( '/"response_message":"' . $error_message . '"/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.post_error/', $log ); + $this->assertMatchesRegularExpression( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); + $this->assertMatchesRegularExpression( '/"response_message":"' . $error_message . '"/', $log ); // cleanup. wp_delete_post( $post_id ); @@ -201,7 +201,7 @@ public function test_sync_to_discourse_when_creating_with_response_body_error() // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.body_validation_error/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.body_validation_error/', $log ); // cleanup. wp_delete_post( $post_id ); @@ -242,7 +242,7 @@ public function test_sync_to_discourse_when_creating_with_enqueued_post() { // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/publish.WARNING: create_post.queued_topic_notice/', $log ); + $this->assertMatchesRegularExpression( '/publish.WARNING: create_post.queued_topic_notice/', $log ); // cleanup. wp_delete_post( $post_id ); @@ -501,7 +501,7 @@ public function test_sync_to_discourse_when_updating_with_deleted_topic() { // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/publish.WARNING: update_post.deleted_topic_notice/', $log ); + $this->assertMatchesRegularExpression( '/publish.WARNING: update_post.deleted_topic_notice/', $log ); // cleanup. wp_delete_post( $post_id ); @@ -933,8 +933,8 @@ public function test_remote_post_forbidden() { $this->assertEquals( $response, $this->build_post_error() ); $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.post_error/', $log ); - $this->assertRegExp( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.post_error/', $log ); + $this->assertMatchesRegularExpression( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); } /** @@ -952,8 +952,8 @@ public function test_remote_post_unprocessable() { $this->assertEquals( $response, $this->build_post_error() ); $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.post_error/', $log ); - $this->assertRegExp( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.post_error/', $log ); + $this->assertMatchesRegularExpression( '/"http_code":' . $raw_response['response']['code'] . '/', $log ); } /** @@ -973,7 +973,7 @@ public function test_remote_post_failed_to_connect() { $this->assertEquals( $response, $this->build_post_error() ); $log = $this->get_last_log(); - $this->assertRegExp( '/publish.ERROR: create_post.post_error/', $log ); + $this->assertMatchesRegularExpression( '/publish.ERROR: create_post.post_error/', $log ); } /** diff --git a/tests/phpunit/test-discourse-sso.php b/tests/phpunit/test-discourse-sso.php index c81222cd..1709336f 100644 --- a/tests/phpunit/test-discourse-sso.php +++ b/tests/phpunit/test-discourse-sso.php @@ -15,7 +15,63 @@ */ class DiscourseSSOTest extends UnitTest { - public function setUp() { + /** + * User id + * + * @access protected + * @var int + */ + protected $user_id; + + /** + * Secret + * + * @access protected + * @var string + */ + protected $secret; + + /** + * Nonce + * + * @access protected + * @var string + */ + protected $nonce; + + /** + * Query vars + * + * @access protected + * @var array + */ + protected $query_vars; + + /** + * Client + * + * @access protected + * @var \WPDiscourse\DiscourseSSO\DiscourseSSO + */ + protected $discourse_sso; + + /** + * Signaure + * + * @access protected + * @var string + */ + protected $signature; + + /** + * Payload + * + * @access protected + * @var string + */ + protected $payload; + + public function setUp(): void { $this->secret = 'secret'; $this->nonce = 'abcd'; $this->payload = base64_encode( "nonce={$this->nonce}" ); @@ -35,7 +91,7 @@ public function setUp() { $this->user_id = self::factory()->user->create(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $_GET['request'] = null; @@ -104,7 +160,7 @@ public function test_sso_parse_request_invalid_signature() { $this->assertEquals( $parse_result->get_error_message(), 'SSO error' ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_provider.ERROR: parse_request.invalid_sso/', $log ); + $this->assertMatchesRegularExpression( '/sso_provider.ERROR: parse_request.invalid_sso/', $log ); } /** @@ -126,8 +182,8 @@ public function test_sso_parse_request_invalid_nonce() { $this->assertEquals( $parse_result->get_error_message(), $error_message ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_provider.ERROR: parse_request.invalid_sso/', $log ); - $this->assertRegExp( '/"message":"' . $error_message . '"/', $log ); + $this->assertMatchesRegularExpression( '/sso_provider.ERROR: parse_request.invalid_sso/', $log ); + $this->assertMatchesRegularExpression( '/"message":"' . $error_message . '"/', $log ); } /** @@ -171,8 +227,8 @@ public function test_logout_from_discourse_failed_to_get_discourse_user() { $this->assertEquals( $logout_result->get_error_message(), $error_message ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_provider.ERROR: logout.discourse_user/', $log ); - $this->assertRegExp( '/"message":"' . $error_message . '"/', $log ); + $this->assertMatchesRegularExpression( '/sso_provider.ERROR: logout.discourse_user/', $log ); + $this->assertMatchesRegularExpression( '/"message":"' . $error_message . '"/', $log ); } /** @@ -196,7 +252,7 @@ public function test_logout_from_discourse_failed_to_logout() { $this->assertEquals( $logout_result->get_error_message(), $error_message ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_provider.ERROR: logout.response_error/', $log ); - $this->assertRegExp( '/"message":"' . $error_message . '"/', $log ); + $this->assertMatchesRegularExpression( '/sso_provider.ERROR: logout.response_error/', $log ); + $this->assertMatchesRegularExpression( '/"message":"' . $error_message . '"/', $log ); } } diff --git a/tests/phpunit/test-file-handler.php b/tests/phpunit/test-file-handler.php index 06213ae3..96afb7f7 100644 --- a/tests/phpunit/test-file-handler.php +++ b/tests/phpunit/test-file-handler.php @@ -73,7 +73,7 @@ public function test_log_file_write() { $log_file = $log_files[0]; $last_entry = shell_exec( "tail -n 1 $log_file" ); - $this->assertRegExp( '/New Log/', $last_entry ); + $this->assertMatchesRegularExpression( '/New Log/', $last_entry ); } /** @@ -136,8 +136,8 @@ function ( $record ) use ( $tomorrows_datetime ) { $todays_date = $todays_datetime->format( FileHandler::DATE_FORMAT ); $files = $file_handler->list_files(); - $this->assertRegExp( '/' . $tomorrows_date . '/', $files[0] ); - $this->assertRegExp( '/' . $todays_date . '/', $files[1] ); + $this->assertMatchesRegularExpression( '/' . $tomorrows_date . '/', $files[0] ); + $this->assertMatchesRegularExpression( '/' . $todays_date . '/', $files[1] ); } /** diff --git a/tests/phpunit/test-file-manager.php b/tests/phpunit/test-file-manager.php index 9bec6dbf..47d0ac9e 100644 --- a/tests/phpunit/test-file-manager.php +++ b/tests/phpunit/test-file-manager.php @@ -17,7 +17,7 @@ class FileManagerTest extends UnitTest { /** * Setup test class. */ - public function setUp() { + public function setUp(): void { parent::setUp(); static::reset_permissions(); } @@ -25,7 +25,7 @@ public function setUp() { /** * Teardown test class. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); static::reset_permissions(); } @@ -37,7 +37,7 @@ public function test_validation_uploads_creation() { $file_manager = new FileManager(); $this->recursive_rmdir( $file_manager->upload_dir ); - $this->assertDirectoryNotExists( $file_manager->upload_dir ); + $this->assertDirectoryDoesNotExist( $file_manager->upload_dir ); $file_manager->validate(); @@ -52,7 +52,7 @@ public function test_validation_logs_creation() { $file_manager = new FileManager(); $this->recursive_rmdir( $file_manager->logs_dir ); - $this->assertDirectoryNotExists( $file_manager->logs_dir ); + $this->assertDirectoryDoesNotExist( $file_manager->logs_dir ); $file_manager->validate(); diff --git a/tests/phpunit/test-log-viewer.php b/tests/phpunit/test-log-viewer.php index 4bae3da8..bcde6348 100644 --- a/tests/phpunit/test-log-viewer.php +++ b/tests/phpunit/test-log-viewer.php @@ -7,6 +7,7 @@ namespace WPDiscourse\Test; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use \WPDiscourse\Logs\FileManager; use \WPDiscourse\Logs\FileHandler; use \WPDiscourse\Logs\Logger; @@ -18,6 +19,7 @@ * Logger test case. */ class LogViewerTest extends UnitTest { + use ArraySubsetAsserts; /** * Instance of LogViewer. @@ -30,7 +32,7 @@ class LogViewerTest extends UnitTest { /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->viewer = new LogViewer( FormHelper::get_instance() ); @@ -40,7 +42,7 @@ public function setUp() { /** * Teardown each test. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); self::$plugin_options['logs-enabled'] = 1; diff --git a/tests/phpunit/test-logger.php b/tests/phpunit/test-logger.php index e09fb6d5..3abf5853 100644 --- a/tests/phpunit/test-logger.php +++ b/tests/phpunit/test-logger.php @@ -21,7 +21,7 @@ class LoggerTest extends UnitTest { /** * Teardown each test. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); self::$plugin_options['logs-enabled'] = 1; diff --git a/tests/phpunit/test-sso-client.php b/tests/phpunit/test-sso-client.php index 213a003a..b41bc7bb 100644 --- a/tests/phpunit/test-sso-client.php +++ b/tests/phpunit/test-sso-client.php @@ -16,7 +16,71 @@ */ class SSOClientTest extends UnitTest { - public static function setUpBeforeClass() { + /** + * Discourse user id + * + * @access protected + * @var int + */ + protected $discourse_user_id; + + /** + * User id + * + * @access protected + * @var int + */ + protected $user_id; + + /** + * Secret + * + * @access protected + * @var string + */ + protected $secret; + + /** + * Nonce + * + * @access protected + * @var string + */ + protected $nonce; + + /** + * Query args + * + * @access protected + * @var array + */ + protected $query_args; + + /** + * Client + * + * @access protected + * @var \WPDiscourse\SSOClient\Client + */ + protected $sso_client; + + /** + * Signaure + * + * @access protected + * @var string + */ + protected $signature; + + /** + * Payload + * + * @access protected + * @var array + */ + protected $payload; + + public static function setUpBeforeClass(): void { parent::initialize_shared_variables(); wp_logout(); @@ -26,7 +90,7 @@ public static function setUpBeforeClass() { } } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->discourse_user_id = 5; @@ -60,7 +124,7 @@ public function setUp() { $_GET['sig'] = rawurlencode( $this->signature ); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $_GET['sso'] = null; @@ -101,7 +165,7 @@ public function test_parse_request_invalid_signature() { $this->assertNotEquals( $user->ID, $this->user_id ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_client.ERROR: parse_request.invalid_signature/', $log ); + $this->assertMatchesRegularExpression( '/sso_client.ERROR: parse_request.invalid_signature/', $log ); } /** @@ -120,7 +184,7 @@ public function test_parse_request_get_user_failed() { $this->assertNotEquals( $user->ID, $this->user_id ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_client.ERROR: parse_request.get_user_id/', $log ); + $this->assertMatchesRegularExpression( '/sso_client.ERROR: parse_request.get_user_id/', $log ); } /** @@ -135,7 +199,7 @@ public function test_parse_request_update_user_failed() { $this->assertNotEquals( $user->ID, $this->user_id ); $log = $this->get_last_log(); - $this->assertRegExp( '/sso_client.ERROR: parse_request.update_user/', $log ); + $this->assertMatchesRegularExpression( '/sso_client.ERROR: parse_request.update_user/', $log ); remove_filter( 'wpdc_sso_client_updated_user', array( $this, 'invalid_update_user_filter' ), 10 ); } diff --git a/tests/phpunit/test-sync-discourse-topic.php b/tests/phpunit/test-sync-discourse-topic.php index 61a031a8..a0c779dc 100644 --- a/tests/phpunit/test-sync-discourse-topic.php +++ b/tests/phpunit/test-sync-discourse-topic.php @@ -23,10 +23,34 @@ class SyncDiscourseTopicTest extends UnitTest { */ protected $sync_topic; + /** + * Request + * + * @access protected + * @var WP_REST_Request + */ + protected $request; + + /** + * Signaure + * + * @access protected + * @var string + */ + protected $signature; + + /** + * Payload + * + * @access protected + * @var array + */ + protected $payload; + /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); self::$plugin_options['webhook-secret'] = '1234567891011'; diff --git a/tests/phpunit/test-sync-discourse-user.php b/tests/phpunit/test-sync-discourse-user.php index 73765749..f4cac996 100644 --- a/tests/phpunit/test-sync-discourse-user.php +++ b/tests/phpunit/test-sync-discourse-user.php @@ -23,10 +23,34 @@ class SyncDiscourseUserTest extends UnitTest { */ protected $sync_user; + /** + * Request + * + * @access protected + * @var WP_REST_Request + */ + protected $request; + + /** + * Signaure + * + * @access protected + * @var string + */ + protected $signature; + + /** + * Payload + * + * @access protected + * @var array + */ + protected $payload; + /** * Setup each test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); self::$plugin_options['webhook-secret'] = '1234567891011'; @@ -48,7 +72,7 @@ public function setUp() { $this->request->set_body( $this->payload ); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $payload = json_decode( $this->payload ); @@ -151,7 +175,7 @@ public function test_update_user_unable_to_find_user() { // Ensure the right log is created. $log = $this->get_last_log(); - $this->assertRegExp( '/webhook_user.WARNING: update_user.user_not_found/', $log ); + $this->assertMatchesRegularExpression( '/webhook_user.WARNING: update_user.user_not_found/', $log ); } } diff --git a/tests/phpunit/test-utilities.php b/tests/phpunit/test-utilities.php index 472640c5..bf2b2e33 100644 --- a/tests/phpunit/test-utilities.php +++ b/tests/phpunit/test-utilities.php @@ -14,7 +14,15 @@ */ class UtilitiesTest extends UnitTest { - public function setUp() { + /** + * User id + * + * @access protected + * @var int + */ + protected $user_id; + + public function setUp(): void { $connection_options = get_option( 'discourse_connect' ); $connection_options = array_merge( $connection_options, self::$connection_options ); update_option( 'discourse_connect', $connection_options ); diff --git a/tests/phpunit/unit-test.php b/tests/phpunit/unit-test.php index c173d259..2397ec3d 100644 --- a/tests/phpunit/unit-test.php +++ b/tests/phpunit/unit-test.php @@ -76,20 +76,20 @@ class UnitTest extends \WP_UnitTestCase { /** * Setup test class */ - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { self::initialize_shared_variables(); } /** * Setup each test. */ - public function setUp() { + public function setUp(): void { } /** * Teardown each test. */ - public function tearDown() { + public function tearDown(): void { $this->clear_logs(); remove_all_filters( 'pre_http_request' ); \Mockery::close(); diff --git a/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php b/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php index 4cdcf4fc..691189e7 100644 --- a/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php +++ b/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php @@ -271,7 +271,7 @@ public function addRecord($level, $message, array $context = array()) if ($this->microsecondTimestamps && \PHP_VERSION_ID < 70100) { $ts = \DateTime::createFromFormat('U.u', \sprintf('%.6F', \microtime(\true)), static::$timezone); } else { - $ts = new \DateTime(null, static::$timezone); + $ts = new \DateTime('now', static::$timezone); } $ts->setTimezone(static::$timezone); $record = array('message' => (string) $message, 'context' => $context, 'level' => $level, 'level_name' => $levelName, 'channel' => $this->name, 'datetime' => $ts, 'extra' => array());