Skip to content

Commit

Permalink
remove old emails test #35
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Nov 24, 2015
1 parent aa6a00d commit 85645cd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
42 changes: 9 additions & 33 deletions application/tests/controllers/Ajax_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ class Ajax_test extends TestCase {

public static function setUpBeforeClass() {
$CI = &get_instance();
$CI->emailWatch = new MY_Model('email_watch');
$CI->emailMeasure = new MY_Model('email_measure');
$CI->emailUser = new MY_Model('email_user');

$CI->emailUser->delete_where(array("id >=" => "0"));
$CI->emailWatch->delete_where(array("id >=" => "0"));
$CI->emailMeasure->delete_where(array("id >=" => "0"));

$CI->load->model('User');
$CI->load->model('Measure');
$CI->load->model('Watch');
Expand All @@ -29,14 +37,6 @@ public function test_checkEmail() {

public function test_signup() {

$this->request->setCallable(
function ($CI) {
$email = $this->getDouble('CI_Email', ['send' => TRUE]);
$this->verifyInvokedOnce($email, 'send');
$CI->email = $email;
}
);

$output = $this->request(
'POST',
['Ajax', 'signup'],
Expand Down Expand Up @@ -113,14 +113,6 @@ public function test_signupFail() {

public function test_facebookSignup() {

$this->request->setCallable(
function ($CI) {
$email = $this->getDouble('CI_Email', ['send' => TRUE]);
$this->verifyInvokedOnce($email, 'send');
$CI->email = $email;
}
);

$output = $this->request(
'POST',
['Ajax', 'facebookSignup'],
Expand Down Expand Up @@ -180,14 +172,6 @@ public function test_facebookSigninFalse() {

public function test_askResetPassword() {

$this->request->setCallable(
function ($CI) {
$email = $this->getDouble('CI_Email', ['send' => TRUE]);
$this->verifyInvokedOnce($email, 'send');
$CI->email = $email;
}
);

$output = $this->request(
'POST',
['Ajax', 'askResetPassword'],
Expand Down Expand Up @@ -271,14 +255,6 @@ public function test_baseMesure() {
014
);

$this->request->setCallable(
function ($CI) {
$email = $this->getDouble('CI_Email', ['send' => TRUE]);
$this->verifyInvokedOnce($email, 'send');
$CI->email = $email;
}
);

$output = $this->request(
'POST',
['Ajax', 'baseMeasure'],
Expand Down Expand Up @@ -336,4 +312,4 @@ function ($CI) {

}

}
}
10 changes: 9 additions & 1 deletion application/tests/controllers/Measures_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public static function setUpBeforeClass() {

self::$userId = $CI->session->userdata('userId');

$CI->emailWatch = new MY_Model('email_watch');
$CI->emailMeasure = new MY_Model('email_measure');
$CI->emailUser = new MY_Model('email_user');

$CI->emailUser->delete_where(array("id >=" => "0"));
$CI->emailWatch->delete_where(array("id >=" => "0"));
$CI->emailMeasure->delete_where(array("id >=" => "0"));

$CI->Watch->delete_where(array("watchId >=" => "0"));
$CI->Measure->delete_where(array("id >=" => "0"));
}
Expand Down Expand Up @@ -109,4 +117,4 @@ public function test_getAccuracy(){
}


}
}
Empty file modified application/tests/controllers/Welcome_test.php
100755 → 100644
Empty file.
10 changes: 9 additions & 1 deletion application/tests/models/Measure_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ public static function setUpBeforeClass() {

self::$watch = $CI->Watch->getWatch(self::$watchId);

$CI->emailWatch = new MY_Model('email_watch');
$CI->emailMeasure = new MY_Model('email_measure');
$CI->emailUser = new MY_Model('email_user');

$CI->emailUser->delete_where(array("id >=" => "0"));
$CI->emailWatch->delete_where(array("id >=" => "0"));
$CI->emailMeasure->delete_where(array("id >=" => "0"));

$CI->Measure->delete_where(array("id >=" => "0"));
}

Expand Down Expand Up @@ -256,4 +264,4 @@ public function test_getMeasuresCountByWatchBrand() {

}

?>
?>
10 changes: 9 additions & 1 deletion application/tests/models/Watch_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public static function setUpBeforeClass() {

self::$userId = $CI->session->userdata('userId');

$CI->emailWatch = new MY_Model('email_watch');
$CI->emailMeasure = new MY_Model('email_measure');
$CI->emailUser = new MY_Model('email_user');

$CI->emailUser->delete_where(array("id >=" => "0"));
$CI->emailWatch->delete_where(array("id >=" => "0"));
$CI->emailMeasure->delete_where(array("id >=" => "0"));

$CI->Watch->delete_where(array("watchId >=" => "0"));
}

Expand Down Expand Up @@ -109,4 +117,4 @@ public static function tearDownAfterClass() {

}

?>
?>

0 comments on commit 85645cd

Please sign in to comment.