Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test to disprove #2123, it is possible to load classes in plugin's Li…
…b directory. App::uses() is intended for classes not procedural files.
  • Loading branch information
lorenzo committed Oct 27, 2011
1 parent 3735c7d commit ee7f417
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Cake/Test/Case/Core/AppTest.php
Expand Up @@ -794,4 +794,20 @@ public function testPaths() {
$this->assertArrayHasKey('Controller', $result);
$this->assertArrayHasKey('Controller/Component', $result);
}

/**
* Proves that it is possible to load plugin libraries in top
* level Lib dir for plugins
*
* @return void
*/
public function testPluginLibClasses() {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
CakePlugin::loadAll();
$this->assertFalse(class_exists('TestPluginOtherLibrary', false));
App::uses('TestPluginOtherLibrary', 'TestPlugin.Lib');
$this->assertTrue(class_exists('TestPluginOtherLibrary'));
}
}
@@ -0,0 +1,19 @@
<?php
/**
* Test Suite TestPlugin Other Library
*
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
* @package Cake.Test.test_app.Plugin.TestPlugin.Lib
* @since CakePHP(tm) v 2.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
class TestPluginOtherLibrary {}

0 comments on commit ee7f417

Please sign in to comment.