2FAuth/tests/Unit/UserModelTest.php

39 lines
771 B
PHP
Raw Normal View History

2021-11-30 17:39:33 +01:00
<?php
namespace Tests\Unit;
2021-12-02 13:15:53 +01:00
use App\Models\User;
2021-11-30 17:39:33 +01:00
use Tests\ModelTestCase;
/**
2021-12-02 13:15:53 +01:00
* @covers \App\Models\User
2021-11-30 17:39:33 +01:00
*/
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()
{
2021-12-02 13:15:53 +01:00
$user = User::factory()->make([
2021-11-30 17:39:33 +01:00
'email' => 'UPPERCASE@example.COM',
]);
$this->assertEquals(strtolower('UPPERCASE@example.COM'), $user->email);
}
}