Doctrine\Tests\CouchDB\HTTP\SocketClientTestCase::testCloseConnection PHP Method

testCloseConnection() public method

public testCloseConnection ( )
    public function testCloseConnection()
    {
        $db = new HTTP\SocketClient();
        $db->setOption('keep-alive', false);
        $db->request('PUT', '/' . $this->getTestDatabase() . '/123', '{"_id":"123","data":"Foo"}');
        $db->request('PUT', '/' . $this->getTestDatabase() . '/456', '{"_id":"456","data":"Foo"}');
        $db->request('PUT', '/' . $this->getTestDatabase() . '/789', '{"_id":"789","data":"Foo"}');
        $db->request('PUT', '/' . $this->getTestDatabase() . '/012', '{"_id":"012","data":"Foo"}');
        $response = $db->request('GET', '/' . $this->getTestDatabase() . '/_all_docs');
        $this->assertTrue($response instanceof HTTP\Response);
        $this->assertSame(4, $response->body['total_rows']);
    }