2010-05-28 04:30:10 +02:00
|
|
|
<?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'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-28 04:34:37 +02:00
|
|
|
class SSReportTest_FakeTest extends SS_Report implements TestOnly {
|
2010-05-28 04:30:10 +02:00
|
|
|
function title() {
|
|
|
|
return 'Report title';
|
|
|
|
}
|
|
|
|
function columns() {
|
|
|
|
return array(
|
|
|
|
"Title" => array(
|
|
|
|
"title" => "Page Title"
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
function sourceRecords($params, $sort, $limit) {
|
2011-05-05 12:40:26 +02:00
|
|
|
return new ArrayList();
|
2010-05-28 04:30:10 +02:00
|
|
|
}
|
|
|
|
}
|