Skip to content

Commit e1c4b39

Browse files
committed
HHVM does not allow array_walk on ArrayObject instances
1 parent 8048167 commit e1c4b39

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/GridFS/SpecFunctionalTest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,19 @@ private function assertEquivalentCollections($expectedCollection, $actualCollect
9797
foreach ($mi as $documents) {
9898
list($expectedDocument, $actualDocument) = $documents;
9999

100-
array_walk($expectedDocument, function(&$value) use ($actualResult) {
101-
if ($value === '*result') {
102-
$value = $actualResult;
100+
foreach ($expectedDocument as $key => $value) {
101+
if ( ! is_string($value)) {
102+
continue;
103103
}
104-
});
105104

106-
array_walk($expectedDocument, function(&$value, $key) use ($actualDocument) {
107-
if ( ! is_string($value)) {
108-
return;
105+
if ($value === '*result') {
106+
$expectedDocument[$key] = $actualResult;
109107
}
110108

111109
if ( ! strncmp($value, '*actual_', 8)) {
112-
$value = $actualDocument[$key];
110+
$expectedDocument[$key] = $actualDocument[$key];
113111
}
114-
});
112+
}
115113

116114
$this->assertSameDocument($expectedDocument, $actualDocument);
117115
}

0 commit comments

Comments
 (0)