Browse Source

Fixing the HtmlHelper tests

José Lorenzo Rodríguez 15 years ago
parent
commit
396fbeec91

+ 2 - 1
lib/Cake/View/Helper/HtmlHelper.php

@@ -944,7 +944,8 @@ class HtmlHelper extends AppHelper {
 		}
 
 		$readerClass = Inflector::camelize($reader) . 'Reader';
-		if (!App::import('Lib', 'config/' . $readerClass)) {
+		App::uses($readerClass, 'Configure');
+		if (!class_exists($readerClass)) {
 			throw new ConfigureException(__('Cannot load the configuration file. Unknown reader.'));
 		}
 

+ 2 - 3
lib/Cake/tests/cases/libs/view/helpers/html.test.php

@@ -16,7 +16,6 @@
  * @since         CakePHP(tm) v 1.2.0.4206
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-App::import('Core', array('Helper', 'AppHelper', 'ClassRegistry', 'Controller'));
 
 App::uses('Helper', 'View');
 App::uses('AppHelper', 'View/Helper');
@@ -1384,7 +1383,7 @@ class HtmlHelperTest extends CakeTestCase {
  */
 
 	public function testLoadConfig() {
-		$path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
+		$path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
 
 		$result = $this->Html->loadConfig('htmlhelper_tags', $path);
 		$expected = array(
@@ -1424,7 +1423,7 @@ class HtmlHelperTest extends CakeTestCase {
  * @expectedException ConfigureException
  */
 	public function testLoadConfigWrongReader() {
-		$path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
+		$path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
 		$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
 	}