Adds in basic conduit methods to PhortuneAccount and PhortuneMerchant, builds out lipsum generators for both.
Details
Diff Detail
- Repository
- rP Phabricator
- Branch
- phortune-1 (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 17706 Build 23769: Run Core Tests Build 23768: arc lint + arc unit
Event Timeline
src/applications/lipsum/generator/PhabricatorTestDataGenerator.php | ||
---|---|---|
76 | You can shuffle($admins); first as a low-budget way to pick one at random: shuffle($admins); return head($admins); We do a fancier version of this above because "load everything, then pick one randomly" won't work well if there are 100,000 matching objects, but it should largely be fine here. | |
src/applications/phortune/lipsum/PhortuneAccountTestDataGenerator.php | ||
23 | This method sometimes returns a PHID (here) and sometimes an object (below). I think that actually works (the caller is OK with either), but presumably unintended? | |
27 | What do you want to skip? | |
src/applications/phortune/lipsum/PhortuneMerchantTestDataGenerator.php | ||
13 | This isn't really true: the "Can Create Merchants" policy is configurable. It's possible for it to be set to "no one", or "anyone except admins", etc. This script will run with the install's configured policies. Perhaps a better approach would be to provide a scoped policy override, like PhabricatorScopedEnv. The code would look something like this: // For the purposes of generating lipsum merchants, allow any user to // create merchants. $override = id(new PhabricatorPhortuneApplication()) ->newCapabilityOverride($can_create, POLICY_USERS); ... unset($override); Then you wouldn't need loadRandomAdmin(), either. |