Skip to content

Commit b9b9b39

Browse files
committed
Merge pull request #111
2 parents cf368d1 + 6d19a24 commit b9b9b39

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ PHONGO_API void zval_to_bson(zval *data, php_phongo_bson_flags_t flags, bson_t *
807807

808808
break;
809809
} else if (instanceof_function(Z_OBJCE_P(data), php_phongo_type_ce TSRMLS_CC)) {
810-
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC, "%s cannot be serialized as a root element", Z_OBJCE_P(data)->name);
810+
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC, "%s instance %s cannot be serialized as a root element", php_phongo_type_ce->name, Z_OBJCE_P(data)->name);
811811

812812
break;
813813
}

tests/bson/bson-fromPHP_error-003.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ foreach ($tests as $document) {
3434
<?php exit(0); ?>
3535
--EXPECTF--
3636
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
37-
UnknownType cannot be serialized as a root element
37+
%S\BSON\Type instance UnknownType cannot be serialized as a root element
3838
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
39-
%S\BSON\Binary cannot be serialized as a root element
39+
%S\BSON\Type instance %S\BSON\Binary cannot be serialized as a root element
4040
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
41-
%S\BSON\Javascript cannot be serialized as a root element
41+
%S\BSON\Type instance %S\BSON\Javascript cannot be serialized as a root element
4242
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
43-
%S\BSON\MinKey cannot be serialized as a root element
43+
%S\BSON\Type instance %S\BSON\MinKey cannot be serialized as a root element
4444
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
45-
%S\BSON\MaxKey cannot be serialized as a root element
45+
%S\BSON\Type instance %S\BSON\MaxKey cannot be serialized as a root element
4646
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
47-
%S\BSON\ObjectID cannot be serialized as a root element
47+
%S\BSON\Type instance %S\BSON\ObjectID cannot be serialized as a root element
4848
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
49-
%S\BSON\Regex cannot be serialized as a root element
49+
%S\BSON\Type instance %S\BSON\Regex cannot be serialized as a root element
5050
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
51-
%S\BSON\Timestamp cannot be serialized as a root element
51+
%S\BSON\Type instance %S\BSON\Timestamp cannot be serialized as a root element
5252
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
53-
%S\BSON\UTCDateTime cannot be serialized as a root element
53+
%S\BSON\Type instance %S\BSON\UTCDateTime cannot be serialized as a root element
5454
===DONE===

0 commit comments

Comments
 (0)