Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Sep 22, 2023
1 parent 85a407a commit ecc0a28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/Testing/PHPUnit/AbstractRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ private function doTestFileMatchesExpectedContent(
): void {
SimpleParameterProvider::setParameter(Option::SOURCE, [$originalFilePath]);

$changedContent = $this->processFilePath($originalFilePath);
// the original file content must be loaded first
$originalFileContent = FileSystem::read($originalFilePath);

// the file is now changed (if any rule matches)
$changedContent = $this->processFilePath($originalFilePath);

$fixtureFilename = basename($fixtureFilePath);
$failureMessage = sprintf('Failed on fixture file "%s"', $fixtureFilename);

Expand Down

0 comments on commit ecc0a28

Please sign in to comment.