From 71d933d496cad8e597a104931c85b1e7776aba86 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 14 Apr 2017 09:48:58 -0700 Subject: [PATCH] Add a failing test case for new Phortune account initialization Summary: Ref T12451. Ref T12484. I think D17657 fixed this, but caused the bug in D17690. The fix for that causes this bug again. Put a unit test on it. This test currently fails; I'll correct the bug in the next change. Test Plan: Ran `arc unit`, saw a failure. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12484, T12451 Differential Revision: https://secure.phabricator.com/D17691 --- src/__phutil_library_map__.php | 2 ++ .../__tests__/PhabricatorPhortuneTestCase.php | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/applications/phortune/__tests__/PhabricatorPhortuneTestCase.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index d9fca984f1..5c1f1ced73 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3428,6 +3428,7 @@ phutil_register_library_map(array( 'PhabricatorPhortuneContentSource' => 'applications/phortune/contentsource/PhabricatorPhortuneContentSource.php', 'PhabricatorPhortuneManagementInvoiceWorkflow' => 'applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php', 'PhabricatorPhortuneManagementWorkflow' => 'applications/phortune/management/PhabricatorPhortuneManagementWorkflow.php', + 'PhabricatorPhortuneTestCase' => 'applications/phortune/__tests__/PhabricatorPhortuneTestCase.php', 'PhabricatorPhragmentApplication' => 'applications/phragment/application/PhabricatorPhragmentApplication.php', 'PhabricatorPhrequentApplication' => 'applications/phrequent/application/PhabricatorPhrequentApplication.php', 'PhabricatorPhrictionApplication' => 'applications/phriction/application/PhabricatorPhrictionApplication.php', @@ -8679,6 +8680,7 @@ phutil_register_library_map(array( 'PhabricatorPhortuneContentSource' => 'PhabricatorContentSource', 'PhabricatorPhortuneManagementInvoiceWorkflow' => 'PhabricatorPhortuneManagementWorkflow', 'PhabricatorPhortuneManagementWorkflow' => 'PhabricatorManagementWorkflow', + 'PhabricatorPhortuneTestCase' => 'PhabricatorTestCase', 'PhabricatorPhragmentApplication' => 'PhabricatorApplication', 'PhabricatorPhrequentApplication' => 'PhabricatorApplication', 'PhabricatorPhrictionApplication' => 'PhabricatorApplication', diff --git a/src/applications/phortune/__tests__/PhabricatorPhortuneTestCase.php b/src/applications/phortune/__tests__/PhabricatorPhortuneTestCase.php new file mode 100644 index 0000000000..b4d6a0e89d --- /dev/null +++ b/src/applications/phortune/__tests__/PhabricatorPhortuneTestCase.php @@ -0,0 +1,26 @@ + true, + ); + } + + public function testNewPhortuneAccount() { + $user = $this->generateNewTestUser(); + $content_source = $this->newContentSource(); + + $accounts = PhortuneAccountQuery::loadAccountsForUser( + $user, + $content_source); + + $this->assertEqual( + 1, + count($accounts), + pht('Creation of default account for users with no accounts.')); + } + +}