Mockery\Expectation::times PHP Method

times() public method

Indicates the number of times this expectation should occur
public times ( integer $limit = null ) : self
$limit integer
return self
    public function times($limit = null)
    {
        if (is_null($limit)) {
            return $this;
        }
        if (!is_int($limit)) {
            throw new \InvalidArgumentException('The passed Times limit should be an integer value');
        }
        $this->_countValidators[] = new $this->_countValidatorClass($this, $limit);
        $this->_countValidatorClass = 'Mockery\\CountValidator\\Exact';
        return $this;
    }

Usage Example

 /**
  * @return $this
  */
 public function times($limit = null)
 {
     $this->expectation->times($limit);
     return $this;
 }