1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/tests/Unit/FactoryCreationTest.php
2019-04-26 20:51:02 +10:00

46 lines
757 B
PHP

<?php
namespace Tests\Unit;
use App\Factory\UserFactory;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Session;
use Tests\TestCase;
/**
* @test
* @covers App\Factory\
*/
class FactoryCreationTest extends TestCase
{
use MakesHash;
public function setUp() :void
{
parent::setUp();
Session::start();
$this->faker = \Faker\Factory::create();
Model::reguard();
}
public function testUserCreate()
{
$new_user = UserFactory::create();
$new_user->email = $this->faker->email;
$new_user->save();
$this->assertNotNull($new_user);
$this->assertInternalType("int", $new_user->id);
}
}