From 4376cc8bd6b5b7dcfb05cfdf79752253fd2d56cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Fri, 2 Feb 2018 14:28:51 +0100 Subject: [PATCH] Added conditions to SortByTest because otherwise different PHP versions... yielded different sort orders (that's sort of ok, as rating is ambiguous). See https://travis-ci.org/parsecsv/parsecsv-for-php/jobs/336540118 --- tests/properties/SortByTest.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/properties/SortByTest.php b/tests/properties/SortByTest.php index c26d4bb..5c10d1e 100644 --- a/tests/properties/SortByTest.php +++ b/tests/properties/SortByTest.php @@ -4,6 +4,7 @@ class SortByTest extends BaseClass { public function testSortByRating() { $this->csv->sort_by = 'rating'; + $this->csv->conditions = 'title does not contain Blood'; $this->_compareWithExpected([ // Rating 0 'The Killing Kind', @@ -12,7 +13,6 @@ class SortByTest extends BaseClass { // Rating 3 'The Last Templar', 'The Broker (Paperback)', - 'Without Blood (Paperback)', // Rating 4 'Deception Point (Paperback)', @@ -29,14 +29,17 @@ class SortByTest extends BaseClass { public function testReverseSortByRating() { $this->csv->sort_by = 'rating'; + $this->csv->conditions = + 'title does not contain Prey AND ' . + 'title does not contain Fortress AND ' . + 'title does not contain Blood AND ' . + 'title does not contain Fear'; $this->csv->sort_reverse = true; $this->_compareWithExpected([ // Rating 5 - 'Digital Fortress : A Thriller (Mass Market Paperback)', - 'Prey', - 'State of Fear (Paperback)', 'Angels & Demons (Mass Market Paperback)', + 'The Traveller', // Rating 4 'The Da Vinci Code (Hardcover)', @@ -46,7 +49,6 @@ class SortByTest extends BaseClass { // Rating 3 'The Broker (Paperback)', 'The Last Templar', - 'Without Blood (Paperback)', // Rating 0 'The Third Secret',