|
58 | 58 | it('throws unauthorized exception for 401 errors', function () { |
59 | 59 | $this->mockErrorResponse(401, 'Unauthorized'); |
60 | 60 |
|
61 | | - expect(fn() => $this->client->getHttpClient()->get('test')) |
| 61 | + expect(fn () => $this->client->getHttpClient()->get('test')) |
62 | 62 | ->toThrow(UnauthorizedException::class); |
63 | 63 | }); |
64 | 64 |
|
65 | 65 | it('throws bad request exception for 400 errors', function () { |
66 | 66 | $this->mockErrorResponse(400, 'Bad Request'); |
67 | 67 |
|
68 | | - expect(fn() => $this->client->getHttpClient()->get('test')) |
| 68 | + expect(fn () => $this->client->getHttpClient()->get('test')) |
69 | 69 | ->toThrow(BadRequestException::class); |
70 | 70 | }); |
71 | 71 |
|
72 | 72 | it('throws not found exception for 404 errors', function () { |
73 | 73 | $this->mockErrorResponse(404, 'Not Found'); |
74 | 74 |
|
75 | | - expect(fn() => $this->client->getHttpClient()->get('test')) |
| 75 | + expect(fn () => $this->client->getHttpClient()->get('test')) |
76 | 76 | ->toThrow(NotFoundException::class); |
77 | 77 | }); |
78 | 78 |
|
79 | 79 | it('throws generic exception for other errors', function () { |
80 | 80 | $this->mockErrorResponse(500, 'Internal Server Error'); |
81 | 81 |
|
82 | | - expect(fn() => $this->client->getHttpClient()->get('test')) |
| 82 | + expect(fn () => $this->client->getHttpClient()->get('test')) |
83 | 83 | ->toThrow(LangGraphException::class); |
84 | 84 | }); |
85 | 85 |
|
|
115 | 115 | }; |
116 | 116 |
|
117 | 117 | // This will test the stream method exists and is callable |
118 | | - expect(fn() => $this->client->getHttpClient()->stream('GET', 'test', [], $callback)) |
| 118 | + expect(fn () => $this->client->getHttpClient()->stream('GET', 'test', [], $callback)) |
119 | 119 | ->not->toThrow(Exception::class); |
120 | 120 | }); |
0 commit comments