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

Commit c9fa8fd

Browse files
committed
Merge branch 'hotfix/97'
Close #106 Fixes #97
2 parents 8994b60 + 59c1293 commit c9fa8fd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
## 2.8.1 - TBD
5+
## 2.8.1 - 2016-04-14
66

77
### Added
88

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

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

2426
## 2.8.0 - 2016-04-12
2527

src/Adapter/Driver/Pgsql/Connection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public function connect()
123123
$connection = $this->getConnectionString();
124124
set_error_handler(function ($number, $string) {
125125
throw new Exception\RuntimeException(
126-
__METHOD__ . ': Unable to connect to database', null, new Exception\ErrorException($string, $number)
126+
__METHOD__ . ': Unable to connect to database',
127+
null,
128+
new Exception\ErrorException($string, $number)
127129
);
128130
});
129131
$this->resource = pg_connect($connection);

test/Adapter/Driver/Pgsql/ConnectionTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ public function testSetConnectionType()
114114
$this->assertEquals($type, self::readAttribute($this->connection, 'type'));
115115
}
116116

117+
/**
118+
* @runInSeparateProcess
119+
*/
117120
public function testSetCharset()
118121
{
119122
if (! extension_loaded('pgsql')) {
@@ -130,11 +133,18 @@ public function testSetCharset()
130133
'charset' => 'SQL_ASCII',
131134
]);
132135

133-
$this->connection->connect();
136+
try {
137+
$this->connection->connect();
138+
} catch (AdapterException\RuntimeException $e) {
139+
$this->markTestSkipped('Skipping pgsql charset test due to inability to connecto to database');
140+
}
134141

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

145+
/**
146+
* @runInSeparateProcess
147+
*/
138148
public function testSetInvalidCharset()
139149
{
140150
if (! extension_loaded('pgsql')) {

0 commit comments

Comments
 (0)