Mockery\Expectation::andReturnUsing PHP Метод

andReturnUsing() публичный Метод

Set a closure or sequence of closures with which to generate return values. The arguments passed to the expected method are passed to the closures as parameters.
public andReturnUsing ( ) : self
Результат self
    public function andReturnUsing()
    {
        $this->_closureQueue = func_get_args();
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * WordPress testing function used to avoid return expectations on action hooks.
  * Throws exception for WordPress filters and generic PHP function testing.
  *
  * @param  callable             $callback
  * @return \Mockery\Expectation
  */
 public function whenHappen(callable $callback)
 {
     if (!$this->isAddedHook && !$this->isAction) {
         throw new RuntimeException('whenHappen() can only be used for WordPress actions or added filters expectations.');
     }
     return $this->expectation->andReturnUsing($callback);
 }
All Usage Examples Of Mockery\Expectation::andReturnUsing