/** * Set up the test case */ public function setUp() { parent::setUp(); $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles'); $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => $dir . 'config.db')); $this->db->exec(' CREATE TABLE IF NOT EXISTS `config_test` ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `section` varchar(255) DEFAULT NULL, `name` varchar(255) NOT NULL, `value` text NOT NULL, `created` datetime NOT NULL, `updated` datetime NOT NULL ); '); }
/** * Set up the test case */ public function setUp() { parent::setUp(); $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles'); $this->db = Enlight_Components_Db::factory('PDO_SQLITE', array('dbname' => $dir . 'menu.db')); $this->db->exec(' DROP TABLE IF EXISTS `menu_test`; CREATE TABLE IF NOT EXISTS `menu_test` ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `parent` INTEGER NOT NULL, `active` INTEGER(1) NOT NULL, `label` varchar(255) NOT NULL ); DROP TABLE IF EXISTS `menu_test2`; CREATE TABLE IF NOT EXISTS `menu_test2` ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `parent` INTEGER NOT NULL, `active` INTEGER(1) NOT NULL, `name` varchar(255) NOT NULL ); '); $this->adapter = new Enlight_Components_Menu_Adapter_DbTable(array('db' => $this->db, 'name' => 'menu_test')); }
private function createDefaultUser($lockeduntilColumn) { $userAdd = "\n\t\t\t\tINSERT INTO `test_auth`\n\t\t\t\t\t(\t`id`,\n\t\t\t\t\t\t`username`,\n\t\t\t\t\t\t`password`,\n\t\t\t\t\t\t`sessionID`,\n\t\t\t\t\t\t`lastlogin`,\n\t\t\t\t\t\t`name`,\n\t\t\t\t\t\t`email`,\n\t\t\t\t\t\t`active`,\n\t\t\t\t\t\t`rights`,\n\t\t\t\t\t\t`failedlogins`,\n\t\t\t\t\t\t`" . $lockeduntilColumn . "`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\t1,\n\t\t\t\t\t\t'demo',\n\t\t\t\t\t\t'fe01ce2a7fbac8fafaed7c982a04e229',\n\t\t\t\t\t\t's4inr04o6apmclk7u88qau4r57',\n\t\t\t\t\t\t'2011-25-11 14:41:24',\n\t\t\t\t\t\t'Administrator',\n\t\t\t\t\t\t'*****@*****.**',\n\t\t\t\t\t\t 1,\n\t\t\t\t\t\t '',\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t '0000-00-00 00:00:00'\n\t\t\t\t\t);\n\t\t"; $this->db->exec($userAdd); }