Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.5.7
* Feature/Fix: Support json arrays in AbstractDatabaseContext

## v1.5.6
* Feature: Testing with command inputs

Expand Down
4 changes: 4 additions & 0 deletions src/Context/AbstractDatabaseContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ protected function convertAssertionValue(string $value, ?string $type): mixed
}

return match ($type) {
'array' => json_decode($value, false, 512, JSON_THROW_ON_ERROR),
'bool' => 'false' !== $value && '0' !== $value,
'DateTimeInterface', 'DateTime' => new \DateTime($value),
'DateTimeImmutable' => new \DateTimeImmutable($value),
Expand Down Expand Up @@ -268,6 +269,9 @@ protected function printAlternatives(array $data): string
case 'bool' === $type:
$realVal = $realVal ? 'true' : 'false';
break;
case 'array' === $type:
$realVal = json_encode($realVal);
break;
case $realVal instanceof \DateTimeInterface:
$realVal = $realVal->format('c');
break;
Expand Down