Parcourir la source

Added empty unit test files for all plugins.

Taddes Kroes il y a 14 ans
Parent
commit
4209f417ae
5 fichiers modifiés avec 52 ajouts et 5 suppressions
  1. 16 5
      test/index.php
  2. 9 0
      test/test_array.php
  3. 9 0
      test/test_pquery.php
  4. 9 0
      test/test_sql.php
  5. 9 0
      test/test_template.php

+ 16 - 5
test/index.php

@@ -1,8 +1,19 @@
 <?php
 
-include_once '../../debug.php';
-include_once '../pquery.php';
-__p::require_plugins('array', 'sql', 'template');
+include_once '../../simpletest/autorun.php';
+include_once '../pquery.config.php';
+include_once PQUERY_ROOT.'pquery.php';
+
+function is_test_file($filename) {
+	return preg_match('/^test_\w+\.php$/', $filename);
+}
+
+foreach( array_filter(scandir('.'), 'is_test_file') as $file )
+	include_once $file;
+
+/*include_once '../../debug.php';
+include_once '../pquery.php';*/
+//__p::require_plugins('array', 'sql', 'template');
 
 // Array test
 /*$a = _p(range(0, 10));
@@ -17,7 +28,7 @@ while( !$a->is_empty() ) {
 $results = $sql->fetch_all('object');
 $results = _arr($results);
 
-debug($results);*/
+debug($results);
 
 __tpl::set_root('templates', false);
 $tpl = _tpl('test.tpl');
@@ -26,6 +37,6 @@ $test1 = $tpl->data->add('test1', array('var' => 'some-variable'));
 $tpl->data->add('test1', array('var' => 'some-other-variable'));
 $test1->add('test2');
 $tpl->data->add('test3');
-debug($tpl->parse());
+debug($tpl->parse());*/
 
 ?>

+ 9 - 0
test/test_array.php

@@ -0,0 +1,9 @@
+<?php
+
+class pQueryArrayTestCase extends UnitTestCase {
+	function test_() {
+		
+	}
+}
+
+?>

+ 9 - 0
test/test_pquery.php

@@ -0,0 +1,9 @@
+<?php
+
+class pQueryTestCase extends UnitTestCase {
+	function test_() {
+		
+	}
+}
+
+?>

+ 9 - 0
test/test_sql.php

@@ -0,0 +1,9 @@
+<?php
+
+class pQuerySqlTestCase extends UnitTestCase {
+	function test_() {
+		
+	}
+}
+
+?>

+ 9 - 0
test/test_template.php

@@ -0,0 +1,9 @@
+<?php
+
+class pQueryTemplateTestCase extends UnitTestCase {
+	function test_() {
+		
+	}
+}
+
+?>