| @@ 108-125 (lines=18) @@ | ||
| 105 | * Testing for the login with invalid or wrong email |
|
| 106 | */ |
|
| 107 | ||
| 108 | public function test_authLoginWrongEmail() |
|
| 109 | { |
|
| 110 | $output = $this->obLogin->authLogin( |
|
| 111 | [ |
|
| 112 | "login" => '[email protected]', |
|
| 113 | "passLogin" => 'egfb' |
|
| 114 | ] |
|
| 115 | ); |
|
| 116 | $output = (array)json_decode($output, True); |
|
| 117 | $expectedOutput = [ |
|
| 118 | [ |
|
| 119 | "key" => "login", |
|
| 120 | "value" => " *Enter correct Email address" |
|
| 121 | ] |
|
| 122 | ]; |
|
| 123 | ||
| 124 | $this->assertEquals($expectedOutput, $output); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * @depends test_authRegister |
|
| @@ 131-148 (lines=18) @@ | ||
| 128 | * @depends test_authRegister |
|
| 129 | * Testing for the login with invalid email credentials |
|
| 130 | */ |
|
| 131 | public function test_authLoginInvalidUsernameEmail() |
|
| 132 | { |
|
| 133 | $output = $this->obLogin->authLogin( |
|
| 134 | [ |
|
| 135 | "login" => 'invalid', |
|
| 136 | "passLogin" => 'invalid' |
|
| 137 | ] |
|
| 138 | ); |
|
| 139 | $output = (array)json_decode($output, True); |
|
| 140 | $expectedOutput = [ |
|
| 141 | [ |
|
| 142 | "key" => "login", |
|
| 143 | "value" => " *Invalid username or email" |
|
| 144 | ] |
|
| 145 | ]; |
|
| 146 | ||
| 147 | $this->assertEquals($expectedOutput, $output); |
|
| 148 | } |
|
| 149 | ||
| 150 | /** |
|
| 151 | * @depends test_authRegister |
|
| @@ 154-170 (lines=17) @@ | ||
| 151 | * @depends test_authRegister |
|
| 152 | * Testing for the login with invalid password credentials |
|
| 153 | */ |
|
| 154 | public function test_authLoginInvalidPassword() |
|
| 155 | { |
|
| 156 | $output = $this->obLogin->authLogin( |
|
| 157 | [ |
|
| 158 | "login" => 'test', |
|
| 159 | "passLogin" => 'invalid' |
|
| 160 | ] |
|
| 161 | ); |
|
| 162 | $output = (array)json_decode($output, True); |
|
| 163 | $expectedOutput = [ |
|
| 164 | [ |
|
| 165 | "key" => "passLogin", |
|
| 166 | "value" => " *Invalid password" |
|
| 167 | ] |
|
| 168 | ]; |
|
| 169 | $this->assertEquals($expectedOutput, $output); |
|
| 170 | } |
|
| 171 | ||
| 172 | /** |
|
| 173 | * @depends test_authRegister |
|