Skip to content

Commit

Permalink
Add tests to the Connection package to increase coverage. (#39963)
Browse files Browse the repository at this point in the history
* Migrated PHPUNIT XML file to new schema.

* Migrated schema using phpunit.

* Added test coverage for the Manager signature verification method.

* Minor lint edit.

* Changelog.

* Added an is_null check to make Phan happy.

* Second time's the charm - checking the error object correctly.

---------

Co-authored-by: tbradsha <[email protected]>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12550233129

Upstream-Ref: Automattic/jetpack@59b0e8d
  • Loading branch information
tbradsha authored and matticbot committed Dec 30, 2024
1 parent a71afe0 commit 879e597
Show file tree
Hide file tree
Showing 17 changed files with 142 additions and 133 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"automattic/jetpack-boost-speed-score": "^0.4.0",
"automattic/jetpack-composer-plugin": "^4.0.0",
"automattic/jetpack-config": "^3.0.0",
"automattic/jetpack-connection": "^6.2.1",
"automattic/jetpack-connection": "^6.2.2-alpha",
"automattic/jetpack-device-detection": "^3.0.0",
"automattic/jetpack-image-cdn": "^0.7.2",
"automattic/jetpack-my-jetpack": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-boost-core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1"
"automattic/jetpack-connection": "^6.2.2-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.2.2-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Added tests to increase code coverage.

## [6.2.1] - 2024-12-16
### Changed
- Updated package dependencies. [#40564]
Expand Down Expand Up @@ -1271,6 +1278,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[6.2.2-alpha]: https://github.com/Automattic/jetpack-connection/compare/v6.2.1...v6.2.2-alpha
[6.2.1]: https://github.com/Automattic/jetpack-connection/compare/v6.2.0...v6.2.1
[6.2.0]: https://github.com/Automattic/jetpack-connection/compare/v6.1.1...v6.2.0
[6.1.1]: https://github.com/Automattic/jetpack-connection/compare/v6.1.0...v6.1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ private function internal_verify_xml_rpc_signature() {

if (
empty( $token_key )
||
empty( $version ) || (string) $jetpack_api_version !== $version ) {
|| empty( $version )
|| (string) $jetpack_api_version !== $version
) {
return new \WP_Error( 'malformed_token', 'Malformed token in request', compact( 'signature_details', 'error_type' ) );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '6.2.1';
const PACKAGE_VERSION = '6.2.2-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-explat/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1"
"automattic/jetpack-connection": "^6.2.2-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.2",
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
"automattic/jetpack-assets": "^4.0.2",
"automattic/jetpack-connection": "^6.2.1",
"automattic/jetpack-connection": "^6.2.2-alpha",
"automattic/jetpack-device-detection": "^3.0.0",
"automattic/jetpack-logo": "^3.0.0",
"automattic/jetpack-redirect": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-licensing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1"
"automattic/jetpack-connection": "^6.2.2-alpha"
},
"require-dev": {
"automattic/wordbless": "^0.4.2",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-admin-ui": "^0.5.1",
"automattic/jetpack-assets": "^4.0.2",
"automattic/jetpack-boost-speed-score": "^0.4.0",
"automattic/jetpack-connection": "^6.2.1",
"automattic/jetpack-connection": "^6.2.2-alpha",
"automattic/jetpack-explat": "^0.2.3",
"automattic/jetpack-jitm": "^4.0.3",
"automattic/jetpack-licensing": "^3.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1",
"automattic/jetpack-connection": "^6.2.2-alpha",
"automattic/jetpack-plugins-installer": "^0.5.0",
"automattic/jetpack-sync": "^4.2.0",
"automattic/jetpack-protect-models": "^0.4.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1",
"automattic/jetpack-connection": "^6.2.2-alpha",
"automattic/jetpack-constants": "^3.0.1",
"automattic/jetpack-password-checker": "^0.4.1",
"automattic/jetpack-ip": "^0.4.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '6.2.1',
'ver' => '6.2.2-alpha1735582226',
),
'jetpack-explat' => array(
'path' => 'jetpack_vendor/automattic/jetpack-explat',
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-plans/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.2",
"automattic/jetpack-connection": "^6.2.1"
"automattic/jetpack-connection": "^6.2.2-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
Loading

0 comments on commit 879e597

Please sign in to comment.