mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR remove sort direction when running canSortBy. Also added test coverage for this. (from r96428)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98192 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
63580a4b13
commit
4982aac955
27
tests/SSReportTest.php
Normal file
27
tests/SSReportTest.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user