Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/__tests__/PhabricatorPhortuneTestCase.php
| Show All 15 Lines | public function testNewPhortuneAccount() { | ||||
| $accounts = PhortuneAccountQuery::loadAccountsForUser( | $accounts = PhortuneAccountQuery::loadAccountsForUser( | ||||
| $user, | $user, | ||||
| $content_source); | $content_source); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| 1, | 1, | ||||
| count($accounts), | count($accounts), | ||||
| pht('Creation of default account for users with no accounts.')); | pht('Creation of default account for users with no accounts.')); | ||||
| // Reload the account. The user should be able to view and edit it, and | |||||
| // should be a member. | |||||
| $account = head($accounts); | |||||
| $account = id(new PhortuneAccountQuery()) | |||||
| ->setViewer($user) | |||||
| ->withPHIDs(array($account->getPHID())) | |||||
| ->requireCapabilities( | |||||
| array( | |||||
| PhabricatorPolicyCapability::CAN_VIEW, | |||||
| PhabricatorPolicyCapability::CAN_EDIT, | |||||
| )) | |||||
| ->executeOne(); | |||||
| $this->assertEqual(true, ($account instanceof PhortuneAccount)); | |||||
| $this->assertEqual(array($user->getPHID()), $account->getMemberPHIDs()); | |||||
| } | } | ||||
| } | } | ||||