Explorar el Código

Fixed some errors caused by folder/class renaming.

Taddeus Kroes hace 14 años
padre
commit
18a753bf89
Se han modificado 2 ficheros con 9 adiciones y 9 borrados
  1. 2 2
      pquery.php
  2. 7 7
      tests/template.php

+ 2 - 2
pquery.php

@@ -164,8 +164,8 @@ class pQuery {
 			return self::error('Plugin "%s" does not exist.', $class_name);
 		
 		// Assert that the plugin extend the base clas properly
-		if( !in_array('pQueryExtension', class_implements($class_name)) )
-			return self::error('Plugin "%s" does not implement pQueryExtension.', $class_name);
+		if( !is_subclass_of($class_name, 'pQuery') )
+			return self::error('Plugin class "%s" does not extend pQuery.', $class_name);
 		
 		// Assert that the required PHP version is installed
 		if( isset($class_name::$REQUIRED_PHP_VERSION)

+ 7 - 7
tests/template.php

@@ -11,7 +11,7 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase {
 	
 	function setUp() {
 		// Set root to tests/templates
-		$this->templates_folder = PQUERY_ROOT.'test/'.self::TEMPLATES_FOLDER;
+		$this->templates_folder = PQUERY_ROOT.'tests/'.self::TEMPLATES_FOLDER;
 		__tpl::set_root($this->templates_folder, false);
 		
 		// Load the test template
@@ -20,14 +20,14 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase {
 	}
 	
 	function test_add_root_relative() {
-		$folder = PQUERY_ROOT.'test/';
-		$folder_relative = 'test/';
+		$folder = PQUERY_ROOT.'tests/';
+		$folder_relative = 'tests/';
 		__tpl::add_root($folder_relative);
 		$this->assertTrue(in_array($folder, __tpl::$include_path), 'folder was not added to include path');
 	}
 	
 	function test_add_root_absolute() {
-		$folder = PQUERY_ROOT.'test/';
+		$folder = PQUERY_ROOT.'tests/';
 		__tpl::add_root($folder, false);
 		$this->assertTrue(in_array($folder, __tpl::$include_path), 'folder was not added to include path');
 	}
@@ -40,14 +40,14 @@ class pQueryTemplateTest extends PHPUnit_Framework_TestCase {
 	}
 	
 	function test_set_root_relative() {
-		$folder = PQUERY_ROOT.'test/';
-		$folder_relative = 'test/';
+		$folder = PQUERY_ROOT.'tests/';
+		$folder_relative = 'tests/';
 		__tpl::set_root($folder_relative);
 		$this->assertEquals(array($folder), __tpl::$include_path, 'folder was not set as only include path');
 	}
 	
 	function test_set_root_absolute() {
-		$folder = PQUERY_ROOT.'test/';
+		$folder = PQUERY_ROOT.'tests/';
 		__tpl::set_root($folder, false);
 		$this->assertEquals(array($folder), __tpl::$include_path, 'folder was not set as only include path');
 	}