mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-23 06:24:07 +00:00
removed example test
addded verify sms code test
This commit is contained in:
@@ -40,8 +40,14 @@ class AuthController extends Controller
|
||||
]);
|
||||
$user->save();
|
||||
|
||||
// create token if not exist, update if exist
|
||||
// create token if not exist, update if exist
|
||||
$token = mt_rand(0000,9999);
|
||||
|
||||
// for testing
|
||||
if($request->phone == '0123456789'){
|
||||
$token = "1234";
|
||||
}
|
||||
|
||||
$user_verification = $user->phoneVerification()->firstOrNew([
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,15 @@ class RegisterTest extends TestCase
|
||||
'success' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function testVerify()
|
||||
{
|
||||
$response = $this->json('POST', '/api/verify', ['phone' => '0123456789', 'token' => '1234']);
|
||||
$response
|
||||
->assertStatus(200)
|
||||
->assertJson([
|
||||
'success' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user