Переглянути джерело

Added usage of 'assertInstanceOf' in unit tests.

Taddeus Kroes 14 роки тому
батько
коміт
9d52a56938
3 змінених файлів з 6 додано та 2 видалено
  1. 1 1
      test/array.php
  2. 4 0
      test/sql.php
  3. 1 1
      test/template.php

+ 1 - 1
test/array.php

@@ -13,7 +13,7 @@ class pQueryArrayTest extends PHPUnit_Framework_TestCase {
 	}
 	
 	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.');
 	}
 	

+ 4 - 0
test/sql.php

@@ -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);
 	}
 	
+	function test_constructor() {
+		$this->assertInstanceOf('pQuerySql', _sql("foo"), 'constructor does not return pQuerySql object');
+	}
+	
 	function test_constructor_simple() {
 		$sql = _sql("select id from foo where bar = '[0]'", 'test1');
 		$this->assertEquals("select id from foo where bar = 'test1'", $sql->query);

+ 1 - 1
test/template.php

@@ -53,7 +53,7 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase {
 	}
 	
 	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() {