Skip to content

Commit

Permalink
Making more App::import() tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 11, 2011
1 parent 0bf51d9 commit 6ac87ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/Cake/tests/cases/libs/app.test.php
Expand Up @@ -471,20 +471,19 @@ function testPluginImporting() {
* @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();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/tests/test_app/views/helpers/banana.php
Expand Up @@ -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 {
}

0 comments on commit 6ac87ee

Please sign in to comment.