mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 20:44:19 +00:00
63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Providers\RouteServiceProvider;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class RegistrationTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
|
|
|
|
/* public function test_create_invitation_request_test()
|
|
{
|
|
|
|
//todo to be updated on finalizing creating company module
|
|
|
|
$response = $this->post('api/v1/account/invite/registration', [
|
|
'company_id' => 1,
|
|
'name' => 'Test User',
|
|
'email' => 'test@example.com',
|
|
'phone' => '899990989',
|
|
'wechat_id' => '5666',
|
|
'company_name' => 'test company co',
|
|
'password' => 'password',
|
|
'password_confirmation' => 'password',
|
|
'contact_email' => "contact@email.com",
|
|
]);
|
|
|
|
|
|
$response->assertStatus(404);
|
|
|
|
}
|
|
|
|
public function test_new_users_can_register()
|
|
{
|
|
$response = $this->post('/api/v1/account/registration', [
|
|
'type' => 1,
|
|
'name' => 'Test User',
|
|
'email' => 'test@example.com',
|
|
'phone' => '899990989',
|
|
'wechat_id' => '5666',
|
|
'company_name' => 'test company co',
|
|
'password' => 'password',
|
|
'password_confirmation' => 'password',
|
|
'contact_email' => "contact@email.com",
|
|
]);
|
|
|
|
$this->assertDatabaseHas('users', [
|
|
'id' => 1,
|
|
'email' => 'test@example.com',
|
|
'name' => 'Test User',
|
|
]);
|
|
|
|
//todo an error experienced on line $inviter = $this->fetchesCompanyModule->execute(['reference'=>'CIEF']);
|
|
|
|
//todo 1. assert a user was logged in 2. assert a user was redirected 3. assert user has a token
|
|
}
|
|
*/
|
|
}
|