diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
commit | a3388622287e218beddfa14a47ed677d4307b36b (patch) | |
tree | 1b4c7ac8597b1cc798b6683d4a81c90d38de12f6 /tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php | |
parent | c7fd3e1167b6f2fa7746edbd0fb8f8c1694c61f9 (diff) |
Removed simpletest and moved all tests in the unit tree
Tests are executed now, but a lot of them need fixing.
Diffstat (limited to 'tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php')
-rw-r--r-- | tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php b/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php deleted file mode 100644 index 96c9351d..00000000 --- a/tests/simple_unit/TableGateway/TableGatewayPgsqlTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -require_once(dirname(__FILE__).'/BaseGatewayTest.php'); - -class TableGatewayPgsqlTest extends BaseGatewayTest -{ - - function test_update() - { - $this->add_record1(); - $address = array('username' => 'tester 1', 'field5_text'=>null); - $result = $this->getGateway()->update($address, 'username = ?', 'Username'); - $this->assertTrue($result); - - $test = $this->getGateway()->find('username = ?', 'tester 1'); - unset($test['id']); - $expect = $this->get_record1(); - $expect['username'] = 'tester 1'; - $expect['field5_text'] = null; - unset($expect['field7_timestamp']); unset($test['field7_timestamp']); - $this->assertEqual($expect, $test); - - $this->assertTrue($this->getGateway()->deleteAll('username = ?', 'tester 1')); - } - - function test_update_named() - { - $this->add_record1(); - $address = array('username' => 'tester 1', 'field5_text'=>null); - $result = $this->getGateway()->update($address, 'username = :name', array(':name'=>'Username')); - $this->assertTrue($result); - - $test = $this->getGateway()->find('username = :name', array(':name'=>'tester 1')); - unset($test['id']); - $expect = $this->get_record1(); - $expect['username'] = 'tester 1'; - $expect['field5_text'] = null; - unset($expect['field7_timestamp']); unset($test['field7_timestamp']); - $this->assertEqual($expect, $test); - - $this->assertTrue($this->getGateway()->deleteAll('username = :name', array(':name'=>'tester 1'))); - } - - function test_find_all() - { - $this->add_record1(); - $this->add_record2(); - - $results = $this->getGateway()->findAll('true')->readAll(); - $this->assertEqual(count($results), 2); - - $result = $this->getGateway()->findAllBySql('SELECT username FROM address WHERE phone = ?', '45233')->read(); - $this->assertEqual($result['username'], 'record2'); - } - -}
\ No newline at end of file |