|
@@ 279-296 (lines=18) @@
|
| 276 |
|
SS_Datetime::clear_mock_now(); |
| 277 |
|
} |
| 278 |
|
|
| 279 |
|
public function testReviewActionVisibleForAuthor() |
| 280 |
|
{ |
| 281 |
|
SS_Datetime::set_mock_now("2020-03-01 12:00:00"); |
| 282 |
|
|
| 283 |
|
/** @var Page|SiteTreeContentReview $page */ |
| 284 |
|
$page = $this->objFromFixture("Page", "contact"); |
| 285 |
|
|
| 286 |
|
/** @var Member $author */ |
| 287 |
|
$author = $this->objFromFixture("Member", "author"); |
| 288 |
|
|
| 289 |
|
$this->logInAs($author); |
| 290 |
|
|
| 291 |
|
$fields = $page->getCMSActions(); |
| 292 |
|
|
| 293 |
|
$this->assertNotNull($fields->fieldByName("ActionMenus.ReviewContent")); |
| 294 |
|
|
| 295 |
|
SS_Datetime::clear_mock_now(); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
|
public function testReviewActionNotVisibleForEditor() |
| 299 |
|
{ |
|
@@ 298-315 (lines=18) @@
|
| 295 |
|
SS_Datetime::clear_mock_now(); |
| 296 |
|
} |
| 297 |
|
|
| 298 |
|
public function testReviewActionNotVisibleForEditor() |
| 299 |
|
{ |
| 300 |
|
SS_Datetime::set_mock_now("2020-03-01 12:00:00"); |
| 301 |
|
|
| 302 |
|
/** @var Page|SiteTreeContentReview $page */ |
| 303 |
|
$page = $this->objFromFixture("Page", "contact"); |
| 304 |
|
|
| 305 |
|
/** @var Member $author */ |
| 306 |
|
$author = $this->objFromFixture("Member", "editor"); |
| 307 |
|
|
| 308 |
|
$this->logInAs($author); |
| 309 |
|
|
| 310 |
|
$fields = $page->getCMSActions(); |
| 311 |
|
|
| 312 |
|
$this->assertNull($fields->fieldByName("ActionMenus.ReviewContent")); |
| 313 |
|
|
| 314 |
|
SS_Datetime::clear_mock_now(); |
| 315 |
|
} |
| 316 |
|
} |
| 317 |
|
|