diff --git a/tests/reports/ReportTest.php b/tests/reports/ReportTest.php new file mode 100644 index 00000000..a5c74d2e --- /dev/null +++ b/tests/reports/ReportTest.php @@ -0,0 +1,58 @@ +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; + } +} \ No newline at end of file diff --git a/tests/reports/SSReportTest.php b/tests/reports/SSReportTest.php deleted file mode 100644 index a805a7ba..00000000 --- a/tests/reports/SSReportTest.php +++ /dev/null @@ -1,27 +0,0 @@ -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(); - } -} \ No newline at end of file