From b5e3c6acc263b3e5eccf2bb33b1db8124ff461ed Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 28 May 2010 02:30:10 +0000 Subject: [PATCH] MINOR remove sort direction when running canSortBy. Also added test coverage for this. (from r96428) (from r98192) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105837 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/SSReportTest.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/SSReportTest.php diff --git a/tests/SSReportTest.php b/tests/SSReportTest.php new file mode 100644 index 00000000..2f637e44 --- /dev/null +++ b/tests/SSReportTest.php @@ -0,0 +1,27 @@ +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(); + } +} \ No newline at end of file