function testGetMethodsSet_should_return_an_array_of_string_that_represent_the_names_of_set_methods()
 {
     $rvm = new ReturnValuesManager('foo');
     $rvm->setReturnValue('bar', 'foo');
     $rvm->setReturnValue('bar2', 'foo2');
     $this->assertEqual(array('bar', 'bar2'), $rvm->getMethodsSet());
 }
示例#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;
 }