Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
ZurmoBaseTest.php
1 <?php
2  /*********************************************************************************
3  * Zurmo is a customer relationship management program developed by
4  * Zurmo, Inc. Copyright (C) 2017 Zurmo Inc.
5  *
6  * Zurmo is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  *
13  * Zurmo is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  *
23  * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
24  * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
25  *
26  * The interactive user interfaces in original and modified versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  *
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the Zurmo
32  * logo and Zurmo copyright notice. If the display of the logo is not reasonably
33  * feasible for technical reasons, the Appropriate Legal Notices must display the words
34  * "Copyright Zurmo Inc. 2017. All rights reserved".
35  ********************************************************************************/
36 
37  class ZurmoBaseTest extends BaseTest
38  {
39  public static $activateDefaultLanguages = false;
40 
41  protected static $activitiesObserver;
42 
43  protected static $conversationsObserver;
44 
45  protected static $emailMessagesObserver;
46 
47  protected static $contactLatestActivityDateTimeObserver;
48 
49  protected static $accountLatestActivityDateTimeObserver;
50 
51  protected static $accountContactAffiliationObserver;
52 
53  public static function setUpBeforeClass()
54  {
55  parent::setUpBeforeClass();
56  ZurmoDatabaseCompatibilityUtil::createActualPermissionsCacheTable();
57  ZurmoDatabaseCompatibilityUtil::createNamedSecurableActualPermissionsCacheTable();
58  ZurmoDatabaseCompatibilityUtil::createActualRightsCacheTable();
59  ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
60  PermissionsCache::forgetAll();
61  AllPermissionsOptimizationCache::forgetAll();
62  RightsCache::forgetAll();
63  PoliciesCache::forgetAll();
64  Currency::resetCaches(); //php only cache
65  Permission::resetCaches(); //php only cache
66  self::$activitiesObserver = new ActivitiesObserver();
67  self::$activitiesObserver->init(); //runs init();
68  self::$conversationsObserver = new ConversationsObserver();
69  self::$conversationsObserver->init(); //runs init();
70  self::$emailMessagesObserver = new EmailMessagesObserver();
71  self::$emailMessagesObserver->init(); //runs init();
72  self::$contactLatestActivityDateTimeObserver = new ContactLatestActivityDateTimeObserver();
73  self::$contactLatestActivityDateTimeObserver->init(); //runs init();
74  self::$accountLatestActivityDateTimeObserver = new AccountLatestActivityDateTimeObserver();
75  self::$accountLatestActivityDateTimeObserver->init(); //runs init();
76  self::$accountContactAffiliationObserver = new AccountContactAffiliationObserver();
77  self::$accountContactAffiliationObserver->init(); //runs init();
78  Yii::app()->gameHelper;
79  Yii::app()->gamificationObserver; //runs init();
80  Yii::app()->gameHelper->resetDeferredPointTypesAndValuesByUserIdToAdd();
81  Yii::app()->emailHelper->sendEmailThroughTransport = false;
82  Yii::app()->jobQueue->deleteAll();
83  }
84 
85  public function setUp()
86  {
87  parent::setUp();
88  Yii::app()->gameHelper->resetDeferredPointTypesAndValuesByUserIdToAdd();
89  }
90 
91  public static function tearDownAfterClass()
92  {
93  self::$activitiesObserver->destroy();
94  self::$conversationsObserver->destroy();
95  self::$emailMessagesObserver->destroy();
96  self::$contactLatestActivityDateTimeObserver->destroy();
97  self::$accountLatestActivityDateTimeObserver->destroy();
98  self::$accountContactAffiliationObserver->destroy();
99  parent::tearDownAfterClass();
100  }
101 
102  protected static function startOutputBuffer()
103  {
104  ob_start();
105  }
106 
107  protected static function endAndGetOutputBuffer()
108  {
109  $content = ob_get_contents();
110  ob_end_clean();
111  self::cleanUpOutputBuffer();
112  return $content;
113  }
114 
115  protected function endPrintOutputBufferAndFail()
116  {
117  echo $this->endAndGetOutputBuffer();
118  $this->fail();
119  }
120 
121  private static function cleanUpOutputBuffer()
122  {
123  while (count(ob_get_status(true)) > 1)
124  {
125  ob_end_clean();
126  }
127  }
128  }
129 ?>
static resetCaches()
Definition: Currency.php:292
Generated on Tue Sep 22 2020 07:10:37
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.