Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15334462
D17474.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17474.diff
View Options
diff --git a/src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php b/src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php
--- a/src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php
+++ b/src/applications/badges/lipsum/PhabricatorBadgesBadgeTestDataGenerator.php
@@ -12,7 +12,7 @@
public function generateObject() {
$author = $this->loadRandomUser();
- list($name, $description) = $this->newLoot();
+ list($name, $description, $quality, $icon) = $this->newLoot();
$xactions = array();
@@ -26,6 +26,16 @@
'value' => $description,
);
+ $xactions[] = array(
+ 'type' => 'quality',
+ 'value' => (string)$quality,
+ );
+
+ $xactions[] = array(
+ 'type' => 'icon',
+ 'value' => $icon,
+ );
+
$params = array(
'transactions' => $xactions,
);
@@ -58,7 +68,17 @@
$drop = preg_replace($effect_pattern, '', $drop);
- return array($drop, $description);
+ $quality_map = PhabricatorBadgesQuality::getQualityMap();
+ shuffle($quality_map);
+ $quality = head($quality_map);
+ $rarity = $quality['rarity'];
+
+ $icon_map = id(new PhabricatorBadgesIconSet())->getIcons();
+ shuffle($icon_map);
+ $icon_map = head($icon_map);
+ $icon = $icon_map->getKey();
+
+ return array($drop, $description, $rarity, $icon);
}
public function rollDropValue($matches) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 9, 9:26 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7387902
Default Alt Text
D17474.diff (1 KB)
Attached To
Mode
D17474: Add quality and icon to Badge Lipsum generator
Attached
Detach File
Event Timeline
Log In to Comment