function test_instance() { $d1 =& dataspace::instance('test'); $this->assertNotNull($d1); $this->assertIsA($d1, 'dataspace'); $d2 =& dataspace::instance('test'); $this->assertReference(&$d1, &$d2); }
function test_form_action_validate_with_name() { $dataspace =& dataspace::instance('test1'); $dataspace->import(array('username' => 'vasa', 'password' => 'yo', 'password_confirm' => 'yo')); $a1 =& new form_action1('test1'); $this->assertFalse($a1->validate()); $dataspace->set('password', 'yoyoyoyo'); $dataspace->set('password_confirm', 'yoyoyoyo'); $a2 =& new form_action1('test1'); $this->assertTrue($a2->validate()); }
function set_value($value) { $form_component =& $this->find_parent_by_class('form_component'); $dataspace =& dataspace::instance($form_component->attributes['name']); if (!isset($this->attributes['name'])) { debug::write_warning("form element 'name' attribute not set:" . $this->get_server_id()); } $dataspace->set_by_index_string($this->_make_index_name($this->attributes['name']), $value); }
function action($name = '') { $this->name = $name; $this->dataspace =& dataspace::instance($name); }
function action() { $this->name = $this->_define_dataspace_name(); $this->dataspace =& dataspace::instance($this->name); }
function is_first_time() { if (isset($this->attributes['name'])) { $dataspace = dataspace::instance($this->attributes['name']); return $dataspace->get('submitted') ? false : true; } else { return isset($_REQUEST['submitted']) ? false : true; } }
function test_form_action_validate_with_name() { $dataspace =& dataspace::instance('test1'); $this->form_action->setReturnValue('_define_dataspace_name', 'test1'); $this->form_action->form_action(); $dataspace->import(array('username' => 'vasa', 'password' => 'yoyoyo', 'password_confirm' => 'yoyoyo')); $this->assertTrue($this->form_action->validate()); }