Skip to content

Commit c278ca8

Browse files
committed
test: Drop deleted Fixture reference from HttpErrorTest
The previous commit deleted tests/Fixture.php but did not stage the HttpErrorTest edit that removes its Fixture usage, so CI still ran the old server-dependent tests and errored with "Class Tests\Fixture not found". Apply the intended HttpErrorTest, leaving only testNonSeamError. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UrUX4ghim2PDnBjXayuLDj
1 parent 01c8ddb commit c278ca8

1 file changed

Lines changed: 0 additions & 57 deletions

File tree

tests/HttpErrorTest.php

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,11 @@
33
declare(strict_types=1);
44

55
use PHPUnit\Framework\TestCase;
6-
use Tests\Fixture;
76

87
final class HttpErrorTest extends TestCase
98
{
10-
public function testInvalidInputError(): void
11-
{
12-
$seam = Fixture::getTestServer();
13-
14-
try {
15-
$seam->request(
16-
"POST",
17-
"/devices/list",
18-
json: [
19-
"device_ids" => 1234,
20-
],
21-
);
22-
$this->fail("Expected InvalidInputError");
23-
} catch (\Seam\HttpInvalidInputError $e) {
24-
$this->assertEquals(400, $e->getStatusCode());
25-
$this->assertNotEmpty($e->getRequestId());
26-
$this->assertEquals("invalid_input", $e->getErrorCode());
27-
$this->assertEquals(
28-
["Expected array, received number"],
29-
$e->getValidationErrorMessages("device_ids"),
30-
);
31-
}
32-
}
33-
34-
public function testUnauthorizedError(): void
35-
{
36-
$test_server = Fixture::getTestServer();
37-
$seam = new \Seam\SeamClient(
38-
"invalid_api_key",
39-
$test_server->client->getConfig("base_uri")->__toString(),
40-
);
41-
42-
try {
43-
$seam->devices->list();
44-
$this->fail("Expected UnauthorizedError");
45-
} catch (\Seam\HttpUnauthorizedError $e) {
46-
$this->assertNotEmpty($e->getRequestId());
47-
}
48-
}
49-
50-
public function testApiError(): void
51-
{
52-
$seam = Fixture::getTestServer();
53-
54-
try {
55-
$seam->devices->get(device_id: "nonexistent_device_id");
56-
$this->fail("Expected ApiError");
57-
} catch (\Seam\HttpApiError $e) {
58-
$this->assertEquals(404, $e->getStatusCode());
59-
$this->assertNotEmpty($e->getRequestId());
60-
$this->assertEquals("device_not_found", $e->getErrorCode());
61-
}
62-
}
63-
649
public function testNonSeamError(): void
6510
{
66-
$seam = Fixture::getTestServer();
67-
6811
$seam = new \Seam\SeamClient(
6912
"seam_apikey1_token",
7013
"https://nonexistent.example.com",

0 commit comments

Comments
 (0)