function test_controller()
 {
     $controller = $this->object->get_controller();
     if (is_a($controller, 'empty_controller')) {
         return;
     }
     $definitions = $controller->get_actions_definitions();
     $controller_class = get_class($controller);
     $empty_action = new empty_action();
     foreach ($definitions as $action => $data) {
         if (isset($data['template_path'])) {
             $template = new template($data['template_path']);
             $this->_check_template($template);
         }
         if (isset($data['action_path'])) {
             debug_mock::expect_never_write('write_error');
             $action_obj = action_factory::create($data['action_path']);
             $this->assertNotIdentical($action_obj, $empty_action, 'controller: "' . $controller_class . '" action object for action "' . $action . '"not found');
             $this->_check_action($action_obj);
         }
         if (isset($data['action_name'])) {
             $this->assertTrue($data['action_name'], 'controller: "' . $controller_class . '" action_name property for action "' . $action . '" is empty - check strings');
         }
     }
     $action = $controller->get_default_action();
     $this->assertTrue(isset($definitions[$action]), 'controller: "' . $controller_class . '" default action "' . $action . '" doesnt exist');
 }
 function test_create()
 {
     debug_mock::expect_never_write();
     $this->object->set_parent_node_id($this->parent_node_id);
     $this->object->set_identifier('test_node');
     $id = $this->object->create();
     $this->assertNotIdentical($id, false, 'create operation failed');
     $this->assertEqual($id, $this->object->get_id());
     $this->_check_sys_site_object_tree_record();
     $this->_check_sys_site_object_record();
     $this->_check_sys_class_record();
 }
 function test_create_complex()
 {
     debug_mock::expect_never_write();
     $this->_create_node('10ru1');
     $this->_create_node('10ru2');
     $this->_create_node('10a1');
     $this->_create_node(1000);
     $this->object->set_parent_node_id($this->parent_node_id);
     $this->object->set_identifier('node_test');
     $id = $this->object->create();
     $this->assertEqual($this->object->get_identifier(), '10ru3');
 }
 function test_create_complex2()
 {
     debug_mock::expect_never_write();
     $this->_create_node('test');
     $this->_create_node('test8');
     $this->_create_node('test9');
     $this->_create_node('test10');
     $this->object->set_parent_node_id($this->parent_node_id);
     $this->object->set_identifier('node_test');
     $id = $this->object->create();
     $this->assertEqual($this->object->get_identifier(), 'test11');
 }