本文整理汇总了PHP中Build::GetGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Build::GetGroup方法的具体用法?PHP Build::GetGroup怎么用?PHP Build::GetGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Build
的用法示例。
在下文中一共展示了Build::GetGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendemail
/** Main function to send email if necessary */
function sendemail($handler, $projectid)
{
include 'config/config.php';
include_once 'include/common.php';
require_once 'include/pdo.php';
require_once 'models/build.php';
require_once 'models/project.php';
require_once 'models/buildgroup.php';
$Project = new Project();
$Project->Id = $projectid;
$Project->Fill();
$sendEmail = null;
if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/sendemail.php')) {
include_once 'local/sendemail.php';
$sendEmail = new SendEmail();
$sendEmail->SetProjectId($projectid);
}
// If we shouldn't sent any emails we stop
if ($Project->EmailBrokenSubmission == 0) {
return;
}
// If the handler has a buildid (it should), we use it
if (isset($handler->BuildId) && $handler->BuildId > 0) {
$buildid = $handler->BuildId;
} else {
// Get the build id
$name = $handler->getBuildName();
$stamp = $handler->getBuildStamp();
$sitename = $handler->getSiteName();
$buildid = get_build_id($name, $stamp, $projectid, $sitename);
}
if ($buildid < 0) {
return;
}
//add_log("Buildid ".$buildid,"sendemail ".$Project->Name,LOG_INFO);
// Check if the group as no email
$Build = new Build();
$Build->Id = $buildid;
$groupid = $Build->GetGroup();
$BuildGroup = new BuildGroup();
$BuildGroup->SetId($groupid);
// If we specified no email we stop here
if ($BuildGroup->GetSummaryEmail() == 2) {
return;
}
$emailCommitters = $BuildGroup->GetEmailCommitters();
$errors = check_email_errors($buildid, $Project->EmailTestTimingChanged, $Project->TestTimeMaxStatus, !$Project->EmailRedundantFailures);
// We have some fixes
if ($errors['hasfixes']) {
$Build->FillFromId($Build->Id);
// Get the list of person who should get the email
$lookup_result = lookup_emails_to_send($errors, $buildid, $projectid, $Build->Type, true, $emailCommitters);
$userids = $lookup_result['userids'];
foreach ($userids as $userid) {
$emailtext = array();
$emailtext['nfixes'] = 0;
// Check if an email has been sent already for this user
foreach ($errors['fixes'] as $fixkey => $nfixes) {
if ($nfixes == 0) {
continue;
}
if (!check_email_sent($userid, $buildid, $fixkey)) {
$emailtext['category'][$fixkey] = $nfixes;
$emailtext['nfixes'] = 1;
}
}
// Send the email
if ($emailtext['nfixes'] == 1) {
send_email_fix_to_user($userid, $emailtext, $Build, $Project);
}
}
}
// No error we return
if (!$errors['errors']) {
return;
}
if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/sendemail.php')) {
$sendEmail->BuildId = $Build->Id;
$sendEmail->Errors = $errors;
}
// If we should send a summary email
if ($BuildGroup->GetSummaryEmail() == 1) {
// Send the summary email
sendsummaryemail($projectid, $groupid, $errors, $buildid);
if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/sendemail.php')) {
$sendEmail->SendSummary();
}
return;
}
$Build->FillFromId($Build->Id);
// Send build error
if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/sendemail.php')) {
$sendEmail->SendBuildError();
}
// Lookup the list of people who should get the email, both registered
// users *and* committers:
//
$lookup_result = lookup_emails_to_send($errors, $buildid, $projectid, $Build->Type, false, $emailCommitters);
// Loop through the *registered* users:
//.........这里部分代码省略.........
示例2: testBuildModel
function testBuildModel()
{
$this->startCodeCoverage();
$build = new Build();
$builderror = new BuildError();
$builderror->Type = 0;
$builderror->Text = 'error';
$buildwarning = new BuildError();
$buildwarning->Type = 1;
$buildwarning->Text = 'warning';
if ($build->GetName() !== false) {
$this->fail("GetName didn't return false for empty build id");
return 1;
}
if ($build->GetLabels() !== false) {
$this->fail("GetLabels didn't return false for empty build id");
return 1;
}
if ($build->GetGroup() !== false) {
$this->fail("GetGroup didn't return false for empty build id");
return 1;
}
if ($build->GetNumberOfErrors() !== false) {
$this->fail("GetNumberOfErrors didn't return false for empty build id");
return 1;
}
if ($build->GetNumberOfWarnings() !== false) {
$this->fail("GetNumberOfWarnings didn't return false for empty build id");
return 1;
}
if ($build->SetSubProject('1234') !== false) {
$this->fail("SetSubProject didn't return false for empty project id");
return 1;
}
if ($build->GetSubProjectName() !== false) {
$this->fail("GetSubProjectName didn't return false for empty build id");
return 1;
}
if ($build->GetErrorDifferences() !== false) {
$this->fail("GetErrorDifferences didn't return false for empty build id");
return 1;
}
if ($build->ComputeUpdateStatistics() !== false) {
$this->fail("ComputeUpdateStatistics didn't return false for empty build id");
return 1;
}
if ($build->ComputeDifferences() !== false) {
$this->fail("ComputeDifferences didn't return false for empty build id");
return 1;
}
if ($build->ComputeConfigureDifferences() !== false) {
$this->fail("ComputeConfigureDifferences didn't return false for empty build id");
return 1;
}
if ($build->ComputeTestTiming() !== false) {
$this->fail("ComputeTestTiming didn't return false for empty build id");
return 1;
}
if ($build->InsertLabelAssociations() !== false) {
$this->fail("InsertLabelAssocations didn't return false for empty build id");
return 1;
}
if ($build->UpdateEndTime('2010-08-07') !== false) {
$this->fail("UpdateEndTime didn't return false for empty build id");
return 1;
}
if ($build->SaveTotalTestsTime('100') !== false) {
$this->fail("SaveTotalTestsTime didn't return false for empty build id");
return 1;
}
$build->Id = '1';
if ($build->ComputeTestTiming() !== false) {
$this->fail("ComputeTestTiming didn't return false for empty project id");
return 1;
}
if ($build->ComputeUpdateStatistics() !== false) {
$this->fail("ComputeUpdateStatistics didn't return false for empty project id");
return 1;
}
$build->ProjectId = '2';
$build->SiteId = '1';
$build->SetSubProject('8567');
if (strpos(file_get_contents($this->logfilename), "New subproject detected") === false) {
$this->fail("'New subproject detected' not found in log after calling SetSubProject for invalid subproject id");
return 1;
}
if ($build->Exists() == false) {
$this->fail("Exists returned false for a valid build id");
return 1;
}
$build->Id = '98765';
$build->SetStamp('20100610-1901-Experimental');
$build->Type = '';
//force this empty for coverage purposes
$build->StartTime = '2009-12-18 14:19:11';
$build->EndTime = '2009-12-18 14:20:23';
$build->SubmitTime = '2012-01-25 16:43:11';
if ($build->Exists() == true) {
$this->fail("Exists returned true for an invalid build id");
return 1;
//.........这里部分代码省略.........