本文整理匯總了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');
}