| @@ 35-42 (lines=8) @@ | ||
| 32 | /** |
|
| 33 | * |
|
| 34 | */ |
|
| 35 | public function testCanView() |
|
| 36 | { |
|
| 37 | $object = $this->objFromFixture('AccordionPanel', 'one'); |
|
| 38 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 39 | $this->assertTrue($object->canView($admin)); |
|
| 40 | $member = $this->objFromFixture('Member', 'default'); |
|
| 41 | $this->assertTrue($object->canView($member)); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * |
|
| @@ 47-54 (lines=8) @@ | ||
| 44 | /** |
|
| 45 | * |
|
| 46 | */ |
|
| 47 | public function testCanEdit() |
|
| 48 | { |
|
| 49 | $object = $this->objFromFixture('AccordionPanel', 'one'); |
|
| 50 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 51 | $this->assertTrue($object->canEdit($admin)); |
|
| 52 | $member = $this->objFromFixture('Member', 'default'); |
|
| 53 | $this->assertTrue($object->canEdit($member)); |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * |
|
| @@ 59-66 (lines=8) @@ | ||
| 56 | /** |
|
| 57 | * |
|
| 58 | */ |
|
| 59 | public function testCanDelete() |
|
| 60 | { |
|
| 61 | $object = $this->objFromFixture('AccordionPanel', 'one'); |
|
| 62 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 63 | $this->assertTrue($object->canDelete($admin)); |
|
| 64 | $member = $this->objFromFixture('Member', 'default'); |
|
| 65 | $this->assertTrue($object->canDelete($member)); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * |
|
| @@ 71-78 (lines=8) @@ | ||
| 68 | /** |
|
| 69 | * |
|
| 70 | */ |
|
| 71 | public function testCanCreate() |
|
| 72 | { |
|
| 73 | $object = $this->objFromFixture('AccordionPanel', 'one'); |
|
| 74 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 75 | $this->assertTrue($object->canCreate($admin)); |
|
| 76 | $member = $this->objFromFixture('Member', 'default'); |
|
| 77 | $this->assertTrue($object->canCreate($member)); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| @@ 24-31 (lines=8) @@ | ||
| 21 | /** |
|
| 22 | * |
|
| 23 | */ |
|
| 24 | public function testCanView() |
|
| 25 | { |
|
| 26 | $object = $this->objFromFixture('RecentBlogPostsBlock', 'one'); |
|
| 27 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 28 | $this->assertFalse($object->canView($admin)); |
|
| 29 | $member = $this->objFromFixture('Member', 'default'); |
|
| 30 | $this->assertFalse($object->canView($member)); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * |
|
| @@ 36-43 (lines=8) @@ | ||
| 33 | /** |
|
| 34 | * |
|
| 35 | */ |
|
| 36 | public function testCanCreate() |
|
| 37 | { |
|
| 38 | $object = $this->objFromFixture('RecentBlogPostsBlock', 'one'); |
|
| 39 | $admin = $this->objFromFixture('Member', 'admin'); |
|
| 40 | $this->assertFalse($object->canCreate($admin)); |
|
| 41 | $member = $this->objFromFixture('Member', 'default'); |
|
| 42 | $this->assertFalse($object->canCreate($member)); |
|
| 43 | } |
|
| 44 | } |
|