mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
27 lines
711 B
PHP
27 lines
711 B
PHP
<?php
|
|
|
|
class ContentReviewTest extends FunctionalTest {
|
|
|
|
public static $fixture_file = 'contentreview/tests/ContentReviewTest.yml';
|
|
|
|
public function testOwnerNames() {
|
|
$editor = $this->objFromFixture('Member', 'editor');
|
|
$this->logInAs($editor);
|
|
|
|
$page = new Page();
|
|
$page->ReviewPeriodDays = 10;
|
|
$page->ContentReviewUsers()->push($editor);
|
|
$page->write();
|
|
|
|
$this->assertTrue($page->doPublish());
|
|
$this->assertEquals($page->OwnerNames, "Test Editor", 'Test Editor should be the owner');
|
|
|
|
$page = $this->objFromFixture('Page', 'about');
|
|
$page->ContentReviewOwnerID = 0;
|
|
$page->write();
|
|
|
|
$this->assertTrue($page->doPublish());
|
|
$this->assertEquals('', $page->OwnerNames);
|
|
}
|
|
}
|