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
eca1c525
Unverified
Commit
eca1c525
authored
Apr 30, 2018
by
Michael Moravec
Committed by
Sergei Morozov
May 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functional test for auto-detected sequence definition
parent
642fc86e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+35
-0
No files found.
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
eca1c525
...
...
@@ -18,6 +18,7 @@ use function array_filter;
use
function
array_keys
;
use
function
array_map
;
use
function
array_search
;
use
function
array_values
;
use
function
count
;
use
function
current
;
use
function
end
;
...
...
@@ -25,6 +26,7 @@ use function explode;
use
function
get_class
;
use
function
in_array
;
use
function
str_replace
;
use
function
strcasecmp
;
use
function
strlen
;
use
function
strtolower
;
use
function
substr
;
...
...
@@ -1454,4 +1456,37 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
self
::
assertEquals
(
$sequence2AllocationSize
,
$actualSequence2
->
getAllocationSize
());
self
::
assertEquals
(
$sequence2InitialValue
,
$actualSequence2
->
getInitialValue
());
}
/**
* @group #3086
*/
public
function
testComparisonWithAutoDetectedSequenceDefinition
()
:
void
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
->
supportsSequences
())
{
self
::
markTestSkipped
(
'This test is only supported on platforms that support sequences.'
);
}
$sequenceName
=
'sequence_auto_detect_test'
;
$sequenceAllocationSize
=
5
;
$sequenceInitialValue
=
10
;
$sequence
=
new
Sequence
(
$sequenceName
,
$sequenceAllocationSize
,
$sequenceInitialValue
);
$this
->
_sm
->
dropAndCreateSequence
(
$sequence
);
$createdSequence
=
array_values
(
array_filter
(
$this
->
_sm
->
listSequences
(),
function
(
Sequence
$sequence
)
use
(
$sequenceName
)
:
bool
{
return
strcasecmp
(
$sequence
->
getName
(),
$sequenceName
)
===
0
;
}
)
)[
0
]
??
null
;
self
::
assertNotNull
(
$createdSequence
);
$comparator
=
new
Comparator
();
$tableDiff
=
$comparator
->
diffSequence
(
$createdSequence
,
$sequence
);
self
::
assertFalse
(
$tableDiff
);
}
}
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