From 77473c5b31306c7205bb2b2c3dd91476463bb958 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 4 Oct 2014 11:04:21 -0400 Subject: [PATCH] Dropped sort class from the core --- 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 5c2a4d9..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); - } -} -