} $view->results = $results; } } // end GeneralForm; try { $tpl = new Opt_Class(); $opf = new Opf_Class($tpl); $tpl->sourceDir = './templates/'; $tpl->compileDir = './templates_c/'; $tpl->compileMode = Opt_Class::CM_REBUILD; $tpl->stripWhitespaces = false; $tpl->gzipCompression = false; $tpl->register(Opt_Class::PHP_FUNCTION, 'dump', 'var_dump'); $tpl->setup(); $translate = new Opc_Translate(new Opc_Translate_Adapter_Ini(array('directory' => './lang/'))); $translate->setLanguage('en'); $opf->setTranslationInterface($translate); $view = new Opt_View('situation_5.tpl'); $view->devFile = 'situation_5.php'; $form = new GeneralForm('form5'); $form->setView($view); $form->execute(); $output = new Opt_Output_Http(); $output->render($view); } catch (Exception $e) { var_dump($e); } catch (Opl_Exception $exception) { $handler = new Opl_ErrorHandler(); $handler->display($exception); }
/** * getGroupAdapter should return the default adapter for the undefined group. * * @covers Opc_Translate::getGroupAdapter */ public function testGroupAdapterSetterDefault() { $translate = new Opc_Translate($obj1 = $this->getMock('Opc_Translate_Adapter')); $translate->setGroupAdapter('foo', $obj2 = $this->getMock('Opc_Translate_Adapter')); $this->assertSame($obj1, $translate->getGroupAdapter('bar')); }