| @@ 61-74 (lines=14) @@ | ||
| 58 | new ArgumentsWildcard(array(new AnyValuesToken)) |
|
| 59 | ); |
|
| 60 | ||
| 61 | if (count($methodCalls)) { |
|
| 62 | throw new NoCallsException(sprintf( |
|
| 63 | "No calls have been made that match:\n". |
|
| 64 | " %s->%s(%s)\n". |
|
| 65 | "but expected at least one.\n". |
|
| 66 | "Recorded `%s(...)` calls:\n%s", |
|
| 67 | ||
| 68 | get_class($object->reveal()), |
|
| 69 | $method->getMethodName(), |
|
| 70 | $method->getArgumentsWildcard(), |
|
| 71 | $method->getMethodName(), |
|
| 72 | $this->util->stringifyCalls($methodCalls) |
|
| 73 | ), $method); |
|
| 74 | } |
|
| 75 | ||
| 76 | throw new NoCallsException(sprintf( |
|
| 77 | "No calls have been made that match:\n". |
|
| @@ 87-101 (lines=15) @@ | ||
| 84 | count($calls), |
|
| 85 | $this->util->stringifyCalls($calls) |
|
| 86 | ); |
|
| 87 | } elseif (count($methodCalls)) { |
|
| 88 | $message = sprintf( |
|
| 89 | "Expected exactly %d calls that match:\n". |
|
| 90 | " %s->%s(%s)\n". |
|
| 91 | "but none were made.\n". |
|
| 92 | "Recorded `%s(...)` calls:\n%s", |
|
| 93 | ||
| 94 | $this->times, |
|
| 95 | get_class($object->reveal()), |
|
| 96 | $method->getMethodName(), |
|
| 97 | $method->getArgumentsWildcard(), |
|
| 98 | $method->getMethodName(), |
|
| 99 | $this->util->stringifyCalls($methodCalls) |
|
| 100 | ); |
|
| 101 | } else { |
|
| 102 | $message = sprintf( |
|
| 103 | "Expected exactly %d calls that match:\n". |
|
| 104 | " %s->%s(%s)\n". |
|