mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
27 lines
650 B
PHP
27 lines
650 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 SSReport implements TestOnly {
|
||
|
function title() {
|
||
|
return 'Report title';
|
||
|
}
|
||
|
function columns() {
|
||
|
return array(
|
||
|
"Title" => array(
|
||
|
"title" => "Page Title"
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
function sourceRecords($params, $sort, $limit) {
|
||
|
return new DataObjectSet();
|
||
|
}
|
||
|
}
|