Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/97'
Browse files Browse the repository at this point in the history
Close #106
Fixes #97
  • Loading branch information
weierophinney committed Apr 14, 2016
2 parents 8994b60 + 59c1293 commit c9fa8fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.8.1 - TBD
## 2.8.1 - 2016-04-14

### Added

Expand All @@ -20,6 +20,8 @@ All notable changes to this project will be documented in this file, in reverse

- [#100](https://github.com/zendframework/zend-db/pull/100) fixes the JOIN
behavior to re-allow selecting an empty column set from the joined table.
- [#106](https://github.com/zendframework/zend-db/pull/106) fixes an issue in
the test suite when ext/pgsql is enabled, but no databases are avaiable.

## 2.8.0 - 2016-04-12

Expand Down
4 changes: 3 additions & 1 deletion src/Adapter/Driver/Pgsql/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ public function connect()
$connection = $this->getConnectionString();
set_error_handler(function ($number, $string) {
throw new Exception\RuntimeException(
__METHOD__ . ': Unable to connect to database', null, new Exception\ErrorException($string, $number)
__METHOD__ . ': Unable to connect to database',
null,
new Exception\ErrorException($string, $number)
);
});
$this->resource = pg_connect($connection);
Expand Down
12 changes: 11 additions & 1 deletion test/Adapter/Driver/Pgsql/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ public function testSetConnectionType()
$this->assertEquals($type, self::readAttribute($this->connection, 'type'));
}

/**
* @runInSeparateProcess
*/
public function testSetCharset()
{
if (! extension_loaded('pgsql')) {
Expand All @@ -130,11 +133,18 @@ public function testSetCharset()
'charset' => 'SQL_ASCII',
]);

$this->connection->connect();
try {
$this->connection->connect();
} catch (AdapterException\RuntimeException $e) {
$this->markTestSkipped('Skipping pgsql charset test due to inability to connecto to database');
}

$this->assertEquals('SQL_ASCII', pg_client_encoding($this->connection->getResource()));
}

/**
* @runInSeparateProcess
*/
public function testSetInvalidCharset()
{
if (! extension_loaded('pgsql')) {
Expand Down

0 comments on commit c9fa8fd

Please sign in to comment.