Skip to content

Commit 47d5fe8

Browse files
committed
Update "type" in ServerDescription and tests
1 parent e4e7974 commit 47d5fe8

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/MongoDB/ServerDescription.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ HashTable* php_phongo_serverdescription_get_properties_hash(phongo_compat_object
202202
ZVAL_LONG(&port, host_list->port);
203203
zend_hash_str_update(props, "port", sizeof("port") - 1, &port);
204204

205-
ZVAL_LONG(&type, php_phongo_server_description_type(intern->server_description));
205+
ZVAL_STRING(&type, mongoc_server_description_type(intern->server_description));
206206
zend_hash_str_update(props, "type", sizeof("type") - 1, &type);
207207
}
208208

tests/server/server-getServerDescription-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object(MongoDB\Driver\ServerDescription)#%d (%d) {
2121
["port"]=>
2222
int(%d)
2323
["type"]=>
24-
int(%d)
24+
string(%d) "%r(Standalone|Mongos|RSPrimary)%r"
2525
["hello_response"]=>
2626
array(%d) {
2727
%a

tests/serverDescription/serverDescription-debug-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object(MongoDB\Driver\ServerDescription)#%d (%d) {
2222
["port"]=>
2323
int(%d)
2424
["type"]=>
25-
int(%d)
25+
string(%d) "%r(Standalone|Mongos|RSPrimary)%r"
2626
["hello_response"]=>
2727
array(%d) {
2828
%a

tests/serverDescription/serverDescription-getType-001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ $manager = create_test_manager();
1717
$server = $manager->selectServer(new MongoDB\Driver\ReadPreference('primary'));
1818
$type = $server->getServerDescription()->getType();
1919

20-
var_dump(in_array($type, $expected_types));
20+
var_dump($type);
2121

2222
?>
2323
===DONE===
2424
<?php exit(0); ?>
25-
--EXPECT--
26-
bool(true)
25+
--EXPECTF--
26+
string(%d) "%r(Standalone|Mongos|RSPrimary)%r"
2727
===DONE===

tests/serverDescription/serverDescription-var_export-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo var_export($server->getServerDescription(), true), "\n";
2020
MongoDB\Driver\ServerDescription::__set_state(array(
2121
'host' => '%s',
2222
'port' => %d,
23-
'type' => %d,
23+
'type' => '%r(Standalone|Mongos|RSPrimary)%r',
2424
'hello_response' =>
2525
array (
2626
%a

0 commit comments

Comments
 (0)