本文整理匯總了PHP中Common_TestCase類的典型用法代碼示例。如果您正苦於以下問題:PHP Common_TestCase類的具體用法?PHP Common_TestCase怎麽用?PHP Common_TestCase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Common_TestCase類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
protected function setUp()
{
global $DB;
parent::setUp();
$DB->connect();
self::restore_database();
$DB->query("UPDATE `glpi_rules`\n SET `is_active`='0'\n WHERE `sub_type`='PluginFusioninventoryInventoryRuleImport'");
// Add a rule to ignore import
// Create rule for import into unknown devices
$rulecollection = new PluginFusioninventoryInventoryRuleImportCollection();
$input = array();
$input['is_active'] = 1;
$input['name'] = 'Ignore import';
$input['match'] = 'AND';
$input['sub_type'] = 'PluginFusioninventoryInventoryRuleImport';
$input['ranking'] = 200;
$rule_id = $rulecollection->add($input);
// Add criteria
$rule = $rulecollection->getRuleClass();
$rulecriteria = new RuleCriteria(get_class($rule));
$input = array();
$input['rules_id'] = $rule_id;
$input['criteria'] = "name";
$input['pattern'] = '*';
$input['condition'] = 0;
$rulecriteria->add($input);
// Add action
$ruleaction = new RuleAction(get_class($rule));
$input = array();
$input['rules_id'] = $rule_id;
$input['action_type'] = 'assign';
$input['field'] = '_ignore_import';
$input['value'] = '1';
$ruleaction->add($input);
}
示例2: setUp
protected function setUp()
{
parent::setUp();
self::restore_database();
// Add some computers
$computer = new Computer();
$pfAgent = new PluginFusioninventoryAgent();
$computer->add(array('name' => 'pc01', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 1, 'entities_id' => 0));
$computer->add(array('name' => 'pc02', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 2, 'entities_id' => 0));
$computer->add(array('name' => 'pc03', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 3, 'entities_id' => 0));
$computer->add(array('name' => 'pc04', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 4, 'entities_id' => 0));
$computer->add(array('name' => 'pc05', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 5, 'entities_id' => 0));
$computer->add(array('name' => 'pc06', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 6, 'entities_id' => 0));
$computer->add(array('name' => 'pc07', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 7, 'entities_id' => 0));
$computer->add(array('name' => 'pc08', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 8, 'entities_id' => 0));
$computer->add(array('name' => 'pc09', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 9, 'entities_id' => 0));
$computer->add(array('name' => 'pc10', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 10, 'entities_id' => 0));
$computer->add(array('name' => 'pc11', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 11, 'entities_id' => 0));
$computer->add(array('name' => 'pc12', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 12, 'entities_id' => 0));
$computer->add(array('name' => 'pc13', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 13, 'entities_id' => 0));
$computer->add(array('name' => 'srv01', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 14, 'entities_id' => 0));
$computer->add(array('name' => 'srv02', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 15, 'entities_id' => 0));
$computer->add(array('name' => 'srv03', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 16, 'entities_id' => 0));
$computer->add(array('name' => 'srv04', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 17, 'entities_id' => 0));
$computer->add(array('name' => 'srv05', 'entities_id' => 0));
$pfAgent->add(array('computers_id' => 18, 'entities_id' => 0));
}
示例3: tearDown
protected function tearDown()
{
parent::tearDown();
}
示例4: tearDown
protected function tearDown()
{
parent::tearDown();
error_reporting($this->old_reporting_level);
}