Commit 9d52a569 authored by Taddeus Kroes's avatar Taddeus Kroes

Added usage of 'assertInstanceOf' in unit tests.

parent ce873a8e
...@@ -13,7 +13,7 @@ class pQueryArrayTest extends PHPUnit_Framework_TestCase { ...@@ -13,7 +13,7 @@ class pQueryArrayTest extends PHPUnit_Framework_TestCase {
} }
function test_constructor() { function test_constructor() {
$this->assertTrue($this->arr instanceof pQueryArray, 'constructor does not return pQueryArray object.'); $this->assertInstanceOf('pQueryArray', $this->arr, 'constructor does not return pQueryArray object.');
$this->assertEquals($this->variable, $this->arr->variable, 'variable is not set correctly.'); $this->assertEquals($this->variable, $this->arr->variable, 'variable is not set correctly.');
} }
......
...@@ -55,6 +55,10 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase { ...@@ -55,6 +55,10 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase {
$this->assertNotEquals("select id from foo where bar = 'select id from foo where bar = 'test1''", $sql->query); $this->assertNotEquals("select id from foo where bar = 'select id from foo where bar = 'test1''", $sql->query);
} }
function test_constructor() {
$this->assertInstanceOf('pQuerySql', _sql("foo"), 'constructor does not return pQuerySql object');
}
function test_constructor_simple() { function test_constructor_simple() {
$sql = _sql("select id from foo where bar = '[0]'", 'test1'); $sql = _sql("select id from foo where bar = '[0]'", 'test1');
$this->assertEquals("select id from foo where bar = 'test1'", $sql->query); $this->assertEquals("select id from foo where bar = 'test1'", $sql->query);
......
...@@ -53,7 +53,7 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase { ...@@ -53,7 +53,7 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase {
} }
function test_constructor() { function test_constructor() {
$this->assertTrue($this->tpl instanceof pQueryTemplate, 'constructor does not return pQueryTemplate object'); $this->assertInstanceOf('pQueryTemplate', $this->tpl, 'constructor does not return pQueryTemplate object');
} }
function test_open_template_file() { function test_open_template_file() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment