Skip to content

Commit 8a28fcb

Browse files
committed
PHPC-1177: Add skip clauses to tests that must run with simple auth
1 parent 772ae9a commit 8a28fcb

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

.travis.scripts/setup_mo.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
echo Loading MO for $DEPLOYMENT
44

5+
if [[ -z $TRAVIS_BUILD_DIR ]]; then
6+
TRAVIS_BUILD_DIR=`pwd`;
7+
fi
8+
59
case $DEPLOYMENT in
610
SHARDED_CLUSTER)
711
${TRAVIS_BUILD_DIR}/.travis.scripts/mo.sh ${TRAVIS_BUILD_DIR}/scripts/presets/travis/sharded_clusters/cluster.json start > /tmp/mo-result.json

tests/connect/standalone-auth-0001.phpt renamed to tests/connect/standalone-auth-001.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Connect to MongoDB with using default auth mechanism
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
55
<?php skip_if_not_auth(); ?>
6+
<?php skip_if_not_auth_mechanism(null); ?>
67
<?php skip_if_not_clean(); ?>
78
--FILE--
89
<?php

tests/connect/standalone-auth-0002.phpt renamed to tests/connect/standalone-auth_error-001.phpt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
--TEST--
2-
Connect to MongoDB with using default auth mechanism #002
3-
--XFAIL--
4-
parse_url() tests must be reimplemented (PHPC-1177)
2+
Connect to MongoDB with using default auth mechanism and wrong password
53
--SKIPIF--
64
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
75
<?php skip_if_not_auth(); ?>
6+
<?php skip_if_not_auth_mechanism(null); ?>
87
<?php skip_if_not_clean(); ?>
98
--FILE--
109
<?php
1110
require_once __DIR__ . "/../utils/basic.inc";
1211

1312
$username = "root";
14-
$password = "tooring";
13+
$password = "the-wrong-password";
1514
$database = "admin";
1615

1716
$parsed = parse_url(URI);

tests/server/server-executeBulkWrite-005.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ foreach ($writeConcerns as $wc) {
2424
var_dump($result->getInsertedCount());
2525
}
2626

27-
$command = new MongoDB\Driver\Command([
28-
'delete' => COLLECTION_NAME,
29-
'deletes' => [ [ 'q' => (object) [], 'limit' => 0 ] ]
30-
]);
31-
$server->executeCommand('local', $command);
27+
$bulk = new MongoDB\Driver\BulkWrite();
28+
$bulk->delete( (object) [] );
29+
$server->executeBulkWrite('local.' . COLLECTION_NAME, $bulk);
3230

3331
?>
3432
===DONE===

tests/utils/skipif.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function skip_if_not_auth_mechanism($authMechanism)
9797
{
9898
$uriAuthMechanism = get_uri_option(URI, 'authMechanism');
9999

100-
if ($uriAuthMechanism === null) {
100+
if ($uriAuthMechanism === null && $authMechanism !== null) {
101101
exit('skip URI is not using authMechanism');
102102
}
103103

0 commit comments

Comments
 (0)