Skip to content

Commit 3a559b3

Browse files
test: remove redundant test/assertion in Adapter/Psr7/ResponseTest (#208)
Co-authored-by: Claude <[email protected]>
1 parent b68077b commit 3a559b3

File tree

1 file changed

+0
-85
lines changed

1 file changed

+0
-85
lines changed

tests/src/Unit/Adapter/Psr7/ResponseTest.php

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,6 @@ protected function setUp(): void
2727
);
2828
}
2929

30-
public function testGetStatusCode(): void
31-
{
32-
$this->assertEquals(200, $this->response->getStatusCode());
33-
}
34-
35-
public function testWithStatus(): void
36-
{
37-
$withStatus = $this->response->withStatus(404, 'Not Found');
38-
$this->assertEquals(404, $withStatus->getStatusCode());
39-
$this->assertEquals('Not Found', $withStatus->getReasonPhrase());
40-
}
41-
42-
public function testGetReasonPhrase(): void
43-
{
44-
$this->assertEquals('OK', $this->response->getReasonPhrase());
45-
}
46-
47-
public function testGetHarResponse(): void
48-
{
49-
$harResponse = $this->response->getHarResponse();
50-
$this->assertInstanceOf(\Deviantintegral\Har\Response::class, $harResponse);
51-
$this->assertEquals(200, $harResponse->getStatus());
52-
}
53-
5430
public function testWithHeader(): void
5531
{
5632
$withHeader = $this->response->withHeader('X-Test', 'value');
@@ -78,29 +54,6 @@ public function testGetHeaderLineWhenHeaderNotPresent(): void
7854
$this->assertEquals('', $this->response->getHeaderLine('X-NonExistent'));
7955
}
8056

81-
public function testGetHeader(): void
82-
{
83-
$headers = $this->response->getHeader('Content-Type');
84-
$this->assertEquals(['text/html; charset=UTF-8'], $headers);
85-
}
86-
87-
public function testHasHeader(): void
88-
{
89-
$this->assertTrue($this->response->hasHeader('Content-Type'));
90-
$this->assertFalse($this->response->hasHeader('X-NonExistent'));
91-
}
92-
93-
public function testGetHeaders(): void
94-
{
95-
$headers = $this->response->getHeaders();
96-
$this->assertArrayHasKey('Content-Type', $headers);
97-
}
98-
99-
public function testGetProtocolVersion(): void
100-
{
101-
$this->assertEquals('1.1', $this->response->getProtocolVersion());
102-
}
103-
10457
public function testWithProtocolVersion(): void
10558
{
10659
$withProtocol = $this->response->withProtocolVersion('2.0');
@@ -113,44 +66,6 @@ public function testWithoutHeader(): void
11366
$this->assertFalse($withoutHeader->hasHeader('Content-Type'));
11467
}
11568

116-
public function testWithAddedHeader(): void
117-
{
118-
$withAdded = $this->response->withAddedHeader('X-Custom', 'value1');
119-
$this->assertEquals(['value1'], $withAdded->getHeader('X-Custom'));
120-
121-
$withMultiple = $withAdded->withAddedHeader('X-Custom', 'value2');
122-
$this->assertEquals(['value1', 'value2'], $withMultiple->getHeader('X-Custom'));
123-
}
124-
125-
public function testWithAddedHeaderArrayValue(): void
126-
{
127-
$withAdded = $this->response->withAddedHeader('X-Custom', ['value1', 'value2']);
128-
$this->assertEquals(['value1', 'value2'], $withAdded->getHeader('X-Custom'));
129-
}
130-
131-
public function testGetBody(): void
132-
{
133-
$body = $this->response->getBody();
134-
$this->assertInstanceOf(\Psr\Http\Message\StreamInterface::class, $body);
135-
136-
// Verify the body content matches the response content
137-
$bodyContent = $body->getContents();
138-
$this->assertNotEmpty($bodyContent);
139-
}
140-
141-
public function testWithBody(): void
142-
{
143-
$newBodyContent = 'Test body content';
144-
$newBody = \GuzzleHttp\Psr7\Utils::streamFor($newBodyContent);
145-
146-
$withBody = $this->response->withBody($newBody);
147-
$this->assertInstanceOf(Response::class, $withBody);
148-
149-
// Verify the new body content
150-
$resultBody = $withBody->getBody();
151-
$this->assertEquals($newBodyContent, $resultBody->getContents());
152-
}
153-
15469
public function testWithStatusDoesNotModifyOriginal(): void
15570
{
15671
$original = $this->response;

0 commit comments

Comments
 (0)