Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
5c101ae3
Commit
5c101ae3
authored
May 11, 2013
by
resurtm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial MSSQL tests.
parent
58f3c323
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
0 deletions
+104
-0
config.php
tests/unit/data/config.php
+6
-0
mssql.sql
tests/unit/data/mssql.sql
+0
-0
MssqlActiveRecordTest.php
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php
+12
-0
MssqlCommandTest.php
tests/unit/framework/db/mssql/MssqlCommandTest.php
+31
-0
MssqlConnectionTest.php
tests/unit/framework/db/mssql/MssqlConnectionTest.php
+43
-0
MssqlQueryTest.php
tests/unit/framework/db/mssql/MssqlQueryTest.php
+12
-0
No files found.
tests/unit/data/config.php
View file @
5c101ae3
...
@@ -12,5 +12,11 @@ return array(
...
@@ -12,5 +12,11 @@ return array(
'dsn'
=>
'sqlite::memory:'
,
'dsn'
=>
'sqlite::memory:'
,
'fixture'
=>
__DIR__
.
'/sqlite.sql'
,
'fixture'
=>
__DIR__
.
'/sqlite.sql'
,
),
),
'sqlsrv'
=>
array
(
'dsn'
=>
'sqlsrv:Server=localhost;Database=test'
,
'username'
=>
''
,
'password'
=>
''
,
'fixture'
=>
__DIR__
.
'/mssql.sql'
,
),
)
)
);
);
tests/unit/data/mssql.sql
View file @
5c101ae3
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php
0 → 100644
View file @
5c101ae3
<?php
namespace
yiiunit\framework\db\mssql
;
class
MssqlActiveRecordTest
extends
\yiiunit\framework\db\ActiveRecordTest
{
public
function
setUp
()
{
$this
->
driverName
=
'sqlsrv'
;
parent
::
setUp
();
}
}
tests/unit/framework/db/mssql/MssqlCommandTest.php
0 → 100644
View file @
5c101ae3
<?php
namespace
yiiunit\framework\db\mssql
;
class
MssqlCommandTest
extends
\yiiunit\framework\db\CommandTest
{
public
function
setUp
()
{
$this
->
driverName
=
'sqlsrv'
;
parent
::
setUp
();
}
function
testAutoQuoting
()
{
$db
=
$this
->
getConnection
(
false
);
$sql
=
'SELECT [[id]], [[t.name]] FROM {{tbl_customer}} t'
;
$command
=
$db
->
createCommand
(
$sql
);
$this
->
assertEquals
(
"SELECT [id], [t].[name] FROM [tbl_customer] t"
,
$command
->
sql
);
}
function
testPrepareCancel
()
{
$this
->
markTestIncomplete
();
}
function
testBindParamValue
()
{
$this
->
markTestIncomplete
();
}
}
tests/unit/framework/db/mssql/MssqlConnectionTest.php
0 → 100644
View file @
5c101ae3
<?php
namespace
yiiunit\framework\db\mssql
;
class
MssqlConnectionTest
extends
\yiiunit\framework\db\ConnectionTest
{
public
function
setUp
()
{
$this
->
driverName
=
'sqlsrv'
;
parent
::
setUp
();
}
function
testQuoteValue
()
{
$connection
=
$this
->
getConnection
(
false
);
$this
->
assertEquals
(
123
,
$connection
->
quoteValue
(
123
));
$this
->
assertEquals
(
"'string'"
,
$connection
->
quoteValue
(
'string'
));
$this
->
assertEquals
(
"'It''s interesting'"
,
$connection
->
quoteValue
(
"It's interesting"
));
}
function
testQuoteTableName
()
{
$connection
=
$this
->
getConnection
(
false
);
$this
->
assertEquals
(
'[table]'
,
$connection
->
quoteTableName
(
'table'
));
$this
->
assertEquals
(
'[table]'
,
$connection
->
quoteTableName
(
'[table]'
));
$this
->
assertEquals
(
'[schema].[table]'
,
$connection
->
quoteTableName
(
'schema.table'
));
$this
->
assertEquals
(
'[schema].[table]'
,
$connection
->
quoteTableName
(
'schema.[table]'
));
$this
->
assertEquals
(
'{{table}}'
,
$connection
->
quoteTableName
(
'{{table}}'
));
$this
->
assertEquals
(
'(table)'
,
$connection
->
quoteTableName
(
'(table)'
));
}
function
testQuoteColumnName
()
{
$connection
=
$this
->
getConnection
(
false
);
$this
->
assertEquals
(
'[column]'
,
$connection
->
quoteColumnName
(
'column'
));
$this
->
assertEquals
(
'[column]'
,
$connection
->
quoteColumnName
(
'[column]'
));
$this
->
assertEquals
(
'[table].[column]'
,
$connection
->
quoteColumnName
(
'table.column'
));
$this
->
assertEquals
(
'[table].[column]'
,
$connection
->
quoteColumnName
(
'table.[column]'
));
$this
->
assertEquals
(
'[[column]]'
,
$connection
->
quoteColumnName
(
'[[column]]'
));
$this
->
assertEquals
(
'{{column}}'
,
$connection
->
quoteColumnName
(
'{{column}}'
));
$this
->
assertEquals
(
'(column)'
,
$connection
->
quoteColumnName
(
'(column)'
));
}
}
tests/unit/framework/db/mssql/MssqlQueryTest.php
0 → 100644
View file @
5c101ae3
<?php
namespace
yiiunit\framework\db\mssql
;
class
MssqlQueryTest
extends
\yiiunit\framework\db\QueryTest
{
public
function
setUp
()
{
$this
->
driverName
=
'sqlsrv'
;
parent
::
setUp
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment