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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
d3740932
Commit
d3740932
authored
Sep 14, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed broken cubrid tests
fixed expected quoting
parent
30907b61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
CubridCommandTest.php
tests/unit/framework/db/cubrid/CubridCommandTest.php
+9
-0
CubridConnectionTest.php
tests/unit/framework/db/cubrid/CubridConnectionTest.php
+23
-0
No files found.
tests/unit/framework/db/cubrid/CubridCommandTest.php
View file @
d3740932
...
@@ -69,4 +69,13 @@ class CubridCommandTest extends CommandTest
...
@@ -69,4 +69,13 @@ class CubridCommandTest extends CommandTest
$command
->
bindValue
(
':name'
,
'user5'
);
$command
->
bindValue
(
':name'
,
'user5'
);
$this
->
assertEquals
(
'user5@example.com'
,
$command
->
queryScalar
());
$this
->
assertEquals
(
'user5@example.com'
,
$command
->
queryScalar
());
}
}
public
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
);
}
}
}
tests/unit/framework/db/cubrid/CubridConnectionTest.php
View file @
d3740932
...
@@ -14,4 +14,27 @@ class CubridConnectionTest extends ConnectionTest
...
@@ -14,4 +14,27 @@ class CubridConnectionTest extends ConnectionTest
$this
->
assertEquals
(
"'string'"
,
$connection
->
quoteValue
(
'string'
));
$this
->
assertEquals
(
"'string'"
,
$connection
->
quoteValue
(
'string'
));
$this
->
assertEquals
(
"'It''s interesting'"
,
$connection
->
quoteValue
(
"It's interesting"
));
$this
->
assertEquals
(
"'It''s interesting'"
,
$connection
->
quoteValue
(
"It's interesting"
));
}
}
public
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)'
));
}
public
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)'
));
}
}
}
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