2014-02-24 01:38:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ContentReviewReportTest extends FunctionalTest {
|
|
|
|
|
|
|
|
public static $fixture_file = 'contentreview/tests/ContentReviewTest.yml';
|
|
|
|
|
2014-02-26 23:07:34 +01:00
|
|
|
protected $requiredExtensions = array(
|
|
|
|
"SiteTree" => array("SiteTreeContentReview"),
|
|
|
|
"Group" => array("ContentReviewOwner"),
|
|
|
|
"Member" => array("ContentReviewOwner"),
|
|
|
|
"CMSPageEditController" => array("ContentReviewCMSExtension"),
|
|
|
|
"SiteConfig" => array("ContentReviewDefaultSettings"),
|
|
|
|
);
|
|
|
|
|
2015-09-23 00:32:23 +02:00
|
|
|
public function testPagesDueForReviewReport() {
|
2014-02-24 01:38:16 +01:00
|
|
|
$editor = $this->objFromFixture('Member', 'editor');
|
|
|
|
$this->logInAs($editor);
|
|
|
|
$report = new PagesDueForReviewReport();
|
|
|
|
|
|
|
|
$report->parameterFields();
|
|
|
|
$report->columns();
|
|
|
|
$report->title();
|
|
|
|
|
|
|
|
$results = $report->sourceRecords(array(
|
|
|
|
'ReviewDateAfter' => '01/01/2010',
|
|
|
|
'ReviewDateBefore' => '12/12/2010'
|
2015-09-23 00:32:23 +02:00
|
|
|
));
|
|
|
|
|
2014-02-25 09:21:08 +01:00
|
|
|
$this->assertEquals(array(
|
2014-02-25 08:43:46 +01:00
|
|
|
'Contact Us',
|
2014-02-25 09:21:08 +01:00
|
|
|
'Contact Us Child',
|
2014-02-24 01:38:16 +01:00
|
|
|
'Staff',
|
2014-02-25 08:43:46 +01:00
|
|
|
'About Us',
|
|
|
|
'Home'
|
2014-02-25 09:21:08 +01:00
|
|
|
), $results->column('Title'));
|
2014-02-24 01:38:16 +01:00
|
|
|
|
|
|
|
SS_Datetime::set_mock_now('2010-02-13 00:00:00');
|
2015-09-23 00:32:23 +02:00
|
|
|
$results = $report->sourceRecords(array());
|
2014-02-25 09:21:08 +01:00
|
|
|
$this->assertEquals(array(
|
2014-02-25 08:43:46 +01:00
|
|
|
'About Us',
|
|
|
|
'Home'
|
2014-02-25 09:21:08 +01:00
|
|
|
), $results->column('Title'));
|
2014-02-24 01:38:16 +01:00
|
|
|
|
|
|
|
SS_Datetime::clear_mock_now();
|
|
|
|
}
|
|
|
|
|
2015-09-23 00:32:23 +02:00
|
|
|
public function testPagesWithoutReviewScheduleReport() {
|
|
|
|
$editor = $this->objFromFixture('Member', 'editor');
|
|
|
|
$this->logInAs($editor);
|
|
|
|
$report = new PagesWithoutReviewScheduleReport();
|
|
|
|
|
|
|
|
$report->parameterFields();
|
|
|
|
$report->columns();
|
|
|
|
$report->title();
|
|
|
|
|
|
|
|
$results = $report->sourceRecords();
|
|
|
|
|
|
|
|
$this->assertEquals(array(
|
|
|
|
'Home',
|
|
|
|
'About Us',
|
|
|
|
'Page without review date',
|
|
|
|
'Page owned by group',
|
|
|
|
), $results->column('Title'));
|
|
|
|
}
|
|
|
|
|
2014-02-24 01:38:16 +01:00
|
|
|
}
|
|
|
|
|