function setUp() { $this->db =& db_factory :: instance(); $this->db_table_test =& db_table_factory :: instance('test1'); $this->_clean_up(); }
function setUp() { parent :: setUp(); $this->db =& db_factory :: instance(); $tree =& tree :: instance(); $values['identifier'] = 'root'; $this->node_id_root = $tree->create_root_node($values, false, true); $values['identifier'] = 'ru'; $values['object_id'] = 1; $this->node_id_ru = $tree->create_sub_node($this->node_id_root, $values); $values['identifier'] = 'document'; $values['object_id'] = 10; $this->node_id_document = $tree->create_sub_node($this->node_id_ru, $values); $values['identifier'] = 'doc1'; $values['object_id'] = 20; $this->node_id_doc1 = $tree->create_sub_node($this->node_id_ru, $values); $values['identifier'] = 'doc2'; $values['object_id'] = 30; $this->node_id_doc2 = $tree->create_sub_node($this->node_id_ru, $values); }
function setUp() { $this->db =& db_factory::instance(); $this->stats_uri = new stats_uri_self_test_version($this); $this->stats_uri->stats_uri(); $this->_clean_up(); }
function setUp() { $this->report = new stats_referers_report(); $this->db =& db_factory :: instance(); $this->_clean_up(); }
function setUp() { $this->db = db_factory::instance(); debug_mock::init($this); $this->driver = new materialized_path_driver_test_version(); $this->_clean_up(); }
function db_table() { $this->_db_table_name = $this->_define_db_table_name(); $this->_columns = $this->_define_columns(); $this->_constraints = $this->_define_constraints(); $this->_db =& db_factory::instance(); }
function setUp() { $this->db = db_factory::instance(); debug_mock::init($this); $this->driver = new nested_sets_driver_test_version(); $this->_clean_up(); }
function setUp() { $this->db =& db_factory::instance(); $this->stats_referer = new stats_referer_self_test_version($this); $this->stats_referer->stats_referer(); $this->_clean_up(); }
function full_text_search() { $this->db =& db_factory :: instance(); $this->indexer =& new full_text_indexer(); $this->use_boolean_mode = $this->_check_boolean_mode(); }
function setUp() { $this->db =& db_factory :: instance(); $this->links_manager =& new links_manager(); $this->_clean_up(); }
function setUp() { $this->db =& db_factory::instance(); $this->_clean_up(); $this->_init_site_object(); $this->object->set_attribute('controller_name', 'site_object_controller'); $controller_id = site_object_controller::get_id('site_object_controller'); $this->object->set_attribute('controller_id', $controller_id); debug_mock::init($this); $user =& user::instance(); $user->_set_id(10); $tree =& tree::instance(); $values['identifier'] = 'root'; $values['object_id'] = 100; $this->root_node_id = $tree->create_root_node($values, false, true); $class_id = $this->object->get_class_id(); $this->db->sql_insert('sys_site_object', array('id' => 100, 'class_id' => $class_id, 'current_version' => 1)); $values['identifier'] = 'ru'; $values['object_id'] = 1; $this->parent_node_id = $tree->create_sub_node($this->root_node_id, $values); $this->db->sql_insert('sys_site_object', array('id' => 1, 'class_id' => $class_id, 'current_version' => 1)); $values['identifier'] = 'document'; $values['object_id'] = 10; $this->sub_node_id = $tree->create_sub_node($this->parent_node_id, $values); $this->db->sql_insert('sys_site_object', array('id' => 10, 'class_id' => $class_id, 'current_version' => 1)); }
function _valid_perform() { $object_data =& fetch_mapped_by_url(); $data = $this->_export(); $phpbb_user_data['user_rank'] = $data['rank']; $db =& db_factory::instance(); return $db->sql_update('phpbb_users', $phpbb_user_data, array('user_id' => $object_data['id'])); }
function site_object_controller_tester($class_name) { $this->db =& db_factory :: instance(); $this->class_name = $class_name; parent :: LimbTestCase(); }
function site_object_tester($class_name) { $this->db =& db_factory :: instance(); $this->class_name = $class_name; parent :: UnitTestCase(); }
function setUp() { $this->db =& db_factory::instance(); $this->cart_handler =& new special_db_cart_handler($this); $this->cart_handler->db_cart_handler(10); $this->user = new Mockuser($this); $this->cart_handler->setReturnReference('_get_user', $this->user); $this->_clean_up(); }
function setUp() { $this->db = db_factory::instance(); $this->stats_counter = new stats_counter_test_version($this); $this->stats_counter->stats_counter(); $this->stats_counter->setReturnValue('_is_home_hit', false); $this->stats_counter->setReturnValue('_is_new_audience', false); $this->_clean_up(); }
function setUp() { $this->db =& db_factory::instance(); $this->_clean_up(); $this->object = new mocked_site_object_test_version($this); $this->object->site_object(); $user =& user::instance(); $user->_set_id(10); }
function get_classes_list() { $project_db = str_replace('_tests', '', DB_NAME); $db =& db_factory::instance(); $db->select_db($project_db); $db->sql_select('sys_class', '*', 'class_name != "site_object"'); $list = $db->get_array(); $db->select_db(DB_NAME); return complex_array::get_column_values('class_name', $list); }
function setUp() { $this->db = db_factory :: instance(); debug_mock :: init($this); $this->imp = $this->_create_tree_imp(); $this->_clean_up(); }
function &fetch_version($version, $sql_params = array()) { $db_table =& $this->_get_db_table(); $table_name = $db_table->get_table_name(); $id = $this->get_id(); $sql = sprintf("SELECT\n\t\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t\tssot.id as node_id, \r\n\t\t\t\t\t\t\t\tssot.parent_id as parent_node_id, \n\t\t\t\t\t\t\t\tssot.level as level,\n\t\t\t\t\t\t\t\ttn.*,\n\t\t\t\t\t\t\t\ttn.id as record_id,\n\t\t\t\t\t\t\t\ttn.object_id as id\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\tsys_site_object_tree as ssot,\n\t\t\t\t\t\t\t\t{$table_name} as tn\r\n\t\t\t\t\t\t\t\t%s\r\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tssot.object_id = {$id} AND \n\t\t\t\t\t\t\t\ttn.object_id = {$id} AND\n\t\t\t\t\t\t\t\ttn.version = {$version}\n\t\t\t\t\t\t\t\t%s", $this->_add_sql($sql_params, 'columns'), $this->_add_sql($sql_params, 'tables'), $this->_add_sql($sql_params, 'conditions')); $db =& db_factory::instance(); $db->sql_exec($sql); return $db->fetch_row(); }
function setUp() { if (!isset($_SERVER['HTTP_HOST'])) { $_SERVER['HTTP_HOST'] = 'some host'; } $this->db =& db_factory::instance(); $this->stats_referer = new stats_referer_self_test_version($this); $this->stats_referer->stats_referer(); $this->_clean_up(); }
function get_options_array() { $db =& db_factory::instance(); $db->sql_select('phpbb_ranks'); $rows = $db->get_array('rank_id'); $result = array(0 => '----'); foreach ($rows as $rank_id => $data) { $result[$rank_id] = $data['rank_title']; } return $result; }
function setUp() { parent::setUp(); $this->db = db_factory::instance(); $this->db->sql_delete('user'); $this->db->sql_delete('sys_site_object'); $this->db->sql_insert('sys_site_object', array('id' => 1, 'identifier' => 'vasa', 'class_id' => '1', 'current_version' => '1')); $this->db->sql_insert('sys_site_object', array('id' => 2, 'identifier' => 'sasa', 'class_id' => '1', 'current_version' => '1')); $this->db->sql_insert('user', array('id' => 1, 'name' => 'Vasa', 'password' => '1', 'version' => '1', 'object_id' => '1')); $this->db->sql_insert('user', array('id' => 2, 'name' => 'Sasa', 'password' => '1', 'version' => '1', 'object_id' => '2')); }
function _valid_perform() { $object_data =& fetch_mapped_by_url(); $data = $this->dataspace->export(); $phpbb_user_data['user_rank'] = $data['rank']; $db =& db_factory::instance(); if ($db->sql_update('phpbb_users', $phpbb_user_data, array('user_id' => $object_data['id']))) { return new response(RESPONSE_STATUS_FORM_SUBMITTED); } else { return new failed_response(); } }
function _valid_perform(&$request, &$response) { $object_data =& fetch_requested_object(); $data = $this->dataspace->export(); $phpbb_user_data['user_rank'] = $data['rank']; $db =& db_factory::instance(); if ($db->sql_update('phpbb_users', $phpbb_user_data, array('user_id' => $object_data['id']))) { $request->set_status(REQUEST_STATUS_FORM_SUBMITTED); } else { $request->set_status(REQUEST_STATUS_FAILURE); } }
function &_get_path_objects_array() { $ids_array = $this->_get_path_objects_ids_array(); $sql = 'SELECT sso.* FROM sys_site_object as sso, sys_site_object_tree as ssot WHERE ssot.object_id=sso.id AND ' . sql_in('sso.id', $ids_array) . ' ORDER BY ssot.level'; $db =& db_factory::instance(); $db->sql_exec($sql); $objects_data =& $db->get_array('id'); return $objects_data; }
function setUp() { $this->db =& db_factory::instance(); $this->_clean_up(); $this->object = new site_object_auto_identifier_test_version(); $tree =& tree::instance(); $values['identifier'] = 'root'; $values['object_id'] = 1; $this->parent_node_id = $tree->create_root_node($values, false, true); $class_id = $this->object->get_class_id(); $this->db->sql_insert('sys_site_object', array('id' => 1, 'class_id' => $class_id, 'current_version' => 1)); debug_mock::init($this); }
function setUp() { $this->db =& db_factory::instance(); $this->_clean_up(); $this->indexer =& new full_text_indexer(); $this->site_object =& new Mocksite_object($this); $this->site_object->setReturnValue('get_id', 10); $this->site_object->setReturnValue('export_attributes', array('id' => 10, 'title' => " <b>this</b><p><br>is\r\n a \"TEST\" title ", 'content' => " [this;;]\r\n is a content 'test'", 'no_search' => 'wow', 'default_weight_field' => 'this is a field')); $attributes_definition = array('id' => array('type' => 'numeric'), 'title' => array('type' => 'string', 'search' => true, 'search_weight' => 10), 'content' => array('type' => 'string', 'search' => true, 'search_weight' => 5), 'no_search' => array(), 'default_weight_field' => array('type' => 'string', 'search' => true)); foreach ($attributes_definition as $id => $definition) { $this->site_object->setReturnValue('get_attribute_definition', $definition, array($id)); } $this->site_object->setReturnValue('get_class_id', 5); }
function test_register() { $rule_match =& new Mocksearch_engine_regex_rule($this); $rule_match->setReturnValue('match', true); $rule_match->setReturnValue('get_matching_phrase', 'test'); $rule_match->setReturnValue('get_engine_name', 'engine_name'); $this->stats_search_phrase->register_search_engine_rule($rule_match); $date = new date(); $this->assertTrue($this->stats_search_phrase->register($date)); $db =& db_factory::instance(); $db->sql_select('sys_stat_search_phrase'); $arr = $db->get_array(); $this->assertEqual(sizeof($arr), 1); $record = current($arr); $this->assertEqual($record['phrase'], 'test'); $this->assertEqual($record['engine'], 'engine_name'); $this->assertEqual($record['time'], $date->get_stamp()); }
function validate(&$dataspace) { if (!($value = $dataspace->get($this->field_name))) { return; } if ($this->current_identifier && $this->current_identifier == $value) { return; } $db =& db_factory::instance(); $sql = 'SELECT * FROM sys_site_object as sco, user as tn WHERE sco.identifier="' . $db->escape($value) . '" AND sco.id=tn.object_id AND sco.current_version=tn.version'; $db->sql_exec($sql); $arr = $db->get_array(); if (is_array($arr) && count($arr)) { $this->error(strings::get('error_duplicate_user', 'error')); } }