function test_returnJustGeneratedClassWithInputParameter_at()
 {
     $rvm = new ReturnValuesManager('test_3');
     $rvm->setInputParameterForMethod('prova_metodo', array('ciao', 'faccia', 1, 2, 3, 5), 2)->setInputParameterForMethod('prova_metodo', array(6, 7, 8), 3);
     FakeObjectGenerator::generate($rvm, new CodeGenerator(dirname(__FILE__) . '/list.php'));
     $classe = "class test_3{\n//timing\n     private static \$times = array();\n//Costants\n//Magic methods\n    public function __call(\$name, \$arguments) {\n        return null;\n    }\n    public function __callStatic(\$name, \$arguments) {\n        return null;\n    }\n//Methods\n    function prova_metodo(){\n        if(isset(self::\$times['prova_metodo'])){\n            self::\$times['prova_metodo']++;\n        }\n        else{\n            self::\$times['prova_metodo'] = 1;\n        }\nswitch (self::\$times['prova_metodo']){\n        case 2:\n        \$input = array('0'=>'ciao','1'=>'faccia','2'=>1,'3'=>2,'4'=>3,'5'=>5);\n        \$args = func_get_args();\n        \$index = 0;\n        foreach (\$args as \$arg)\n        {\n          if(is_object(\$arg))\n          {\n            \$args[\$index] = 'class:'.get_class(\$arg);\n          }\n          \$index++;\n        }\n        \$diff = array_diff(\$input,\$args);\n        if(!empty(\$diff)){ throw new Exception(\"Invalid input parameters. [method prova_metodo] [input \".\$args.\"] [case 2]\");}\n        return null;\n        break;\n        case 3:\n        \$input = array('0'=>6,'1'=>7,'2'=>8);\n        \$args = func_get_args();\n        \$index = 0;\n        foreach (\$args as \$arg)\n        {\n          if(is_object(\$arg))\n          {\n            \$args[\$index] = 'class:'.get_class(\$arg);\n          }\n          \$index++;\n        }\n        \$diff = array_diff(\$input,\$args);\n        if(!empty(\$diff)){ throw new Exception(\"Invalid input parameters. [method prova_metodo] [input \".\$args.\"] [case 3]\");}\n        return null;\n        break;\n        default: return null;\n        }\n    }\n}";
     $this->assertEqual($classe, FakeObjectGenerator::returnedCode());
     $oggetto = new test_3();
     $this->assertNull($oggetto->prova_metodo('ciao'));
     $this->assertNull($oggetto->prova_metodo('ciao', 'faccia', 1, 2, 3, 5));
     $this->expectException('Exception');
     $oggetto->prova_metodo('porca');
 }
 function test_returnJustGeneratedClass_return_objects_array_one_level_deep()
 {
     $rvm = new ReturnValuesManager('test_3');
     $rvm1 = new ReturnValuesManager('test_4');
     $rvm2 = new ReturnValuesManager('test_5');
     $rvm->setReturnObjectsArray('prova_metodo', array($rvm1, $rvm2));
     FakeObjectGenerator::generate($rvm, new CodeGenerator(dirname(__FILE__) . '/list.php'));
     //echo FakeObjectGenerator::returnedCode();
     $classe = "class test_3{\n//timing\n     private static \$times = array();\n//Costants\n//Magic methods\n    public function __call(\$name, \$arguments) {\n        return null;\n    }\n    public function __callStatic(\$name, \$arguments) {\n        return null;\n    }\n//Methods\n    function prova_metodo(){\n        if(isset(self::\$times['prova_metodo'])){\n            self::\$times['prova_metodo']++;\n        }\n        else{\n            self::\$times['prova_metodo'] = 1;\n        }\n        \$rvm_test_4 = new ReturnValuesManager('test_4');\n        if(self::\$times['prova_metodo'] == 1){\n        FakeObjectGenerator::generate(\$rvm_test_4, new CodeGenerator('" . dirname(__FILE__) . "/list.php'));\n        }\n        \$mocktest_4 = new test_4();\n        \$rvm_test_5 = new ReturnValuesManager('test_5');\n        if(self::\$times['prova_metodo'] == 1){\n        FakeObjectGenerator::generate(\$rvm_test_5, new CodeGenerator('" . dirname(__FILE__) . "/list.php'));\n        }\n        \$mocktest_5 = new test_5();\n        return array(\$mocktest_4,\$mocktest_5);\n    }\n}";
     $this->assertEqual($classe, FakeObjectGenerator::returnedCode());
     $oggetto = new test_3();
     $this->assertTrue(is_array($oggetto->prova_metodo()));
     $array = $oggetto->prova_metodo();
     $this->assertIsA($array[0], test_4);
     $this->assertIsA($array[1], test_5);
 }