diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index bc8dc0081dd..a285f170b85 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '63fbf41cc9a6cc66c720926beec4603892eb21d0'; + public const PACKAGE_VERSION = 'b107a16f98aecf2a5ff969e30ff48595daadc06d'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-01-28 00:52:19'; + public const RELEASE_DATE = '2024-01-28 10:48:07'; /** * @var int */ diff --git a/src/Testing/PHPUnit/AbstractRectorTestCase.php b/src/Testing/PHPUnit/AbstractRectorTestCase.php index a3a042dd949..5308d28bef3 100644 --- a/src/Testing/PHPUnit/AbstractRectorTestCase.php +++ b/src/Testing/PHPUnit/AbstractRectorTestCase.php @@ -134,7 +134,7 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractLa } // write temp file FileSystem::write($inputFilePath, $inputFileContents); - $this->doTestFileMatchesExpectedContent($inputFilePath, $expectedFileContents, $fixtureFilePath); + $this->doTestFileMatchesExpectedContent($inputFilePath, $inputFileContents, $expectedFileContents, $fixtureFilePath); } protected function forgetRectorsRulesAndCollectors() : void { @@ -169,11 +169,9 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractLa require_once __DIR__ . '/../../../vendor/scoper-autoload.php'; } } - private function doTestFileMatchesExpectedContent(string $originalFilePath, string $expectedFileContents, string $fixtureFilePath) : void + private function doTestFileMatchesExpectedContent(string $originalFilePath, string $inputFileContents, string $expectedFileContents, string $fixtureFilePath) : void { SimpleParameterProvider::setParameter(Option::SOURCE, [$originalFilePath]); - // the original file content must be loaded first - $originalFileContent = FileSystem::read($originalFilePath); // the file is now changed (if any rule matches) $rectorTestResult = $this->processFilePath($originalFilePath); $changedContents = $rectorTestResult->getChangedContents(); @@ -190,7 +188,7 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractLa try { $this->assertSame($expectedFileContents, $changedContents, $failureMessage); } catch (ExpectationFailedException $exception) { - FixtureFileUpdater::updateFixtureContent($originalFileContent, $changedContents, $fixtureFilePath); + FixtureFileUpdater::updateFixtureContent($inputFileContents, $changedContents, $fixtureFilePath); // if not exact match, check the regex version (useful for generated hashes/uuids in the code) $this->assertStringMatchesFormat($expectedFileContents, $changedContents, $failureMessage); }