mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-03 22:53:58 +02:00
Upgrade CakePHP from 2.2.5 to 2.9.5
This commit is contained in:
parent
5a580df460
commit
235a541597
793 changed files with 60746 additions and 23753 deletions
|
@ -2,26 +2,24 @@
|
|||
/**
|
||||
* CakePluginTest file.
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Test.Case.Core
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('CakePlugin', 'Core');
|
||||
|
||||
/**
|
||||
* CakePluginTest class
|
||||
*
|
||||
*/
|
||||
class CakePluginTest extends CakeTestCase {
|
||||
|
||||
|
@ -179,6 +177,20 @@ class CakePluginTest extends CakeTestCase {
|
|||
CakePlugin::routes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test ignoring missing bootstrap/routes file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIgnoreMissingFiles() {
|
||||
CakePlugin::loadAll(array(array(
|
||||
'bootstrap' => true,
|
||||
'routes' => true,
|
||||
'ignoreMissing' => true
|
||||
)));
|
||||
CakePlugin::routes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that CakePlugin::load() throws an exception on unknown plugin
|
||||
*
|
||||
|
@ -197,10 +209,10 @@ class CakePluginTest extends CakeTestCase {
|
|||
public function testPath() {
|
||||
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
|
||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
|
||||
$this->assertEquals(CakePlugin::path('TestPlugin'), $expected);
|
||||
$this->assertEquals($expected, CakePlugin::path('TestPlugin'));
|
||||
|
||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPluginTwo' . DS;
|
||||
$this->assertEquals(CakePlugin::path('TestPluginTwo'), $expected);
|
||||
$this->assertEquals($expected, CakePlugin::path('TestPluginTwo'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,8 +252,8 @@ class CakePluginTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that CakePlugin::loadAll() will load all plugins in the configured folder wit defaults
|
||||
* and overrides for a plugin
|
||||
* Tests that CakePlugin::loadAll() will load all plugins in the configured folder with defaults
|
||||
* and merges in global defaults.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -249,6 +261,24 @@ class CakePluginTest extends CakeTestCase {
|
|||
CakePlugin::loadAll(array(array('bootstrap' => true), 'TestPlugin' => array('routes' => true)));
|
||||
CakePlugin::routes();
|
||||
|
||||
$expected = array('PluginJs', 'TestPlugin', 'TestPluginTwo');
|
||||
$this->assertEquals($expected, CakePlugin::loaded());
|
||||
$this->assertEquals('loaded js plugin bootstrap', Configure::read('CakePluginTest.js_plugin.bootstrap'));
|
||||
$this->assertEquals('loaded plugin routes', Configure::read('CakePluginTest.test_plugin.routes'));
|
||||
$this->assertEquals('loaded plugin bootstrap', Configure::read('CakePluginTest.test_plugin.bootstrap'));
|
||||
$this->assertEquals('loaded plugin two bootstrap', Configure::read('CakePluginTest.test_plugin_two.bootstrap'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that CakePlugin::loadAll() will load all plugins in the configured folder with defaults
|
||||
* and overrides for a plugin
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testLoadAllWithDefaultsAndOverrideComplex() {
|
||||
CakePlugin::loadAll(array(array('bootstrap' => true), 'TestPlugin' => array('routes' => true, 'bootstrap' => false)));
|
||||
CakePlugin::routes();
|
||||
|
||||
$expected = array('PluginJs', 'TestPlugin', 'TestPluginTwo');
|
||||
$this->assertEquals($expected, CakePlugin::loaded());
|
||||
$this->assertEquals('loaded js plugin bootstrap', Configure::read('CakePluginTest.js_plugin.bootstrap'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue