Doctrine\Tests\CouchDB\HTTP\StreamClientTestCase::testNoConnectionPossible PHP Метод

testNoConnectionPossible() публичный Метод

    public function testNoConnectionPossible()
    {
        $db = new HTTP\StreamClient('127.0.0.1', 12345);
        try {
            $db->request('GET', '/' . $this->getTestDatabase() . '');
            $this->fail('Expected HTTP\\HTTPException.');
        } catch (HTTP\HTTPException $e) {
            $this->assertTrue($e->getMessage() === 'Could not connect to server at 127.0.0.1:12345: \'0: fopen(http://127.0.0.1:12345/' . $this->getTestDatabase() . '): failed to open stream: operation failed\'' || $e->getMessage() === 'Could not connect to server at 127.0.0.1:12345: \'0: fopen(http://127.0.0.1:12345/' . $this->getTestDatabase() . '): failed to open stream: Connection refused\'' || $e->getMessage() === 'Could read from server at 127.0.0.1:12345: \'0: Received an empty response or not status code\'');
        }
    }