Skip to content

Commit 68eba44

Browse files
committed
PHPC-272: Move exceptions into MongoDB\Driver\Exception namespace
1 parent 8c8b6a8 commit 68eba44

38 files changed

+80
-96
lines changed

config.m4

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ if test "$MONGODB" != "no"; then
164164
src/MongoDB/WriteResult.c \
165165
";
166166
MONGODB_MONGODB_EXCEPTIONS="\
167-
src/MongoDB/Exception.c \
168-
src/MongoDB/RuntimeException.c \
169-
src/MongoDB/UnexpectedValueException.c \
170-
src/MongoDB/InvalidArgumentException.c \
171-
src/MongoDB/ConnectionException.c \
172-
src/MongoDB/AuthenticationException.c \
173-
src/MongoDB/SSLConnectionException.c \
174-
src/MongoDB/DuplicateKeyException.c \
175-
src/MongoDB/ExecutionTimeoutException.c \
176-
src/MongoDB/ConnectionTimeoutException.c \
177-
src/MongoDB/WriteException.c \
178-
src/MongoDB/WriteConcernException.c \
179-
src/MongoDB/BulkWriteException.c \
167+
src/MongoDB/Exception/Exception.c \
168+
src/MongoDB/Exception/RuntimeException.c \
169+
src/MongoDB/Exception/UnexpectedValueException.c \
170+
src/MongoDB/Exception/InvalidArgumentException.c \
171+
src/MongoDB/Exception/ConnectionException.c \
172+
src/MongoDB/Exception/AuthenticationException.c \
173+
src/MongoDB/Exception/SSLConnectionException.c \
174+
src/MongoDB/Exception/DuplicateKeyException.c \
175+
src/MongoDB/Exception/ExecutionTimeoutException.c \
176+
src/MongoDB/Exception/ConnectionTimeoutException.c \
177+
src/MongoDB/Exception/WriteException.c \
178+
src/MongoDB/Exception/WriteConcernException.c \
179+
src/MongoDB/Exception/BulkWriteException.c \
180180
";
181181

182182
YAJL_SOURCES="\

config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (PHP_MONGODB != "no") {
1010
ADD_SOURCES(configure_module_dirname + "/src", "bson.c", "mongodb");
1111
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Type.c Unserializable.c Serializable.c Persistable.c Binary.c Javascript.c MaxKey.c MinKey.c ObjectID.c Regex.c Timestamp.c UTCDatetime.c", "mongodb");
1212
ADD_SOURCES(configure_module_dirname + "/src/MongoDB", "Command.c Cursor.c CursorId.c Manager.c Query.c ReadPreference.c Server.c BulkWrite.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c", "mongodb");
13-
ADD_SOURCES(configure_module_dirname + "/src/MongoDB", "Exception.c RuntimeException.c UnexpectedValueException.c InvalidArgumentException.c ConnectionException.c AuthenticationException.c SSLConnectionException.c DuplicateKeyException.c ExecutionTimeoutException.c ConnectionTimeoutException.c WriteException.c WriteConcernException.c BulkWriteException.c", "mongodb");
13+
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Exception", "Exception.c RuntimeException.c UnexpectedValueException.c InvalidArgumentException.c ConnectionException.c AuthenticationException.c SSLConnectionException.c DuplicateKeyException.c ExecutionTimeoutException.c ConnectionTimeoutException.c WriteException.c WriteConcernException.c BulkWriteException.c", "mongodb");
1414
ADD_SOURCES(configure_module_dirname + "/src/contrib/", "php-ssl.c", "mongodb");
1515
ADD_SOURCES(configure_module_dirname + "/src/libbson/src/yajl", "yajl_version.c yajl.c yajl_encode.c yajl_lex.c yajl_parser.c yajl_buf.c yajl_tree.c yajl_alloc.c yajl_gen.c", "mongodb");
1616
ADD_SOURCES(configure_module_dirname + "/src/libbson/src/bson", "bcon.c bson.c bson-atomic.c bson-clock.c bson-context.c bson-error.c bson-iter.c bson-iso8601.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version.c bson-writer.c", "mongodb");

src/MongoDB/AuthenticationException.c renamed to src/MongoDB/Exception/AuthenticationException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(AuthenticationException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "AuthenticationException", php_phongo_authenticationexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "AuthenticationException", php_phongo_authenticationexception_me);
6464
php_phongo_authenticationexception_ce = zend_register_internal_class_ex(&ce, php_phongo_connectionexception_ce, NULL TSRMLS_CC);
6565

6666
return SUCCESS;

src/MongoDB/BulkWriteException.c renamed to src/MongoDB/Exception/BulkWriteException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(BulkWriteException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "BulkWriteException", php_phongo_bulkwriteexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "BulkWriteException", php_phongo_bulkwriteexception_me);
6464
php_phongo_bulkwriteexception_ce = zend_register_internal_class_ex(&ce, php_phongo_writeexception_ce, NULL TSRMLS_CC);
6565

6666
return SUCCESS;

src/MongoDB/ConnectionException.c renamed to src/MongoDB/Exception/ConnectionException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(ConnectionException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "ConnectionException", php_phongo_connectionexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "ConnectionException", php_phongo_connectionexception_me);
6464
php_phongo_connectionexception_ce = zend_register_internal_class_ex(&ce, php_phongo_runtimeexception_ce, NULL TSRMLS_CC);
6565

6666
return SUCCESS;

src/MongoDB/ConnectionTimeoutException.c renamed to src/MongoDB/Exception/ConnectionTimeoutException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(ConnectionTimeoutException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "ConnectionTimeoutException", php_phongo_connectiontimeoutexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "ConnectionTimeoutException", php_phongo_connectiontimeoutexception_me);
6464
php_phongo_connectiontimeoutexception_ce = zend_register_internal_class_ex(&ce, php_phongo_connectionexception_ce, NULL TSRMLS_CC);
6565
PHONGO_CE_INIT(php_phongo_connectiontimeoutexception_ce);
6666

src/MongoDB/DuplicateKeyException.c renamed to src/MongoDB/Exception/DuplicateKeyException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(DuplicateKeyException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "DuplicateKeyException", php_phongo_duplicatekeyexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "DuplicateKeyException", php_phongo_duplicatekeyexception_me);
6464
php_phongo_duplicatekeyexception_ce = zend_register_internal_class_ex(&ce, php_phongo_writeexception_ce, NULL TSRMLS_CC);
6565
PHONGO_CE_INIT(php_phongo_duplicatekeyexception_ce);
6666

src/MongoDB/Exception.c renamed to src/MongoDB/Exception/Exception.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(Exception)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "Exception", php_phongo_exception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "Exception", php_phongo_exception_me);
6464
php_phongo_exception_ce = zend_register_internal_interface(&ce TSRMLS_CC);
6565

6666
return SUCCESS;

src/MongoDB/ExecutionTimeoutException.c renamed to src/MongoDB/Exception/ExecutionTimeoutException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(ExecutionTimeoutException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "ExecutionTimeoutException", php_phongo_executiontimeoutexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "ExecutionTimeoutException", php_phongo_executiontimeoutexception_me);
6464
php_phongo_executiontimeoutexception_ce = zend_register_internal_class_ex(&ce, php_phongo_runtimeexception_ce, NULL TSRMLS_CC);
6565
PHONGO_CE_INIT(php_phongo_executiontimeoutexception_ce);
6666

src/MongoDB/InvalidArgumentException.c renamed to src/MongoDB/Exception/InvalidArgumentException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(InvalidArgumentException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "InvalidArgumentException", php_phongo_invalidargumentexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "InvalidArgumentException", php_phongo_invalidargumentexception_me);
6464
php_phongo_invalidargumentexception_ce = zend_register_internal_class_ex(&ce, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
6565
zend_class_implements(php_phongo_invalidargumentexception_ce TSRMLS_CC, 1, php_phongo_exception_ce);
6666

src/MongoDB/RuntimeException.c renamed to src/MongoDB/Exception/RuntimeException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(RuntimeException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "RuntimeException", php_phongo_runtimeexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "RuntimeException", php_phongo_runtimeexception_me);
6464
php_phongo_runtimeexception_ce = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException, NULL TSRMLS_CC);
6565
zend_class_implements(php_phongo_runtimeexception_ce TSRMLS_CC, 1, php_phongo_exception_ce);
6666

src/MongoDB/SSLConnectionException.c renamed to src/MongoDB/Exception/SSLConnectionException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(SSLConnectionException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "SSLConnectionException", php_phongo_sslconnectionexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "SSLConnectionException", php_phongo_sslconnectionexception_me);
6464
php_phongo_sslconnectionexception_ce = zend_register_internal_class_ex(&ce, php_phongo_connectionexception_ce, NULL TSRMLS_CC);
6565
PHONGO_CE_INIT(php_phongo_sslconnectionexception_ce);
6666

src/MongoDB/UnexpectedValueException.c renamed to src/MongoDB/Exception/UnexpectedValueException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(UnexpectedValueException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "UnexpectedValueException", php_phongo_unexpectedvalueexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "UnexpectedValueException", php_phongo_unexpectedvalueexception_me);
6464
php_phongo_unexpectedvalueexception_ce = zend_register_internal_class_ex(&ce, spl_ce_UnexpectedValueException, NULL TSRMLS_CC);
6565
zend_class_implements(php_phongo_unexpectedvalueexception_ce TSRMLS_CC, 1, php_phongo_exception_ce);
6666

src/MongoDB/WriteConcernException.c renamed to src/MongoDB/Exception/WriteConcernException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PHP_MINIT_FUNCTION(WriteConcernException)
6060
zend_class_entry ce;
6161
(void)type;(void)module_number;
6262

63-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "WriteConcernException", php_phongo_writeconcernexception_me);
63+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "WriteConcernException", php_phongo_writeconcernexception_me);
6464
php_phongo_writeconcernexception_ce = zend_register_internal_class_ex(&ce, php_phongo_writeexception_ce, NULL TSRMLS_CC);
6565

6666
return SUCCESS;

src/MongoDB/WriteException.c renamed to src/MongoDB/Exception/WriteException.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ PHP_MINIT_FUNCTION(WriteException)
8787
zend_class_entry ce;
8888
(void)type;(void)module_number;
8989

90-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "WriteException", php_phongo_writeexception_me);
90+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "WriteException", php_phongo_writeexception_me);
9191
php_phongo_writeexception_ce = zend_register_internal_class_ex(&ce, php_phongo_runtimeexception_ce, NULL TSRMLS_CC);
9292

9393
zend_declare_property_null(php_phongo_writeexception_ce, ZEND_STRL("writeResult"), ZEND_ACC_PROTECTED TSRMLS_CC);

tests/bson/bson-binary-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ foreach($types as $type) {
2626
throws(function() {
2727
$b = new BSON\Binary("random binary data without type");
2828
echo "FAIL: Constructed BSON\Binary without type!\n";
29-
}, "InvalidArgumentException");
29+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
3030

3131

3232

@@ -52,7 +52,7 @@ bool(true)
5252
bool(true)
5353
bool(true)
5454
bool(true)
55-
OK: Got InvalidArgumentException
55+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
5656
Test#0 { "binary" : { "$type" : "00", "$binary" : "cmFuZG9tIGJpbmFyeSBkYXRh" } }
5757
string(73) "{ "binary" : { "$type" : "00", "$binary" : "cmFuZG9tIGJpbmFyeSBkYXRh" } }"
5858
string(73) "{ "binary" : { "$type" : "00", "$binary" : "cmFuZG9tIGJpbmFyeSBkYXRh" } }"

tests/bson/bson-javascript-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $tests = array(
1515

1616
throws(function() {
1717
$j = new BSON\Javascript;
18-
}, "InvalidArgumentException");
18+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
1919

2020
foreach($tests as $n => $test) {
2121
echo "Test#{$n}", "\n";
@@ -29,7 +29,7 @@ foreach($tests as $n => $test) {
2929
===DONE===
3030
<?php exit(0); ?>
3131
--EXPECTF--
32-
OK: Got InvalidArgumentException
32+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
3333
Test#0
3434
bool(true)
3535
bool(true)

tests/bson/bson-objectid-001.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ foreach($tests as $n => $test) {
4242

4343
throws(function() {
4444
$id = new BSON\ObjectID("53e28b650640fd3162152de12");
45-
}, "InvalidArgumentException");
45+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
4646
throws(function() {
4747
$id = new BSON\ObjectID("53e28b650640fd3162152dg1");
48-
}, "InvalidArgumentException");
48+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
4949
throws(function() {
5050
$id = new BSON\ObjectID("-3e28b650640fd3162152da1");
51-
}, "InvalidArgumentException");
51+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
5252
throws(function() {
5353
$id = new BSON\ObjectID(" 3e28b650640fd3162152da1");
54-
}, "InvalidArgumentException");
54+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
5555
throws(function() {
5656
$id = new BSON\ObjectID(new stdclass);
57-
}, "InvalidArgumentException");
57+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
5858

5959

6060

@@ -85,10 +85,10 @@ Test#4 { "pregenerated" : { "$oid" : "53e28b650640fd3162152de1" } }
8585
string(60) "{ "pregenerated" : { "$oid" : "53e28b650640fd3162152de1" } }"
8686
string(60) "{ "pregenerated" : { "$oid" : "53e28b650640fd3162152de1" } }"
8787
bool(true)
88-
OK: Got InvalidArgumentException
89-
OK: Got InvalidArgumentException
90-
OK: Got InvalidArgumentException
91-
OK: Got InvalidArgumentException
92-
OK: Got InvalidArgumentException
88+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
89+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
90+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
91+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
92+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
9393
OK: Got E_WARNING
9494
===DONE===

tests/bson/bson-regex-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $tests = array(
1717

1818
throws(function() {
1919
$regexp = new BSON\Regex;
20-
}, "InvalidArgumentException");
20+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
2121

2222

2323
foreach($tests as $n => $test) {
@@ -38,7 +38,7 @@ $regexp->getFlags(true);
3838
Pattern: regexp
3939
Flags: i
4040
String representation: /regexp/i
41-
OK: Got InvalidArgumentException
41+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
4242
Test#0 { "regex" : { "$regex" : "regexp", "$options" : "i" } }
4343
string(55) "{ "regex" : { "$regex" : "regexp", "$options" : "i" } }"
4444
string(55) "{ "regex" : { "$regex" : "regexp", "$options" : "i" } }"

tests/bson/bson-timestamp-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $tests = array(
1313

1414
throws(function() {
1515
$s = new BSON\Timestamp;
16-
}, "InvalidArgumentException");
16+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
1717

1818
$s = new BSON\Timestamp(1234, 5678);
1919
echo $s, "\n";
@@ -30,7 +30,7 @@ foreach($tests as $n => $test) {
3030
===DONE===
3131
<?php exit(0); ?>
3232
--EXPECTF--
33-
OK: Got InvalidArgumentException
33+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
3434
[1234:5678]
3535
Test#0 { "timestamp" : { "$timestamp" : { "t" : 5678, "i" : 1234 } } }
3636
string(63) "{ "timestamp" : { "$timestamp" : { "t" : 5678, "i" : 1234 } } }"

tests/bson/bson-unknown-001.phpt

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,23 @@ BSON Serializing a PHP resource should throw exception
66
<?php
77
require_once __DIR__ . "/../utils/basic.inc";
88

9-
try {
9+
throws(function() {
1010
$a = array("stderr" => STDERR);
1111

1212
$b = BSON\fromArray($a);
13-
} catch(MongoDB\Driver\UnexpectedValueException $e) {
14-
echo $e->getMessage(), "\n";
15-
}
16-
var_dump($a);
13+
}, "MongoDB\Driver\Exception\UnexpectedValueException");
1714

18-
try {
15+
throws(function() {
1916
$a = array("stderr" => STDERR, "stdout" => STDOUT);
2017

2118
$b = BSON\fromArray($a);
22-
} catch(MongoDB\Driver\UnexpectedValueException $e) {
23-
echo $e->getMessage(), "\n";
24-
}
25-
var_dump($a);
19+
}, "MongoDB\Driver\Exception\UnexpectedValueException");
2620

2721

2822
?>
2923
===DONE===
3024
<?php exit(0); ?>
3125
--EXPECTF--
32-
Got unsupported type 'resource'
33-
array(1) {
34-
["stderr"]=>
35-
resource(3) of type (stream)
36-
}
37-
Got unsupported type 'resource'
38-
array(2) {
39-
["stderr"]=>
40-
resource(3) of type (stream)
41-
["stdout"]=>
42-
resource(2) of type (stream)
43-
}
26+
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
27+
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
4428
===DONE===

tests/bson/bson-utcdatetime-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ echo $utcdatetime, "\n";
2424

2525
throws(function() {
2626
$d = new BSON\UTCDatetime;
27-
}, "InvalidArgumentException");
27+
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
2828

2929
$tests = array(
3030
array($utcdatetime),
@@ -46,7 +46,7 @@ foreach($tests as $n => $test) {
4646
--EXPECTF--
4747
string(31) "Thu, 20 Nov 2014 01:03:31 +0000"
4848
1416445411987
49-
OK: Got InvalidArgumentException
49+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
5050
Test#0 { "0" : { "$date" : 1416445411987 } }
5151
string(37) "{ "0" : { "$date" : 1416445411987 } }"
5252
string(37) "{ "0" : { "$date" : 1416445411987 } }"

tests/connect/standalone-auth-0002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ $bulk = new MongoDB\Driver\BulkWrite;
2020
$bulk->insert(array("my" => "value"));
2121
throws(function() use($manager, $bulk) {
2222
$retval = $manager->executeBulkWrite(NS, $bulk);
23-
}, "MongoDB\Driver\AuthenticationException");
23+
}, "MongoDB\Driver\Exception\AuthenticationException");
2424

2525
?>
2626
===DONE===
2727
<?php exit(0); ?>
2828
--EXPECT--
29-
OK: Got MongoDB\Driver\AuthenticationException
29+
OK: Got MongoDB\Driver\Exception\AuthenticationException
3030
===DONE===

tests/connect/standalone-plain-0002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $bulk = new MongoDB\Driver\BulkWrite();
3939
$bulk->insert(array("very" => "important"));
4040
throws(function() use($manager, $bulk) {
4141
$manager->executeBulkWrite(NS, $bulk);
42-
}, "MongoDB\Driver\AuthenticationException");
42+
}, "MongoDB\Driver\Exception\AuthenticationException");
4343

4444
$cmd = array(
4545
"dropUser" => "bugs",
@@ -56,6 +56,6 @@ try {
5656
<?php exit(0); ?>
5757
--EXPECT--
5858
User Created
59-
OK: Got MongoDB\Driver\AuthenticationException
59+
OK: Got MongoDB\Driver\Exception\AuthenticationException
6060
User deleted
6161
===DONE===

tests/connect/standalone-ssl-0002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ echo throws(function() use($manager) {
5050
$bulk = new MongoDB\Driver\BulkWrite;
5151
$bulk->insert(array("my" => "value"));
5252
$retval = $manager->executeBulkWrite(NS, $bulk);
53-
}, "MongoDB\\Driver\\SSLConnectionException", "executeBulkWrite"), "\n";
53+
}, "MongoDB\\Driver\\Exception\\SSLConnectionException", "executeBulkWrite"), "\n";
5454

5555

5656
echo "Changing to server\n";
@@ -70,7 +70,7 @@ printf("Certificate valid (not expired): %s\n", isValid($cert) ? "OK" : "NO");
7070
===DONE===
7171
<?php exit(0); ?>
7272
--EXPECTF--
73-
OK: Got MongoDB\Driver\SSLConnectionException thrown from executeBulkWrite
73+
OK: Got MongoDB\Driver\Exception\SSLConnectionException thrown from executeBulkWrite
7474
%s
7575
Changing to server
7676
Inserted: 1

0 commit comments

Comments
 (0)