2010-02-25 03:34:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ContentReviewTest extends FunctionalTest {
|
2014-02-18 15:39:13 +13:00
|
|
|
|
2014-02-13 14:07:39 +13:00
|
|
|
public static $fixture_file = 'contentreview/tests/ContentReviewTest.yml';
|
|
|
|
|
2014-02-13 16:35:13 +13:00
|
|
|
public function testOwnerNames() {
|
2010-02-25 03:34:39 +00:00
|
|
|
$editor = $this->objFromFixture('Member', 'editor');
|
|
|
|
$this->logInAs($editor);
|
|
|
|
|
|
|
|
$page = new Page();
|
|
|
|
$page->ReviewPeriodDays = 10;
|
2014-02-13 16:35:13 +13:00
|
|
|
$page->ContentReviewUsers()->push($editor);
|
2010-02-25 03:34:39 +00:00
|
|
|
$page->write();
|
|
|
|
|
|
|
|
$this->assertTrue($page->doPublish());
|
2014-02-13 16:35:13 +13:00
|
|
|
$this->assertEquals($page->OwnerNames, "Test Editor", 'Test Editor should be the owner');
|
2010-02-25 03:34:39 +00:00
|
|
|
|
|
|
|
$page = $this->objFromFixture('Page', 'about');
|
2013-03-18 15:20:51 +13:00
|
|
|
$page->ContentReviewOwnerID = 0;
|
2010-02-25 03:34:39 +00:00
|
|
|
$page->write();
|
|
|
|
|
|
|
|
$this->assertTrue($page->doPublish());
|
2014-02-13 16:35:13 +13:00
|
|
|
$this->assertEquals('', $page->OwnerNames);
|
2010-02-25 03:34:39 +00:00
|
|
|
}
|
|
|
|
}
|