Ejemplo n.º 1
0
 function testGetReturnValueArray_at()
 {
     $rvm = new ReturnValuesManager('foo');
     $rvm->setReturnValue('bar', 'bar1', 1)->setReturnValue('bar2', 1, 2);
     $this->assertEqual(array('bar' => array('1' => 'bar1'), 'bar2' => array('2' => 1)), $rvm->getReturnValueArray());
 }
Ejemplo n.º 2
0
 /**
  * Run throw all the methods looking for a method with a default value.
  * If it is found, this method acts as a proxy for the private method that generate the code.
  *
  * @param ReturnValuesManager $returnValuesManager
  * @return string
  */
 public function returnGenerateClassForDefault(ReturnValuesManager $returnValuesManager)
 {
     $code = "";
     foreach ($returnValuesManager->getMethodsSet() as $method) {
         $return_values = $returnValuesManager->getReturnValueArray();
         if (isset($return_values[$method]['default']) && $return_values[$method]['default'] instanceof ReturnValuesManager) {
             $code .= $this->getCodeForCreatingClassForDefault($return_values[$method]['default']);
         }
     }
     return $code;
 }