Example #1
0
 /**
  * @covers Opf_Class::setTranslationInterface
  * @covers Opf_Class::getTranslationInterface
  */
 public function testSettingTranslationInterface()
 {
     Opl_Registry::register('opt', $this->_optMock);
     $opf = new Opf_Class();
     $this->assertEquals(null, $opf->getTranslationInterface());
     $opf->setTranslationInterface($mock = $this->getMock('Opl_Translation_Interface'));
     $this->assertSame($mock, $opf->getTranslationInterface());
     $opf->setTranslationInterface(null);
     $this->assertEquals(null, $opf->getTranslationInterface());
 }
Example #2
0
        }
        $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);
}