Dropped Sort class
Moved it off to joshtronic/php-sort
This commit is contained in:
parent
ea28dbbc5e
commit
ce45dc0dbe
2 changed files with 0 additions and 131 deletions
|
@ -1,61 +0,0 @@
|
|||
<?php
|
||||
|
||||
class SortTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testByNameASC()
|
||||
{
|
||||
$shuffled = [
|
||||
['name' => '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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue