Permalink
Browse files

ENHANCEMENT: renaming SSReportTest to Report test so it matches the n…

…ame of Report.php
  • Loading branch information...
1 parent e55d8bc commit fe2805834a639852201b38387d31ed24a876a326 Julian Seidenberg committed Apr 3, 2012
Showing with 58 additions and 27 deletions.
  1. +58 −0 tests/reports/ReportTest.php
  2. +0 −27 tests/reports/SSReportTest.php
@@ -0,0 +1,58 @@
+<?php
+
+class ReportTest 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'));
+ }
+
+ function testGetReports() {
+ $reports = SS_Report::get_reports();
+ $this->assertNotNull($reports, "Reports returned");
+ Debug::Show($reports);
+ }
+}
+
+class ReportTest_FakeTest extends SS_Report implements TestOnly {
+ function title() {
+ return 'Report title';
+ }
+ function columns() {
+ return array(
+ "Title" => array(
+ "title" => "Page Title"
+ )
+ );
+ }
+ function sourceRecords($params, $sort, $limit) {
+ return new ArrayList();
+ }
+
+ function sort() {
+ return 100;
+ }
+}
+
+
+class ReportTest_FakeTest2 extends SS_Report implements TestOnly {
+ function title() {
+ return 'Report title';
+ }
+ function columns() {
+ return array(
+ "Title" => array(
+ "title" => "Page Title"
+ )
+ );
+ }
+ function sourceRecords($params, $sort, $limit) {
+ return new ArrayList();
+ }
+
+ function sort() {
+ return 98;
+ }
+}
@@ -1,27 +0,0 @@
-<?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 SS_Report implements TestOnly {
- function title() {
- return 'Report title';
- }
- function columns() {
- return array(
- "Title" => array(
- "title" => "Page Title"
- )
- );
- }
- function sourceRecords($params, $sort, $limit) {
- return new ArrayList();
- }
-}

0 comments on commit fe28058

Please sign in to comment.