function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->conn = $this->toolkit->getDefaultDbConnection();
     $this->db = new lmbSimpleDb($this->conn);
     $this->db->delete('test_db_table');
 }
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->connection = lmbToolkit::instance()->getDefaultDbConnection();
     DriverPgsqlSetup($this->connection->getConnectionId());
     parent::setUp();
 }
 function setUp()
 {
     $toolkit = lmbToolkit::save();
     $this->conn = $toolkit->getDefaultDbConnection();
     $this->db_table_test = new lmbTableGateway('test_db_table', $this->conn);
     $this->_cleanUp();
 }
Esempio n. 4
0
 function setUp()
 {
     lmbToolkit::save();
     $this->toolkit = lmbToolkit::merge(new lmbLogTools());
     $_SERVER['REQUEST_URI'] = null;
     $_SERVER['REQUEST_METHOD'] = null;
 }
Esempio n. 5
0
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->compiled_dir = LIMB_VAR_DIR . '/compiled';
     $this->config = new lmbWactTemplateConfig($this->compiled_dir);
     $this->locator = new WactTestTemplateLocator($this->config);
     $this->initWactDictionaries($this->config);
 }
 function setUp()
 {
     $this->cache_dir = LIMB_VAR_DIR . '/fpcache/';
     lmbFs::rm($this->cache_dir);
     $this->filter2 = new MockInterceptingFilter();
     $this->user = new lmbFullPageCacheUser();
     $this->toolkit = lmbToolkit::save();
 }
 function setUp()
 {
     $toolkit = lmbToolkit::save();
     $this->conn = $toolkit->getDefaultDbConnection();
     $this->db = new lmbSimpleDb($this->conn);
     $this->db->delete('lmb_session');
     $this->driver = new lmbSessionDbStorage($this->conn);
 }
 function setUp()
 {
     $toolkit = lmbToolkit::save();
     $this->conn = new lmbAuditDbConnection($toolkit->getDefaultDbConnection());
     $toolkit->setDefaultDbConnection($this->conn);
     $this->db = new lmbSimpleDb($this->conn);
     $this->creator = new lmbARTestingObjectMother($this->conn);
     $this->_cleanUp();
 }
Esempio n. 9
0
 function setUp()
 {
     parent::setUp();
     $this->_toolkit = lmbToolkit::save();
     $this->_input_stream_parser = new MockInputStreamParser();
     $this->_toolkit->setInputStreamParser($this->_input_stream_parser);
     $_SERVER['REQUEST_METHOD'] = null;
     $_POST = array();
 }
Esempio n. 10
0
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->request = $this->toolkit->getRequest();
     $this->response = $this->toolkit->getResponse();
     $this->session = $this->toolkit->getSession();
     $this->session->reset();
     $this->connection = $this->toolkit->getDefaultDbConnection();
     $this->db = new lmbSimpleDb($this->connection);
 }
Esempio n. 11
0
 function setUp()
 {
     lmbToolkit::save();
     $this->toolkit = lmbToolkit::merge(new lmbConfTools());
     $this->application_configs_dir = lmb_var_dir() . '/app/settings';
     lmbFs::mkdir($this->application_configs_dir);
     $this->package_configs_dir = lmb_var_dir() . '/package/settings';
     lmbFs::mkdir($this->package_configs_dir);
     $tests_include_apth = $this->application_configs_dir . ';' . $this->package_configs_dir;
     $this->toolkit->setConfIncludePath($tests_include_apth);
 }
Esempio n. 12
0
 function testIsDefaultDbDSNAvailable()
 {
     $tools = new lmbDbTools();
     $tools->setDefaultDbDSN("mysql://localhost/test");
     $this->assertTrue($tools->isDefaultDbDSNAvailable());
     $toolkit = lmbToolkit::save();
     $tools = new lmbDbTools();
     $toolkit->setConf('db', new ExceptionalDbConfStub());
     $this->assertFalse($tools->isDefaultDbDSNAvailable());
     lmbToolkit::restore();
 }
 function testUseRussianAsCurrentLocale()
 {
     $toolkit = lmbToolkit::save();
     $toolkit->addLocaleObject(new lmbLocale('ru_RU', new lmbIni(dirname(__FILE__) . '/../../../i18n/locale/ru_RU.ini')));
     $date = new lmbDateTime('2004-12-20 10:15:30');
     $time = $date->getStamp();
     $code = '{$#var|i18n_date:"ru_RU", "stamp"}';
     $tpl = $this->_createMacroTemplate($code, 'tpl.html');
     $tpl->set('var', $time);
     $out = $tpl->render();
     $this->assertEqual($out, '20.12.2004');
     lmbToolkit::restore();
 }
Esempio n. 14
0
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->dsn = $this->toolkit->getDefaultDbDSN();
     $this->conn = new MockDbConnection();
 }
Esempio n. 15
0
 function setUp()
 {
     parent::setUp();
     lmbToolkit::save();
 }
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->_cleanUp();
 }
Esempio n. 17
0
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     lmbFs::rm(LIMB_VAR_DIR . '/tpl');
     lmbFs::mkdir(LIMB_VAR_DIR . '/tpl/compiled');
 }
Esempio n. 18
0
 function setUp()
 {
     lmbToolkit::save();
     lmbToolkit::merge(new lmbProfileTools());
     $this->toolkit = lmbToolkit::instance();
 }
Esempio n. 19
0
 function testOverloadGetterByTools()
 {
     lmbToolkit::save();
     $toolkit = lmbToolkit::setup(new TestTools());
     $toolkit->set('var', 'value1');
     $this->assertEqual($toolkit->getVar(), 'value1');
     lmbToolkit::save();
     $toolkit->setVar('value2');
     $this->assertEqual($toolkit->getVar(), 'value2');
     lmbToolkit::restore();
     $this->assertEqual($toolkit->get('var'), 'value1');
     lmbToolkit::restore();
 }
Esempio n. 20
0
 function setUp()
 {
     $toolkit = lmbToolkit::save();
 }
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->cache_writer = new lmbFullPageCacheWriter(LIMB_VAR_DIR . '/pages');
     $this->cache_writer->flushAll();
 }
Esempio n. 22
0
 function setUp()
 {
     lmbToolkit::save();
     $this->toolkit = lmbToolkit::merge(new lmbLogTools());
 }
 function setUp()
 {
     lmbToolkit::save();
 }
    function testTranslateSubstituteParametersDefaultContext()
    {
        $toolkit = lmbToolkit::save();
        $back = new lmbQtDictionaryBackend();
        $back->setSearchPath($translations_dir = LIMB_VAR_DIR . '/translations');
        $toolkit->setDictionaryBackend($back);
        $xml = <<<EOD
<?xml version="1.0"?>
<!DOCTYPE TS><TS>
<context>
<message>
    <source>Hello {name}</source>
    <translation>Привет {name}</translation>
</message>
</context>
</TS>
EOD;
        file_put_contents($translations_dir . '/default.ru_RU.ts', $xml);
        $toolkit->setLocale('ru_RU');
        $this->assertEqual(lmb_i18n('Hello {name}', array('{name}' => 'Bob')), 'Привет Bob');
        lmbToolkit::restore();
    }
 function setUp()
 {
     $toolkit = lmbToolkit::save();
     $this->conn = $toolkit->getDefaultDbConnection();
 }
 function testDBEUseRussianAsCurrentLocale()
 {
     $toolkit = lmbToolkit::save();
     $toolkit->addLocaleObject(new lmbLocale('ru', new lmbIni(dirname(__FILE__) . '/../ru.ini')));
     $date = new lmbDateTime('2005-01-20 10:15:30');
     $template = '{$var|i18n_date:"ru", "stamp"}';
     $this->registerTestingTemplate('/limb/locale_date_filter_dbe_use_russian_locale.html', $template);
     $page = $this->initTemplate('/limb/locale_date_filter_dbe_use_russian_locale.html');
     $page->set('var', $date->getStamp());
     $this->assertEqual($page->capture(), '20.01.2005');
     lmbToolkit::restore();
 }
Esempio n. 27
0
 function setUp()
 {
     $this->toolkit = lmbToolkit::save();
     $this->request = $this->toolkit->getRequest();
 }
 function testIsRequestAvailableInControllerConstructor()
 {
     //this is quite a "hacky" trick which removes the fixture toolkit, this should be refactored
     //alas, this means the whole test suite must be reconsidered as well
     lmbToolkit::restore();
     lmbToolkit::save();
     $dispatched_params = array('controller' => 'RememberRequestParams', 'param' => 150);
     $this->_setUpMocks($dispatched_params);
     $this->filter->run($this->chain);
     $controller = $this->toolkit->getDispatchedController();
     $this->assertEqual($controller->param, $dispatched_params['param']);
     //trick again...
     lmbToolkit::restore();
     lmbToolkit::save();
 }
 function setUp()
 {
     $_SERVER['REQUEST_METHOD'] = null;
     $this->toolkit = lmbToolkit::save();
     $this->request = $this->toolkit->getRequest();
 }