Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function testView() |
||
18 | { |
||
19 | //Test 1: applicant can view manager |
||
20 | $ianApplicant = $this->createApplicant(); |
||
21 | $maryManager = $this->createManager(); |
||
22 | $canApplicantViewManager = $this->getManagerPolicy()->view($ianApplicant->user, $maryManager); |
||
23 | $this->assertTrue($canApplicantViewManager); |
||
24 | |||
25 | //Test 2: manager can view self |
||
26 | $canManagerViewSelf = $this->getManagerPolicy()->view($maryManager->user, $maryManager); |
||
27 | $this->assertTrue($canManagerViewSelf); |
||
28 | |||
29 | //Test 3: manager can view other manager |
||
30 | $daveManager = $this->createManager(); |
||
31 | $sallyManager = $this->createManager(); |
||
32 | $canManagerViewManager = $this->getManagerPolicy()->view($daveManager->user, $sallyManager); |
||
33 | $this->assertTrue($canManagerViewManager); |
||
34 | } |
||
36 |