@@ 132-143 (lines=12) @@ | ||
129 | $this->assertTrue($thirdCategory->canEdit($editor), 'Editor should be able to edit category.'); |
|
130 | } |
|
131 | ||
132 | public function testCanCreate() |
|
133 | { |
|
134 | $this->useDraftSite(); |
|
135 | ||
136 | $admin = $this->objFromFixture(Member::class, 'Admin'); |
|
137 | $editor = $this->objFromFixture(Member::class, 'Editor'); |
|
138 | ||
139 | $category = BlogCategory::singleton(); |
|
140 | ||
141 | $this->assertTrue($category->canCreate($admin), 'Admin should be able to create category.'); |
|
142 | $this->assertTrue($category->canCreate($editor), 'Editor should be able to create category.'); |
|
143 | } |
|
144 | ||
145 | public function testCanDelete() |
|
146 | { |
@@ 105-114 (lines=10) @@ | ||
102 | $this->assertNotEmpty($fields->dataFieldByName('Authors')); |
|
103 | } |
|
104 | ||
105 | public function testCanViewFuturePost() |
|
106 | { |
|
107 | $blogPost = $this->objFromFixture(BlogPost::class, 'NullPublishDate'); |
|
108 | ||
109 | $editor = $this->objFromFixture(Member::class, 'BlogEditor'); |
|
110 | $this->assertTrue($blogPost->canView($editor)); |
|
111 | ||
112 | $visitor = $this->objFromFixture(Member::class, 'Visitor'); |
|
113 | $this->assertFalse($blogPost->canView($visitor)); |
|
114 | } |
|
115 | ||
116 | /** |
|
117 | * The purpose of getDate() is to act as a proxy for PublishDate in the default RSS |
@@ 130-141 (lines=12) @@ | ||
127 | $this->assertTrue($thirdTag->canEdit($editor), 'Editor should be able to edit tag.'); |
|
128 | } |
|
129 | ||
130 | public function testCanCreate() |
|
131 | { |
|
132 | $this->useDraftSite(); |
|
133 | ||
134 | $admin = $this->objFromFixture(Member::class, 'Admin'); |
|
135 | $editor = $this->objFromFixture(Member::class, 'Editor'); |
|
136 | ||
137 | $tag = singleton(BlogTag::class); |
|
138 | ||
139 | $this->assertTrue($tag->canCreate($admin), 'Admin should be able to create tag.'); |
|
140 | $this->assertTrue($tag->canCreate($editor), 'Editor should be able to create tag.'); |
|
141 | } |
|
142 | ||
143 | public function testCanDelete() |
|
144 | { |