| @@ 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". |
|
| @@ 78-92 (lines=15) @@ | ||
| 75 | count($calls), |
|
| 76 | $this->util->stringifyCalls($calls) |
|
| 77 | ); |
|
| 78 | } elseif (count($methodCalls)) { |
|
| 79 | $message = sprintf( |
|
| 80 | "Expected exactly %d calls that match:\n". |
|
| 81 | " %s->%s(%s)\n". |
|
| 82 | "but none were made.\n". |
|
| 83 | "Recorded `%s(...)` calls:\n%s", |
|
| 84 | ||
| 85 | $this->times, |
|
| 86 | get_class($object->reveal()), |
|
| 87 | $method->getMethodName(), |
|
| 88 | $method->getArgumentsWildcard(), |
|
| 89 | $method->getMethodName(), |
|
| 90 | $this->util->stringifyCalls($methodCalls) |
|
| 91 | ); |
|
| 92 | } else { |
|
| 93 | $message = sprintf( |
|
| 94 | "Expected exactly %d calls that match:\n". |
|
| 95 | " %s->%s(%s)\n". |
|