當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DifferentialDiff::getUnitStatus方法代碼示例

本文整理匯總了PHP中DifferentialDiff::getUnitStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP DifferentialDiff::getUnitStatus方法的具體用法?PHP DifferentialDiff::getUnitStatus怎麽用?PHP DifferentialDiff::getUnitStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DifferentialDiff的用法示例。


在下文中一共展示了DifferentialDiff::getUnitStatus方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderDiffPropertyViewValue

 public function renderDiffPropertyViewValue(DifferentialDiff $diff)
 {
     $colors = array(DifferentialUnitStatus::UNIT_NONE => 'grey', DifferentialUnitStatus::UNIT_OKAY => 'green', DifferentialUnitStatus::UNIT_WARN => 'yellow', DifferentialUnitStatus::UNIT_FAIL => 'red', DifferentialUnitStatus::UNIT_SKIP => 'blue', DifferentialUnitStatus::UNIT_AUTO_SKIP => 'blue');
     $icon_color = idx($colors, $diff->getUnitStatus(), 'grey');
     $message = DifferentialRevisionUpdateHistoryView::getDiffUnitMessage($diff->getUnitStatus());
     $status = id(new PHUIStatusListView())->addItem(id(new PHUIStatusItemView())->setIcon(PHUIStatusItemView::ICON_STAR, $icon_color)->setTarget($message));
     return $status;
 }
開發者ID:endlessm,項目名稱:phabricator,代碼行數:8,代碼來源:DifferentialUnitField.php

示例2: renderHarbormasterStatus

 protected function renderHarbormasterStatus(DifferentialDiff $diff, array $messages)
 {
     $colors = array(DifferentialUnitStatus::UNIT_NONE => 'grey', DifferentialUnitStatus::UNIT_OKAY => 'green', DifferentialUnitStatus::UNIT_WARN => 'yellow', DifferentialUnitStatus::UNIT_FAIL => 'red', DifferentialUnitStatus::UNIT_SKIP => 'blue', DifferentialUnitStatus::UNIT_AUTO_SKIP => 'blue', DifferentialUnitStatus::UNIT_POSTPONED => 'blue');
     $icon_color = idx($colors, $diff->getUnitStatus(), 'grey');
     $message = DifferentialRevisionUpdateHistoryView::getDiffUnitMessage($diff);
     $note = array();
     $groups = mgroup($messages, 'getResult');
     $groups = array_select_keys($groups, array(ArcanistUnitTestResult::RESULT_FAIL, ArcanistUnitTestResult::RESULT_BROKEN, ArcanistUnitTestResult::RESULT_UNSOUND, ArcanistUnitTestResult::RESULT_SKIP, ArcanistUnitTestResult::RESULT_PASS)) + $groups;
     foreach ($groups as $result => $group) {
         $count = new PhutilNumber(count($group));
         switch ($result) {
             case ArcanistUnitTestResult::RESULT_PASS:
                 $note[] = pht('%s Passed Test(s)', $count);
                 break;
             case ArcanistUnitTestResult::RESULT_FAIL:
                 $note[] = pht('%s Failed Test(s)', $count);
                 break;
             case ArcanistUnitTestResult::RESULT_SKIP:
                 $note[] = pht('%s Skipped Test(s)', $count);
                 break;
             case ArcanistUnitTestResult::RESULT_BROKEN:
                 $note[] = pht('%s Broken Test(s)', $count);
                 break;
             case ArcanistUnitTestResult::RESULT_UNSOUND:
                 $note[] = pht('%s Unsound Test(s)', $count);
                 break;
             default:
                 $note[] = pht('%s Other Test(s)', $count);
                 break;
         }
     }
     $buildable = $diff->getBuildable();
     if ($buildable) {
         $full_results = '/harbormaster/unit/' . $buildable->getID() . '/';
         $note[] = phutil_tag('a', array('href' => $full_results), pht('View Full Results'));
     }
     $excuse = $diff->getProperty('arc:unit-excuse');
     if (strlen($excuse)) {
         $excuse = array(phutil_tag('strong', array(), pht('Excuse:')), ' ', phutil_escape_html_newlines($excuse));
         $note[] = $excuse;
     }
     $note = phutil_implode_html(" · ", $note);
     $status = id(new PHUIStatusListView())->addItem(id(new PHUIStatusItemView())->setIcon(PHUIStatusItemView::ICON_STAR, $icon_color)->setTarget($message)->setNote($note));
     return $status;
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:45,代碼來源:DifferentialUnitField.php

示例3: getDiffUnitMessage

 public static function getDiffUnitMessage(DifferentialDiff $diff)
 {
     switch ($diff->getUnitStatus()) {
         case DifferentialUnitStatus::UNIT_NONE:
             return pht('No Unit Test Coverage');
         case DifferentialUnitStatus::UNIT_OKAY:
             return pht('Unit Tests OK');
         case DifferentialUnitStatus::UNIT_WARN:
             return pht('Unit Test Warnings');
         case DifferentialUnitStatus::UNIT_FAIL:
             return pht('Unit Test Errors');
         case DifferentialUnitStatus::UNIT_SKIP:
             return pht('Unit Tests Skipped');
         case DifferentialUnitStatus::UNIT_AUTO_SKIP:
             return pht('Automatic diff as part of commit; unit tests not applicable.');
         case DifferentialUnitStatus::UNIT_POSTPONED:
             return pht('Unit Tests Postponed');
     }
     return '???';
 }
開發者ID:denghp,項目名稱:phabricator,代碼行數:20,代碼來源:DifferentialRevisionUpdateHistoryView.php

示例4: getDiffUnitMessage

 public static function getDiffUnitMessage(DifferentialDiff $diff)
 {
     switch ($diff->getUnitStatus()) {
         case DifferentialUnitStatus::UNIT_NONE:
             return 'No Unit Test Coverage';
         case DifferentialUnitStatus::UNIT_OKAY:
             return 'Unit Tests OK';
         case DifferentialUnitStatus::UNIT_WARN:
             return 'Unit Test Warnings';
         case DifferentialUnitStatus::UNIT_FAIL:
             return 'Unit Test Errors';
         case DifferentialUnitStatus::UNIT_SKIP:
             return 'Unit Tests Skipped';
         case DifferentialUnitStatus::UNIT_POSTPONED:
             return 'Unit Tests Postponed';
     }
     return '???';
 }
開發者ID:neoxen,項目名稱:phabricator,代碼行數:18,代碼來源:DifferentialRevisionUpdateHistoryView.php


注:本文中的DifferentialDiff::getUnitStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。