@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add quality and icon to Badge Lipsum generator

Summary: This just adds a few more dimensions to the generator.

Test Plan: run `bin/lipsum generate badges`, verify new icons and quality work.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17474

authored by

Chad Little and committed by
chad
814c28d3 b28da103

+22 -2
+22 -2
src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php
··· 12 12 public function generateObject() { 13 13 $author = $this->loadRandomUser(); 14 14 15 - list($name, $description) = $this->newLoot(); 15 + list($name, $description, $quality, $icon) = $this->newLoot(); 16 16 17 17 $xactions = array(); 18 18 ··· 24 24 $xactions[] = array( 25 25 'type' => 'description', 26 26 'value' => $description, 27 + ); 28 + 29 + $xactions[] = array( 30 + 'type' => 'quality', 31 + 'value' => (string)$quality, 32 + ); 33 + 34 + $xactions[] = array( 35 + 'type' => 'icon', 36 + 'value' => $icon, 27 37 ); 28 38 29 39 $params = array( ··· 58 68 59 69 $drop = preg_replace($effect_pattern, '', $drop); 60 70 61 - return array($drop, $description); 71 + $quality_map = PhabricatorBadgesQuality::getQualityMap(); 72 + shuffle($quality_map); 73 + $quality = head($quality_map); 74 + $rarity = $quality['rarity']; 75 + 76 + $icon_map = id(new PhabricatorBadgesIconSet())->getIcons(); 77 + shuffle($icon_map); 78 + $icon_map = head($icon_map); 79 + $icon = $icon_map->getKey(); 80 + 81 + return array($drop, $description, $rarity, $icon); 62 82 } 63 83 64 84 public function rollDropValue($matches) {