Permalink
Browse files

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...
1 parent 3735c7d commit ee7f41708533d91ea92ff66f2bcd8969040fea5a @lorenzo lorenzo committed Oct 27, 2011
@@ -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.