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,24 +2,34 @@
|
|||
/**
|
||||
* TaskCollectionTest 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://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
|
||||
* @package Cake.Test.Case.Console
|
||||
* @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('TaskCollection', 'Console');
|
||||
App::uses('Shell', 'Console');
|
||||
|
||||
/**
|
||||
* Extended Task
|
||||
*/
|
||||
class DbConfigAliasedTask extends Shell {
|
||||
}
|
||||
|
||||
/**
|
||||
* TaskCollectionTest
|
||||
*
|
||||
* @package Cake.Test.Case.Console
|
||||
*/
|
||||
class TaskCollectionTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
|
@ -54,8 +64,8 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
$this->assertInstanceOf('DbConfigTask', $result);
|
||||
$this->assertInstanceOf('DbConfigTask', $this->Tasks->DbConfig);
|
||||
|
||||
$result = $this->Tasks->attached();
|
||||
$this->assertEquals(array('DbConfig'), $result, 'attached() results are wrong.');
|
||||
$result = $this->Tasks->loaded();
|
||||
$this->assertEquals(array('DbConfig'), $result, 'loaded() results are wrong.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +88,7 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testLoadMissingTask() {
|
||||
$result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
|
||||
$this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,15 +120,36 @@ class TaskCollectionTest extends CakeTestCase {
|
|||
$this->Tasks->load('Extract');
|
||||
$this->Tasks->load('DbConfig');
|
||||
|
||||
$result = $this->Tasks->attached();
|
||||
$result = $this->Tasks->loaded();
|
||||
$this->assertEquals(array('Extract', 'DbConfig'), $result, 'loaded tasks is wrong');
|
||||
|
||||
$this->Tasks->unload('DbConfig');
|
||||
$this->assertFalse(isset($this->Tasks->DbConfig));
|
||||
$this->assertTrue(isset($this->Tasks->Extract));
|
||||
|
||||
$result = $this->Tasks->attached();
|
||||
$result = $this->Tasks->loaded();
|
||||
$this->assertEquals(array('Extract'), $result, 'loaded tasks is wrong');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests loading as an alias
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testLoadWithAlias() {
|
||||
$result = $this->Tasks->load('DbConfig', array('className' => 'DbConfigAliased'));
|
||||
$this->assertInstanceOf('DbConfigAliasedTask', $result);
|
||||
$this->assertInstanceOf('DbConfigAliasedTask', $this->Tasks->DbConfig);
|
||||
|
||||
$result = $this->Tasks->loaded();
|
||||
$this->assertEquals(array('DbConfig'), $result, 'loaded() results are wrong.');
|
||||
|
||||
$result = $this->Tasks->load('SomeTask', array('className' => 'TestPlugin.OtherTask'));
|
||||
$this->assertInstanceOf('OtherTaskTask', $result);
|
||||
$this->assertInstanceOf('OtherTaskTask', $this->Tasks->SomeTask);
|
||||
|
||||
$result = $this->Tasks->loaded();
|
||||
$this->assertEquals(array('DbConfig', 'SomeTask'), $result, 'loaded() results are wrong.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue