mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Client API Test
This commit is contained in:
parent
ea5f045509
commit
6272fb36fc
53
tests/Feature/ClientTest.php
Normal file
53
tests/Feature/ClientTest.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Jobs\Account\CreateAccount;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\User;
|
||||
use App\Utils\Traits\UserSessionAttributes;
|
||||
use Faker\Factory;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ClientTest extends TestCase
|
||||
{
|
||||
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Session::start();
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$data = [
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'password' => 'ALongAndBrilliantPassword123'
|
||||
];
|
||||
|
||||
$this->user = CreateAccount::dispatchNow($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A valid user can be logged in.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testUserCreated()
|
||||
{
|
||||
$this->assertTrue($user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user