@@ 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 | } |
@@ 36-48 (lines=13) @@ | ||
33 | /** |
|
34 | * |
|
35 | */ |
|
36 | public function testCanView() |
|
37 | { |
|
38 | $object = $this->objFromFixture(RecentBlogPostsBlock::class, 'one'); |
|
39 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
40 | $member = $this->objFromFixture(Member::class, 'default'); |
|
41 | if (class_exists(Blog::class)) { |
|
42 | $this->assertTrue($object->canView($admin)); |
|
43 | $this->assertTrue($object->canView($member)); |
|
44 | } else { |
|
45 | $this->assertFalse($object->canView($admin)); |
|
46 | $this->assertFalse($object->canView($member)); |
|
47 | } |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * |
|
@@ 53-65 (lines=13) @@ | ||
50 | /** |
|
51 | * |
|
52 | */ |
|
53 | public function testCanCreate() |
|
54 | { |
|
55 | $object = $this->objFromFixture(RecentBlogPostsBlock::class, 'one'); |
|
56 | $admin = $this->objFromFixture(Member::class, 'admin'); |
|
57 | $member = $this->objFromFixture(Member::class, 'default'); |
|
58 | if (class_exists(Blog::class)) { |
|
59 | $this->assertTrue($object->canCreate($admin)); |
|
60 | $this->assertTrue($object->canCreate($member)); |
|
61 | } else { |
|
62 | $this->assertFalse($object->canCreate($admin)); |
|
63 | $this->assertFalse($object->canCreate($member)); |
|
64 | } |
|
65 | } |
|
66 | } |