diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-29 09:24:08 +0200 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-29 09:24:08 +0200 |
commit | 70e305a918fcf193009831d4e89aa8c386df3dc4 (patch) | |
tree | 8cc49f253f29636ddd623aa2c2b98835300604f0 /tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php | |
parent | 55df8dac44f54a305e8bd7e50ef63f76725d2333 (diff) |
Ported / fixed most old tests
Diffstat (limited to 'tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php')
-rw-r--r-- | tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php b/tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php index 234f70bd..fae1f394 100644 --- a/tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php +++ b/tests/unit/Data/TableGateway/TableGatewayPgsqlTest.php @@ -1,11 +1,19 @@ <?php -require_once(dirname(__FILE__).'/BaseGatewayTest.php'); +require_once(dirname(__FILE__).'/BaseGateway.php'); /** * @package System.Data.TableGateway */ -class TableGatewayPgsqlTest extends BaseGatewayTest +class TableGatewayPgsqlTest extends BaseGateway { + public function setUp() + { + if (!extension_loaded('pgsql')) { + $this->markTestSkipped( + 'The pgsql extension is not available.' + ); + } + } function test_update() { @@ -20,7 +28,7 @@ class TableGatewayPgsqlTest extends BaseGatewayTest $expect['username'] = 'tester 1'; $expect['field5_text'] = null; unset($expect['field7_timestamp']); unset($test['field7_timestamp']); - $this->assertEqual($expect, $test); + $this->assertEquals($expect, $test); $this->assertTrue($this->getGateway()->deleteAll('username = ?', 'tester 1')); } @@ -38,7 +46,7 @@ class TableGatewayPgsqlTest extends BaseGatewayTest $expect['username'] = 'tester 1'; $expect['field5_text'] = null; unset($expect['field7_timestamp']); unset($test['field7_timestamp']); - $this->assertEqual($expect, $test); + $this->assertEquals($expect, $test); $this->assertTrue($this->getGateway()->deleteAll('username = :name', array(':name'=>'tester 1'))); } @@ -49,10 +57,10 @@ class TableGatewayPgsqlTest extends BaseGatewayTest $this->add_record2(); $results = $this->getGateway()->findAll('true')->readAll(); - $this->assertEqual(count($results), 2); + $this->assertEquals(count($results), 2); $result = $this->getGateway()->findAllBySql('SELECT username FROM address WHERE phone = ?', '45233')->read(); - $this->assertEqual($result['username'], 'record2'); + $this->assertEquals($result['username'], 'record2'); } }
\ No newline at end of file |