| @@ 51-63 (lines=13) @@ | ||
| 48 | /** |
|
| 49 | * |
|
| 50 | */ |
|
| 51 | public function testCanView() |
|
| 52 | { |
|
| 53 | $object = $this->objFromFixture(FormBlock::class, 'one'); |
|
| 54 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
| 55 | $member = $this->objFromFixture(Member::class, 'default'); |
|
| 56 | if (class_exists('UserDefinedForm')) { |
|
| 57 | $this->assertTrue($object->canView($admin)); |
|
| 58 | $this->assertTrue($object->canView($member)); |
|
| 59 | } else { |
|
| 60 | $this->assertFalse($object->canView($admin)); |
|
| 61 | $this->assertFalse($object->canView($member)); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * |
|
| @@ 68-80 (lines=13) @@ | ||
| 65 | /** |
|
| 66 | * |
|
| 67 | */ |
|
| 68 | public function testCanCreate() |
|
| 69 | { |
|
| 70 | $object = $this->objFromFixture(FormBlock::class, 'one'); |
|
| 71 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
| 72 | $member = $this->objFromFixture(Member::class, 'default'); |
|
| 73 | if (class_exists('UserDefinedForm')) { |
|
| 74 | $this->assertTrue($object->canCreate($admin)); |
|
| 75 | $this->assertTrue($object->canCreate($member)); |
|
| 76 | } else { |
|
| 77 | $this->assertFalse($object->canCreate($admin)); |
|
| 78 | $this->assertFalse($object->canCreate($member)); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | } |
|
| @@ 35-47 (lines=13) @@ | ||
| 32 | /** |
|
| 33 | * |
|
| 34 | */ |
|
| 35 | public function testCanView() |
|
| 36 | { |
|
| 37 | $object = $this->objFromFixture(RecentBlogPostsBlock::class, 'one'); |
|
| 38 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
| 39 | $member = $this->objFromFixture(Member::class, 'default'); |
|
| 40 | if (class_exists('Blog')) { |
|
| 41 | $this->assertTrue($object->canView($admin)); |
|
| 42 | $this->assertTrue($object->canView($member)); |
|
| 43 | } else { |
|
| 44 | $this->assertFalse($object->canView($admin)); |
|
| 45 | $this->assertFalse($object->canView($member)); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * |
|
| @@ 52-64 (lines=13) @@ | ||
| 49 | /** |
|
| 50 | * |
|
| 51 | */ |
|
| 52 | public function testCanCreate() |
|
| 53 | { |
|
| 54 | $object = $this->objFromFixture(RecentBlogPostsBlock::class, 'one'); |
|
| 55 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
| 56 | $member = $this->objFromFixture(Member::class, 'default'); |
|
| 57 | if (class_exists('Blog')) { |
|
| 58 | $this->assertTrue($object->canCreate($admin)); |
|
| 59 | $this->assertTrue($object->canCreate($member)); |
|
| 60 | } else { |
|
| 61 | $this->assertFalse($object->canCreate($admin)); |
|
| 62 | $this->assertFalse($object->canCreate($member)); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | } |
|