mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 07:48:37 +02:00
Complete Unit, Feature and Api tests
This commit is contained in:
39
tests/Unit/UserModelTest.php
Normal file
39
tests/Unit/UserModelTest.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\User;
|
||||
use Tests\ModelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\User
|
||||
*/
|
||||
class UserModelTest extends ModelTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function test_model_configuration()
|
||||
{
|
||||
$this->runConfigurationAssertions(new User(),
|
||||
['name', 'email', 'password'],
|
||||
['password', 'remember_token'],
|
||||
['*'],
|
||||
[],
|
||||
['id' => 'int', 'email_verified_at' => 'datetime']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function test_email_is_set_lowercased()
|
||||
{
|
||||
$user = factory(User::class)->make([
|
||||
'email' => 'UPPERCASE@example.COM',
|
||||
]);
|
||||
|
||||
$this->assertEquals(strtolower('UPPERCASE@example.COM'), $user->email);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user