forked from changeweb/Unifiedtransform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassModuleTest.php
More file actions
executable file
·47 lines (38 loc) · 1.17 KB
/
Copy pathClassModuleTest.php
File metadata and controls
executable file
·47 lines (38 loc) · 1.17 KB
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
<?php
namespace Tests\Feature\Manage;
use App\User;
use App\Myclass;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ClassModuleTest extends TestCase
{
use RefreshDatabase;
public function setUp(): void {
parent::setUp();
$admin = factory(User::class)->states('admin')->create();
$this->actingAs($admin);
$this->withoutExceptionHandling();
}
/** @test */
public function view_is(){
$this->get('school/sections')
->assertViewIs('school.sections');
}
/** @test */
public function it_shows_the_class_list() {
$this->get('school/sections')
->assertStatus(200)
->assertViewHas('classes');
}
/** @test */
public function admin_can_create_class() {
$class = factory(Myclass::class)->make();
$this->followingRedirects()
->post('school/add-class', $class->toArray())
->assertStatus(200);
$this->assertDatabaseHas('classes', $class->toArray());
$this->get('settings')
->assertSee('Manage '.$class['class_number']);
}
}