Making more App::import() tests pass

This commit is contained in:
Jose Lorenzo Rodriguez 2011-03-11 18:18:58 -04:30
parent 0bf51d92ca
commit 6ac87eef68
2 changed files with 9 additions and 7 deletions

View file

@ -471,20 +471,19 @@ class AppImportTest extends CakeTestCase {
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/410
*/
function testImportingHelpersFromAlternatePaths() {
App::build();
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.');
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
App::import('Helper', 'Banana');
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper was not found because the path does not exist.');
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper was not found because the path does not exist.');
App::build(array(
'helpers' => array(
'View/Helper' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
)
));
App::build(array('vendors' => array(LIBS)));
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.');
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');
App::import('Helper', 'Banana');
$this->assertTrue(class_exists('BananaHelper'), 'BananaHelper was not loaded.');
$this->assertTrue(class_exists('BananaHelper', false), 'BananaHelper was not loaded.');
App::build();
}

View file

@ -15,5 +15,8 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Helper', 'View');
class BananaHelper extends Helper {
}