@@ 91-100 (lines=10) @@ | ||
88 | $this->assertNotEmpty($fields->dataFieldByName('Authors')); |
|
89 | } |
|
90 | ||
91 | public function testCanViewFuturePost() |
|
92 | { |
|
93 | $blogPost = $this->objFromFixture(BlogPost::class, 'NullPublishDate'); |
|
94 | ||
95 | $editor = $this->objFromFixture(Member::class, 'BlogEditor'); |
|
96 | $this->assertTrue($blogPost->canView($editor)); |
|
97 | ||
98 | $visitor = $this->objFromFixture(Member::class, 'Visitor'); |
|
99 | $this->assertFalse($blogPost->canView($visitor)); |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * The purpose of getDate() is to act as a proxy for PublishDate in the default RSS |
@@ 122-133 (lines=12) @@ | ||
119 | $this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.'); |
|
120 | } |
|
121 | ||
122 | public function testCanCreate() |
|
123 | { |
|
124 | $this->useDraftSite(); |
|
125 | ||
126 | $admin = $this->objFromFixture(Member::class, 'Admin'); |
|
127 | $editor = $this->objFromFixture(Member::class, 'Editor'); |
|
128 | ||
129 | $category = singleton(BlogCategory::class); |
|
130 | ||
131 | $this->assertTrue($category->canCreate($admin), 'Admin should be able to create category.'); |
|
132 | $this->assertTrue($category->canCreate($editor), 'Editor should be able to create category.'); |
|
133 | } |
|
134 | ||
135 | public function testCanDelete() |
|
136 | { |
@@ 128-139 (lines=12) @@ | ||
125 | $this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.'); |
|
126 | } |
|
127 | ||
128 | public function testCanCreate() |
|
129 | { |
|
130 | $this->useDraftSite(); |
|
131 | ||
132 | $admin = $this->objFromFixture(Member::class, 'Admin'); |
|
133 | $editor = $this->objFromFixture(Member::class, 'Editor'); |
|
134 | ||
135 | $tag = singleton(BlogTag::class); |
|
136 | ||
137 | $this->assertTrue($tag->canCreate($admin), 'Admin should be able to create tag.'); |
|
138 | $this->assertTrue($tag->canCreate($editor), 'Editor should be able to create tag.'); |
|
139 | } |
|
140 | ||
141 | public function testCanDelete() |
|
142 | { |