client = new Client( new Psr18Client(), new Authentication(getenv('OPENAI_CLIENT_TEST_AUTH_TOKEN') ?: 'token'), (new MockUri())->base ); } public function testListMethod(): void { $list = $this->client->models()->list(); $response = $list->getResponse(); $this->assertGreaterThanOrEqual(200, $response->getStatusCode()); $this->assertLessThan(300, $response->getStatusCode()); $model = $list->toModel(); $model->jsonSerialize(); $this->assertInstanceOf(ListResponse::class, $model); } public function testRetrieveMethod(): void { $retrieve = $this->client->models()->retrieve('gpt-3.5-turbo'); $response = $retrieve->getResponse(); $this->assertGreaterThanOrEqual(200, $response->getStatusCode()); $this->assertLessThan(300, $response->getStatusCode()); $model = $retrieve->toModel(); $model->jsonSerialize(); $this->assertInstanceOf(RetrieveResponse::class, $model); } public function testDeleteMethod(): void { $delete = $this->client->models()->delete('ft:gpt-3.5-turbo:acemeco:suffix:abc123'); $response = $delete->getResponse(); $this->assertGreaterThanOrEqual(200, $response->getStatusCode()); $this->assertLessThan(300, $response->getStatusCode()); $model = $delete->toModel(); $model->jsonSerialize(); $this->assertInstanceOf(DeleteResponse::class, $model); } }