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"),
|
|
|
|
);
|
|
|
|
|
2014-02-24 01:38:16 +01:00
|
|
|
public function testReportContent() {
|
|
|
|
$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'
|
|
|
|
), 'NextReviewDate ASC', false);
|
|
|
|
|
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');
|
|
|
|
$results = $report->sourceRecords(array(
|
|
|
|
), 'NextReviewDate ASC', false);
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|