assertSame('', $r->body()); $this->assertSame(200, $r->status()); } public function testConstructorStatus(): void { $r = new Response(404); $this->assertSame(404, $r->status()); } public function testBodySetterReturnsThis(): void { $r = new Response(); $same = $r->body('hello'); $this->assertSame($r, $same); $this->assertSame('hello', $r->body()); } public function testStatusSetterReturnsThis(): void { $r = new Response(); $same = $r->status(301); $this->assertSame($r, $same); $this->assertSame(301, $r->status()); } public function testBodyOverwrite(): void { $r = (new Response())->body('first'); $r->body('second'); $this->assertSame('second', $r->body()); } public function testBodyEmpty(): void { $r = (new Response())->body('content'); $r->body(''); $this->assertSame('', $r->body()); } public function testFluentChain(): void { $r = new Response(); $body = $r->status(201)->body('created')->body(); $this->assertSame('created', $body); $this->assertSame(201, $r->status()); } }