diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index 62fb14b4..c3dfa45e 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -781,13 +781,13 @@ final class Expectation foreach ($array as $key => $value) { Assert::assertArrayHasKey($key, $valueAsArray, $message); - $second_message = $message !== '' ? $message : sprintf( + $assertMessage = $message !== '' ? $message : sprintf( 'Failed asserting that an array has a key %s with the value %s.', $this->export($key), $this->export($valueAsArray[$key]), ); - Assert::assertEquals($value, $valueAsArray[$key], $second_message); + Assert::assertEquals($value, $valueAsArray[$key], $assertMessage); } return $this; @@ -812,13 +812,13 @@ final class Expectation /* @phpstan-ignore-next-line */ $propertyValue = $this->value->{$property}; - $second_message = $message !== '' ? $message : sprintf( + $assertMessage = $message !== '' ? $message : sprintf( 'Failed asserting that an object has a property %s with the value %s.', $this->export($property), $this->export($propertyValue), ); - Assert::assertEquals($value, $propertyValue, $second_message); + Assert::assertEquals($value, $propertyValue, $assertMessage); } return $this; diff --git a/tests-external/Features/Expect/toMatchSnapshot.php b/tests-external/Features/Expect/toMatchSnapshot.php index db7b9666..2cef88a1 100644 --- a/tests-external/Features/Expect/toMatchSnapshot.php +++ b/tests-external/Features/Expect/toMatchSnapshot.php @@ -32,4 +32,4 @@ describe('within describe', function () { ->toEndWith('pass_with_dataset_with_data_set____my_datas_set_value______my_datas_set_value__.snap') ->and($this->snapshotable)->toMatchSnapshot(); }); -})->with(['my-datas-set-value']); \ No newline at end of file +})->with(['my-datas-set-value']);