1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/tests/Unit/FactoryCreationTest.php

46 lines
757 B
PHP
Raw Normal View History

2019-04-26 12:51:02 +02:00
<?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);
}
}