1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/tests/Feature/ClientTest.php

62 lines
1.4 KiB
PHP
Raw Normal View History

2019-03-26 06:00:15 +01:00
<?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;
2019-03-26 22:17:28 +01:00
use Illuminate\Database\Eloquent\Model;
2019-03-26 06:00:15 +01:00
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
{
2019-03-26 22:17:28 +01:00
//use DatabaseTransactions;
2019-03-26 06:00:15 +01:00
public function setUp()
{
parent::setUp();
Session::start();
2019-03-26 22:17:28 +01:00
$this->faker = \Faker\Factory::create();
Model::reguard();
2019-03-26 06:00:15 +01:00
}
2019-03-26 12:31:07 +01:00
public function testAccountCreation()
{
2019-03-26 22:17:28 +01:00
$data = [
'first_name' => $this->faker->firstName,
'last_name' => $this->faker->lastName,
'email' => $this->faker->unique()->safeEmail,
'password' => 'ALongAndBrilliantPassword123',
'_token' => csrf_token(),
'privacy_policy' => 1,
'terms_of_service' => 1
];
$response = $this->post('/signup', $data);
2019-03-26 12:31:07 +01:00
2019-03-26 22:17:28 +01:00
$response->assertStatus(200)
->assertJson([
'first_name' => $data['first_name'],
]);
2019-03-26 12:31:07 +01:00
}
2019-03-26 06:00:15 +01:00
public function testUserCreated()
{
2019-03-26 12:31:07 +01:00
$this->assertTrue(true);
2019-03-26 06:00:15 +01:00
}
}