当前位置: 首页>>代码示例>>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;未经允许,请勿转载。