Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/Unit/Client/Transport/HttpTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function testSseBufferIsBoundedByConfiguredCap(): void

$this->invokeProcessSseStream($transport);

self::assertSame('', $this->readPrivate($transport, 'sseBuffer'), 'buffer must be cleared on abort');
self::assertNull($this->readPrivate($transport, 'activeStream'), 'stream must be released on abort');
$this->assertSame('', $this->readPrivate($transport, 'sseBuffer'), 'buffer must be cleared on abort');
$this->assertNull($this->readPrivate($transport, 'activeStream'), 'stream must be released on abort');
}

#[TestDox('aborting the SSE stream fails the in-flight request immediately instead of waiting for its timeout')]
Expand All @@ -60,9 +60,9 @@ public function testAbortFailsPendingRequestFast(): void
$this->invokeProcessSseStream($transport);

$response = $state->consumeResponse(1);
self::assertInstanceOf(Error::class, $response);
self::assertSame(Error::INTERNAL_ERROR, $response->code);
self::assertSame(1, $response->id);
$this->assertInstanceOf(Error::class, $response);
$this->assertSame(Error::INTERNAL_ERROR, $response->code);
$this->assertSame(1, $response->id);
}

#[TestDox('well-formed delimited events are parsed and dispatched')]
Expand All @@ -78,7 +78,7 @@ public function testWellFormedEventsStillParse(): void

$this->invokeProcessSseStream($transport);

self::assertSame(['hello', 'world'], $messages);
$this->assertSame(['hello', 'world'], $messages);
}

#[TestDox('the buffer cap must be a positive number of bytes')]
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/Client/Transport/StdioTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testInputBufferIsBounded(): void

$this->invokeProcessInput($transport);

self::assertSame('', $this->readPrivate($transport, 'inputBuffer'), 'buffer must be cleared on abort');
$this->assertSame('', $this->readPrivate($transport, 'inputBuffer'), 'buffer must be cleared on abort');
}

#[TestDox('aborting the input fails the in-flight request immediately')]
Expand All @@ -49,9 +49,9 @@ public function testAbortFailsPendingRequestFast(): void
$this->invokeProcessInput($transport);

$response = $state->consumeResponse(1);
self::assertInstanceOf(Error::class, $response);
self::assertSame(Error::INTERNAL_ERROR, $response->code);
self::assertSame(1, $response->id);
$this->assertInstanceOf(Error::class, $response);
$this->assertSame(Error::INTERNAL_ERROR, $response->code);
$this->assertSame(1, $response->id);
}

#[TestDox('newline-delimited frames within the cap are parsed and dispatched')]
Expand All @@ -67,7 +67,7 @@ public function testWellFormedFramesStillParse(): void

$this->invokeProcessInput($transport);

self::assertSame(['{"a":1}', '{"b":2}'], $messages);
$this->assertSame(['{"a":1}', '{"b":2}'], $messages);
}

#[TestDox('the buffer cap must be a positive number of bytes')]
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Server/Transport/StdioTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testOverlongLineIsDiscarded(): void

$this->pumpToEof($transport);

self::assertSame([], $messages, 'the over-length line must never be dispatched');
$this->assertSame([], $messages, 'the over-length line must never be dispatched');
}

#[TestDox('processing resumes with the next line after an over-length line is discarded')]
Expand All @@ -37,7 +37,7 @@ public function testRecoversAfterOverlongLine(): void

$this->pumpToEof($transport);

self::assertSame(['{"valid":1}'], $messages);
$this->assertSame(['{"valid":1}'], $messages);
}

#[TestDox('a normal line within the cap is dispatched')]
Expand All @@ -48,7 +48,7 @@ public function testNormalLineIsDispatched(): void

$this->pumpToEof($transport);

self::assertSame(['{"jsonrpc":"2.0","id":1}'], $messages);
$this->assertSame(['{"jsonrpc":"2.0","id":1}'], $messages);
}

#[TestDox('the line byte cap must be a positive number of bytes')]
Expand Down