Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
GameRewardsSuperUserWalkthroughTest.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 
44  {
45  private static $gameReward1;
46 
47  private static $gameReward2;
48 
49  private static $gameReward3;
50 
51  private static $gameReward4;
52 
53  private static $gameReward5;
54 
55  private static $gameReward6;
56 
57  private static $gameReward7;
58 
59  private static $gameReward8;
60 
61  private static $gameReward9;
62 
63  private static $gameReward10;
64 
65  private static $gameReward11;
66 
67  private static $gameReward12;
68 
69  public static function setUpBeforeClass()
70  {
71  parent::setUpBeforeClass();
72  SecurityTestHelper::createSuperAdmin();
73  $super = User::getByUsername('super');
74  Yii::app()->user->userModel = $super;
75 
76  //Setup test data owned by the super user.
77  self::$gameReward1 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward', $super);
78  self::$gameReward2 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward2', $super);
79  self::$gameReward3 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward3', $super);
80  self::$gameReward4 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward4', $super);
81  self::$gameReward5 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward5', $super);
82  self::$gameReward6 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward6', $super);
83  self::$gameReward7 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward7', $super);
84  self::$gameReward8 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward8', $super);
85  self::$gameReward9 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward9', $super);
86  self::$gameReward10 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward10', $super);
87  self::$gameReward11 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward11', $super);
88  self::$gameReward12 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward12', $super);
89  //Setup default dashboard.
90  Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
91  }
92 
93  public function testSuperUserAllDefaultControllerActions()
94  {
95  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
96 
97  //Test all default controller actions that do not require any POST/GET variables to be passed.
98  //This does not include portlet controller actions.
99  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default');
100  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/index');
101  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/create');
102 
103  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/list');
104  $this->assertContains('anyMixedAttributes', $content);
105  //Test the search or paging of the listview.
106  Yii::app()->clientScript->reset(); //to make sure old js doesn't make it to the UI
107  $this->setGetArray(array('ajax' => 'list-view'));
108  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/list');
109  $this->assertNotContains('anyMixedAttributes', $content);
110  $this->resetGetArray();
111 
112  //Default Controller actions requiring some sort of parameter via POST or GET
113  //Load Model Edit Views
114  $this->setGetArray(array('id' => self::$gameReward1->id));
115  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/edit');
116  //Save game rewards
117  $this->assertEquals(null, self::$gameReward1->description);
118  $this->setPostArray(array('GameReward' => array('description' => '555')));
119  //Make sure the redirect is to the details view and not the list view.
120  $this->runControllerWithRedirectExceptionAndGetContent('gameRewards/default/edit',
121  Yii::app()->createUrl('gameRewards/default/details', array('id' => self::$gameReward1->id)));
122  $gameReward1 = GameReward::getById(self::$gameReward1->id);
123  $this->assertEquals('555', $gameReward1->description);
124  //Test having a failed validation on the game rewards during save.
125  $this->setGetArray (array('id' => self::$gameReward1->id));
126  $this->setPostArray(array('GameReward' => array('name' => '')));
127  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/edit');
128  $this->assertContains('Name cannot be blank', $content);
129 
130  //Load Model Detail Views
131  $this->setGetArray(array('id' => self::$gameReward1->id, 'lockPortlets' => '1'));
132  $this->resetPostArray();
133  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/details');
134 
135  //Load Model MassEdit Views.
136  //MassEdit view for single selected ids
137  $this->setGetArray(array('selectedIds' => '4,5,6,7,8', 'selectAll' => '')); // Not Coding Standard
138  $this->resetPostArray();
139  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/massEdit');
140  $this->assertContains('<strong>5</strong>&#160;records selected for updating', $content);
141 
142  //MassEdit view for all result selected ids
143  $this->setGetArray(array('selectAll' => '1'));
144  $this->resetPostArray();
145  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/massEdit');
146  $this->assertContains('<strong>12</strong>&#160;records selected for updating', $content);
147 
148  //save Model MassEdit for selected Ids
149  //Test that the 2 game rewards do not have the office phone number we are populating them with.
150  $gameReward1 = GameReward::getById(self::$gameReward1->id);
151  $gameReward2 = GameReward::getById(self::$gameReward2->id);
152  $this->assertNotEquals('456765421', $gameReward1->description);
153  $this->assertNotEquals('456765421', $gameReward2->description);
154  $this->setGetArray(array(
155  'selectedIds' => self::$gameReward1->id . ',' . self::$gameReward2->id, // Not Coding Standard
156  'selectAll' => '',
157  'GameReward_page' => 1));
158  $this->setPostArray(array(
159  'GameReward' => array('description' => '2222'),
160  'MassEdit' => array('description' => 1)
161  ));
162  $this->runControllerWithRedirectExceptionAndGetContent('gameRewards/default/massEdit');
163  //Test that the 2 game rewards have the new office phone number and the other game rewards do not.
164  $gameReward1 = GameReward::getById(self::$gameReward1->id);
165  $gameReward2 = GameReward::getById(self::$gameReward2->id);
166  $gameReward3 = GameReward::getById(self::$gameReward3->id);
167  $gameReward4 = GameReward::getById(self::$gameReward4->id);
168  $gameReward5 = GameReward::getById(self::$gameReward5->id);
169  $gameReward6 = GameReward::getById(self::$gameReward6->id);
170  $gameReward7 = GameReward::getById(self::$gameReward7->id);
171  $gameReward8 = GameReward::getById(self::$gameReward8->id);
172  $gameReward9 = GameReward::getById(self::$gameReward9->id);
173  $gameReward10 = GameReward::getById(self::$gameReward10->id);
174  $gameReward11 = GameReward::getById(self::$gameReward11->id);
175  $gameReward12 = GameReward::getById(self::$gameReward12->id);
176  $this->assertEquals ('2222', $gameReward1->description);
177  $this->assertEquals ('2222', $gameReward2->description);
178  $this->assertEmpty ($gameReward3->description);
179  $this->assertEmpty ($gameReward4->description);
180  $this->assertEmpty ($gameReward5->description);
181  $this->assertEmpty ($gameReward6->description);
182  $this->assertEmpty ($gameReward7->description);
183  $this->assertEmpty ($gameReward8->description);
184  $this->assertEmpty ($gameReward9->description);
185  $this->assertEmpty ($gameReward10->description);
186  $this->assertEmpty ($gameReward11->description);
187  $this->assertEmpty ($gameReward12->description);
188 
189  //save Model MassEdit for entire search result
190  $this->setGetArray(array(
191  'selectAll' => '1',
192  'GameReward_page' => 1));
193  $this->setPostArray(array(
194  'GameReward' => array('description' => '3333'),
195  'MassEdit' => array('description' => 1)
196  ));
197  $pageSize = Yii::app()->pagination->getForCurrentUserByType('massEditProgressPageSize');
198  $this->assertEquals(5, $pageSize);
199  Yii::app()->pagination->setForCurrentUserByType('massEditProgressPageSize', 20);
200  $this->runControllerWithRedirectExceptionAndGetContent('gameRewards/default/massEdit');
201  Yii::app()->pagination->setForCurrentUserByType('massEditProgressPageSize', $pageSize);
202  //Test that all game rewards have the new phone number.
203  $gameReward1 = GameReward::getById(self::$gameReward1->id);
204  $gameReward2 = GameReward::getById(self::$gameReward2->id);
205  $gameReward3 = GameReward::getById(self::$gameReward3->id);
206  $gameReward4 = GameReward::getById(self::$gameReward4->id);
207  $gameReward5 = GameReward::getById(self::$gameReward5->id);
208  $gameReward6 = GameReward::getById(self::$gameReward6->id);
209  $gameReward7 = GameReward::getById(self::$gameReward7->id);
210  $gameReward8 = GameReward::getById(self::$gameReward8->id);
211  $gameReward9 = GameReward::getById(self::$gameReward9->id);
212  $gameReward10 = GameReward::getById(self::$gameReward10->id);
213  $gameReward11 = GameReward::getById(self::$gameReward11->id);
214  $gameReward12 = GameReward::getById(self::$gameReward12->id);
215  $this->assertEquals ('3333', $gameReward1->description);
216  $this->assertEquals ('3333', $gameReward2->description);
217  $this->assertEquals ('3333', $gameReward3->description);
218  $this->assertEquals ('3333', $gameReward4->description);
219  $this->assertEquals ('3333', $gameReward5->description);
220  $this->assertEquals ('3333', $gameReward6->description);
221  $this->assertEquals ('3333', $gameReward7->description);
222  $this->assertEquals ('3333', $gameReward8->description);
223  $this->assertEquals ('3333', $gameReward9->description);
224  $this->assertEquals ('3333', $gameReward10->description);
225  $this->assertEquals ('3333', $gameReward11->description);
226  $this->assertEquals ('3333', $gameReward12->description);
227 
228  //Autocomplete for GameReward
229  $this->setGetArray(array('term' => 'super'));
230  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/autoComplete');
231 
232  //actionModalList
233  $this->setGetArray(array(
234  'modalTransferInformation' => array('sourceIdFieldId' => 'x', 'sourceNameFieldId' => 'y', 'modalId' => 'z')
235  ));
236  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/modalList');
237 
238  //actionAuditEventsModalList
239  $this->setGetArray(array('id' => $gameReward1->id));
240  $this->resetPostArray();
241  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/auditEventsModalList');
242  }
243 
248  {
249  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
250 
251  //Save a layout change. Collapse all portlets in the GameReward Details View.
252  //At this point portlets for this view should be created because we have already loaded the 'details' page in a request above.
253  $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition(
254  'GameRewardDetailsAndRelationsView', $super->id, array());
255  $this->assertEquals (2, count($portlets[1]));
256  $this->assertFalse (array_key_exists(2, $portlets) );
257  $portletPostData = array();
258  $portletCount = 0;
259  foreach ($portlets as $column => $columnPortlets)
260  {
261  foreach ($columnPortlets as $position => $portlet)
262  {
263  $this->assertEquals('0', $portlet->collapsed);
264  $portletPostData['GameRewardDetailsAndRelationsView_' . $portlet->id] = array(
265  'collapsed' => 'true',
266  'column' => 0,
267  'id' => 'GameRewardDetailsAndRelationsView_' . $portlet->id,
268  'position' => $portletCount,
269  );
270  $portletCount++;
271  }
272  }
273  //There should have been a total of 2 portlets.
274  $this->assertEquals(2, $portletCount);
275  }
276 
280  public function testSuperUserDeleteAction()
281  {
282  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
283 
284  //Delete an game reward.
285  $this->setGetArray(array('id' => self::$gameReward4->id));
286  $this->resetPostArray();
287  $this->runControllerWithRedirectExceptionAndGetContent('gameRewards/default/delete');
288  $gameRewards = GameReward::getAll();
289  $this->assertEquals(11, count($gameRewards));
290  try
291  {
292  GameReward::getById(self::$gameReward4->id);
293  $this->fail();
294  }
295  catch (NotFoundException $e)
296  {
297  //success
298  }
299  }
300 
304  public function testSuperUserCreateAction()
305  {
306  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
307  //Create a new game reward.
308  $this->resetGetArray();
309  $this->setPostArray(array('GameReward' => array(
310  'name' => 'myNewGameReward',
311  'description' => '456765421',
312  'cost' => 5,
313  'quantity' => 10)));
314  $redirectUrl = $this->runControllerWithRedirectExceptionAndGetUrl('gameRewards/default/create');
315  $gameRewards = GameReward::getByName('myNewGameReward');
316  $gameRewardTransaction1 = new GameRewardTransaction();
317  $gameRewardTransaction1->person = $super;
318  $gameRewardTransaction1->quantity = 5;
319  $gameRewardTransaction2 = new GameRewardTransaction();
320  $gameRewardTransaction2->person = $super;
321  $gameRewardTransaction2->quantity = 5;
322  $gameRewards[0]->transactions->add($gameRewardTransaction1);
323  $gameRewards[0]->transactions->add($gameRewardTransaction2);
324  $this->assertTrue($gameRewards[0]->save());
325  $this->assertEquals(1, count($gameRewards));
326  $this->assertTrue ($gameRewards[0]->id > 0);
327  $compareRedirectUrl = Yii::app()->createUrl('gameRewards/default/details', array('id' => $gameRewards[0]->id));
328  $this->assertEquals($compareRedirectUrl, $redirectUrl);
329  $this->assertEquals('456765421', $gameRewards[0]->description);
330  $this->assertTrue ($gameRewards[0]->owner == $super);
331  $gameRewards = GameReward::getAll();
332  $this->assertEquals(12, count($gameRewards));
333  }
334 
338  public function testSuperUserCopyAction()
339  {
340  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
341  $gameRewards = GameReward::getAll();
342  $this->assertEquals(12, count($gameRewards));
343  $gameRewards = GameReward::getByName('myNewGameReward');
344 
345  $postArray = array(
346  'GameReward' => array(
347  'quantity' => 23,
348  'cost' => 22,
349  )
350  );
351 
352  $this->updateModelValuesFromPostArray($gameRewards[0], $postArray);
353  $this->assertModelHasValuesFromPostArray($gameRewards[0], $postArray);
354 
355  $this->assertTrue($gameRewards[0]->save());
356 
357  $this->assertTrue(
358  $this->checkCopyActionResponseAttributeValuesFromPostArray($gameRewards[0], $postArray)
359  );
360 
361  $postArray['GameReward']['name'] = 'myClonedGameReward';
362  $postArray['GameReward']['description'] = 'Cloned description';
363  $this->setGetArray(array('id' => $gameRewards[0]->id));
364  $this->setPostArray($postArray);
365  $this->runControllerWithRedirectExceptionAndGetUrl('gameRewards/default/copy');
366 
367  $gameRewards = GameReward::getByName('myClonedGameReward');
368  $this->assertEquals(1, count($gameRewards));
369  $this->assertTrue ($gameRewards[0]->owner->isSame($super));
370  $this->assertModelHasValuesFromPostArray($gameRewards[0], $postArray);
371  $gameRewards = GameReward::getAll();
372  $this->assertEquals(13, count($gameRewards));
373  }
374 
378  public function testStickySearchActions()
379  {
380  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
381  StickySearchUtil::clearDataByKey('GameRewardsSearchView');
382  $value = StickySearchUtil::getDataByKey('GameRewardsSearchView');
383  $this->assertNull($value);
384 
385  //Sort order desc
386  $this->setGetArray(array('GameRewardsSearchForm' => array('anyMixedAttributes' => 'xyz',
387  SearchForm::SELECTED_LIST_ATTRIBUTES => array('quantity', 'name')),
388  'GameReward_sort' => 'name.desc'));
389 
390  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/');
391  $data = StickySearchUtil::getDataByKey('GameRewardsSearchView');
392  $compareData = array('dynamicClauses' => array(),
393  'dynamicStructure' => null,
394  'anyMixedAttributes' => 'xyz',
395  'anyMixedAttributesScope' => null,
396  SearchForm::SELECTED_LIST_ATTRIBUTES => array('quantity', 'name'),
397  'sortAttribute' => 'name',
398  'sortDescending' => true
399  );
400  $this->assertEquals($compareData, $data);
401 
402  //Sort order asc
403  StickySearchUtil::clearDataByKey('GameRewardsSearchView');
404  $this->setGetArray(array('GameRewardsSearchForm' => array('anyMixedAttributes' => 'xyz',
405  SearchForm::SELECTED_LIST_ATTRIBUTES => array('quantity', 'name')),
406  'GameReward_sort' => 'quantity'));
407 
408  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/');
409  $data = StickySearchUtil::getDataByKey('GameRewardsSearchView');
410  $compareData = array('dynamicClauses' => array(),
411  'dynamicStructure' => null,
412  'anyMixedAttributes' => 'xyz',
413  'anyMixedAttributesScope' => null,
414  SearchForm::SELECTED_LIST_ATTRIBUTES => array('quantity', 'name'),
415  'sortAttribute' => 'quantity',
416  'sortDescending' => false
417  );
418  $this->assertEquals($compareData, $data);
419 
420  $this->setGetArray(array('clearingSearch' => true));
421  $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default');
422  $data = StickySearchUtil::getDataByKey('GameRewardsSearchView');
423  $compareData = array('dynamicClauses' => array(),
424  'dynamicStructure' => null,
425  'anyMixedAttributesScope' => null,
426  SearchForm::SELECTED_LIST_ATTRIBUTES => array('name', 'cost', 'quantity')
427  );
428  $this->assertEquals($compareData, $data);
429  }
430 
435  {
436  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
437 
438  //MassDelete for selected Record Count
439  $gameRewards = GameReward::getAll();
440  $this->assertEquals(13, count($gameRewards));
441 
442  //Load Model MassDelete Views.
443  //MassDelete view for single selected ids
444  $this->setGetArray(array('selectedIds' => '5,6,7,8', 'selectAll' => '', )); // Not Coding Standard
445  $this->resetPostArray();
446  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/massDelete');
447  $this->assertContains('<strong>4</strong>&#160;Game Rewards selected for removal', $content);
448 
449  //MassDelete view for all result selected ids
450  $this->setGetArray(array('selectAll' => '1'));
451  $this->resetPostArray();
452  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/massDelete');
453  $this->assertContains('<strong>13</strong>&#160;Game Rewards selected for removal', $content);
454  //MassDelete for selected ids
455  $this->setGetArray(array(
456  'selectedIds' => implode(',', array(self::$gameReward2->id,self::$gameReward3->id,self::$gameReward12->id)), // Not Coding Standard
457  'selectAll' => '',
458  'GameReward_page' => 1));
459  $this->setPostArray(array('selectedRecordCount' => 3));
460  $this->runControllerWithRedirectExceptionAndGetContent('gameRewards/default/massDelete');
461 
462  //MassDelete for selected Record Count
463  $gameRewards = GameReward::getAll();
464  $this->assertEquals(10, count($gameRewards));
465  }
466 
467  public function testRedeemList()
468  {
469  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
470  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/redeemList');
471  $this->assertContains('<h4 class="reward-name">myClonedGameReward</h4>', $content);
472  //Test the search or paging of the listview.
473  Yii::app()->clientScript->reset(); //to make sure old js doesn't make it to the UI
474  $this->setGetArray(array('ajax' => 'list-view'));
475  $content = $this->runControllerWithNoExceptionsAndGetContent('gameRewards/default/redeemList');
476  $this->assertNotContains('anyMixedAttributes', $content);
477  $this->resetGetArray();
478  }
479 
480  public function testRedeemReward()
481  {
482  $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
483  $super->primaryEmail->emailAddress = 'super@zurmo.com';
484  $super->save();
485  Yii::app()->user->userModel = $super;
486  $gameRewards = GameReward::getByName('myNewGameReward');
487 
488  //not enough coins
489  $this->setGetArray(array('id' => $gameRewards[0]->id));
490  $content = $this->runControllerWithExitExceptionAndGetContent('gameRewards/default/redeemReward');
491  $this->assertContains('You do not have enough coins to redeem this reward', $content);
492 
493  //enough coins
494  $gameCoin = new GameCoin();
495  $gameCoin->person = $super;
496  $gameCoin->value = 100;
497  $this->assertTrue($gameCoin->save());
498  $notifications = Notification::getAll();
499 
500  //check for no notification
501  $this->assertEquals(0, EmailMessage::getCount());
502  $this->assertEquals(0, count($notifications));
503  $this->setGetArray(array('id' => $gameRewards[0]->id));
504  $content = $this->runControllerWithExitExceptionAndGetContent('gameRewards/default/redeemReward');
505  $this->assertContains('myNewGameReward has been redeemed.', $content);
506 
507  //check for notification
508  $notifications = Notification::getAll();
509  $this->assertEquals(1, count($notifications));
510  //email content
511  $this->assertContains('myNewGameReward was redeemed by Clark Kent.', $notifications[0]->notificationMessage->htmlContent);
512  //check url
513  $this->assertContains('/gameRewards/default/details?id=13', $notifications[0]->notificationMessage->htmlContent); // Not Coding Standard
514 
515  //check for email notification
516  $emailMessages = EmailMessage::getAll();
517  $this->assertCount(1, $emailMessages);
518  $this->assertContains('myNewGameReward was redeemed by Clark Kent.', $emailMessages[0]->content->htmlContent);
519  $this->assertContains('myNewGameReward was redeemed by Clark Kent.', $emailMessages[0]->content->textContent);
520  }
521  }
522 ?>
static getByLayoutIdAndUser($layoutId, $user)
Definition: Dashboard.php:46
static getByUsername($username)
Definition: User.php:49
runControllerWithRedirectExceptionAndGetContent($route, $compareUrl=null, $compareUrlContains=false)
updateModelValuesFromPostArray($model, $postArray)
static getByName($name)
Definition: GameReward.php:33
static getCount(RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $where=null, $modelClassName=null, $selectDistinct=false)
checkCopyActionResponseAttributeValuesFromPostArray($model, $postArray, $linkClass=null, $controllerId=null)
static getById($id, $modelClassName=null)
logoutCurrentUserLoginNewUserAndGetByUsername($username)
assertModelHasValuesFromPostArray($model, $postArray)
runControllerWithNoExceptionsAndGetContent($route, $empty=false)
static getAll($orderBy=null, $sortDescending=false, $modelClassName=null)
Generated on Fri Jul 3 2020 07:10:32
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.