Permalink
Browse files

MINOR remove sort direction when running canSortBy. Also added test c…

…overage for this. (from r96428) (from r98192)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105837 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent e1242f0 commit b5e3c6acc263b3e5eccf2bb33b1db8124ff461ed @chillu chillu committed May 28, 2010
Showing with 27 additions and 0 deletions.
  1. +27 −0 tests/SSReportTest.php
View
@@ -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();
+ }
+}

0 comments on commit b5e3c6a

Please sign in to comment.