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