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
1f728488
Commit
1f728488
authored
Dec 28, 2013
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix index flags
parent
2196da9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Index.php
lib/Doctrine/DBAL/Schema/Index.php
+3
-3
IndexTest.php
tests/Doctrine/Tests/DBAL/Schema/IndexTest.php
+3
-0
No files found.
lib/Doctrine/DBAL/Schema/Index.php
View file @
1f728488
...
@@ -259,7 +259,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -259,7 +259,7 @@ class Index extends AbstractAsset implements Constraint
*/
*/
public
function
addFlag
(
$flag
)
public
function
addFlag
(
$flag
)
{
{
$this
->
flags
[
strtolower
(
$flag
)]
=
true
;
$this
->
_
flags
[
strtolower
(
$flag
)]
=
true
;
return
$this
;
return
$this
;
}
}
...
@@ -273,7 +273,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -273,7 +273,7 @@ class Index extends AbstractAsset implements Constraint
*/
*/
public
function
hasFlag
(
$flag
)
public
function
hasFlag
(
$flag
)
{
{
return
isset
(
$this
->
flags
[
strtolower
(
$flag
)]);
return
isset
(
$this
->
_
flags
[
strtolower
(
$flag
)]);
}
}
/**
/**
...
@@ -285,6 +285,6 @@ class Index extends AbstractAsset implements Constraint
...
@@ -285,6 +285,6 @@ class Index extends AbstractAsset implements Constraint
*/
*/
public
function
removeFlag
(
$flag
)
public
function
removeFlag
(
$flag
)
{
{
unset
(
$this
->
flags
[
strtolower
(
$flag
)]);
unset
(
$this
->
_
flags
[
strtolower
(
$flag
)]);
}
}
}
}
tests/Doctrine/Tests/DBAL/Schema/IndexTest.php
View file @
1f728488
...
@@ -89,13 +89,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase
...
@@ -89,13 +89,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase
{
{
$idx1
=
$this
->
createIndex
();
$idx1
=
$this
->
createIndex
();
$this
->
assertFalse
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertFalse
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertEmpty
(
$idx1
->
getFlags
());
$idx1
->
addFlag
(
'clustered'
);
$idx1
->
addFlag
(
'clustered'
);
$this
->
assertTrue
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertTrue
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertTrue
(
$idx1
->
hasFlag
(
'CLUSTERED'
));
$this
->
assertTrue
(
$idx1
->
hasFlag
(
'CLUSTERED'
));
$this
->
assertSame
(
array
(
'clustered'
),
$idx1
->
getFlags
());
$idx1
->
removeFlag
(
'clustered'
);
$idx1
->
removeFlag
(
'clustered'
);
$this
->
assertFalse
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertFalse
(
$idx1
->
hasFlag
(
'clustered'
));
$this
->
assertEmpty
(
$idx1
->
getFlags
());
}
}
/**
/**
...
...
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