-
Notifications
You must be signed in to change notification settings - Fork 308
/
Copy pathProfileInformationControllerTest.php
48 lines (37 loc) · 1.46 KB
/
ProfileInformationControllerTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Laravel\Fortify\Tests;
use Illuminate\Contracts\Auth\Authenticatable;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
use Mockery;
class ProfileInformationControllerTest extends OrchestraTestCase
{
public function test_contact_information_can_be_updated()
{
$user = Mockery::mock(Authenticatable::class);
$this->mock(UpdatesUserProfileInformation::class)
->shouldReceive('update')
->once();
$response = $this->withoutExceptionHandling()->actingAs($user)->putJson('/user/profile-information', [
'name' => 'Taylor Otwell',
'email' => '[email protected]',
]);
$response->assertStatus(200);
}
public function test_email_address_will_be_updated_case_insensitive()
{
app('config')->set('fortify.lowercase_usernames', true);
$user = Mockery::mock(Authenticatable::class);
$this->mock(UpdatesUserProfileInformation::class)
->shouldReceive('update')
->with($user, [
'name' => 'Taylor Otwell',
'email' => '[email protected]',
])
->once();
$response = $this->withoutExceptionHandling()->actingAs($user)->putJson('/user/profile-information', [
'name' => 'Taylor Otwell',
'email' => '[email protected]',
]);
$response->assertStatus(200);
}
}