Files
mongo-php-driver/tests/serverDescription/serverDescription-constants.phpt
Jeremy Mikola 10b3a1fe70 PHPC-1150: SDAM Monitoring (#1289)
* PHPC-1805: Implement ServerDescription class

* PHPC-1910: Implement Server::getServerDescription()

* PHPC-1934: Check for uninitialized intern in ServerDescription get_properties_hash

* PHPC-1925: Change ServerDescription::getType() to return a string

* PHPC-1891: Implement TopologyDescription class

* PHPC-1892: Implement SDAMSubscriber interface

* PHPC-1893: Implement SDAM event classes

* Revise server and topology event classes and tests

Use phongo_objectid_init in getTopologyId() methods. Report topologyId as an ObjectId in debug info. Report TopologyDescription servers as ServerDescription in debug info.

Copy parameters in phongo_serverdescription_init and phongo_topologydescription_init for consistency with other functions (e.g. phongo_readconcern_init). This also creates phongo_serverdescription_init_ex for when we want to skip copying in Server::getServerDescription().

* PHPC-1953: Add tests for debug handlers

* PHPC-1959: Utilize Manager::addSubscriber() in tests

Skip TopologyClosedEvent test (pending PHPC-2023)

* PHPC-1958: Assert same topologyId for SDAM events

* PHPC-2025: Support load balancer in ServerDescription and TopologyDescription

* PHPC-2026: Handle 64-bit lastUpdateTime for 32-bit platforms

Co-authored-by: Tanli Su <46271307+tanlisu@users.noreply.github.com>
Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Tanli Su <tanli.su@gmail.com>
2022-01-10 13:14:10 -05:00

32 lines
960 B
PHP

--TEST--
MongoDB\Driver\ServerDescription constants
--FILE--
<?php
var_dump(MongoDB\Driver\ServerDescription::TYPE_UNKNOWN);
var_dump(MongoDB\Driver\ServerDescription::TYPE_STANDALONE);
var_dump(MongoDB\Driver\ServerDescription::TYPE_MONGOS);
var_dump(MongoDB\Driver\ServerDescription::TYPE_POSSIBLE_PRIMARY);
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_PRIMARY);
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_SECONDARY);
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_ARBITER);
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_OTHER);
var_dump(MongoDB\Driver\ServerDescription::TYPE_RS_GHOST);
var_dump(MongoDB\Driver\ServerDescription::TYPE_LOAD_BALANCER);
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
string(7) "Unknown"
string(10) "Standalone"
string(6) "Mongos"
string(15) "PossiblePrimary"
string(9) "RSPrimary"
string(11) "RSSecondary"
string(9) "RSArbiter"
string(7) "RSOther"
string(7) "RSGhost"
string(12) "LoadBalancer"
===DONE===