| @@ 51-60 (lines=10) @@ | ||
| 48 | /** |
|
| 49 | * We can view if we're logged in as admin. Otherwise, no. |
|
| 50 | */ |
|
| 51 | public function testAllowView() |
|
| 52 | { |
|
| 53 | $this->logOut(); |
|
| 54 | $viewFalse = LogEntry::create()->canView(null); |
|
| 55 | $this->assertFalse($viewFalse); |
|
| 56 | ||
| 57 | $this->logInWithPermission('ADMIN'); |
|
| 58 | $viewTrue = LogEntry::create()->canView(); |
|
| 59 | $this->assertTrue($viewTrue); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * We can Delete if we're logged in as admin. Otherwise, no. |
|
| @@ 65-74 (lines=10) @@ | ||
| 62 | /** |
|
| 63 | * We can Delete if we're logged in as admin. Otherwise, no. |
|
| 64 | */ |
|
| 65 | public function testAllowDelete() |
|
| 66 | { |
|
| 67 | $this->logOut(); |
|
| 68 | $deleteFalse = LogEntry::create()->canDelete(null); |
|
| 69 | $this->assertFalse($deleteFalse); |
|
| 70 | ||
| 71 | $this->logInWithPermission('ADMIN'); |
|
| 72 | $deleteTrue = LogEntry::create()->canDelete(); |
|
| 73 | $this->assertTrue($deleteTrue); |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Ensure that the contents are JSON encoded and pretty printed, and that the CSS class is correct |
|