mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT: renaming SSReportTest to Report test so it matches the name of Report.php
This commit is contained in:
parent
e55d8bc5d6
commit
fe2805834a
58
tests/reports/ReportTest.php
Normal file
58
tests/reports/ReportTest.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user