diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index 3520fd461ec..4c0e9c3cea4 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -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')); + } } diff --git a/lib/Cake/Test/test_app/Plugin/TestPlugin/Lib/TestPluginOtherLibrary.php b/lib/Cake/Test/test_app/Plugin/TestPlugin/Lib/TestPluginOtherLibrary.php new file mode 100644 index 00000000000..9df2508a2bb --- /dev/null +++ b/lib/Cake/Test/test_app/Plugin/TestPlugin/Lib/TestPluginOtherLibrary.php @@ -0,0 +1,19 @@ + + * 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 {}