|
61 | 61 | 'model' => 'gpt-3.5-turbo-instruct',
|
62 | 62 | 'prompt' => 'PHP is ',
|
63 | 63 | ]);
|
64 |
| -})->expectExceptionMessage('The model `gpt-1` does not exist'); |
| 64 | +})->throws(\OpenAI\Exceptions\ErrorException::class, 'The model `gpt-1` does not exist'); |
65 | 65 |
|
66 | 66 | it('throws an exception if there is no more fake response', function () {
|
67 | 67 | $fake = new ClientFake([
|
|
77 | 77 | 'model' => 'gpt-3.5-turbo-instruct',
|
78 | 78 | 'prompt' => 'PHP is ',
|
79 | 79 | ]);
|
80 |
| -})->expectExceptionMessage('No fake responses left'); |
| 80 | +})->throws('No fake responses left'); |
81 | 81 |
|
82 | 82 | it('allows to add more responses', function () {
|
83 | 83 | $fake = new ClientFake([
|
|
136 | 136 | $parameters['model'] === 'gpt-3.5-turbo-instruct' &&
|
137 | 137 | $parameters['prompt'] === 'PHP is ';
|
138 | 138 | });
|
139 |
| -})->expectException(ExpectationFailedException::class); |
| 139 | +})->throws(ExpectationFailedException::class); |
140 | 140 |
|
141 | 141 | it('asserts a request was sent on the resource', function () {
|
142 | 142 | $fake = new ClientFake([
|
|
186 | 186 | ]);
|
187 | 187 |
|
188 | 188 | $fake->assertSent(Completions::class, 2);
|
189 |
| -})->expectException(ExpectationFailedException::class); |
| 189 | +})->throws(ExpectationFailedException::class); |
190 | 190 |
|
191 | 191 | it('asserts a request was not sent', function () {
|
192 | 192 | $fake = new ClientFake;
|
|
205 | 205 | ]);
|
206 | 206 |
|
207 | 207 | $fake->assertNotSent(Completions::class);
|
208 |
| -})->expectException(ExpectationFailedException::class); |
| 208 | +})->throws(ExpectationFailedException::class); |
209 | 209 |
|
210 | 210 | it('asserts a request was not sent on the resource', function () {
|
211 | 211 | $fake = new ClientFake([
|
|
232 | 232 | ]);
|
233 | 233 |
|
234 | 234 | $fake->assertNothingSent();
|
235 |
| -})->expectException(ExpectationFailedException::class); |
| 235 | +})->throws(ExpectationFailedException::class); |
0 commit comments