diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..525efe5 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "joshtronic/php-sort", + "type": "library", + "license": "MIT", + "require": { + "platform": { + "php": ">=5.3" + } + }, + "autoload": { + "psr-4": { + "Pickles\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Pickles\\Tests\\": "tests" + } + } +} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..24d2560 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,5 @@ + + + vendor/* + + diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..cb568a9 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,4 @@ + + + ./tests + diff --git a/tests/SortTest.php b/tests/SortTest.php index ed916f2..d29543e 100644 --- a/tests/SortTest.php +++ b/tests/SortTest.php @@ -1,6 +1,10 @@ 'gamma'], ]; - Pickles\Sort::by('name', $shuffled); + Sort::by('name', $shuffled); $this->assertEquals($sorted, $shuffled); } @@ -43,7 +47,7 @@ class SortTest extends PHPUnit_Framework_TestCase ['name' => 'alpha'], ]; - Pickles\Sort::by('name', $shuffled, Pickles\Sort::DESC); + Sort::by('name', $shuffled, Sort::DESC); $this->assertEquals($sorted, $shuffled); } @@ -53,9 +57,8 @@ class SortTest extends PHPUnit_Framework_TestCase $shuffled = [['foo' => 'bar', 'bar' => 'foo']]; $sorted = [['foo' => 'bar', 'bar' => 'foo']]; - Pickles\Sort::by('name', $shuffled); + Sort::by('name', $shuffled); $this->assertEquals($sorted, $shuffled); } } -