| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testView() |
||
| 21 | { |
||
| 22 | //Test 1: User is the applicant |
||
| 23 | //Expect to be allowed to view |
||
| 24 | $applicant = $this->makeApplicant(1); |
||
| 25 | $userCanViewOwnApplicant = $this->getPolicy()->view($applicant->user, $applicant); |
||
| 26 | $this->assertTrue($userCanViewOwnApplicant); |
||
| 27 | |||
| 28 | //Test 2: Applicants cannot view other applicant |
||
| 29 | $applicant2 = $this->makeApplicant(2); |
||
| 30 | $user1CanViewApplicant2 = $this->getPolicy()->view($applicant->user, $applicant2); |
||
| 31 | $this->assertFalse($user1CanViewApplicant2); |
||
| 32 | } |
||
| 34 |