Skip to content

Commit

Permalink
tests: Rename and abstractify custom TestCase base classes (#41935)
Browse files Browse the repository at this point in the history
PHPUnit 10+ requires that test class names match the filename, PSR-4
style. We've written a PHPUnit sniff to help find mismatches, but to
work properly it needs any custom TestCase base classes to be abstract
and have names ending in "TestCase" or "TestBase".

This PR adds `abstract` where necessary and renames classes where
necessary.

In a few places this has already caused other existing PHPUnit rules to
start fixing things. 😀

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

Upstream-Ref: Automattic/jetpack@18072cc
  • Loading branch information
anomiex authored and matticbot committed Feb 24, 2025
1 parent 43bc765 commit cf41ab6
Show file tree
Hide file tree
Showing 24 changed files with 115 additions and 110 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"automattic/jetpack-admin-ui": "^0.5.2",
"automattic/jetpack-assets": "^4.0.8-alpha",
"automattic/jetpack-autoloader": "^5.0.1",
"automattic/jetpack-autoloader": "^5.0.2-alpha",
"automattic/jetpack-composer-plugin": "^4.0.0",
"automattic/jetpack-config": "^3.0.0",
"automattic/jetpack-publicize": "^0.61.0-alpha",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [0.4.2-alpha] - unreleased

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

## [0.4.1] - 2025-01-23
### Changed
- Internal updates.
Expand Down Expand Up @@ -104,6 +108,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add a new package for Boost Speed Score [#30914]
- Add a new argument to `Speed_Score` to identify where the request was made from (e.g. 'boost-plugin', 'jetpack-dashboard', etc). [#31012]

[0.4.2-alpha]: https://github.com/Automattic/jetpack-boost-speed-score/compare/v0.4.1...v0.4.2-alpha
[0.4.1]: https://github.com/Automattic/jetpack-boost-speed-score/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/Automattic/jetpack-boost-speed-score/compare/v0.3.14...v0.4.0
[0.3.14]: https://github.com/Automattic/jetpack-boost-speed-score/compare/v0.3.13...v0.3.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class Speed_Score {

const PACKAGE_VERSION = '0.4.1';
const PACKAGE_VERSION = '0.4.2-alpha';

/**
* Array of module slugs that are currently active and can impact speed score.
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 @@ -7,7 +7,7 @@
"php": ">=7.2",
"automattic/jetpack-admin-ui": "^0.5.2",
"automattic/jetpack-assets": "^4.0.8-alpha",
"automattic/jetpack-boost-speed-score": "^0.4.1",
"automattic/jetpack-boost-speed-score": "^0.4.2-alpha",
"automattic/jetpack-connection": "^6.6.0-alpha",
"automattic/jetpack-explat": "^0.2.7",
"automattic/jetpack-jitm": "^4.1.1-alpha",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-publicize/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.2",
"automattic/jetpack-admin-ui": "^0.5.2",
"automattic/jetpack-connection": "^6.6.0-alpha",
"automattic/jetpack-autoloader": "^5.0.1",
"automattic/jetpack-autoloader": "^5.0.2-alpha",
"automattic/jetpack-config": "^3.0.0",
"automattic/jetpack-assets": "^4.0.8-alpha",
"automattic/jetpack-redirect": "^3.0.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 @@ -18,7 +18,7 @@
),
'jetpack-boost-speed-score' => array(
'path' => 'jetpack_vendor/automattic/jetpack-boost-speed-score',
'ver' => '0.4.1',
'ver' => '0.4.2-alpha1740408687',
),
'jetpack-config' => array(
'path' => 'jetpack_vendor/automattic/jetpack-config',
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload_packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package automattic/jetpack-autoloader
*/

namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_socialⓥ6_2_0_alpha\al5_0_1;
namespace Automattic\Jetpack\Autoloader\jpc4802e05bbcf59fd3b6350e8d3e5482c_socialⓥ6_2_0_alpha\al5_0_2_alpha;

// phpcs:ignore

Expand Down
68 changes: 34 additions & 34 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "894faed323c6c62ec25dbf74d527c01497ac29fa"
"reference": "665cebf51644bb3ddd0c23bf1538dd2b97554f01"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -63,7 +63,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "a50d4663ca05c1f4d7874ade487de37a14ad19de"
"reference": "df08cec4abcd670de727b01cddbbbf17cd8fec75"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -125,7 +125,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "71a128cfb60be6a042daf5b966b1e8f28ea01c1c"
"reference": "9260cb3663cdb0ae9b5cd00681c161724a536e6c"
},
"require": {
"automattic/jetpack-constants": "^3.0.1",
Expand Down Expand Up @@ -192,12 +192,12 @@
},
{
"name": "automattic/jetpack-autoloader",
"version": "5.0.1",
"version_normalized": "5.0.1.0",
"version": "5.0.2-alpha.1740408687",
"version_normalized": "5.0.2.0-alpha1740408687",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "99efef0e1b0bd6fd5961e3985138ecb021bb24fc"
"reference": "ffcfa2b9fafcbb335520fa078c938bc3d9fa9897"
},
"require": {
"composer-plugin-api": "^2.2",
Expand Down Expand Up @@ -268,7 +268,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-core",
"reference": "6f2733ea8b73800bc11be4ec98429a50505421a1"
"reference": "96c1b145f8887617fede3f72112dc59646c1800c"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down Expand Up @@ -321,12 +321,12 @@
},
{
"name": "automattic/jetpack-boost-speed-score",
"version": "0.4.1",
"version_normalized": "0.4.1.0",
"version": "0.4.2-alpha.1740408687",
"version_normalized": "0.4.2.0-alpha1740408687",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
"reference": "eae66fa15778db76f17cb892341c6ce176f9f042"
"reference": "00edb2508f81927e5573eb861094123283501587"
},
"require": {
"automattic/jetpack-boost-core": "^0.3.5",
Expand Down Expand Up @@ -393,7 +393,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "265edb49851932f4e5c1fc946e666cf724919e33"
"reference": "762c28c5c9335c8eba44088eee6aab07f9313a20"
},
"require": {
"composer-plugin-api": "^2.2",
Expand Down Expand Up @@ -456,7 +456,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "490aae7d01c635d9af2118f30e2acf35fee0b74a"
"reference": "7f6fb90877be595be80823b54a0b8973871e786b"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -531,7 +531,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "1bba1081e46efabed6362debbc5479d5aa88a3a2"
"reference": "a89c5dfbdc41fd9cbf4a57b1f0681c8aed0bb3e8"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
Expand Down Expand Up @@ -618,7 +618,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "ab0fab38f190dca170354a435e42b63b62935d62"
"reference": "b5d6a297950145536600a9a86695da8fe2948860"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -675,7 +675,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "fdfe45617cac873718f18f69b669f368a06bb5d3"
"reference": "b95eedf75bdbea373c8e7fc904e5e052155ef10b"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -731,7 +731,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
"reference": "4cfdd51d4f30eefd45c0cb1ee6f8adfb926bba56"
"reference": "7fa6ac5d5b1eea3ef6c766015b181045ba0f0a76"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down Expand Up @@ -809,7 +809,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "b6c343a170fe6a04aff8ff6f70fcaafc1ee34599"
"reference": "d074593bb86965ae89d3bf01dad93568bbacb0d4"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -870,7 +870,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "d52dbd4d63467f3f98c6c09deb2f765e4b6dc413"
"reference": "a20318816d4ec4b318c7a9877ca12e705ec69e52"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
Expand Down Expand Up @@ -948,7 +948,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "eb84f209875057f327b00342d7e68e29ba28cbb6"
"reference": "c0e1598b39d43d7b7244b6876c9744c97d1c6240"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down Expand Up @@ -1007,7 +1007,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "ca57d3112ea58fd61a9f0c5223efc16689f856eb"
"reference": "2ede3a900ab92633c81fef93d2c1a4058742bc4d"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -1063,12 +1063,12 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "87a8dc2ea4af5be1a2fb72f2a64b34f6d51f44c0"
"reference": "6d7c5a4c3988ec556aef277e343d5b7aea35010d"
},
"require": {
"automattic/jetpack-admin-ui": "^0.5.2",
"automattic/jetpack-assets": "^4.0.8-alpha",
"automattic/jetpack-boost-speed-score": "^0.4.1",
"automattic/jetpack-boost-speed-score": "^0.4.2-alpha",
"automattic/jetpack-connection": "^6.6.0-alpha",
"automattic/jetpack-constants": "^3.0.1",
"automattic/jetpack-explat": "^0.2.7",
Expand Down Expand Up @@ -1162,7 +1162,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "8023d858501ee966a995b6fc0efc2548f890da6a"
"reference": "61ae3c9e6ac1683bee8e90f536244eab406bdea0"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -1220,7 +1220,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
"reference": "fedc2730a8f7a3e13ad439297abff970f88d91b3"
"reference": "945ccb4224dd03025e19ebe5a1fcf1c7fe3c9669"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down Expand Up @@ -1285,7 +1285,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "ebf05e204303ef53e295d3bd20c6fa95187f9189"
"reference": "37337f481db0b0881b262c202b22d2b245a4d36a"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^3.0.0",
Expand Down Expand Up @@ -1344,7 +1344,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-post-list",
"reference": "088ab7d1848c1e23e49a9c9e68a068b47406ca8b"
"reference": "e420a872e4db4676db8008c01cf61604214b1907"
},
"require": {
"automattic/jetpack-assets": "^4.0.8-alpha",
Expand Down Expand Up @@ -1412,7 +1412,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
"reference": "415ceb723838c3420b9988f43476235ec835a691"
"reference": "62f6227dc95162a6f5e0c291bdd7f2495263e3dd"
},
"require": {
"automattic/jetpack-redirect": "^3.0.1",
Expand Down Expand Up @@ -1480,7 +1480,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
"reference": "85b7c4fc015da130db91137646ba565b27ae8bfc"
"reference": "6f65de21cf1c9a5b3ca9a35bf1b32da62074ab78"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down Expand Up @@ -1552,12 +1552,12 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-publicize",
"reference": "ffee2022bf11c476888100568fda11cbadfe5212"
"reference": "791df1e36ac276f50e567a1cf259f19af26807c9"
},
"require": {
"automattic/jetpack-admin-ui": "^0.5.2",
"automattic/jetpack-assets": "^4.0.8-alpha",
"automattic/jetpack-autoloader": "^5.0.1",
"automattic/jetpack-autoloader": "^5.0.2-alpha",
"automattic/jetpack-config": "^3.0.0",
"automattic/jetpack-connection": "^6.6.0-alpha",
"automattic/jetpack-plans": "^0.5.2",
Expand Down Expand Up @@ -1632,7 +1632,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "feb17e9ca39ca65febcb27f46c3440eec010911e"
"reference": "05022c655bbc351a5332c4eac9ef1e265b457ee2"
},
"require": {
"automattic/jetpack-status": "^5.0.4-alpha",
Expand Down Expand Up @@ -1690,7 +1690,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "eae67c5fb2922ddb0732b2fff4d5674218ea9da1"
"reference": "67633af0c777cadceda626a3e4094e0db94929d0"
},
"require": {
"php": ">=7.2"
Expand Down Expand Up @@ -1747,7 +1747,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "1a0f89bef90f0bf21b83a61cf24408151ad4bce1"
"reference": "f841e824f1b8495d7c1e946fe3da32ca5d174df4"
},
"require": {
"automattic/jetpack-constants": "^3.0.1",
Expand Down Expand Up @@ -1814,7 +1814,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "5f16c6f40dd7bd9aec06c2717fe7b32ac2d6c075"
"reference": "0c4640c00719b99c63c15dbfcc52c6651a92d1c0"
},
"require": {
"automattic/jetpack-connection": "^6.6.0-alpha",
Expand Down
Loading

0 comments on commit cf41ab6

Please sign in to comment.