PhlyTest\Conduit\Http\ResponseTest::testCannotMutateResponseAfterCallingEnd PHP Method

testCannotMutateResponseAfterCallingEnd() public method

    public function testCannotMutateResponseAfterCallingEnd()
    {
        $response = $this->response->withStatus(201);
        $response = $response->write("First\n");
        $response = $response->end('DONE');
        $test = $response->withStatus(200);
        $test = $test->withHeader('X-Foo', 'Foo');
        $test = $test->write('MOAR!');
        $this->assertSame($response, $test);
        $this->assertEquals(201, $test->getStatusCode());
        $this->assertFalse($test->hasHeader('X-Foo'));
        $this->assertNotContains('MOAR!', (string) $test->getBody());
        $this->assertContains('First', (string) $test->getBody());
        $this->assertContains('DONE', (string) $test->getBody());
    }