Upgrade CakePHP from 2.2.5 to 2.9.5

This commit is contained in:
Brm Ko 2017-02-26 15:29:44 +01:00
parent 5a580df460
commit 235a541597
793 changed files with 60746 additions and 23753 deletions

View file

@ -2,19 +2,18 @@
/**
* SqlserverTest 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.Model.Datasource.Database
* @since CakePHP(tm) v 1.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('Model', 'Model');
@ -98,7 +97,7 @@ class SqlserverTestDb extends Sqlserver {
/**
* describe method
*
* @param object $model
* @param Model $model
* @return void
*/
public function describe($model) {
@ -114,17 +113,10 @@ class SqlserverTestDb extends Sqlserver {
*/
class SqlserverTestModel extends CakeTestModel {
/**
* name property
*
* @var string 'SqlserverTestModel'
*/
public $name = 'SqlserverTestModel';
/**
* useTable property
*
* @var bool false
* @var bool
*/
public $useTable = false;
@ -187,17 +179,10 @@ class SqlserverTestModel extends CakeTestModel {
*/
class SqlserverClientTestModel extends CakeTestModel {
/**
* name property
*
* @var string 'SqlserverAssociatedTestModel'
*/
public $name = 'SqlserverClientTestModel';
/**
* useTable property
*
* @var bool false
* @var bool
*/
public $useTable = false;
@ -263,7 +248,7 @@ class SqlserverTest extends CakeTestCase {
/**
* autoFixtures property
*
* @var bool false
* @var bool
*/
public $autoFixtures = false;
@ -277,8 +262,10 @@ class SqlserverTest extends CakeTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
*/
public function setUp() {
parent::setUp();
$this->Dbo = ConnectionManager::getDataSource('test');
if (!($this->Dbo instanceof Sqlserver)) {
$this->markTestSkipped('Please configure the test datasource to use SQL Server.');
@ -293,6 +280,7 @@ class SqlserverTest extends CakeTestCase {
* @return void
*/
public function tearDown() {
parent::tearDown();
unset($this->Dbo);
unset($this->model);
}
@ -322,6 +310,10 @@ class SqlserverTest extends CakeTestCase {
$expected = "''";
$result = $this->db->value('', 'binary');
$this->assertSame($expected, $result);
$expected = 'NULL';
$result = $this->db->value(null, 'string');
$this->assertSame($expected, $result);
}
/**
@ -447,7 +439,25 @@ class SqlserverTest extends CakeTestCase {
'Length' => 72,
'Null' => 'NO',
'Size' => ''
)
),
(object)array(
'Default' => null,
'Field' => 'parent_id',
'Key' => '0',
'Type' => 'bigint',
'Length' => 8,
'Null' => 'YES',
'Size' => '0',
),
(object)array(
'Default' => null,
'Field' => 'description',
'Key' => '0',
'Type' => 'text',
'Length' => 16,
'Null' => 'YES',
'Size' => '0',
),
));
$this->db->executeResultsStack = array($SqlserverTableDescription);
$dummyModel = $this->model;
@ -477,9 +487,22 @@ class SqlserverTest extends CakeTestCase {
'default' => '',
'length' => 36,
'key' => 'primary'
),
'parent_id' => array(
'type' => 'biginteger',
'null' => true,
'default' => null,
'length' => 8,
),
'description' => array(
'type' => 'text',
'null' => true,
'default' => null,
'length' => null,
)
);
$this->assertEquals($expected, $result);
$this->assertSame($expected['parent_id'], $result['parent_id']);
}
/**
@ -553,6 +576,14 @@ class SqlserverTest extends CakeTestCase {
$result = $this->db->buildColumn($column);
$expected = "[checked] bit DEFAULT '1'";
$this->assertEquals($expected, $result);
$column = array(
'name' => 'huge',
'type' => 'biginteger',
);
$result = $this->db->buildColumn($column);
$expected = "[huge] bigint";
$this->assertEquals($expected, $result);
}
/**