本文整理匯總了PHP中Contrat::initAsSpecimen方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contrat::initAsSpecimen方法的具體用法?PHP Contrat::initAsSpecimen怎麽用?PHP Contrat::initAsSpecimen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contrat
的用法示例。
在下文中一共展示了Contrat::initAsSpecimen方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Contrat
print $langs->trans($tmp);
} else {
print $tmp;
}
print '</td>' . "\n";
print '<td align="center">';
if ($conf->global->CONTRACT_ADDON == "{$file}") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmod&value=' . $file . '">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}
print '</td>';
$contract = new Contrat($db);
$contract->initAsSpecimen();
// Info
$htmltooltip = '';
$htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>';
$nextval = $module->getNextValue($mysoc, $contract);
if ("{$nextval}" != $langs->trans("NotAvailable")) {
// Keep " on nextval
$htmltooltip .= '' . $langs->trans("NextValue") . ': ';
if ($nextval) {
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
$nextval = $langs->trans($nextval);
}
$htmltooltip .= $nextval . '<br>';
} else {
$htmltooltip .= $langs->trans($module->error) . '<br>';
}
示例2: testContratCreate
/**
* testContratCreate
*
* @return int
*/
public function testContratCreate()
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject = new Contrat($this->savdb);
$localobject->initAsSpecimen();
$result = $localobject->create($user);
print __METHOD__ . " result=" . $result . "\n";
$this->assertLessThan($result, 0);
return $result;
}