mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
0cecb21f50
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105855 467b73ca-7a2a-4603-9d3b-597d59a354a9
27 lines
651 B
PHP
27 lines
651 B
PHP
<?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 DataObjectSet();
|
|
}
|
|
} |