Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
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
sinan
mongo-php-library
Commits
a0aceaf4
Commit
a0aceaf4
authored
Apr 24, 2015
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-63: Test custom name for index creation
parent
56395109
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
CollectionFunctionalTest.php
tests/CollectionFunctionalTest.php
+5
-5
No files found.
tests/CollectionFunctionalTest.php
View file @
a0aceaf4
...
...
@@ -84,8 +84,8 @@ class CollectionFunctionalTest extends FunctionalTestCase
$that
->
assertFalse
(
$info
->
isTtl
());
});
$this
->
assertSame
(
'
t_1'
,
$this
->
collection
->
createIndex
(
array
(
't'
=>
1
),
array
(
'expireAfterSeconds'
=>
0
)));
$this
->
assertIndexExists
(
'
t_1
'
,
function
(
IndexInfo
$info
)
use
(
$that
)
{
$this
->
assertSame
(
'
my_ttl'
,
$this
->
collection
->
createIndex
(
array
(
't'
=>
1
),
array
(
'expireAfterSeconds'
=>
0
,
'name'
=>
'my_ttl'
)));
$this
->
assertIndexExists
(
'
my_ttl
'
,
function
(
IndexInfo
$info
)
use
(
$that
)
{
$that
->
assertFalse
(
$info
->
isSparse
());
$that
->
assertFalse
(
$info
->
isUnique
());
$that
->
assertTrue
(
$info
->
isTtl
());
...
...
@@ -96,13 +96,13 @@ class CollectionFunctionalTest extends FunctionalTestCase
{
$that
=
$this
;
$expectedNames
=
array
(
'x_1'
,
'y_-1_z_1'
,
'g_2dsphere_z_1'
,
'
t_1
'
);
$expectedNames
=
array
(
'x_1'
,
'y_-1_z_1'
,
'g_2dsphere_z_1'
,
'
my_ttl
'
);
$indexes
=
array
(
array
(
'key'
=>
array
(
'x'
=>
1
),
'sparse'
=>
true
,
'unique'
=>
true
),
array
(
'key'
=>
array
(
'y'
=>
-
1
,
'z'
=>
1
)),
array
(
'key'
=>
array
(
'g'
=>
'2dsphere'
,
'z'
=>
1
)),
array
(
'key'
=>
array
(
't'
=>
1
),
'expireAfterSeconds'
=>
0
),
array
(
'key'
=>
array
(
't'
=>
1
),
'expireAfterSeconds'
=>
0
,
'name'
=>
'my_ttl'
),
);
$this
->
assertSame
(
$expectedNames
,
$this
->
collection
->
createIndexes
(
$indexes
));
...
...
@@ -125,7 +125,7 @@ class CollectionFunctionalTest extends FunctionalTestCase
$that
->
assertFalse
(
$info
->
isTtl
());
});
$this
->
assertIndexExists
(
'
t_1
'
,
function
(
IndexInfo
$info
)
use
(
$that
)
{
$this
->
assertIndexExists
(
'
my_ttl
'
,
function
(
IndexInfo
$info
)
use
(
$that
)
{
$that
->
assertFalse
(
$info
->
isSparse
());
$that
->
assertFalse
(
$info
->
isUnique
());
$that
->
assertTrue
(
$info
->
isTtl
());
...
...
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