Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
15a601a7
Commit
15a601a7
authored
Aug 11, 2014
by
Adrien Crivelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover Index options with unit tests
parent
f650cfb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+1
-0
IndexTest.php
tests/Doctrine/Tests/DBAL/Schema/IndexTest.php
+16
-2
No files found.
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
15a601a7
...
@@ -845,6 +845,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
...
@@ -845,6 +845,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
'ALTER TABLE mytable RENAME quoted3 TO "baz"'
,
'ALTER TABLE mytable RENAME quoted3 TO "baz"'
,
);
);
}
}
public
function
testGeneratesPartialIndexesSqlOnlyWhenSupportingPartialIndexes
()
public
function
testGeneratesPartialIndexesSqlOnlyWhenSupportingPartialIndexes
()
{
{
$this
->
markTestSkipped
(
'Index declaration in statements like CREATE TABLE is not supported.'
);
$this
->
markTestSkipped
(
'Index declaration in statements like CREATE TABLE is not supported.'
);
...
...
tests/Doctrine/Tests/DBAL/Schema/IndexTest.php
View file @
15a601a7
...
@@ -8,9 +8,9 @@ use Doctrine\DBAL\Schema\Index;
...
@@ -8,9 +8,9 @@ use Doctrine\DBAL\Schema\Index;
class
IndexTest
extends
\PHPUnit_Framework_TestCase
class
IndexTest
extends
\PHPUnit_Framework_TestCase
{
{
public
function
createIndex
(
$unique
=
false
,
$primary
=
false
)
public
function
createIndex
(
$unique
=
false
,
$primary
=
false
,
$options
=
array
()
)
{
{
return
new
Index
(
"foo"
,
array
(
"bar"
,
"baz"
),
$unique
,
$primary
);
return
new
Index
(
"foo"
,
array
(
"bar"
,
"baz"
),
$unique
,
$primary
,
array
(),
$options
);
}
}
public
function
testCreateIndex
()
public
function
testCreateIndex
()
...
@@ -142,4 +142,18 @@ class IndexTest extends \PHPUnit_Framework_TestCase
...
@@ -142,4 +142,18 @@ class IndexTest extends \PHPUnit_Framework_TestCase
$this
->
assertFalse
(
$index
->
hasColumnAtPosition
(
"bar"
,
1
));
$this
->
assertFalse
(
$index
->
hasColumnAtPosition
(
"bar"
,
1
));
$this
->
assertFalse
(
$index
->
hasColumnAtPosition
(
"baz"
,
0
));
$this
->
assertFalse
(
$index
->
hasColumnAtPosition
(
"baz"
,
0
));
}
}
public
function
testOptions
()
{
$idx1
=
$this
->
createIndex
();
$this
->
assertFalse
(
$idx1
->
hasOption
(
'where'
));
$this
->
assertEmpty
(
$idx1
->
getOptions
());
$idx2
=
$this
->
createIndex
(
false
,
false
,
array
(
'where'
=>
'name IS NULL'
));
$this
->
assertTrue
(
$idx2
->
hasOption
(
'where'
));
$this
->
assertTrue
(
$idx2
->
hasOption
(
'WHERE'
));
$this
->
assertSame
(
'name IS NULL'
,
$idx2
->
getOption
(
'where'
));
$this
->
assertSame
(
'name IS NULL'
,
$idx2
->
getOption
(
'WHERE'
));
$this
->
assertSame
(
array
(
'where'
=>
'name IS NULL'
),
$idx2
->
getOptions
());
}
}
}
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