本文整理汇总了PHP中DB_DataObject::DebugLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_DataObject::DebugLevel方法的具体用法?PHP DB_DataObject::DebugLevel怎么用?PHP DB_DataObject::DebugLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_DataObject
的用法示例。
在下文中一共展示了DB_DataObject::DebugLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTransactionCommitWithCustomMethodsAcrossMultipleTables
public function testTransactionCommitWithCustomMethodsAcrossMultipleTables()
{
$c = DB_DataObject::factory('vanillainnodb');
// innoDB
$c->find();
$cl = DB_DataObject::factory('vanillainnodb2');
// innoDB
$cl->name = 'Michael Jackson';
$cl->insert();
$u = DB_DataObject::factory('testuser');
// Non innoDB
$u->login = 'test';
$u->password = 'test';
$this->assertTrue($u->insert());
// Just to verify inserting was ok
$c->begin();
while ($c->fetch()) {
$c->delete();
}
$u->delete();
$cl->delete();
$c->commit();
DB_DataObject::DebugLevel(0);
$c2 = DB_DataObject::factory('vanillainnodb');
$this->assertFalse($c2->find());
$u2 = DB_DataObject::factory('testuser');
$u2->login = 'test';
$u2->password = 'test';
$this->assertFalse($u2->find());
// Non innoDB
$cl = DB_DataObject::factory('vanillainnodb2');
$cl->name = 'Michael Jackson';
$this->assertFalse($cl->find());
}
示例2: testProcessFormUpdateNoni18nFields
public function testProcessFormUpdateNoni18nFields()
{
$t = DB_DataObject::factory('formtest');
$t->get(2);
$fb = MyFB::create($t);
$form = $fb->getForm();
$post = array_merge($form->exportValues(), array('pays' => 'es', 'testuser_id' => '5', '_qf__' . $form->getAttribute('name') => 1));
$get = $_GET;
$request = array_merge($get, $post);
$form->initRequest($get, $post, $request);
$this->assertTrue($form->isSubmitted());
// DB_DataObject::DebugLevel(1);
$form->process(array($fb, 'processForm'), false);
DB_DataObject::DebugLevel(0);
T::setLang('fr');
$t = DB_DataObject::factory('formtest');
$t->get(2);
$this->assertEqual($t->pays, 'es');
$this->assertEqual($t->testuser_id, '5');
}