mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Renamed the Mssql driver to Sqlserver.
This commit is contained in:
parent
846634d729
commit
39320ef352
10 changed files with 80 additions and 80 deletions
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* This is core configuration file.
|
* This is core configuration file.
|
||||||
*
|
*
|
||||||
* Use it to configure core behaviour ofCake.
|
* Use it to configure core behaviour of Cake.
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
* Database/Mysql - MySQL 4 & 5,
|
* Database/Mysql - MySQL 4 & 5,
|
||||||
* Database/Sqlite - SQLite (PHP5 only),
|
* Database/Sqlite - SQLite (PHP5 only),
|
||||||
* Database/Postgres - PostgreSQL 7 and higher,
|
* Database/Postgres - PostgreSQL 7 and higher,
|
||||||
* Database/Mssql - Microsoft SQL Server 2000 and higher,
|
* Database/Sqlserver - Microsoft SQL Server 2005 and higher,
|
||||||
* Database/Oracle - Oracle 8 and higher
|
* Database/Oracle - Oracle 8 and higher
|
||||||
*
|
*
|
||||||
* You can add custom database drivers (or override existing drivers) by adding the
|
* You can add custom database drivers (or override existing drivers) by adding the
|
||||||
|
|
|
@ -104,7 +104,7 @@ class DbConfigTask extends Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$driver = $this->in(__d('cake_console', 'Driver:'), array('Mssql', 'Mysql', 'Oracle', 'Postgres', 'Sqlite'), 'Mysql');
|
$driver = $this->in(__d('cake_console', 'Driver:'), array('Mysql', 'Oracle', 'Postgres', 'Sqlite', 'Sqlserver'), 'Mysql');
|
||||||
|
|
||||||
$persistent = $this->in(__d('cake_console', 'Persistent Connection?'), array('y', 'n'), 'n');
|
$persistent = $this->in(__d('cake_console', 'Persistent Connection?'), array('y', 'n'), 'n');
|
||||||
if (strtolower($persistent) == 'n') {
|
if (strtolower($persistent) == 'n') {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
/**
|
/**
|
||||||
* This is core configuration file.
|
* This is core configuration file.
|
||||||
*
|
*
|
||||||
* Use it to configure core behaviour ofCake.
|
* Use it to configure core behaviour of Cake.
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
* Database/Mysql - MySQL 4 & 5,
|
* Database/Mysql - MySQL 4 & 5,
|
||||||
* Database/Sqlite - SQLite (PHP5 only),
|
* Database/Sqlite - SQLite (PHP5 only),
|
||||||
* Database/Postgres - PostgreSQL 7 and higher,
|
* Database/Postgres - PostgreSQL 7 and higher,
|
||||||
* Database/Mssql - Microsoft SQL Server 2000 and higher,
|
* Database/Sqlserver - Microsoft SQL Server 2005 and higher,
|
||||||
* Database/Oracle - Oracle 8 and higher
|
* Database/Oracle - Oracle 8 and higher
|
||||||
*
|
*
|
||||||
* You can add custom database drivers (or override existing drivers) by adding the
|
* You can add custom database drivers (or override existing drivers) by adding the
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* MS SQL layer for DBO
|
* MS SQL Server layer for DBO
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -26,14 +26,14 @@ App::uses('DboSource', 'Model/Datasource');
|
||||||
*
|
*
|
||||||
* @package cake.libs.model.datasources.dbo
|
* @package cake.libs.model.datasources.dbo
|
||||||
*/
|
*/
|
||||||
class Mssql extends DboSource {
|
class Sqlserver extends DboSource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Driver description
|
* Driver description
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $description = "MS SQL DBO Driver";
|
public $description = "SQL Server DBO Driver";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starting quote character for quoted identifiers
|
* Starting quote character for quoted identifiers
|
|
@ -431,8 +431,8 @@ class TranslateBehaviorTest extends CakeTestCase {
|
||||||
$expected = array(1 => 'Titel #1', 2 => 'Titel #2', 3 => 'Titel #3');
|
$expected = array(1 => 'Titel #1', 2 => 'Titel #2', 3 => 'Titel #3');
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
// MSSQL trigger an error and stops the page even if the debug = 0
|
// SQL Server trigger an error and stops the page even if the debug = 0
|
||||||
if ($this->db instanceof Mssql) {
|
if ($this->db instanceof Sqlserver) {
|
||||||
$debug = Configure::read('debug');
|
$debug = Configure::read('debug');
|
||||||
Configure::write('debug', 0);
|
Configure::write('debug', 0);
|
||||||
|
|
||||||
|
|
|
@ -606,7 +606,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testBehaviorFindCallbacks() {
|
function testBehaviorFindCallbacks() {
|
||||||
$this->skipIf($this->db instanceof Mssql, 'This test is not compatible with Mssql.');
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||||
|
|
||||||
$Apple = new Apple();
|
$Apple = new Apple();
|
||||||
$expected = $Apple->find('all');
|
$expected = $Apple->find('all');
|
||||||
|
@ -807,7 +807,7 @@ class BehaviorCollectionTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testBehaviorBelongsToFindCallbacks() {
|
function testBehaviorBelongsToFindCallbacks() {
|
||||||
$this->skipIf($this->db instanceof Mssql, 'This test is not compatible with Mssql.');
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||||
|
|
||||||
$Apple = new Apple();
|
$Apple = new Apple();
|
||||||
$Apple->unbindModel(array('hasMany' => array('Child'), 'hasOne' => array('Sample')), false);
|
$Apple->unbindModel(array('hasMany' => array('Child'), 'hasOne' => array('Sample')), false);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* MssqlTest file
|
* SqlserverTest file
|
||||||
*
|
*
|
||||||
* PHP 5
|
* PHP 5
|
||||||
*
|
*
|
||||||
|
@ -18,14 +18,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::uses('Model', 'Model');
|
App::uses('Model', 'Model');
|
||||||
App::uses('Mssql', 'Model/Datasource/Database');
|
App::uses('Sqlserver', 'Model/Datasource/Database');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MssqlTestDb class
|
* SqlserverTestDb class
|
||||||
*
|
*
|
||||||
* @package cake.tests.cases.libs.model.datasources.dbo
|
* @package cake.tests.cases.libs.model.datasources.dbo
|
||||||
*/
|
*/
|
||||||
class MssqlTestDb extends Mssql {
|
class SqlserverTestDb extends Sqlserver {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* simulated property
|
* simulated property
|
||||||
|
@ -102,18 +102,18 @@ class MssqlTestDb extends Mssql {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MssqlTestModel class
|
* SqlserverTestModel class
|
||||||
*
|
*
|
||||||
* @package cake.tests.cases.libs.model.datasources
|
* @package cake.tests.cases.libs.model.datasources
|
||||||
*/
|
*/
|
||||||
class MssqlTestModel extends Model {
|
class SqlserverTestModel extends Model {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* name property
|
* name property
|
||||||
*
|
*
|
||||||
* @var string 'MssqlTestModel'
|
* @var string 'SqlserverTestModel'
|
||||||
*/
|
*/
|
||||||
public $name = 'MssqlTestModel';
|
public $name = 'SqlserverTestModel';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* useTable property
|
* useTable property
|
||||||
|
@ -154,7 +154,7 @@ class MssqlTestModel extends Model {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $belongsTo = array(
|
public $belongsTo = array(
|
||||||
'MssqlClientTestModel' => array(
|
'SqlserverClientTestModel' => array(
|
||||||
'foreignKey' => 'client_id'
|
'foreignKey' => 'client_id'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -186,17 +186,17 @@ class MssqlTestModel extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MssqlClientTestModel class
|
* SqlserverClientTestModel class
|
||||||
*
|
*
|
||||||
* @package cake.tests.cases.libs.model.datasources
|
* @package cake.tests.cases.libs.model.datasources
|
||||||
*/
|
*/
|
||||||
class MssqlClientTestModel extends Model {
|
class SqlserverClientTestModel extends Model {
|
||||||
/**
|
/**
|
||||||
* name property
|
* name property
|
||||||
*
|
*
|
||||||
* @var string 'MssqlAssociatedTestModel'
|
* @var string 'SqlserverAssociatedTestModel'
|
||||||
*/
|
*/
|
||||||
public $name = 'MssqlClientTestModel';
|
public $name = 'SqlserverClientTestModel';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* useTable property
|
* useTable property
|
||||||
|
@ -220,11 +220,11 @@ class MssqlClientTestModel extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MssqlTestResultIterator class
|
* SqlserverTestResultIterator class
|
||||||
*
|
*
|
||||||
* @package cake.tests.cases.libs.model.datasources
|
* @package cake.tests.cases.libs.model.datasources
|
||||||
*/
|
*/
|
||||||
class MssqlTestResultIterator extends ArrayIterator {
|
class SqlserverTestResultIterator extends ArrayIterator {
|
||||||
/**
|
/**
|
||||||
* closeCursor method
|
* closeCursor method
|
||||||
*
|
*
|
||||||
|
@ -234,11 +234,11 @@ class MssqlTestResultIterator extends ArrayIterator {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MssqlTest class
|
* SqlserverTest class
|
||||||
*
|
*
|
||||||
* @package cake.tests.cases.libs.model.datasources.dbo
|
* @package cake.tests.cases.libs.model.datasources.dbo
|
||||||
*/
|
*/
|
||||||
class MssqlTest extends CakeTestCase {
|
class SqlserverTest extends CakeTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Dbo instance to be tested
|
* The Dbo instance to be tested
|
||||||
|
@ -267,11 +267,11 @@ class MssqlTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
$this->Dbo = ConnectionManager::getDataSource('test');
|
$this->Dbo = ConnectionManager::getDataSource('test');
|
||||||
if (!($this->Dbo instanceof Mssql)) {
|
if (!($this->Dbo instanceof Sqlserver)) {
|
||||||
$this->markTestSkipped('Please configure the test datasource to use SQL Server.');
|
$this->markTestSkipped('Please configure the test datasource to use SQL Server.');
|
||||||
}
|
}
|
||||||
$this->db = new MssqlTestDb($this->Dbo->config);
|
$this->db = new SqlserverTestDb($this->Dbo->config);
|
||||||
$this->model = new MssqlTestModel();
|
$this->model = new SqlserverTestModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -318,24 +318,24 @@ class MssqlTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testFields() {
|
public function testFields() {
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'[MssqlTestModel].[id] AS [MssqlTestModel__0]',
|
'[SqlserverTestModel].[id] AS [SqlserverTestModel__0]',
|
||||||
'[MssqlTestModel].[client_id] AS [MssqlTestModel__1]',
|
'[SqlserverTestModel].[client_id] AS [SqlserverTestModel__1]',
|
||||||
'[MssqlTestModel].[name] AS [MssqlTestModel__2]',
|
'[SqlserverTestModel].[name] AS [SqlserverTestModel__2]',
|
||||||
'[MssqlTestModel].[login] AS [MssqlTestModel__3]',
|
'[SqlserverTestModel].[login] AS [SqlserverTestModel__3]',
|
||||||
'[MssqlTestModel].[passwd] AS [MssqlTestModel__4]',
|
'[SqlserverTestModel].[passwd] AS [SqlserverTestModel__4]',
|
||||||
'[MssqlTestModel].[addr_1] AS [MssqlTestModel__5]',
|
'[SqlserverTestModel].[addr_1] AS [SqlserverTestModel__5]',
|
||||||
'[MssqlTestModel].[addr_2] AS [MssqlTestModel__6]',
|
'[SqlserverTestModel].[addr_2] AS [SqlserverTestModel__6]',
|
||||||
'[MssqlTestModel].[zip_code] AS [MssqlTestModel__7]',
|
'[SqlserverTestModel].[zip_code] AS [SqlserverTestModel__7]',
|
||||||
'[MssqlTestModel].[city] AS [MssqlTestModel__8]',
|
'[SqlserverTestModel].[city] AS [SqlserverTestModel__8]',
|
||||||
'[MssqlTestModel].[country] AS [MssqlTestModel__9]',
|
'[SqlserverTestModel].[country] AS [SqlserverTestModel__9]',
|
||||||
'[MssqlTestModel].[phone] AS [MssqlTestModel__10]',
|
'[SqlserverTestModel].[phone] AS [SqlserverTestModel__10]',
|
||||||
'[MssqlTestModel].[fax] AS [MssqlTestModel__11]',
|
'[SqlserverTestModel].[fax] AS [SqlserverTestModel__11]',
|
||||||
'[MssqlTestModel].[url] AS [MssqlTestModel__12]',
|
'[SqlserverTestModel].[url] AS [SqlserverTestModel__12]',
|
||||||
'[MssqlTestModel].[email] AS [MssqlTestModel__13]',
|
'[SqlserverTestModel].[email] AS [SqlserverTestModel__13]',
|
||||||
'[MssqlTestModel].[comments] AS [MssqlTestModel__14]',
|
'[SqlserverTestModel].[comments] AS [SqlserverTestModel__14]',
|
||||||
'CONVERT(VARCHAR(20), [MssqlTestModel].[last_login], 20) AS [MssqlTestModel__15]',
|
'CONVERT(VARCHAR(20), [SqlserverTestModel].[last_login], 20) AS [SqlserverTestModel__15]',
|
||||||
'[MssqlTestModel].[created] AS [MssqlTestModel__16]',
|
'[SqlserverTestModel].[created] AS [SqlserverTestModel__16]',
|
||||||
'CONVERT(VARCHAR(20), [MssqlTestModel].[updated], 20) AS [MssqlTestModel__17]'
|
'CONVERT(VARCHAR(20), [SqlserverTestModel].[updated], 20) AS [SqlserverTestModel__17]'
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $this->db->fields($this->model);
|
$result = $this->db->fields($this->model);
|
||||||
|
@ -343,7 +343,7 @@ class MssqlTest extends CakeTestCase {
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$this->db->clearFieldMappings();
|
$this->db->clearFieldMappings();
|
||||||
$result = $this->db->fields($this->model, null, 'MssqlTestModel.*');
|
$result = $this->db->fields($this->model, null, 'SqlserverTestModel.*');
|
||||||
$expected = $fields;
|
$expected = $fields;
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
|
@ -355,13 +355,13 @@ class MssqlTest extends CakeTestCase {
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$this->db->clearFieldMappings();
|
$this->db->clearFieldMappings();
|
||||||
$result = $this->db->fields($this->model, null, array('*', 'MssqlClientTestModel.*'));
|
$result = $this->db->fields($this->model, null, array('*', 'SqlserverClientTestModel.*'));
|
||||||
$expected = array_merge($fields, array(
|
$expected = array_merge($fields, array(
|
||||||
'[MssqlClientTestModel].[id] AS [MssqlClientTestModel__18]',
|
'[SqlserverClientTestModel].[id] AS [SqlserverClientTestModel__18]',
|
||||||
'[MssqlClientTestModel].[name] AS [MssqlClientTestModel__19]',
|
'[SqlserverClientTestModel].[name] AS [SqlserverClientTestModel__19]',
|
||||||
'[MssqlClientTestModel].[email] AS [MssqlClientTestModel__20]',
|
'[SqlserverClientTestModel].[email] AS [SqlserverClientTestModel__20]',
|
||||||
'CONVERT(VARCHAR(20), [MssqlClientTestModel].[created], 20) AS [MssqlClientTestModel__21]',
|
'CONVERT(VARCHAR(20), [SqlserverClientTestModel].[created], 20) AS [SqlserverClientTestModel__21]',
|
||||||
'CONVERT(VARCHAR(20), [MssqlClientTestModel].[updated], 20) AS [MssqlClientTestModel__22]'));
|
'CONVERT(VARCHAR(20), [SqlserverClientTestModel].[updated], 20) AS [SqlserverClientTestModel__22]'));
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ class MssqlTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testDistinctWithLimit() {
|
public function testDistinctWithLimit() {
|
||||||
$this->db->read($this->model, array(
|
$this->db->read($this->model, array(
|
||||||
'fields' => array('DISTINCT MssqlTestModel.city', 'MssqlTestModel.country'),
|
'fields' => array('DISTINCT SqlserverTestModel.city', 'SqlserverTestModel.country'),
|
||||||
'limit' => 5
|
'limit' => 5
|
||||||
));
|
));
|
||||||
$result = $this->db->getLastQuery();
|
$result = $this->db->getLastQuery();
|
||||||
|
@ -400,7 +400,7 @@ class MssqlTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDescribe() {
|
public function testDescribe() {
|
||||||
$MssqlTableDescription = new MssqlTestResultIterator(array(
|
$SqlserverTableDescription = new SqlserverTestResultIterator(array(
|
||||||
(object) array(
|
(object) array(
|
||||||
'Default' => '((0))',
|
'Default' => '((0))',
|
||||||
'Field' => 'count',
|
'Field' => 'count',
|
||||||
|
@ -410,7 +410,7 @@ class MssqlTest extends CakeTestCase {
|
||||||
'Type' => 'integer'
|
'Type' => 'integer'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this->db->executeResultsStack = array($MssqlTableDescription);
|
$this->db->executeResultsStack = array($SqlserverTableDescription);
|
||||||
$dummyModel = $this->model;
|
$dummyModel = $this->model;
|
||||||
$result = $this->db->describe($dummyModel);
|
$result = $this->db->describe($dummyModel);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -512,13 +512,13 @@ class MssqlTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testUpdateAllSyntax() {
|
public function testUpdateAllSyntax() {
|
||||||
$fields = array('MssqlTestModel.client_id' => '[MssqlTestModel].[client_id] + 1');
|
$fields = array('SqlserverTestModel.client_id' => '[SqlserverTestModel].[client_id] + 1');
|
||||||
$conditions = array('MssqlTestModel.updated <' => date('2009-01-01 00:00:00'));
|
$conditions = array('SqlserverTestModel.updated <' => date('2009-01-01 00:00:00'));
|
||||||
$this->db->update($this->model, $fields, null, $conditions);
|
$this->db->update($this->model, $fields, null, $conditions);
|
||||||
|
|
||||||
$result = $this->db->getLastQuery();
|
$result = $this->db->getLastQuery();
|
||||||
$this->assertNoPattern('/MssqlTestModel/', $result);
|
$this->assertNoPattern('/SqlserverTestModel/', $result);
|
||||||
$this->assertPattern('/^UPDATE \[mssql_test_models\]/', $result);
|
$this->assertPattern('/^UPDATE \[sqlserver_test_models\]/', $result);
|
||||||
$this->assertPattern('/SET \[client_id\] = \[client_id\] \+ 1/', $result);
|
$this->assertPattern('/SET \[client_id\] = \[client_id\] \+ 1/', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,10 +556,10 @@ class MssqlTest extends CakeTestCase {
|
||||||
$this->db->insertMulti($this->model, $fields, $values);
|
$this->db->insertMulti($this->model, $fields, $values);
|
||||||
$result = $this->db->simulated;
|
$result = $this->db->simulated;
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'SET IDENTITY_INSERT [mssql_test_models] ON',
|
'SET IDENTITY_INSERT [sqlserver_test_models] ON',
|
||||||
"INSERT INTO [mssql_test_models] ([id], [name], [login]) VALUES (1, 'Larry', 'PhpNut')",
|
"INSERT INTO [sqlserver_test_models] ([id], [name], [login]) VALUES (1, 'Larry', 'PhpNut')",
|
||||||
"INSERT INTO [mssql_test_models] ([id], [name], [login]) VALUES (2, 'Renan', 'renan.saddam')",
|
"INSERT INTO [sqlserver_test_models] ([id], [name], [login]) VALUES (2, 'Renan', 'renan.saddam')",
|
||||||
'SET IDENTITY_INSERT [mssql_test_models] OFF'
|
'SET IDENTITY_INSERT [sqlserver_test_models] OFF'
|
||||||
);
|
);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
|
@ -571,8 +571,8 @@ class MssqlTest extends CakeTestCase {
|
||||||
$this->db->insertMulti($this->model, $fields, $values);
|
$this->db->insertMulti($this->model, $fields, $values);
|
||||||
$result = $this->db->simulated;
|
$result = $this->db->simulated;
|
||||||
$expected = array(
|
$expected = array(
|
||||||
"INSERT INTO [mssql_test_models] ([name], [login]) VALUES ('Larry', 'PhpNut')",
|
"INSERT INTO [sqlserver_test_models] ([name], [login]) VALUES ('Larry', 'PhpNut')",
|
||||||
"INSERT INTO [mssql_test_models] ([name], [login]) VALUES ('Renan', 'renan.saddam')",
|
"INSERT INTO [sqlserver_test_models] ([name], [login]) VALUES ('Renan', 'renan.saddam')",
|
||||||
);
|
);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
|
@ -634,7 +634,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testDeconstructFieldsTime() {
|
function testDeconstructFieldsTime() {
|
||||||
$this->skipIf($this->db instanceof Mssql, 'This test is not compatible with Mssql.');
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||||
|
|
||||||
$this->loadFixtures('Apple');
|
$this->loadFixtures('Apple');
|
||||||
$TestModel = new Apple();
|
$TestModel = new Apple();
|
||||||
|
@ -723,7 +723,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testDeconstructFieldsDateTime() {
|
function testDeconstructFieldsDateTime() {
|
||||||
$this->skipIf($this->db instanceof Mssql, 'This test is not compatible with Mssql.');
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||||
|
|
||||||
$this->loadFixtures('Apple');
|
$this->loadFixtures('Apple');
|
||||||
$TestModel = new Apple();
|
$TestModel = new Apple();
|
||||||
|
|
|
@ -79,7 +79,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
*/
|
*/
|
||||||
function testGroupBy() {
|
function testGroupBy() {
|
||||||
$db = ConnectionManager::getDataSource('test');
|
$db = ConnectionManager::getDataSource('test');
|
||||||
$isStrictGroupBy = $this->db instanceof Postgres || $this->db instanceof Sqlite || $this->db instanceof Oracle || $this->db instanceof Mssql;
|
$isStrictGroupBy = $this->db instanceof Postgres || $this->db instanceof Sqlite || $this->db instanceof Oracle || $this->db instanceof Sqlserver;
|
||||||
$message = 'Postgres, Oracle, SQLite and SQL Server have strict GROUP BY and are incompatible with this test.';
|
$message = 'Postgres, Oracle, SQLite and SQL Server have strict GROUP BY and are incompatible with this test.';
|
||||||
|
|
||||||
if ($this->skipIf($isStrictGroupBy, $message )) {
|
if ($this->skipIf($isStrictGroupBy, $message )) {
|
||||||
|
@ -390,7 +390,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testRecursiveUnbind() {
|
function testRecursiveUnbind() {
|
||||||
if ($this->skipIf($this->db instanceof Mssql, 'The test of testRecursiveUnbind test is not compatible with Mssql, because it check for time columns.')) {
|
if ($this->skipIf($this->db instanceof Sqlserver, 'The test of testRecursiveUnbind test is not compatible with SQL Server, because it check for time columns.')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3648,7 +3648,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testFindCombinedRelations() {
|
function testFindCombinedRelations() {
|
||||||
if ($this->skipIf($this->db instanceof Mssql, 'The test of testRecursiveUnbind test is not compatible with Mssql, because it check for time columns.')) {
|
if ($this->skipIf($this->db instanceof Sqlserver, 'The test of testRecursiveUnbind test is not compatible with SQL Server, because it check for time columns.')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6228,7 +6228,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
// These tests are expected to fail on SQL Server since the LIMIT/OFFSET
|
// These tests are expected to fail on SQL Server since the LIMIT/OFFSET
|
||||||
// hack can't handle small record counts.
|
// hack can't handle small record counts.
|
||||||
if (!($this->db instanceof Mssql)) {
|
if (!($this->db instanceof Sqlserver)) {
|
||||||
$result = $TestModel->find('all', array('limit' => 3, 'page' => 2));
|
$result = $TestModel->find('all', array('limit' => 3, 'page' => 2));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
|
@ -6623,7 +6623,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
*/
|
*/
|
||||||
function testFindCountDistinct() {
|
function testFindCountDistinct() {
|
||||||
$this->skipIf($this->db instanceof Sqlite, 'SELECT COUNT(DISTINCT field) is not compatible with SQLite');
|
$this->skipIf($this->db instanceof Sqlite, 'SELECT COUNT(DISTINCT field) is not compatible with SQLite');
|
||||||
$this->skipIf($this->db instanceof Mssql, 'This test is not compatible with Mssql.');
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
||||||
|
|
||||||
$this->loadFixtures('Project');
|
$this->loadFixtures('Project');
|
||||||
$TestModel = new Project();
|
$TestModel = new Project();
|
||||||
|
@ -7396,7 +7396,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertEqual($result['Post']['two'], 2);
|
$this->assertEqual($result['Post']['two'], 2);
|
||||||
|
|
||||||
// SQL Server does not support operators in expressions
|
// SQL Server does not support operators in expressions
|
||||||
if (!($this->db instanceof Mssql)) {
|
if (!($this->db instanceof Sqlserver)) {
|
||||||
$Post->Author->virtualFields = array('false' => '1 = 2');
|
$Post->Author->virtualFields = array('false' => '1 = 2');
|
||||||
$result = $Post->find('first');
|
$result = $Post->find('first');
|
||||||
$this->assertEqual($result['Post']['two'], 2);
|
$this->assertEqual($result['Post']['two'], 2);
|
||||||
|
|
|
@ -172,7 +172,7 @@ class CakeRequestTestCase extends CakeTestCase {
|
||||||
function testFILESParsing() {
|
function testFILESParsing() {
|
||||||
$_FILES = array('data' => array('name' => array(
|
$_FILES = array('data' => array('name' => array(
|
||||||
'File' => array(
|
'File' => array(
|
||||||
array('data' => 'cake_mssql_patch.patch'),
|
array('data' => 'cake_sqlserver_patch.patch'),
|
||||||
array('data' => 'controller.diff'),
|
array('data' => 'controller.diff'),
|
||||||
array('data' => ''),
|
array('data' => ''),
|
||||||
array('data' => ''),
|
array('data' => ''),
|
||||||
|
@ -221,7 +221,7 @@ class CakeRequestTestCase extends CakeTestCase {
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'File' => array(
|
'File' => array(
|
||||||
array('data' => array(
|
array('data' => array(
|
||||||
'name' => 'cake_mssql_patch.patch',
|
'name' => 'cake_sqlserver_patch.patch',
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'tmp_name' => '/private/var/tmp/phpy05Ywj',
|
'tmp_name' => '/private/var/tmp/phpy05Ywj',
|
||||||
'error' => 0,
|
'error' => 0,
|
||||||
|
|
Loading…
Add table
Reference in a new issue