本文整理汇总了PHP中debug_mock::expect_never_write方法的典型用法代码示例。如果您正苦于以下问题:PHP debug_mock::expect_never_write方法的具体用法?PHP debug_mock::expect_never_write怎么用?PHP debug_mock::expect_never_write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug_mock
的用法示例。
在下文中一共展示了debug_mock::expect_never_write方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_controller
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');
}
示例2: test_create
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();
}
示例3: test_create_complex
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');
}
示例4: test_create_complex2
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');
}