Skip to content

Commit ffb563a

Browse files
authored
Merge branch 'master' into master
2 parents b8df243 + 7a13a26 commit ffb563a

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/AspectMock/Proxy/Verifier.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public function verifyInvokedMultipleTimes($name, $times, $params = null)
114114
if (is_array($params)) {
115115
$equals = 0;
116116
foreach ($calls as $args) {
117-
if ($this->onlyExpectedArguments($params, $args) == $params) $equals++;
117+
if ($this->onlyExpectedArguments($params, $args) === $params) {
118+
$equals++;
119+
}
118120
}
119121
if ($equals == $times) return;
120122
$params = ArgumentsFormatter::toString($params);
@@ -149,14 +151,21 @@ public function verifyNeverInvoked($name, $params = null)
149151
$calls = $this->getCallsForMethod($name);
150152
$separator = $this->callSyntax($name);
151153

152-
if (is_array($params)) {
153-
if (empty($calls)) return;
154-
foreach ($calls as $args) {
155-
if ($this->onlyExpectedArguments($params, $args) == $params) throw new fail(sprintf($this->neverInvoked, $this->className));
156-
}
157-
return;
158-
}
159-
if (count($calls)) throw new fail(sprintf($this->neverInvoked, $this->className.$separator.$name));
154+
if (is_array($params)) {
155+
if (empty($calls)) {
156+
return;
157+
}
158+
159+
foreach ($calls as $args) {
160+
if ($this->onlyExpectedArguments($params, $args) === $params) {
161+
throw new fail(sprintf($this->neverInvoked, $this->className));
162+
}
163+
}
164+
return;
165+
}
166+
if (count($calls)) {
167+
throw new fail(sprintf($this->neverInvoked, $this->className.$separator.$name));
168+
}
160169
}
161170

162171
}

0 commit comments

Comments
 (0)