From ee61b77226bdfb257d4c71ce7cd70eacd4655672 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Tue, 27 Jun 2023 22:23:41 +0200 Subject: [PATCH 01/49] bumped version --- src/Console/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Application.php b/src/Console/Application.php index bac8b2fb069..57598aad049 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -39,7 +39,7 @@ */ final class Application extends BaseApplication { - public const VERSION = '3.20.0'; + public const VERSION = '3.20.1-DEV'; public const VERSION_CODENAME = 'Triangle'; private ToolInfo $toolInfo; From 30e140df537fd612df0763c77a637cbd729a8b69 Mon Sep 17 00:00:00 2001 From: Greg Korba Date: Thu, 29 Jun 2023 17:16:42 +0200 Subject: [PATCH 02/49] DX: Rename abstract test classes to `*TestCase` convention (#7100) --- .../Sets/{AbstractSetTest.php => AbstractSetTestCase.php} | 2 +- tests/RuleSet/Sets/DoctrineAnnotationSetTest.php | 2 +- tests/RuleSet/Sets/PERCS1x0RiskySetTest.php | 2 +- tests/RuleSet/Sets/PERCS1x0SetTest.php | 2 +- tests/RuleSet/Sets/PERRiskySetTest.php | 2 +- tests/RuleSet/Sets/PERSetTest.php | 2 +- tests/RuleSet/Sets/PHP54MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP56MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHP70MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHP70MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP71MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHP71MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP73MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP74MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHP74MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP80MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHP80MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP81MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHP82MigrationSetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit100MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit30MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit32MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit35MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit43MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit48MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit50MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit52MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit54MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit55MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit56MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit57MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit60MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit75MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PHPUnit84MigrationRiskySetTest.php | 2 +- tests/RuleSet/Sets/PSR12RiskySetTest.php | 2 +- tests/RuleSet/Sets/PSR12SetTest.php | 2 +- tests/RuleSet/Sets/PSR1SetTest.php | 2 +- tests/RuleSet/Sets/PSR2SetTest.php | 2 +- tests/RuleSet/Sets/PhpCsFixerRiskySetTest.php | 2 +- tests/RuleSet/Sets/PhpCsFixerSetTest.php | 2 +- tests/RuleSet/Sets/SymfonyRiskySetTest.php | 2 +- tests/RuleSet/Sets/SymfonySetTest.php | 2 +- .../Smoke/{AbstractSmokeTest.php => AbstractSmokeTestCase.php} | 2 +- tests/Smoke/CiIntegrationTest.php | 2 +- tests/Smoke/InstallViaComposerTest.php | 2 +- tests/Smoke/PharTest.php | 2 +- tests/Smoke/StdinTest.php | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) rename tests/RuleSet/Sets/{AbstractSetTest.php => AbstractSetTestCase.php} (98%) rename tests/Smoke/{AbstractSmokeTest.php => AbstractSmokeTestCase.php} (94%) diff --git a/tests/RuleSet/Sets/AbstractSetTest.php b/tests/RuleSet/Sets/AbstractSetTestCase.php similarity index 98% rename from tests/RuleSet/Sets/AbstractSetTest.php rename to tests/RuleSet/Sets/AbstractSetTestCase.php index 5d16496a044..3e228432ad7 100644 --- a/tests/RuleSet/Sets/AbstractSetTest.php +++ b/tests/RuleSet/Sets/AbstractSetTestCase.php @@ -24,7 +24,7 @@ /** * @internal */ -abstract class AbstractSetTest extends TestCase +abstract class AbstractSetTestCase extends TestCase { public function testSet(): void { diff --git a/tests/RuleSet/Sets/DoctrineAnnotationSetTest.php b/tests/RuleSet/Sets/DoctrineAnnotationSetTest.php index fcb7978dbe3..a4084659a48 100644 --- a/tests/RuleSet/Sets/DoctrineAnnotationSetTest.php +++ b/tests/RuleSet/Sets/DoctrineAnnotationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\DoctrineAnnotationSet */ -final class DoctrineAnnotationSetTest extends AbstractSetTest +final class DoctrineAnnotationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PERCS1x0RiskySetTest.php b/tests/RuleSet/Sets/PERCS1x0RiskySetTest.php index 65e8af91d73..04345090c46 100644 --- a/tests/RuleSet/Sets/PERCS1x0RiskySetTest.php +++ b/tests/RuleSet/Sets/PERCS1x0RiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PERCS1x0RiskySet */ -final class PERCS1x0RiskySetTest extends AbstractSetTest +final class PERCS1x0RiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PERCS1x0SetTest.php b/tests/RuleSet/Sets/PERCS1x0SetTest.php index d9f4ef52b49..f18a7e49ec0 100644 --- a/tests/RuleSet/Sets/PERCS1x0SetTest.php +++ b/tests/RuleSet/Sets/PERCS1x0SetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PERCS1x0Set */ -final class PERCS1x0SetTest extends AbstractSetTest +final class PERCS1x0SetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PERRiskySetTest.php b/tests/RuleSet/Sets/PERRiskySetTest.php index 859dcf83d47..46e069f8f32 100644 --- a/tests/RuleSet/Sets/PERRiskySetTest.php +++ b/tests/RuleSet/Sets/PERRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PERRiskySet */ -final class PERRiskySetTest extends AbstractSetTest +final class PERRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PERSetTest.php b/tests/RuleSet/Sets/PERSetTest.php index 837316db555..d3980afd546 100644 --- a/tests/RuleSet/Sets/PERSetTest.php +++ b/tests/RuleSet/Sets/PERSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PERSet */ -final class PERSetTest extends AbstractSetTest +final class PERSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP54MigrationSetTest.php b/tests/RuleSet/Sets/PHP54MigrationSetTest.php index 23540bd14c5..319541083ec 100644 --- a/tests/RuleSet/Sets/PHP54MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP54MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP54MigrationSet */ -final class PHP54MigrationSetTest extends AbstractSetTest +final class PHP54MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP56MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHP56MigrationRiskySetTest.php index 7b28670be46..4b172261b7a 100644 --- a/tests/RuleSet/Sets/PHP56MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHP56MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP56MigrationRiskySet */ -final class PHP56MigrationRiskySetTest extends AbstractSetTest +final class PHP56MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP70MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHP70MigrationRiskySetTest.php index 90323e6020e..458bbe71845 100644 --- a/tests/RuleSet/Sets/PHP70MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHP70MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP70MigrationRiskySet */ -final class PHP70MigrationRiskySetTest extends AbstractSetTest +final class PHP70MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP70MigrationSetTest.php b/tests/RuleSet/Sets/PHP70MigrationSetTest.php index f84229a079f..920a6d700e7 100644 --- a/tests/RuleSet/Sets/PHP70MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP70MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP70MigrationSet */ -final class PHP70MigrationSetTest extends AbstractSetTest +final class PHP70MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP71MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHP71MigrationRiskySetTest.php index 1db11c22f46..016fbcffbf8 100644 --- a/tests/RuleSet/Sets/PHP71MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHP71MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP71MigrationRiskySet */ -final class PHP71MigrationRiskySetTest extends AbstractSetTest +final class PHP71MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP71MigrationSetTest.php b/tests/RuleSet/Sets/PHP71MigrationSetTest.php index 5f614fc1f3c..5e4f9a3b70a 100644 --- a/tests/RuleSet/Sets/PHP71MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP71MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP71MigrationSet */ -final class PHP71MigrationSetTest extends AbstractSetTest +final class PHP71MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP73MigrationSetTest.php b/tests/RuleSet/Sets/PHP73MigrationSetTest.php index 9b19e25afd0..f67dc48a22e 100644 --- a/tests/RuleSet/Sets/PHP73MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP73MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP73MigrationSet */ -final class PHP73MigrationSetTest extends AbstractSetTest +final class PHP73MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP74MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHP74MigrationRiskySetTest.php index f7e99298405..d5a1e833b4f 100644 --- a/tests/RuleSet/Sets/PHP74MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHP74MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP74MigrationRiskySet */ -final class PHP74MigrationRiskySetTest extends AbstractSetTest +final class PHP74MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP74MigrationSetTest.php b/tests/RuleSet/Sets/PHP74MigrationSetTest.php index 9a7a38b2114..5c75668f92f 100644 --- a/tests/RuleSet/Sets/PHP74MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP74MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP74MigrationSet */ -final class PHP74MigrationSetTest extends AbstractSetTest +final class PHP74MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP80MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHP80MigrationRiskySetTest.php index bd6263de117..e0743f58cf2 100644 --- a/tests/RuleSet/Sets/PHP80MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHP80MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP80MigrationRiskySet */ -final class PHP80MigrationRiskySetTest extends AbstractSetTest +final class PHP80MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP80MigrationSetTest.php b/tests/RuleSet/Sets/PHP80MigrationSetTest.php index 7dc5d0c0711..486fddcb2d8 100644 --- a/tests/RuleSet/Sets/PHP80MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP80MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP80MigrationSet */ -final class PHP80MigrationSetTest extends AbstractSetTest +final class PHP80MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP81MigrationSetTest.php b/tests/RuleSet/Sets/PHP81MigrationSetTest.php index 34b5cfa80c2..9244ba583bf 100644 --- a/tests/RuleSet/Sets/PHP81MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP81MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP81MigrationSet */ -final class PHP81MigrationSetTest extends AbstractSetTest +final class PHP81MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHP82MigrationSetTest.php b/tests/RuleSet/Sets/PHP82MigrationSetTest.php index 30fcae6eecd..08e454afc27 100644 --- a/tests/RuleSet/Sets/PHP82MigrationSetTest.php +++ b/tests/RuleSet/Sets/PHP82MigrationSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHP82MigrationSet */ -final class PHP82MigrationSetTest extends AbstractSetTest +final class PHP82MigrationSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit100MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit100MigrationRiskySetTest.php index f34a40e6b44..b6294829ec2 100644 --- a/tests/RuleSet/Sets/PHPUnit100MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit100MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit100MigrationRiskySet */ -final class PHPUnit100MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit100MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit30MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit30MigrationRiskySetTest.php index 6632aa60ac8..1453269d9b5 100644 --- a/tests/RuleSet/Sets/PHPUnit30MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit30MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit30MigrationRiskySet */ -final class PHPUnit30MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit30MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit32MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit32MigrationRiskySetTest.php index 22a0c726f5a..17ab4d44926 100644 --- a/tests/RuleSet/Sets/PHPUnit32MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit32MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit32MigrationRiskySet */ -final class PHPUnit32MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit32MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit35MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit35MigrationRiskySetTest.php index d5fe669ce05..18dddf9f93b 100644 --- a/tests/RuleSet/Sets/PHPUnit35MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit35MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit35MigrationRiskySet */ -final class PHPUnit35MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit35MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit43MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit43MigrationRiskySetTest.php index c00e8ccc81d..0ff17f35051 100644 --- a/tests/RuleSet/Sets/PHPUnit43MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit43MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit43MigrationRiskySet */ -final class PHPUnit43MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit43MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit48MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit48MigrationRiskySetTest.php index d8c6fc375de..fe05b0a471a 100644 --- a/tests/RuleSet/Sets/PHPUnit48MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit48MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit48MigrationRiskySet */ -final class PHPUnit48MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit48MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit50MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit50MigrationRiskySetTest.php index 043bc085736..11c380eb027 100644 --- a/tests/RuleSet/Sets/PHPUnit50MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit50MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit50MigrationRiskySet */ -final class PHPUnit50MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit50MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit52MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit52MigrationRiskySetTest.php index 8ebd2bd8655..9467f7db856 100644 --- a/tests/RuleSet/Sets/PHPUnit52MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit52MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit52MigrationRiskySet */ -final class PHPUnit52MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit52MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit54MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit54MigrationRiskySetTest.php index e07f3c9ecd8..37197f4d101 100644 --- a/tests/RuleSet/Sets/PHPUnit54MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit54MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit54MigrationRiskySet */ -final class PHPUnit54MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit54MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit55MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit55MigrationRiskySetTest.php index f81e51311c8..afc9bdc3cbc 100644 --- a/tests/RuleSet/Sets/PHPUnit55MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit55MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit55MigrationRiskySet */ -final class PHPUnit55MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit55MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit56MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit56MigrationRiskySetTest.php index 9de3cbae945..8441864e602 100644 --- a/tests/RuleSet/Sets/PHPUnit56MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit56MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit56MigrationRiskySet */ -final class PHPUnit56MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit56MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit57MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit57MigrationRiskySetTest.php index 0583b4be929..09fd0caf0f5 100644 --- a/tests/RuleSet/Sets/PHPUnit57MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit57MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit57MigrationRiskySet */ -final class PHPUnit57MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit57MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit60MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit60MigrationRiskySetTest.php index 49be35e8f09..b71949fe6d3 100644 --- a/tests/RuleSet/Sets/PHPUnit60MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit60MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit60MigrationRiskySet */ -final class PHPUnit60MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit60MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit75MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit75MigrationRiskySetTest.php index 1d1adac61cb..0c75f27444d 100644 --- a/tests/RuleSet/Sets/PHPUnit75MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit75MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit75MigrationRiskySet */ -final class PHPUnit75MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit75MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PHPUnit84MigrationRiskySetTest.php b/tests/RuleSet/Sets/PHPUnit84MigrationRiskySetTest.php index 060f244a5bc..75be7ed94b7 100644 --- a/tests/RuleSet/Sets/PHPUnit84MigrationRiskySetTest.php +++ b/tests/RuleSet/Sets/PHPUnit84MigrationRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PHPUnit84MigrationRiskySet */ -final class PHPUnit84MigrationRiskySetTest extends AbstractSetTest +final class PHPUnit84MigrationRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PSR12RiskySetTest.php b/tests/RuleSet/Sets/PSR12RiskySetTest.php index 2e3f0e2952e..b2317a0a7e5 100644 --- a/tests/RuleSet/Sets/PSR12RiskySetTest.php +++ b/tests/RuleSet/Sets/PSR12RiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PSR12RiskySet */ -final class PSR12RiskySetTest extends AbstractSetTest +final class PSR12RiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PSR12SetTest.php b/tests/RuleSet/Sets/PSR12SetTest.php index 3eff9fc5eb5..2c8a43db4e8 100644 --- a/tests/RuleSet/Sets/PSR12SetTest.php +++ b/tests/RuleSet/Sets/PSR12SetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PSR12Set */ -final class PSR12SetTest extends AbstractSetTest +final class PSR12SetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PSR1SetTest.php b/tests/RuleSet/Sets/PSR1SetTest.php index 754d70d5319..f139cd5d205 100644 --- a/tests/RuleSet/Sets/PSR1SetTest.php +++ b/tests/RuleSet/Sets/PSR1SetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PSR1Set */ -final class PSR1SetTest extends AbstractSetTest +final class PSR1SetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PSR2SetTest.php b/tests/RuleSet/Sets/PSR2SetTest.php index 9a01b797f6b..bd5ec628219 100644 --- a/tests/RuleSet/Sets/PSR2SetTest.php +++ b/tests/RuleSet/Sets/PSR2SetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PSR2Set */ -final class PSR2SetTest extends AbstractSetTest +final class PSR2SetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PhpCsFixerRiskySetTest.php b/tests/RuleSet/Sets/PhpCsFixerRiskySetTest.php index 578b787fc0d..dae717c0b34 100644 --- a/tests/RuleSet/Sets/PhpCsFixerRiskySetTest.php +++ b/tests/RuleSet/Sets/PhpCsFixerRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PhpCsFixerRiskySet */ -final class PhpCsFixerRiskySetTest extends AbstractSetTest +final class PhpCsFixerRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/PhpCsFixerSetTest.php b/tests/RuleSet/Sets/PhpCsFixerSetTest.php index 0d4b86474c6..cf547efe7fd 100644 --- a/tests/RuleSet/Sets/PhpCsFixerSetTest.php +++ b/tests/RuleSet/Sets/PhpCsFixerSetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\PhpCsFixerSet */ -final class PhpCsFixerSetTest extends AbstractSetTest +final class PhpCsFixerSetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/SymfonyRiskySetTest.php b/tests/RuleSet/Sets/SymfonyRiskySetTest.php index ea9f21e89c9..e755b4a2d58 100644 --- a/tests/RuleSet/Sets/SymfonyRiskySetTest.php +++ b/tests/RuleSet/Sets/SymfonyRiskySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\SymfonyRiskySet */ -final class SymfonyRiskySetTest extends AbstractSetTest +final class SymfonyRiskySetTest extends AbstractSetTestCase { } diff --git a/tests/RuleSet/Sets/SymfonySetTest.php b/tests/RuleSet/Sets/SymfonySetTest.php index 38b06e7cb5d..f03330c89af 100644 --- a/tests/RuleSet/Sets/SymfonySetTest.php +++ b/tests/RuleSet/Sets/SymfonySetTest.php @@ -19,6 +19,6 @@ * * @covers \PhpCsFixer\RuleSet\Sets\SymfonySet */ -final class SymfonySetTest extends AbstractSetTest +final class SymfonySetTest extends AbstractSetTestCase { } diff --git a/tests/Smoke/AbstractSmokeTest.php b/tests/Smoke/AbstractSmokeTestCase.php similarity index 94% rename from tests/Smoke/AbstractSmokeTest.php rename to tests/Smoke/AbstractSmokeTestCase.php index 4123bd5743c..e3256ef2ddd 100644 --- a/tests/Smoke/AbstractSmokeTest.php +++ b/tests/Smoke/AbstractSmokeTestCase.php @@ -27,7 +27,7 @@ * * @group covers-nothing */ -abstract class AbstractSmokeTest extends TestCase +abstract class AbstractSmokeTestCase extends TestCase { protected static function markTestSkippedOrFail(string $message): void { diff --git a/tests/Smoke/CiIntegrationTest.php b/tests/Smoke/CiIntegrationTest.php index 5fac77971ef..0067b0ef039 100644 --- a/tests/Smoke/CiIntegrationTest.php +++ b/tests/Smoke/CiIntegrationTest.php @@ -32,7 +32,7 @@ * * @large */ -final class CiIntegrationTest extends AbstractSmokeTest +final class CiIntegrationTest extends AbstractSmokeTestCase { /** * @var string diff --git a/tests/Smoke/InstallViaComposerTest.php b/tests/Smoke/InstallViaComposerTest.php index d8f37600ddf..a08c97186e3 100644 --- a/tests/Smoke/InstallViaComposerTest.php +++ b/tests/Smoke/InstallViaComposerTest.php @@ -29,7 +29,7 @@ * * @large */ -final class InstallViaComposerTest extends AbstractSmokeTest +final class InstallViaComposerTest extends AbstractSmokeTestCase { /** * @var string[] diff --git a/tests/Smoke/PharTest.php b/tests/Smoke/PharTest.php index 2c16c0c4a7a..b2b5caa670f 100644 --- a/tests/Smoke/PharTest.php +++ b/tests/Smoke/PharTest.php @@ -31,7 +31,7 @@ * * @large */ -final class PharTest extends AbstractSmokeTest +final class PharTest extends AbstractSmokeTestCase { /** * @var string diff --git a/tests/Smoke/StdinTest.php b/tests/Smoke/StdinTest.php index b2087ebddc5..acee72616ab 100644 --- a/tests/Smoke/StdinTest.php +++ b/tests/Smoke/StdinTest.php @@ -30,7 +30,7 @@ * * @large */ -final class StdinTest extends AbstractSmokeTest +final class StdinTest extends AbstractSmokeTestCase { public function testFixingStdin(): void { From 1d25926e14d7dc121509d2f6eea71c2353729860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Thu, 29 Jun 2023 22:44:52 +0200 Subject: [PATCH 03/49] DX: fix checkbashisms installation (#7102) --- dev-tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/install.sh b/dev-tools/install.sh index 9dc8f92cb7e..6ab385c6fcc 100755 --- a/dev-tools/install.sh +++ b/dev-tools/install.sh @@ -20,7 +20,7 @@ cd "$(dirname "$0")" mkdir -p bin -VERSION_CB="2.23.3" +VERSION_CB="2.23.5" VERSION_SC="stable" echo λλλ checkbashisms From 8f3bd188305adf59f8b29e4ee659012261b1fa41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Fri, 30 Jun 2023 16:51:54 +0200 Subject: [PATCH 04/49] bug: Fix and enhance Gitlab reporter (#7089) --- doc/schemas/fix/codeclimate.json | 98 +++++++++++++++++++ doc/usage.rst | 1 + src/Console/Command/FixCommand.php | 1 + .../Report/FixReport/GitlabReporter.php | 17 +++- .../Report/FixReport/ReporterFactory.php | 4 +- .../FixReport/AbstractReporterTestCase.php | 36 ++++++- .../Report/FixReport/GitlabReporterTest.php | 34 +++++-- .../Report/FixReport/JsonReporterTest.php | 33 ++----- .../Report/FixReport/JunitReporterTest.php | 46 ++++++++- .../Report/FixReport/TextReporterTest.php | 40 +++++++- .../Report/FixReport/XmlReporterTest.php | 40 +++++++- .../ListSetsReport/JsonReporterTest.php | 29 +----- tests/Test/Assert/AssertJsonSchemaTrait.php | 39 ++++++++ 13 files changed, 347 insertions(+), 71 deletions(-) create mode 100644 doc/schemas/fix/codeclimate.json create mode 100644 tests/Test/Assert/AssertJsonSchemaTrait.php diff --git a/doc/schemas/fix/codeclimate.json b/doc/schemas/fix/codeclimate.json new file mode 100644 index 00000000000..d50767b036e --- /dev/null +++ b/doc/schemas/fix/codeclimate.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#issues", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["issue"] + }, + "check_name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "categories": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "Bug Risk", + "Clarity", + "Compatibility", + "Complexity", + "Duplication", + "Performance", + "Security", + "Style", + "Unused Code" + ] + } + }, + "location": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "lines": { + "type": "object", + "properties": { + "begin": { + "type": "number" + }, + "end": { + "type": "number" + } + }, + "required": [ + "begin", + "end" + ] + } + }, + "required": [ + "path", + "lines" + ] + }, + "remediation_points": { + "type": "number" + }, + "content": { + "type": "object", + "properties": { + "body": { + "type": "string" + } + }, + "required": [ + "body" + ] + }, + "fingerprint": { + "type": "string" + }, + "severity": { + "type": "string", + "enum": [ + "info", + "minor", + "major", + "critical" + ] + } + } + }, + "required": [ + "type", + "check_name", + "description", + "categories", + "location" + ] +} diff --git a/doc/usage.rst b/doc/usage.rst index 7192f176b98..5bc7f1e1b83 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -26,6 +26,7 @@ The ``--format`` option for the output format. Supported formats are ``txt`` (de NOTE: the output for the following formats are generated in accordance with schemas * ``checkstyle`` follows the common `"checkstyle" XML schema `_ +* ``gitlab`` follows the `codeclimate JSON schema `_ * ``json`` follows the `own JSON schema `_ * ``junit`` follows the `JUnit XML schema from Jenkins `_ * ``xml`` follows the `own XML schema `_ diff --git a/src/Console/Command/FixCommand.php b/src/Console/Command/FixCommand.php index e0a17169508..40f065b554b 100644 --- a/src/Console/Command/FixCommand.php +++ b/src/Console/Command/FixCommand.php @@ -97,6 +97,7 @@ public function getHelp(): string NOTE: the output for the following formats are generated in accordance with schemas * `checkstyle` follows the common `"checkstyle" XML schema `_ +* `gitlab` follows the `codeclimate JSON schema `_ * `json` follows the `own JSON schema `_ * `junit` follows the `JUnit XML schema from Jenkins `_ * `xml` follows the `own XML schema `_ diff --git a/src/Console/Report/FixReport/GitlabReporter.php b/src/Console/Report/FixReport/GitlabReporter.php index 974d66d1190..073656ffbd7 100644 --- a/src/Console/Report/FixReport/GitlabReporter.php +++ b/src/Console/Report/FixReport/GitlabReporter.php @@ -14,6 +14,8 @@ namespace PhpCsFixer\Console\Report\FixReport; +use SebastianBergmann\Diff\Chunk; +use SebastianBergmann\Diff\Parser; use Symfony\Component\Console\Formatter\OutputFormatter; /** @@ -27,6 +29,13 @@ */ final class GitlabReporter implements ReporterInterface { + private Parser $diffParser; + + public function __construct() + { + $this->diffParser = new Parser(); + } + public function getFormat(): string { return 'gitlab'; @@ -39,15 +48,21 @@ public function generate(ReportSummary $reportSummary): string { $report = []; foreach ($reportSummary->getChanged() as $fileName => $change) { + $diffs = $this->diffParser->parse($change['diff']); + $firstChunk = isset($diffs[0]) ? $diffs[0]->getChunks() : []; + $firstChunk = array_shift($firstChunk); foreach ($change['appliedFixers'] as $fixerName) { $report[] = [ + 'check_name' => $fixerName, 'description' => $fixerName, + 'categories' => ['Style'], 'fingerprint' => md5($fileName.$fixerName), 'severity' => 'minor', 'location' => [ 'path' => $fileName, 'lines' => [ - 'begin' => 0, // line numbers are required in the format, but not available to reports + 'begin' => $firstChunk instanceof Chunk ? $firstChunk->getStart() : 0, + 'end' => $firstChunk instanceof Chunk ? $firstChunk->getStartRange() : 0, ], ], ]; diff --git a/src/Console/Report/FixReport/ReporterFactory.php b/src/Console/Report/FixReport/ReporterFactory.php index d091f441c34..4e5e931c15f 100644 --- a/src/Console/Report/FixReport/ReporterFactory.php +++ b/src/Console/Report/FixReport/ReporterFactory.php @@ -23,9 +23,7 @@ */ final class ReporterFactory { - /** - * @var array - */ + /** @var array */ private array $reporters = []; public function registerBuiltInReporters(): self diff --git a/tests/Console/Report/FixReport/AbstractReporterTestCase.php b/tests/Console/Report/FixReport/AbstractReporterTestCase.php index 68bdc4f7370..9968e718ec7 100644 --- a/tests/Console/Report/FixReport/AbstractReporterTestCase.php +++ b/tests/Console/Report/FixReport/AbstractReporterTestCase.php @@ -83,7 +83,17 @@ final public static function provideGenerateCases(): iterable [ 'someFile.php' => [ 'appliedFixers' => ['some_fixer_name_here'], - 'diff' => '', + 'diff' => '--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + }', ], ], 10, @@ -100,7 +110,17 @@ final public static function provideGenerateCases(): iterable [ 'someFile.php' => [ 'appliedFixers' => ['some_fixer_name_here'], - 'diff' => 'this text is a diff ;)', + 'diff' => '--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + }', ], ], 10, @@ -134,7 +154,17 @@ final public static function provideGenerateCases(): iterable [ 'someFile.php' => [ 'appliedFixers' => ['some_fixer_name_here'], - 'diff' => '', + 'diff' => '--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + }', ], ], 10, diff --git a/tests/Console/Report/FixReport/GitlabReporterTest.php b/tests/Console/Report/FixReport/GitlabReporterTest.php index 69edf53c411..97adbcad2e0 100644 --- a/tests/Console/Report/FixReport/GitlabReporterTest.php +++ b/tests/Console/Report/FixReport/GitlabReporterTest.php @@ -16,6 +16,7 @@ use PhpCsFixer\Console\Report\FixReport\GitlabReporter; use PhpCsFixer\Console\Report\FixReport\ReporterInterface; +use PhpCsFixer\Tests\Test\Assert\AssertJsonSchemaTrait; /** * @author Hans-Christian Otto @@ -26,6 +27,8 @@ */ final class GitlabReporterTest extends AbstractReporterTestCase { + use AssertJsonSchemaTrait; + protected function createReporter(): ReporterInterface { return new GitlabReporter(); @@ -45,13 +48,16 @@ protected static function createSimpleReport(): string { return <<<'JSON' [{ + "categories": ["Style"], + "check_name": "some_fixer_name_here", "description": "some_fixer_name_here", "fingerprint": "ad098ea6ea7a28dd85dfcdfc9e2bded0", "severity": "minor", "location": { "path": "someFile.php", "lines": { - "begin": 0 + "begin": 2, + "end": 7 } } }] @@ -67,23 +73,29 @@ protected static function createWithAppliedFixersReport(): string { return <<<'JSON' [{ + "categories": ["Style"], + "check_name": "some_fixer_name_here_1", "description": "some_fixer_name_here_1", "fingerprint": "b74e9385c8ae5b1f575c9c8226c7deff", "severity": "minor", "location": { "path": "someFile.php", "lines": { - "begin": 0 + "begin": 0, + "end": 0 } } },{ + "categories": ["Style"], + "check_name": "some_fixer_name_here_2", "description": "some_fixer_name_here_2", "fingerprint": "acad4672140c737a83c18d1474d84074", "severity": "minor", "location": { "path": "someFile.php", "lines": { - "begin": 0 + "begin": 0, + "end": 0 } } }] @@ -99,33 +111,42 @@ protected static function createComplexReport(): string { return <<<'JSON' [{ + "categories": ["Style"], + "check_name": "some_fixer_name_here_1", "description": "some_fixer_name_here_1", "fingerprint": "b74e9385c8ae5b1f575c9c8226c7deff", "severity": "minor", "location": { "path": "someFile.php", "lines": { - "begin": 0 + "begin": 0, + "end": 0 } } },{ + "categories": ["Style"], + "check_name": "some_fixer_name_here_2", "description": "some_fixer_name_here_2", "fingerprint": "acad4672140c737a83c18d1474d84074", "severity": "minor", "location": { "path": "someFile.php", "lines": { - "begin": 0 + "begin": 0, + "end": 0 } } },{ + "categories": ["Style"], + "check_name": "another_fixer_name_here", "description": "another_fixer_name_here", "fingerprint": "30e86e533dac0f1b93bbc3a55c6908f8", "severity": "minor", "location": { "path": "anotherFile.php", "lines": { - "begin": 0 + "begin": 0, + "end": 0 } } }] @@ -134,6 +155,7 @@ protected static function createComplexReport(): string protected function assertFormat(string $expected, string $input): void { + self::assertJsonSchema(__DIR__.'/../../../../doc/schemas/fix/codeclimate.json', $input); self::assertJsonStringEqualsJsonString($expected, $input); } } diff --git a/tests/Console/Report/FixReport/JsonReporterTest.php b/tests/Console/Report/FixReport/JsonReporterTest.php index 1d9d72e2ff3..7eb1f820723 100644 --- a/tests/Console/Report/FixReport/JsonReporterTest.php +++ b/tests/Console/Report/FixReport/JsonReporterTest.php @@ -16,6 +16,7 @@ use PhpCsFixer\Console\Report\FixReport\JsonReporter; use PhpCsFixer\Console\Report\FixReport\ReporterInterface; +use PhpCsFixer\Tests\Test\Assert\AssertJsonSchemaTrait; /** * @author Boris Gorbylev @@ -27,12 +28,15 @@ */ final class JsonReporterTest extends AbstractReporterTestCase { + use AssertJsonSchemaTrait; + protected static function createSimpleReport(): string { return <<<'JSON' { "files": [ { + "diff": "--- Original\n+++ New\n@@ -2,7 +2,7 @@\n\n class Foo\n {\n- public function bar($foo = 1, $bar)\n+ public function bar($foo, $bar)\n {\n }\n }", "name": "someFile.php" } ], @@ -51,7 +55,7 @@ protected static function createWithDiffReport(): string "files": [ { "name": "someFile.php", - "diff": "this text is a diff ;)" + "diff": "--- Original\n+++ New\n@@ -2,7 +2,7 @@\n\n class Foo\n {\n- public function bar($foo = 1, $bar)\n+ public function bar($foo, $bar)\n {\n }\n }" } ], "time": { @@ -86,6 +90,7 @@ protected static function createWithTimeAndMemoryReport(): string { "files": [ { + "diff": "--- Original\n+++ New\n@@ -2,7 +2,7 @@\n\n class Foo\n {\n- public function bar($foo = 1, $bar)\n+ public function bar($foo, $bar)\n {\n }\n }", "name": "someFile.php" } ], @@ -147,31 +152,7 @@ protected static function createNoErrorReport(): string protected function assertFormat(string $expected, string $input): void { - self::assertJsonSchema($input); + self::assertJsonSchema(__DIR__.'/../../../../doc/schemas/fix/schema.json', $input); self::assertJsonStringEqualsJsonString($expected, $input); } - - private static function assertJsonSchema(string $json): void - { - $jsonPath = __DIR__.'/../../../../doc/schemas/fix/schema.json'; - - $data = json_decode($json); - - $validator = new \JsonSchema\Validator(); - $validator->validate( - $data, - (object) ['$ref' => 'file://'.realpath($jsonPath)] - ); - - self::assertTrue( - $validator->isValid(), - implode( - "\n", - array_map( - static fn (array $item): string => sprintf('Property `%s`: %s.', $item['property'], $item['message']), - $validator->getErrors(), - ) - ) - ); - } } diff --git a/tests/Console/Report/FixReport/JunitReporterTest.php b/tests/Console/Report/FixReport/JunitReporterTest.php index f503f0de6ed..0db1a284dc2 100644 --- a/tests/Console/Report/FixReport/JunitReporterTest.php +++ b/tests/Console/Report/FixReport/JunitReporterTest.php @@ -76,7 +76,22 @@ protected static function createSimpleReport(): string - Wrong code style + Wrong code style + +Diff: +--------------- + +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } @@ -95,7 +110,17 @@ protected static function createWithDiffReport(): string Diff: --------------- -this text is a diff ;)]]> +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + }]]> @@ -126,7 +151,22 @@ protected static function createWithTimeAndMemoryReport(): string - Wrong code style + Wrong code style + +Diff: +--------------- + +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } diff --git a/tests/Console/Report/FixReport/TextReporterTest.php b/tests/Console/Report/FixReport/TextReporterTest.php index a1ae2b01cf7..39b5a11d777 100644 --- a/tests/Console/Report/FixReport/TextReporterTest.php +++ b/tests/Console/Report/FixReport/TextReporterTest.php @@ -40,6 +40,20 @@ protected static function createSimpleReport(): string PHP_EOL, <<<'TEXT' 1) someFile.php + ---------- begin diff ---------- +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } + ----------- end diff ----------- + TEXT ); @@ -53,7 +67,17 @@ protected static function createWithDiffReport(): string <<<'TEXT' 1) someFile.php ---------- begin diff ---------- -this text is a diff ;) +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } ----------- end diff ----------- @@ -80,6 +104,20 @@ protected static function createWithTimeAndMemoryReport(): string PHP_EOL, <<<'TEXT' 1) someFile.php + ---------- begin diff ---------- +--- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } + ----------- end diff ----------- + Fixed 1 of 10 files in 1.234 seconds, 2.500 MB memory used diff --git a/tests/Console/Report/FixReport/XmlReporterTest.php b/tests/Console/Report/FixReport/XmlReporterTest.php index ff21fd1d695..740b0e6f7bf 100644 --- a/tests/Console/Report/FixReport/XmlReporterTest.php +++ b/tests/Console/Report/FixReport/XmlReporterTest.php @@ -64,7 +64,19 @@ protected static function createSimpleReport(): string - + + --- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } + XML; @@ -77,7 +89,17 @@ protected static function createWithDiffReport(): string - + --- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } @@ -107,7 +129,19 @@ protected static function createWithTimeAndMemoryReport(): string - + + --- Original ++++ New +@@ -2,7 +2,7 @@ + + class Foo + { +- public function bar($foo = 1, $bar) ++ public function bar($foo, $bar) + { + } + } +