mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 04:24:01 +00:00
added send verification test
This commit is contained in:
@@ -48,9 +48,8 @@ class AuthController extends Controller
|
||||
$user_verification->token = $token;
|
||||
$user_verification->save();
|
||||
|
||||
// send token to phone
|
||||
// ** switching to nexmo **
|
||||
//$message = "IZYIM verification code : ". $token;
|
||||
// TODO: send token to phone
|
||||
//$message = "RM0.00 IZYIM: Verification code : ". $token;
|
||||
//$twilio = new Twilio(env('TWILIO_ACC'), env('TWILIO_TOKEN'), env('TWILIO_NUMBER'));
|
||||
//$twilio->message($request->phone, $message);
|
||||
return response()->json(['success'=> true, 'message'=> 'A verification code has been send to your mobile number.' ]);
|
||||
@@ -121,8 +120,6 @@ class AuthController extends Controller
|
||||
return response()->json(['success'=> false, 'error'=> $validator->messages()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$name = $request->name;
|
||||
$password = $request->password;
|
||||
$role = $request->role;
|
||||
|
||||
@@ -15,12 +15,8 @@ class LoginTest extends TestCase
|
||||
*/
|
||||
public function testExample()
|
||||
{
|
||||
$response = $this->json('POST', '/api/login', ['phone' => '01234567899','password' => '123']);
|
||||
|
||||
$response = $this->json('POST', '/api/login', ['phone' => '0123456789','password' => 'secret']);
|
||||
$response
|
||||
->assertStatus(201)
|
||||
->assertJson([
|
||||
'created' => true,
|
||||
]);
|
||||
->assertStatus(200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,14 +13,13 @@ class RegisterTest extends TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testRegister()
|
||||
public function testSendVerification()
|
||||
{
|
||||
$response = $this->json('POST', '/api/register', ['name' => 'Sally']);
|
||||
|
||||
$response = $this->json('POST', '/api/send-verification', ['phone' => '0123456789']);
|
||||
$response
|
||||
->assertStatus(201)
|
||||
->assertStatus(200)
|
||||
->assertJson([
|
||||
'created' => true,
|
||||
'success' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user