Skip to content

Commit dee9ff9

Browse files
committed
PHPC-450: Don't assert exact isMaster response when dumping Servers
Since isMaster's response varies by server version, we can omit it from expected Server dump output.
1 parent b54a8bf commit dee9ff9

File tree

1 file changed

+6
-148
lines changed

1 file changed

+6
-148
lines changed

tests/replicaset/manager-getservers-001.phpt

Lines changed: 6 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ $bulk = new \MongoDB\Driver\BulkWrite();
1414
$bulk->insert($doc);
1515
$wresult = $manager->executeBulkWrite(NS, $bulk);
1616

17-
1817
var_dump($manager->getServers());
1918
$servers = $manager->getServers();
2019

@@ -52,60 +51,8 @@ array(3) {
5251
string(3) "one"
5352
}
5453
["last_is_master"]=>
55-
array(17) {
56-
["setName"]=>
57-
string(10) "REPLICASET"
58-
["setVersion"]=>
59-
int(1)
60-
["ismaster"]=>
61-
bool(true)
62-
["secondary"]=>
63-
bool(false)
64-
["hosts"]=>
65-
array(2) {
66-
[0]=>
67-
string(19) "192.168.112.10:3000"
68-
[1]=>
69-
string(19) "192.168.112.10:3001"
70-
}
71-
["arbiters"]=>
72-
array(1) {
73-
[0]=>
74-
string(19) "192.168.112.10:3002"
75-
}
76-
["primary"]=>
77-
string(19) "192.168.112.10:3000"
78-
["tags"]=>
79-
array(%d) {
80-
["dc"]=>
81-
string(2) "pa"
82-
["ordinal"]=>
83-
string(3) "one"
84-
}
85-
["me"]=>
86-
string(19) "192.168.112.10:3000"
87-
["electionId"]=>
88-
object(%s\ObjectID)#%d (1) {
89-
["oid"]=>
90-
string(24) "%s"
91-
}
92-
["maxBsonObjectSize"]=>
93-
int(16777216)
94-
["maxMessageSizeBytes"]=>
95-
int(48000000)
96-
["maxWriteBatchSize"]=>
97-
int(1000)
98-
["localTime"]=>
99-
object(%s\UTCDateTime)#%d (%d) {
100-
["milliseconds"]=>
101-
int(%d)
102-
}
103-
["maxWireVersion"]=>
104-
int(3)
105-
["minWireVersion"]=>
106-
int(0)
107-
["ok"]=>
108-
float(1)
54+
array(%d) {
55+
%a
10956
}
11057
["round_trip_time"]=>
11158
int(%d)
@@ -136,55 +83,8 @@ array(3) {
13683
string(3) "two"
13784
}
13885
["last_is_master"]=>
139-
array(16) {
140-
["setName"]=>
141-
string(10) "REPLICASET"
142-
["setVersion"]=>
143-
int(1)
144-
["ismaster"]=>
145-
bool(false)
146-
["secondary"]=>
147-
bool(true)
148-
["hosts"]=>
149-
array(2) {
150-
[0]=>
151-
string(19) "192.168.112.10:3000"
152-
[1]=>
153-
string(19) "192.168.112.10:3001"
154-
}
155-
["arbiters"]=>
156-
array(1) {
157-
[0]=>
158-
string(19) "192.168.112.10:3002"
159-
}
160-
["primary"]=>
161-
string(19) "192.168.112.10:3000"
162-
["tags"]=>
163-
array(%d) {
164-
["dc"]=>
165-
string(3) "nyc"
166-
["ordinal"]=>
167-
string(3) "two"
168-
}
169-
["me"]=>
170-
string(19) "192.168.112.10:3001"
171-
["maxBsonObjectSize"]=>
172-
int(16777216)
173-
["maxMessageSizeBytes"]=>
174-
int(48000000)
175-
["maxWriteBatchSize"]=>
176-
int(1000)
177-
["localTime"]=>
178-
object(%s\UTCDateTime)#%d (%d) {
179-
["milliseconds"]=>
180-
int(%d)
181-
}
182-
["maxWireVersion"]=>
183-
int(3)
184-
["minWireVersion"]=>
185-
int(0)
186-
["ok"]=>
187-
float(1)
86+
array(%d) {
87+
%a
18888
}
18989
["round_trip_time"]=>
19090
int(%d)
@@ -208,50 +108,8 @@ array(3) {
208108
["is_passive"]=>
209109
bool(false)
210110
["last_is_master"]=>
211-
array(16) {
212-
["setName"]=>
213-
string(10) "REPLICASET"
214-
["setVersion"]=>
215-
int(1)
216-
["ismaster"]=>
217-
bool(false)
218-
["secondary"]=>
219-
bool(false)
220-
["hosts"]=>
221-
array(2) {
222-
[0]=>
223-
string(19) "192.168.112.10:3000"
224-
[1]=>
225-
string(19) "192.168.112.10:3001"
226-
}
227-
["arbiters"]=>
228-
array(1) {
229-
[0]=>
230-
string(19) "192.168.112.10:3002"
231-
}
232-
["primary"]=>
233-
string(19) "192.168.112.10:3000"
234-
["arbiterOnly"]=>
235-
bool(true)
236-
["me"]=>
237-
string(19) "192.168.112.10:3002"
238-
["maxBsonObjectSize"]=>
239-
int(16777216)
240-
["maxMessageSizeBytes"]=>
241-
int(48000000)
242-
["maxWriteBatchSize"]=>
243-
int(1000)
244-
["localTime"]=>
245-
object(%s\UTCDateTime)#%d (%d) {
246-
["milliseconds"]=>
247-
int(%d)
248-
}
249-
["maxWireVersion"]=>
250-
int(3)
251-
["minWireVersion"]=>
252-
int(0)
253-
["ok"]=>
254-
float(1)
111+
array(%d) {
112+
%a
255113
}
256114
["round_trip_time"]=>
257115
int(%d)

0 commit comments

Comments
 (0)