/** * @param array $rule * @param int $actualTimes * @param string $method * @return null */ protected function validateSingleWith(array $rule, $actualTimes, $method) { if ($rule['times'] == $actualTimes) { return null; } $args = $this->renderArguments($rule['with']); $converter = new NumberToTimesConverter(); $msg = sprintf("Expected {$method}(%s) to be called %s, but it was called %s.%s", $args, $converter->convert($rule['times']), $converter->convert($actualTimes), $this->didReceive()); throw new \PHPUnit_Framework_AssertionFailedError($msg); }
public function testAnyOtherNumberIsPluralized() { $this->assert($this->converter->convert(123))->equals('123 times'); }