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
6 changes: 1 addition & 5 deletions src/Testing/Responses/Concerns/Fakeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ private static function buildAttributes(array $original, array $override): array
unset($override[$key]);
}

// we are going to append all remaining overrides with numeric keys
// we are going to append all remaining overrides
foreach ($override as $key => $value) {
if (! is_numeric($key)) {
continue;
}

$new[$key] = $value;
}

Expand Down
7 changes: 6 additions & 1 deletion tests/Responses/Assistants/AssistantResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@
test('fake with override', function () {
$response = AssistantResponse::fake([
'id' => 'asst_1234',
'metadata' => [
'key' => 'value',
],
]);

expect($response)
->id->toBe('asst_1234');
->id->toBe('asst_1234')
->metadata->toBeArray()
->metadata->key->toBe('value');
});