mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making more App::import() tests pass
This commit is contained in:
parent
0bf51d92ca
commit
6ac87eef68
2 changed files with 9 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue