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
9a7e242d
Unverified
Commit
9a7e242d
authored
Jul 30, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #650
parents
b86fae4e
0ab17825
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
42 deletions
+28
-42
CrudSpecFunctionalTest.php
tests/Collection/CrudSpecFunctionalTest.php
+2
-3
SpecFunctionalTest.php
tests/GridFS/SpecFunctionalTest.php
+2
-2
ChangeStreamsSpecTest.php
tests/SpecTests/ChangeStreamsSpecTest.php
+7
-10
CommandMonitoringSpecTest.php
tests/SpecTests/CommandMonitoringSpecTest.php
+2
-5
CrudSpecTest.php
tests/SpecTests/CrudSpecTest.php
+4
-5
RetryableWritesSpecTest.php
tests/SpecTests/RetryableWritesSpecTest.php
+2
-5
TransactionsSpecTest.php
tests/SpecTests/TransactionsSpecTest.php
+9
-12
No files found.
tests/Collection/CrudSpecFunctionalTest.php
View file @
9a7e242d
...
...
@@ -34,8 +34,6 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
*/
public
function
testSpecification
(
array
$initialData
,
array
$test
,
$minServerVersion
,
$maxServerVersion
)
{
$this
->
setName
(
str_replace
(
' '
,
'_'
,
$test
[
'description'
]));
if
(
isset
(
$minServerVersion
)
||
isset
(
$maxServerVersion
))
{
$this
->
checkServerVersion
(
$minServerVersion
,
$maxServerVersion
);
}
...
...
@@ -71,7 +69,8 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
$maxServerVersion
=
isset
(
$json
[
'maxServerVersion'
])
?
$json
[
'maxServerVersion'
]
:
null
;
foreach
(
$json
[
'tests'
]
as
$test
)
{
$testArgs
[]
=
[
$json
[
'data'
],
$test
,
$minServerVersion
,
$maxServerVersion
];
$name
=
str_replace
(
' '
,
'_'
,
$test
[
'description'
]);
$testArgs
[
$name
]
=
[
$json
[
'data'
],
$test
,
$minServerVersion
,
$maxServerVersion
];
}
}
...
...
tests/GridFS/SpecFunctionalTest.php
View file @
9a7e242d
...
...
@@ -40,7 +40,6 @@ class SpecFunctionalTest extends FunctionalTestCase
*/
public
function
testSpecification
(
array
$initialData
,
array
$test
)
{
$this
->
setName
(
str_replace
(
' '
,
'_'
,
$test
[
'description'
]));
$this
->
initializeData
(
$initialData
);
if
(
isset
(
$test
[
'arrange'
]))
{
...
...
@@ -77,7 +76,8 @@ class SpecFunctionalTest extends FunctionalTestCase
$json
=
json_decode
(
file_get_contents
(
$filename
),
true
);
foreach
(
$json
[
'tests'
]
as
$test
)
{
$testArgs
[]
=
[
$json
[
'data'
],
$test
];
$name
=
str_replace
(
' '
,
'_'
,
$test
[
'description'
]);
$testArgs
[
$name
]
=
[
$json
[
'data'
],
$test
];
}
}
...
...
tests/SpecTests/ChangeStreamsSpecTest.php
View file @
9a7e242d
...
...
@@ -58,17 +58,14 @@ class ChangeStreamsSpecTest extends FunctionalTestCase
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param stdClass $test Individual "tests[]" document
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
* @param string $database2Name Name of alternate database under test
* @param string $collection2Name Name of alternate collection under test
* @param stdClass $test Individual "tests[]" document
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
* @param string $database2Name Name of alternate database under test
* @param string $collection2Name Name of alternate collection under test
*/
public
function
testChangeStreams
(
$name
,
stdClass
$test
,
$databaseName
=
null
,
$collectionName
=
null
,
$database2Name
=
null
,
$collection2Name
=
null
)
public
function
testChangeStreams
(
stdClass
$test
,
$databaseName
=
null
,
$collectionName
=
null
,
$database2Name
=
null
,
$collection2Name
=
null
)
{
$this
->
setName
(
$name
);
$this
->
checkServerRequirements
(
$this
->
createRunOn
(
$test
));
if
(
!
isset
(
$databaseName
,
$collectionName
,
$database2Name
,
$collection2Name
))
{
...
...
@@ -151,7 +148,7 @@ class ChangeStreamsSpecTest extends FunctionalTestCase
foreach
(
$json
->
tests
as
$test
)
{
$name
=
$group
.
': '
.
$test
->
description
;
$testArgs
[
]
=
[
$name
,
$test
,
$databaseName
,
$collectionName
,
$database2Name
,
$collection2Name
];
$testArgs
[
$name
]
=
[
$test
,
$databaseName
,
$collectionName
,
$database2Name
,
$collection2Name
];
}
}
...
...
tests/SpecTests/CommandMonitoringSpecTest.php
View file @
9a7e242d
...
...
@@ -130,16 +130,13 @@ class CommandMonitoringSpecTest extends FunctionalTestCase
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param stdClass $test Individual "tests[]" document
* @param array $data Top-level "data" array to initialize collection
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
*/
public
function
testCommandMonitoring
(
$name
,
stdClass
$test
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
public
function
testCommandMonitoring
(
stdClass
$test
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
{
$this
->
setName
(
$name
);
$this
->
checkServerRequirements
(
$this
->
createRunOn
(
$test
));
$databaseName
=
isset
(
$databaseName
)
?
$databaseName
:
$this
->
getDatabaseName
();
...
...
@@ -177,7 +174,7 @@ class CommandMonitoringSpecTest extends FunctionalTestCase
foreach
(
$json
->
tests
as
$test
)
{
$name
=
$group
.
': '
.
$test
->
description
;
$testArgs
[
]
=
[
$name
,
$test
,
$data
,
$databaseName
,
$collectionName
];
$testArgs
[
$name
]
=
[
$test
,
$data
,
$databaseName
,
$collectionName
];
}
}
...
...
tests/SpecTests/CrudSpecTest.php
View file @
9a7e242d
...
...
@@ -37,17 +37,16 @@ class CrudSpecTest extends FunctionalTestCase
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param stdClass $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" array with server requirements
* @param array $data Top-level "data" array to initialize collection
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
*/
public
function
testCrud
(
$name
,
stdClass
$test
,
array
$runOn
=
null
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
public
function
testCrud
(
stdClass
$test
,
array
$runOn
=
null
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
{
if
(
isset
(
self
::
$incompleteTests
[
$
name
]))
{
$this
->
markTestIncomplete
(
self
::
$incompleteTests
[
$
name
]);
if
(
isset
(
self
::
$incompleteTests
[
$
this
->
dataDescription
()
]))
{
$this
->
markTestIncomplete
(
self
::
$incompleteTests
[
$
this
->
dataDescription
()
]);
}
if
(
isset
(
$runOn
))
{
...
...
@@ -104,7 +103,7 @@ class CrudSpecTest extends FunctionalTestCase
foreach
(
$json
->
tests
as
$test
)
{
$name
=
$group
.
': '
.
$test
->
description
;
$testArgs
[
$name
]
=
[
$
name
,
$
test
,
$runOn
,
$data
,
$databaseName
,
$collectionName
];
$testArgs
[
$name
]
=
[
$test
,
$runOn
,
$data
,
$databaseName
,
$collectionName
];
}
}
...
...
tests/SpecTests/RetryableWritesSpecTest.php
View file @
9a7e242d
...
...
@@ -16,15 +16,12 @@ class RetryableWritesSpecTest extends FunctionalTestCase
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param stdClass $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" array with server requirements
* @param array $data Top-level "data" array to initialize collection
*/
public
function
testRetryableWrites
(
$name
,
stdClass
$test
,
array
$runOn
=
null
,
array
$data
)
public
function
testRetryableWrites
(
stdClass
$test
,
array
$runOn
=
null
,
array
$data
)
{
$this
->
setName
(
$name
);
// TODO: Revise this once a test environment with multiple mongos nodes is available (see: PHPLIB-430)
if
(
isset
(
$test
->
useMultipleMongoses
)
&&
$test
->
useMultipleMongoses
&&
$this
->
isShardedCluster
())
{
$this
->
markTestSkipped
(
'"useMultipleMongoses" is not supported'
);
...
...
@@ -63,7 +60,7 @@ class RetryableWritesSpecTest extends FunctionalTestCase
foreach
(
$json
->
tests
as
$test
)
{
$name
=
$group
.
': '
.
$test
->
description
;
$testArgs
[
]
=
[
$name
,
$test
,
$runOn
,
$data
];
$testArgs
[
$name
]
=
[
$test
,
$runOn
,
$data
];
}
}
...
...
tests/SpecTests/TransactionsSpecTest.php
View file @
9a7e242d
...
...
@@ -113,19 +113,16 @@ class TransactionsSpecTest extends FunctionalTestCase
* Execute an individual test case from the specification.
*
* @dataProvider provideTests
* @param string $name Test name
* @param stdClass $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" array with server requirements
* @param array $data Top-level "data" array to initialize collection
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
* @param stdClass $test Individual "tests[]" document
* @param array $runOn Top-level "runOn" array with server requirements
* @param array $data Top-level "data" array to initialize collection
* @param string $databaseName Name of database under test
* @param string $collectionName Name of collection under test
*/
public
function
testTransactions
(
$name
,
stdClass
$test
,
array
$runOn
=
null
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
public
function
testTransactions
(
stdClass
$test
,
array
$runOn
=
null
,
array
$data
,
$databaseName
=
null
,
$collectionName
=
null
)
{
$this
->
setName
(
$name
);
if
(
isset
(
self
::
$incompleteTests
[
$name
]))
{
$this
->
markTestIncomplete
(
self
::
$incompleteTests
[
$name
]);
if
(
isset
(
self
::
$incompleteTests
[
$this
->
dataDescription
()]))
{
$this
->
markTestIncomplete
(
self
::
$incompleteTests
[
$this
->
dataDescription
()]);
}
// TODO: Revise this once a test environment with multiple mongos nodes is available (see: PHPLIB-430)
...
...
@@ -192,7 +189,7 @@ class TransactionsSpecTest extends FunctionalTestCase
foreach
(
$json
->
tests
as
$test
)
{
$name
=
$group
.
': '
.
$test
->
description
;
$testArgs
[
]
=
[
$name
,
$test
,
$runOn
,
$data
,
$databaseName
,
$collectionName
];
$testArgs
[
$name
]
=
[
$test
,
$runOn
,
$data
,
$databaseName
,
$collectionName
];
}
}
...
...
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