Skip to content

Commit 9b91512

Browse files
committed
corrections
1 parent d715e90 commit 9b91512

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/Database/ez_pdo.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ class ez_pdo extends ezsqlModel implements DatabaseInterface
2323
*/
2424
private $dbh;
2525

26-
/**
27-
* Query result
28-
* @var mixed
29-
*/
30-
private $result;
31-
3226
/**
3327
* Database configuration setting
3428
* @var ConfigInterface
3529
*/
3630
private $database;
3731

32+
/**
33+
* Query result
34+
* @var mixed
35+
*/
36+
protected $result;
37+
3838
public function __construct(ConfigInterface $settings = null)
3939
{
4040
if (empty($settings)) {
@@ -450,7 +450,7 @@ public function query(string $query, bool $use_prepare = false)
450450

451451
if ($this->processQuery($query, $param) === false) {
452452
if ($this->isTransactional)
453-
throw new \PDOException($this->getLast_Error());
453+
throw new \PDOException($this->lastError);
454454

455455
return false;
456456
}

tests/pdo/pdo_pgsqlTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function testInsert()
102102
public function testUpdate()
103103
{
104104
$this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD));
105+
$this->object->drop('unit_test');
105106
$this->object->query('CREATE TABLE unit_test(id serial, test_key varchar(50), test_value varchar(50), PRIMARY KEY (ID))');
106107
$this->object->insert('unit_test', array('test_key' => 'test 1', 'test_value' => 'testing string 1'));
107108

@@ -134,6 +135,7 @@ public function testUpdate()
134135
public function testDelete()
135136
{
136137
$this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD));
138+
$this->object->drop('unit_test');
137139
$this->object->query('CREATE TABLE unit_test(id serial, test_key varchar(50), test_value varchar(50), PRIMARY KEY (ID))');
138140
$this->object->insert('unit_test', array('test_key' => 'test 1', 'test_value' => 'testing string 1'));
139141
$this->object->insert('unit_test', array('test_key' => 'test 2', 'test_value' => 'testing string 2'));

0 commit comments

Comments
 (0)