Completed
Push — feature/manager_localization2 ( de29b5...0f36f8 )
by Xander
16:57 queued 09:59
created

BasePolicyTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
c 0
b 0
f 0
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createApplicant() 0 4 1
A createUser() 0 4 1
A createManager() 0 4 1
1
<?php
2
3
namespace Tests\Unit\Policies;
4
5
use Tests\TestCase;
6
use Illuminate\Foundation\Testing\WithFaker;
7
use Illuminate\Foundation\Testing\RefreshDatabase;
8
use App\Models\Applicant;
9
use App\Models\Manager;
10
use App\Models\User;
11
12
/**
13
 * A base class for Policy tests
14
 */
15
16
abstract class BasePolicyTest extends TestCase
17
{
18
19
    //create basic user
20
    public function createUser()
21
    {
22
        $user = factory(User::class)->create();
23
        return $user;
24
    }
25
26
    //create applicant, factory includes a user
27
    public function createApplicant()
28
    {
29
        $applicant = factory(Applicant::class)->create();
30
        return $applicant;
31
    }
32
    //create manager, factory includes a user
33
    public function createManager()
34
    {
35
        $manager = factory(Manager::class)->create();
36
        return $manager;
37
    }
38
39
    /*
40
    protected function makeJobPoster() {
41
        $jobPoster = JobPoster::make();
42
    }
43
44
    //makeJob($manager) {}
45
46
    //makeApplication($applicant, $job) {}
47
    */
48
}
49