Ejemplo n.º 1
0
 /**
  * Initializes the getParameterCount() method of the given callable.
  *
  * @param \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode $mock
  * @param integer $parameterCount
  * @return \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode
  */
 private function initFunctionOrMethodMock($mock, $parameterCount)
 {
     $mock->expects($this->once())->method('getParameterCount')->will($this->returnValue($parameterCount));
     return $mock;
 }
Ejemplo n.º 2
0
 /**
  * Initializes the getMetric() method of the given function or method node.
  *
  * @param \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode $mock
  * @param string $metric
  * @param mixed $value
  * @return \PHPMD\Node\FunctionNode|\PHPMD\Node\MethodNode
  */
 protected function initFunctionOrMethod($mock, $metric, $value)
 {
     if ($metric === null) {
         return $mock;
     }
     $mock->expects($this->atLeastOnce())->method('getMetric')->with($this->equalTo($metric))->will($this->returnValue($value));
     return $mock;
 }