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