From ce45dc0dbe05f31630a50c7ebd87fdb35bc3e429 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Fri, 17 Oct 2014 07:18:47 -0400 Subject: [PATCH] Dropped Sort class Moved it off to joshtronic/php-sort --- src/Sort.php | 70 -------------------------------------- tests/Pickles/SortTest.php | 61 --------------------------------- 2 files changed, 131 deletions(-) delete mode 100644 src/Sort.php delete mode 100644 tests/Pickles/SortTest.php diff --git a/src/Sort.php b/src/Sort.php deleted file mode 100644 index 6d37de6..0000000 --- a/src/Sort.php +++ /dev/null @@ -1,70 +0,0 @@ -' : '<') .' $b) ? -1 : 1; - ')); - - return true; - } -} - diff --git a/tests/Pickles/SortTest.php b/tests/Pickles/SortTest.php deleted file mode 100644 index ed916f2..0000000 --- a/tests/Pickles/SortTest.php +++ /dev/null @@ -1,61 +0,0 @@ - 'epsilon'], - ['name' => 'gamma'], - ['name' => 'alpha'], - ['name' => 'delta'], - ['name' => 'beta'], - ]; - - $sorted = [ - ['name' => 'alpha'], - ['name' => 'beta'], - ['name' => 'delta'], - ['name' => 'epsilon'], - ['name' => 'gamma'], - ]; - - Pickles\Sort::by('name', $shuffled); - - $this->assertEquals($sorted, $shuffled); - } - - public function testByNameDESC() - { - $shuffled = [ - ['name' => 'epsilon'], - ['name' => 'gamma'], - ['name' => 'alpha'], - ['name' => 'delta'], - ['name' => 'beta'], - ]; - - $sorted = [ - ['name' => 'gamma'], - ['name' => 'epsilon'], - ['name' => 'delta'], - ['name' => 'beta'], - ['name' => 'alpha'], - ]; - - Pickles\Sort::by('name', $shuffled, Pickles\Sort::DESC); - - $this->assertEquals($sorted, $shuffled); - } - - public function testMissingField() - { - $shuffled = [['foo' => 'bar', 'bar' => 'foo']]; - $sorted = [['foo' => 'bar', 'bar' => 'foo']]; - - Pickles\Sort::by('name', $shuffled); - - $this->assertEquals($sorted, $shuffled); - } -} -