ENHANCEMENT: renaming SSReportTest to Report test so it matches the name of Report.php

This commit is contained in:
Julian Seidenberg 2012-04-03 16:13:06 +12:00
parent e55d8bc5d6
commit fe2805834a
2 changed files with 58 additions and 27 deletions

View File

@ -0,0 +1,58 @@
<?php
class ReportTest extends SapphireTest {
function testCanSortBy() {
$report = new SSReportTest_FakeTest();
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title ASC'));
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title DESC'));
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title'));
}
function testGetReports() {
$reports = SS_Report::get_reports();
$this->assertNotNull($reports, "Reports returned");
Debug::Show($reports);
}
}
class ReportTest_FakeTest extends SS_Report implements TestOnly {
function title() {
return 'Report title';
}
function columns() {
return array(
"Title" => array(
"title" => "Page Title"
)
);
}
function sourceRecords($params, $sort, $limit) {
return new ArrayList();
}
function sort() {
return 100;
}
}
class ReportTest_FakeTest2 extends SS_Report implements TestOnly {
function title() {
return 'Report title';
}
function columns() {
return array(
"Title" => array(
"title" => "Page Title"
)
);
}
function sourceRecords($params, $sort, $limit) {
return new ArrayList();
}
function sort() {
return 98;
}
}

View File

@ -1,27 +0,0 @@
<?php
class SSReportTest extends SapphireTest {
function testCanSortBy() {
$report = new SSReportTest_FakeTest();
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title ASC'));
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title DESC'));
$this->assertTrue($report->sourceQuery(array())->canSortBy('Title'));
}
}
class SSReportTest_FakeTest extends SS_Report implements TestOnly {
function title() {
return 'Report title';
}
function columns() {
return array(
"Title" => array(
"title" => "Page Title"
)
);
}
function sourceRecords($params, $sort, $limit) {
return new ArrayList();
}
}