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
24f10f15
Commit
24f10f15
authored
Jan 30, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use length-10 instead of filename
parent
5310c62b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
StreamWrapperFunctionalTest.php
tests/GridFS/StreamWrapperFunctionalTest.php
+13
-20
No files found.
tests/GridFS/StreamWrapperFunctionalTest.php
View file @
24f10f15
...
...
@@ -3,7 +3,6 @@
namespace
MongoDB\Tests\GridFS
;
use
MongoDB\BSON\Binary
;
use
MongoDB\BSON\ObjectId
;
use
MongoDB\BSON\UTCDateTime
;
/**
...
...
@@ -157,10 +156,10 @@ class StreamWrapperFunctionalTest extends FunctionalTestCase
$this
->
assertSame
(
0100222
,
$stat
[
'mode'
]);
$this
->
assertSame
(
0
,
$stat
[
7
]);
$this
->
assertSame
(
0
,
$stat
[
'size'
]);
$this
->
assert
GreaterThanOrEqual
(
0
,
$stat
[
9
]);
$this
->
assert
GreaterThanOrEqual
(
0
,
$stat
[
'mtime'
]);
$this
->
assert
GreaterThanOrEqual
(
0
,
$stat
[
10
]);
$this
->
assert
GreaterThanOrEqual
(
0
,
$stat
[
'ctime'
]);
$this
->
assert
Same
(
0
,
$stat
[
9
]);
$this
->
assert
Same
(
0
,
$stat
[
'mtime'
]);
$this
->
assert
Same
(
0
,
$stat
[
10
]);
$this
->
assert
Same
(
0
,
$stat
[
'ctime'
]);
$this
->
assertSame
(
1024
,
$stat
[
11
]);
$this
->
assertSame
(
1024
,
$stat
[
'blksize'
]);
...
...
@@ -173,25 +172,19 @@ class StreamWrapperFunctionalTest extends FunctionalTestCase
public
function
testWritableStreamStatAfterSaving
()
{
$id
=
new
ObjectId
;
$stream
=
$this
->
bucket
->
openUploadStream
(
'filename'
,
[
'chunkSizeBytes'
=>
1024
,
'_id'
=>
$id
]);
$this
->
assertSame
(
6
,
fwrite
(
$stream
,
'foobar'
));
$this
->
assertTrue
(
fclose
(
$stream
));
$currentTimestamp
=
time
();
$stream
=
$this
->
bucket
->
openDownloadStream
(
$id
);
$stream
=
$this
->
bucket
->
openDownloadStream
(
'length-10'
);
$stat
=
fstat
(
$stream
);
$this
->
assertSame
(
0100444
,
$stat
[
2
]);
$this
->
assertSame
(
0100444
,
$stat
[
'mode'
]);
$this
->
assertSame
(
6
,
$stat
[
7
]);
$this
->
assertSame
(
6
,
$stat
[
'size'
]);
$this
->
assert
GreaterThanOrEqual
(
$currentTimestamp
,
$stat
[
9
]);
$this
->
assert
GreaterThanOrEqual
(
$currentTimestamp
,
$stat
[
'mtime'
]);
$this
->
assert
GreaterThanOrEqual
(
$currentTimestamp
,
$stat
[
10
]);
$this
->
assert
GreaterThanOrEqual
(
$currentTimestamp
,
$stat
[
'ctime'
]);
$this
->
assertSame
(
102
4
,
$stat
[
11
]);
$this
->
assertSame
(
102
4
,
$stat
[
'blksize'
]);
$this
->
assertSame
(
10
,
$stat
[
7
]);
$this
->
assertSame
(
10
,
$stat
[
'size'
]);
$this
->
assert
Same
(
1484202200000
/
1000
,
$stat
[
9
]);
$this
->
assert
Same
(
1484202200000
/
1000
,
$stat
[
'mtime'
]);
$this
->
assert
Same
(
1484202200000
/
1000
,
$stat
[
10
]);
$this
->
assert
Same
(
1484202200000
/
1000
,
$stat
[
'ctime'
]);
$this
->
assertSame
(
4
,
$stat
[
11
]);
$this
->
assertSame
(
4
,
$stat
[
'blksize'
]);
}
public
function
testWritableStreamWrite
()
...
...
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