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
b8a481ee
Commit
b8a481ee
authored
Jan 24, 2018
by
Gabriel Caruso
Committed by
Jeremy Mikola
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dedicated PHPUnit assertions
parent
f4801b80
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
DatabaseFunctionalTest.php
tests/Database/DatabaseFunctionalTest.php
+2
-2
IndexInfoTest.php
tests/Model/IndexInfoTest.php
+2
-2
ChangeStreamFunctionalTest.php
tests/Operation/ChangeStreamFunctionalTest.php
+4
-4
No files found.
tests/Database/DatabaseFunctionalTest.php
View file @
b8a481ee
...
@@ -91,7 +91,7 @@ class DatabaseFunctionalTest extends FunctionalTestCase
...
@@ -91,7 +91,7 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$commandResult
=
current
(
$cursor
->
toArray
());
$commandResult
=
current
(
$cursor
->
toArray
());
$this
->
assertCommandSucceeded
(
$commandResult
);
$this
->
assertCommandSucceeded
(
$commandResult
);
$this
->
assert
True
(
isset
(
$commandResult
->
ismaster
)
);
$this
->
assert
ObjectHasAttribute
(
'ismaster'
,
$commandResult
);
$this
->
assertTrue
(
$commandResult
->
ismaster
);
$this
->
assertTrue
(
$commandResult
->
ismaster
);
}
}
...
@@ -110,7 +110,7 @@ class DatabaseFunctionalTest extends FunctionalTestCase
...
@@ -110,7 +110,7 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$this
->
assertCommandSucceeded
(
$commandResult
);
$this
->
assertCommandSucceeded
(
$commandResult
);
$this
->
assertInternalType
(
'array'
,
$commandResult
);
$this
->
assertInternalType
(
'array'
,
$commandResult
);
$this
->
assert
True
(
isset
(
$commandResult
[
'ismaster'
])
);
$this
->
assert
ArrayHasKey
(
'ismaster'
,
$commandResult
);
$this
->
assertTrue
(
$commandResult
[
'ismaster'
]);
$this
->
assertTrue
(
$commandResult
[
'ismaster'
]);
}
}
...
...
tests/Model/IndexInfoTest.php
View file @
b8a481ee
...
@@ -80,7 +80,7 @@ class IndexInfoTest extends TestCase
...
@@ -80,7 +80,7 @@ class IndexInfoTest extends TestCase
$this
->
assertFalse
(
$info
->
isSparse
());
$this
->
assertFalse
(
$info
->
isSparse
());
$this
->
assertTrue
(
$info
->
isTtl
());
$this
->
assertTrue
(
$info
->
isTtl
());
$this
->
assertFalse
(
$info
->
isUnique
());
$this
->
assertFalse
(
$info
->
isUnique
());
$this
->
assert
True
(
isset
(
$info
[
'expireAfterSeconds'
])
);
$this
->
assert
ArrayHasKey
(
'expireAfterSeconds'
,
$info
);
$this
->
assertSame
(
100
,
$info
[
'expireAfterSeconds'
]);
$this
->
assertSame
(
100
,
$info
[
'expireAfterSeconds'
]);
}
}
...
@@ -107,7 +107,7 @@ class IndexInfoTest extends TestCase
...
@@ -107,7 +107,7 @@ class IndexInfoTest extends TestCase
]);
]);
$this
->
assertInstanceOf
(
'ArrayAccess'
,
$info
);
$this
->
assertInstanceOf
(
'ArrayAccess'
,
$info
);
$this
->
assert
True
(
isset
(
$info
[
'name'
])
);
$this
->
assert
ArrayHasKey
(
'name'
,
$info
);
$this
->
assertSame
(
'x_1'
,
$info
[
'name'
]);
$this
->
assertSame
(
'x_1'
,
$info
[
'name'
]);
}
}
...
...
tests/Operation/ChangeStreamFunctionalTest.php
View file @
b8a481ee
...
@@ -143,7 +143,7 @@ class ChangeStreamFunctionalTest extends FunctionalTestCase
...
@@ -143,7 +143,7 @@ class ChangeStreamFunctionalTest extends FunctionalTestCase
$changeStreamResult
=
$this
->
collection
->
watch
();
$changeStreamResult
=
$this
->
collection
->
watch
();
$this
->
assert
Same
(
null
,
$changeStreamResult
->
key
());
$this
->
assert
Null
(
$changeStreamResult
->
key
());
$result
=
$this
->
collection
->
insertOne
([
'x'
=>
1
]);
$result
=
$this
->
collection
->
insertOne
([
'x'
=>
1
]);
$this
->
assertInstanceOf
(
'MongoDB\InsertOneResult'
,
$result
);
$this
->
assertInstanceOf
(
'MongoDB\InsertOneResult'
,
$result
);
...
@@ -153,15 +153,15 @@ class ChangeStreamFunctionalTest extends FunctionalTestCase
...
@@ -153,15 +153,15 @@ class ChangeStreamFunctionalTest extends FunctionalTestCase
$this
->
assertSame
(
1
,
$changeStreamResult
->
key
());
$this
->
assertSame
(
1
,
$changeStreamResult
->
key
());
$changeStreamResult
->
next
();
$changeStreamResult
->
next
();
$this
->
assert
Same
(
null
,
$changeStreamResult
->
key
());
$this
->
assert
Null
(
$changeStreamResult
->
key
());
$changeStreamResult
->
next
();
$changeStreamResult
->
next
();
$this
->
assert
Same
(
null
,
$changeStreamResult
->
key
());
$this
->
assert
Null
(
$changeStreamResult
->
key
());
$operation
=
new
DatabaseCommand
(
$this
->
getDatabaseName
(),
[
"killCursors"
=>
$this
->
getCollectionName
(),
"cursors"
=>
[
$changeStreamResult
->
getCursorId
()]]);
$operation
=
new
DatabaseCommand
(
$this
->
getDatabaseName
(),
[
"killCursors"
=>
$this
->
getCollectionName
(),
"cursors"
=>
[
$changeStreamResult
->
getCursorId
()]]);
$operation
->
execute
(
$this
->
getPrimaryServer
());
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStreamResult
->
next
();
$changeStreamResult
->
next
();
$this
->
assert
Same
(
null
,
$changeStreamResult
->
key
());
$this
->
assert
Null
(
$changeStreamResult
->
key
());
$result
=
$this
->
collection
->
insertOne
([
'x'
=>
2
]);
$result
=
$this
->
collection
->
insertOne
([
'x'
=>
2
]);
$this
->
assertInstanceOf
(
'MongoDB\InsertOneResult'
,
$result
);
$this
->
assertInstanceOf
(
'MongoDB\InsertOneResult'
,
$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