-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathUserProfileTest.php
50 lines (34 loc) · 1.04 KB
/
UserProfileTest.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
49
50
<?php
namespace Tests\Feature;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class UserProfileTest extends TestCase
{
use RefreshDatabase;
public $user;
public function setup() :void
{
parent::setUp();
$this->seed('RolesAndPermissionsSeeder');
$superadmin = create('App\User');
$superadmin->assignRole('super admin');
$this->signIn($superadmin);
$this->user = create('App\User', ['id'=>222]);
}
/** @test */
public function it_should_display_user_name()
{
$response = $this->get('/badges/user/222');
$response->assertSeeText($this->user->firstname);
$response->assertSeeText($this->user->lastname);
}
/** @test */
public function it_should_display_achievements()
{
$this->withoutExceptionHandling();
$response = $this->get('/badges/user/222');
$response->assertSee('Active Organiser ' . Carbon::now()->year);
}
}