-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add key value array for mock user to ease tests' understanding #35
- Loading branch information
1 parent
2435cae
commit 0873072
Showing
1 changed file
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,22 +34,40 @@ public static function setUpBeforeClass() { | |
$CI->User->insert($data); | ||
|
||
$data['email'] = '[email protected]'; | ||
// + 2 days and 1 hour | ||
$data['registerDate'] = time() + (2*24*60*60) + 3600; | ||
$data['lastLogin'] = $data['registerDate']; | ||
$CI->User->insert($data); | ||
|
||
$data['email'] = '[email protected]'; | ||
$data['registerDate'] = time() + (3*24*60*60) + 3600; | ||
$data['lastLogin'] = $data['registerDate']; | ||
$CI->User->insert($data); | ||
|
||
$data['email'] = '[email protected]'; | ||
$data['registerDate'] = time() + (4*24*60*60) + 3600; | ||
$data['lastLogin'] = $data['registerDate']; | ||
$CI->User->insert($data); | ||
|
||
$data['email'] = '[email protected]'; | ||
$data['registerDate'] = time() + (5*24*60*60) + 3600; | ||
$data['lastLogin'] = $data['registerDate']; | ||
$CI->User->insert($data); | ||
|
||
$data['email'] = '[email protected]'; | ||
$data['registerDate'] = time() + (6*24*60*60) + 3600; | ||
$data['lastLogin'] = $data['registerDate']; | ||
$CI->User->insert($data); | ||
|
||
$tmp = $CI->User->select()->find_all(); | ||
|
||
self::$users = $CI->User->select()->find_all(); | ||
|
||
self::$users['nestor'] = $tmp[0]; | ||
self::$users['ernest'] = $tmp[1]; | ||
self::$users['anatole'] = $tmp[2]; | ||
self::$users['phillibert'] = $tmp[3]; | ||
self::$users['hippolyte'] = $tmp[4]; | ||
self::$users['raymond'] = $tmp[5]; | ||
} | ||
|
||
public function setUp() { | ||
|
@@ -96,7 +114,6 @@ public function setUp() { | |
|
||
$this->emailMeasure = new MY_Model('email_measure'); | ||
$this->emailWatch = new MY_Model('email_watch'); | ||
|
||
} | ||
|
||
public function test_mock() { | ||
|
@@ -111,7 +128,6 @@ public function test_mock() { | |
); | ||
} | ||
|
||
|
||
public function test_signup() { | ||
|
||
echo 'test_signup'; | ||
|
@@ -121,7 +137,7 @@ public function test_signup() { | |
$this->email->updateObserver( | ||
'TEST', | ||
SIGN_UP, | ||
self::$users[0])[0]['_id'] | ||
self::$users['nestor'])[0]['_id'] | ||
); | ||
} | ||
|
||
|
@@ -136,13 +152,15 @@ public function test_lostPassword(){ | |
$this->email->updateObserver( | ||
'TEST', | ||
RESET_PASSWORD, | ||
array('user' => self::$users[0], | ||
array('user' => self::$users['nestor'], | ||
'token' => 'plop' ))[0]['_id'] | ||
); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
// public function test_addWatch() { | ||
|
||
// echo 'test_addWatch'; | ||
|