Skip to content

Commit caed554

Browse files
committed
improve tests
1 parent 41abc77 commit caed554

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/Testing/Responses/Fixtures/Images/CreateResponseFixture.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ final class CreateResponseFixture
99
'data' => [
1010
[
1111
'url' => 'https://openai.com/fake-image.png',
12-
'b64_json' => 'fake-b64_json',
1312
],
1413
],
1514
];

tests/Responses/Images/CreateResponse.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,26 @@
6666
'data' => [
6767
[
6868
'url' => 'https://openai.com/new-image.png',
69+
'revised_prompt' => 'the revised prompt',
6970
],
7071
],
7172
]);
7273

7374
expect($response['data'][0])
74-
->url->toBe('https://openai.com/new-image.png');
75+
->url->toBe('https://openai.com/new-image.png')
76+
->revised_prompt->toBe('the revised prompt');
77+
});
78+
79+
test('fake with override of b64_json', function () {
80+
$response = CreateResponse::fake([
81+
'data' => [
82+
[
83+
'url' => '',
84+
'b64_json' => 'some-fake-b64-string',
85+
],
86+
],
87+
]);
88+
89+
expect($response['data'][0])
90+
->b64_json->toBe('some-fake-b64-string');
7591
});

0 commit comments

Comments
 (0)