Skip to content

Commit e30b93b

Browse files
committed
Merge pull request #106
2 parents b9b9b39 + 73ab90e commit e30b93b

9 files changed

+11
-4
lines changed

tests/connect/standalone-ssl-0002.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
Connect to MongoDB with using SSL and verify the stream
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
56
--FILE--
67
<?php

tests/connect/standalone-ssl-0004.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
Connect to MongoDB with using SSL and verify the stream
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
56
--FILE--
67
<?php

tests/connect/standalone-ssl-0005.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
Connect to MongoDB with using SSL and verify the stream
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
56
--FILE--
67
<?php

tests/connect/standalone-ssl-0006.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
Connect to MongoDB with using SSL and default options
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support interception of SSL connection creation"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
56
--FILE--
67
<?php

tests/manager/manager-debug-001.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
MongoDB\Driver\Manager: Writing debug log files
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
56
--FILE--
67
<?php

tests/manager/manager-debug-002.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
MongoDB\Driver\Manager: mongodb.debug=stderr
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
56
--INI--
67
mongodb.debug=stderr

tests/manager/manager-debug-003.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
MongoDB\Driver\Manager: mongodb.debug=stdout
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
56
--INI--
67
mongodb.debug=stdout

tests/manager/manager-executequery-without-assignment.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
--TEST--
22
MongoDB\Driver\Manager: Executing Query without assignment still executes
33
--SKIPIF--
4+
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
45
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
56
--FILE--
67
<?php

tests/utils/tools.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,26 +236,25 @@ function throws($function, $exceptionname, $infunction = null) {
236236
try {
237237
$function();
238238
} catch(Exception $e) {
239+
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
239240
if ($e instanceof $exceptionname) {
240241
if ($infunction) {
241242
$trace = $e->getTrace();
242243
$function = $trace[0]["function"];
243244
if (strcasecmp($function, $infunction) == 0) {
244245
printf("OK: Got %s thrown from %s\n", $exceptionname, $infunction);
245246
} else {
246-
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
247247
printf("ALMOST: Got %s - but was thrown in %s, not %s (%s)\n", $exceptionname, $function, $infunction, $message);
248248
}
249249
return $e->getMessage();
250250
}
251251
printf("OK: Got %s\n", $exceptionname);
252252
} else {
253-
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
254-
printf("ALMOST: Got %s - expected %s: %s\n", get_class($e), $exceptionname, $message);
253+
printf("ALMOST: Got %s (%s) - expected %s\n", get_class($e), $message, $exceptionname);
255254
}
256255
return $e->getMessage();
257256
}
258-
echo "FAILED: Expected $exceptionname thrown!\n";
257+
echo "FAILED: Expected $exceptionname thrown, but no exception thrown!\n";
259258
}
260259
function printServer(MongoDB\Driver\Server $server)
261260
{

0 commit comments

Comments
 (0)