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
5145112c
Commit
5145112c
authored
Feb 22, 2019
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-414: Remove orphan chunks for GridFS spec tests
parent
a16c1884
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
SpecFunctionalTest.php
tests/GridFS/SpecFunctionalTest.php
+10
-0
No files found.
tests/GridFS/SpecFunctionalTest.php
View file @
5145112c
...
@@ -6,6 +6,7 @@ use MongoDB\Collection;
...
@@ -6,6 +6,7 @@ use MongoDB\Collection;
use
MongoDB\BSON\Binary
;
use
MongoDB\BSON\Binary
;
use
MongoDB\BSON\ObjectId
;
use
MongoDB\BSON\ObjectId
;
use
MongoDB\BSON\UTCDateTime
;
use
MongoDB\BSON\UTCDateTime
;
use
MongoDB\GridFS\Exception\FileNotFoundException
;
use
MongoDB\Operation\BulkWrite
;
use
MongoDB\Operation\BulkWrite
;
use
DateTime
;
use
DateTime
;
use
Exception
;
use
Exception
;
...
@@ -54,6 +55,15 @@ class SpecFunctionalTest extends FunctionalTestCase
...
@@ -54,6 +55,15 @@ class SpecFunctionalTest extends FunctionalTestCase
$result
=
$e
;
$result
=
$e
;
}
}
/* Per the GridFS spec: "Drivers MAY attempt to delete any orphaned
* chunks with files_id equal to id before raising the error." The spec
* tests do not expect orphaned chunks to be removed, so we manually
* remove those chunks from the expected collection. */
if
(
$test
[
'act'
][
'operation'
]
===
'delete'
&&
$result
instanceof
FileNotFoundException
)
{
$filesId
=
$this
->
convertTypes
(
$test
[
'act'
])[
'arguments'
][
'id'
];
$this
->
expectedChunksCollection
->
deleteMany
([
'files_id'
=>
$filesId
]);
}
if
(
isset
(
$test
[
'assert'
]))
{
if
(
isset
(
$test
[
'assert'
]))
{
$this
->
executeAssert
(
$test
[
'assert'
],
$result
);
$this
->
executeAssert
(
$test
[
'assert'
],
$result
);
}
}
...
...
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