Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable PHPC specific tests, and better error messages if a wrong exception is thrown #106

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/connect/standalone-ssl-0002.phpt
@@ -1,6 +1,7 @@
--TEST--
Connect to MongoDB with using SSL and verify the stream
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions tests/connect/standalone-ssl-0004.phpt
@@ -1,6 +1,7 @@
--TEST--
Connect to MongoDB with using SSL and verify the stream
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions tests/connect/standalone-ssl-0005.phpt
@@ -1,6 +1,7 @@
--TEST--
Connect to MongoDB with using SSL and verify the stream
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support peer verification"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions tests/connect/standalone-ssl-0006.phpt
@@ -1,6 +1,7 @@
--TEST--
Connect to MongoDB with using SSL and default options
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM does not support interception of SSL connection creation"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("STANDALONE_SSL"); ?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions tests/manager/manager-debug-001.phpt
@@ -1,6 +1,7 @@
--TEST--
MongoDB\Driver\Manager: Writing debug log files
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions tests/manager/manager-debug-002.phpt
@@ -1,6 +1,7 @@
--TEST--
MongoDB\Driver\Manager: mongodb.debug=stderr
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
--INI--
mongodb.debug=stderr
Expand Down
1 change: 1 addition & 0 deletions tests/manager/manager-debug-003.phpt
@@ -1,6 +1,7 @@
--TEST--
MongoDB\Driver\Manager: mongodb.debug=stdout
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
--INI--
mongodb.debug=stdout
Expand Down
1 change: 1 addition & 0 deletions tests/manager/manager-executequery-without-assignment.phpt
@@ -1,6 +1,7 @@
--TEST--
MongoDB\Driver\Manager: Executing Query without assignment still executes
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
--FILE--
<?php
Expand Down
7 changes: 3 additions & 4 deletions tests/utils/tools.php
Expand Up @@ -236,26 +236,25 @@ function throws($function, $exceptionname, $infunction = null) {
try {
$function();
} catch(Exception $e) {
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
if ($e instanceof $exceptionname) {
if ($infunction) {
$trace = $e->getTrace();
$function = $trace[0]["function"];
if (strcasecmp($function, $infunction) == 0) {
printf("OK: Got %s thrown from %s\n", $exceptionname, $infunction);
} else {
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
printf("ALMOST: Got %s - but was thrown in %s, not %s (%s)\n", $exceptionname, $function, $infunction, $message);
}
return $e->getMessage();
}
printf("OK: Got %s\n", $exceptionname);
} else {
$message = str_replace(array("\n", "\r"), ' ', $e->getMessage());
printf("ALMOST: Got %s - expected %s: %s\n", get_class($e), $exceptionname, $message);
printf("ALMOST: Got %s (%s) - expected %s\n", get_class($e), $message, $exceptionname);
}
return $e->getMessage();
}
echo "FAILED: Expected $exceptionname thrown!\n";
echo "FAILED: Expected $exceptionname thrown, but no exception thrown!\n";
}
function printServer(MongoDB\Driver\Server $server)
{
Expand Down