This commit is contained in:
Nuno Maduro
2025-07-25 21:10:05 -06:00
parent 2aa32569f0
commit 222ed174bc
2 changed files with 5 additions and 5 deletions

View File

@ -781,13 +781,13 @@ final class Expectation
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
Assert::assertArrayHasKey($key, $valueAsArray, $message); 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.', 'Failed asserting that an array has a key %s with the value %s.',
$this->export($key), $this->export($key),
$this->export($valueAsArray[$key]), $this->export($valueAsArray[$key]),
); );
Assert::assertEquals($value, $valueAsArray[$key], $second_message); Assert::assertEquals($value, $valueAsArray[$key], $assertMessage);
} }
return $this; return $this;
@ -812,13 +812,13 @@ final class Expectation
/* @phpstan-ignore-next-line */ /* @phpstan-ignore-next-line */
$propertyValue = $this->value->{$property}; $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.', 'Failed asserting that an object has a property %s with the value %s.',
$this->export($property), $this->export($property),
$this->export($propertyValue), $this->export($propertyValue),
); );
Assert::assertEquals($value, $propertyValue, $second_message); Assert::assertEquals($value, $propertyValue, $assertMessage);
} }
return $this; return $this;

View File

@ -32,4 +32,4 @@ describe('within describe', function () {
->toEndWith('pass_with_dataset_with_data_set____my_datas_set_value______my_datas_set_value__.snap') ->toEndWith('pass_with_dataset_with_data_set____my_datas_set_value______my_datas_set_value__.snap')
->and($this->snapshotable)->toMatchSnapshot(); ->and($this->snapshotable)->toMatchSnapshot();
}); });
})->with(['my-datas-set-value']); })->with(['my-datas-set-value']);