Browse Source

First building blocks: native PHP sort, insertion sort.

- Supports paratest to parallelize tests.
Frederic G. MARAND 10 years ago
parent
commit
537005a888

+ 3 - 0
OSInet/Sort/.gitignore

@@ -0,0 +1,3 @@
+composer.phar
+
+vendor

+ 41 - 0
OSInet/Sort/InsertionSort.php

@@ -0,0 +1,41 @@
+<?php
+/**
+ * @file
+ *   InsertionSort.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort;
+
+/**
+ * Class InsertionSort
+ *
+ * @package OSInet\Sort
+ *
+ * @see http://en.wikipedia.org/wiki/Insertion_sort
+ */
+class InsertionSort extends Sort {
+
+  public function sort($data, $comparison, $options = array()) {
+    $sorted = array();
+    foreach ($data as $unsorted_offset => $unsorted_value) {
+      $found = false;
+      foreach ($sorted as $sorted_offset => $sorted_value) {
+        $result = $comparison($unsorted_value, $sorted_value);
+        if ($result < 0) {
+          $found = true;
+          array_splice($sorted, $sorted_offset, 0, array($unsorted_value));
+          break;
+        }
+      }
+      if (!$found) {
+        $sorted[] = $unsorted_value;
+      }
+    }
+
+    return $sorted;
+  }
+} 

+ 30 - 0
OSInet/Sort/NativeSort.php

@@ -0,0 +1,30 @@
+<?php
+/**
+ * @file
+ *   NativeSort.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort;
+
+/**
+ * Class NativeSort: use PHP builtin usort() function.
+ *
+ * @package OSInet\Sort
+ *
+ * @see http://en.wikipedia.org/wiki/Insertion_sort
+ */
+class NativeSort extends Sort {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function sort($data, $comparison, $options = array()) {
+    $sorted = $data;
+    usort($sorted, $comparison);
+    return $sorted;
+  }
+} 

+ 24 - 0
OSInet/Sort/Sort.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * @file
+ *   Sort.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort;
+
+
+abstract class Sort implements SortInterface {
+  /**
+   * {@inheritdoc}
+   */
+  public static function create($type) {
+    $namespace = __NAMESPACE__;
+    $class = $namespace . '\\' . ucfirst($type) . "Sort";
+    $ret = class_exists($class, true) ? new $class() : false;
+    return $ret;
+  }
+}

+ 39 - 0
OSInet/Sort/SortInterface.php

@@ -0,0 +1,39 @@
+<?php
+/**
+ * @file
+ *   SortInterface.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort;
+
+
+interface SortInterface {
+  /**
+   * @param string $type
+   *   The name of the sort algorithm: bubble, heap, insertion, merge, quick,
+   *   selection, and so on.
+   *
+   * @return SortInterface
+   */
+  public static function create($type);
+
+  /**
+   * @param array $data
+   *   The data to sort. It will not be modified in place.
+   * @param callable $comparison
+   *   The comparison callback. It must take two Sortable parameters, and
+   *   return less than 0 if the first is lower than the second, 0 if they are
+   *   equal, and more than 0 if the first is higher than the second. It may
+   *   take a third array parameter, which will receive the $options array.
+   * @param array $options
+   *   A hash of options for the comparison function.
+   *
+   * @return array
+   *   The sorted version of the input data.
+   */
+  public function sort($data, $comparison, $options = array());
+}

+ 65 - 0
OSInet/Sort/Tests/InsertionSortTest.php

@@ -0,0 +1,65 @@
+<?php
+/**
+ * @file
+ *   InsertionSortTest.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort\Tests;
+
+
+use OSInet\Sort\Sort;
+
+class InsertionSortTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * @var \OSInet\Sort\InsertionSort
+   */
+  protected $sort;
+
+  protected $expected;
+
+  public function setUp() {
+    $this->sort = Sort::create('insertion');
+    $this->assertInstanceOf('OSInet\Sort\SortInterface', $this->sort);
+    // Roughly 4 seconds on my 2011 MacBook Pro
+    $this->expected = range(1, 1000);
+  }
+
+  protected function genericTest($source, $expected = NULL) {
+    $actual = $this->sort->sort($source, function ($a, $b) {
+      return $a - $b;
+    });
+    if (!isset($expected)) {
+      $expected = $this->expected;
+    }
+    $this->assertEquals($expected, $actual);
+  }
+
+  public function testEmpty() {
+    $this->genericTest(array(), array());
+  }
+
+  public function testSorted() {
+    $source = $this->expected;
+    $this->genericTest($source);
+  }
+
+  public function testReverted() {
+    $source = array_reverse($this->expected);
+    $this->genericTest($source);
+  }
+
+  public function testRandom() {
+    $passes = 10;
+
+    $source = $this->expected;
+    for ($i = 0 ; $i < $passes ; $i++) {
+      shuffle($source);
+      $this->genericTest($source);
+    }
+  }
+}

+ 65 - 0
OSInet/Sort/Tests/NativeSortTest.php

@@ -0,0 +1,65 @@
+<?php
+/**
+ * @file
+ *   NativeSortTest.php
+ *
+ * @author: marand
+ *
+ * @license General Public License version 2 or later
+ */
+
+namespace OSInet\Sort\Tests;
+
+
+use OSInet\Sort\Sort;
+
+class NativeSortTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * @var \OSInet\Sort\NativeSort
+   */
+  protected $sort;
+
+  protected $expected;
+
+  public function setUp() {
+    $this->sort = Sort::create('native');
+    $this->assertInstanceOf('OSInet\Sort\SortInterface', $this->sort);
+    // Roughly 4 seconds on my 2011 MacBook Pro
+    $this->expected = range(1, 5000);
+  }
+
+  protected function genericTest($source, $expected = NULL) {
+    $actual = $this->sort->sort($source, function ($a, $b) {
+      return $a - $b;
+    });
+    if (!isset($expected)) {
+      $expected = $this->expected;
+    }
+    $this->assertEquals($expected, $actual);
+  }
+
+  public function testEmpty() {
+    $this->genericTest(array(), array());
+  }
+
+  public function testSorted() {
+    $source = $this->expected;
+    $this->genericTest($source);
+  }
+
+  public function testReverted() {
+    $source = array_reverse($this->expected);
+    $this->genericTest($source);
+  }
+
+  public function testRandom() {
+    $passes = 10;
+
+    $source = $this->expected;
+    for ($i = 0 ; $i < $passes ; $i++) {
+      shuffle($source);
+      $this->genericTest($source);
+    }
+  }
+}

+ 21 - 0
OSInet/Sort/composer.json

@@ -0,0 +1,21 @@
+{
+    "name": "osinet/sort",
+    "description": "A collection of sort implementations",
+    "license": "GPL-3.0+",
+    "authors": [
+        {
+            "name": "Frederic G. MARAND",
+            "email": "fgm@osinet.fr"
+        }
+    ],
+    "minimum-stability": "dev",
+    "require": {
+      "phpunit/phpunit": "*",
+      "brianium/paratest": "dev-master"
+    },
+    "autoload": {
+      "psr-0": {
+        "OSInet\\Sort": "../.."
+      }
+    }
+}

+ 649 - 0
OSInet/Sort/composer.lock

@@ -0,0 +1,649 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+    ],
+    "hash": "2d4d6d1357aef91f34b6aef215c2b8b4",
+    "packages": [
+        {
+            "name": "brianium/habitat",
+            "version": "v1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/brianium/habitat.git",
+                "reference": "d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/brianium/habitat/zipball/d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96",
+                "reference": "d0979e3bb379cbc78ecb42b3ac171bc2b7e06d96",
+                "shasum": ""
+            },
+            "require-dev": {
+                "monolog/monolog": ">=1.5.0",
+                "phpunit/phpunit": ">=3.7.21"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "Habitat": [
+                        "src/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Scaturro",
+                    "email": "scaturrob@gmail.com",
+                    "homepage": "http://brianscaturro.com",
+                    "role": "Lead"
+                }
+            ],
+            "description": "A dependable php environment",
+            "time": "2013-06-08 04:42:29"
+        },
+        {
+            "name": "brianium/paratest",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/brianium/paratest.git",
+                "reference": "defa0aab8326ecaa9426bd392777a9527d84a68b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/brianium/paratest/zipball/defa0aab8326ecaa9426bd392777a9527d84a68b",
+                "reference": "defa0aab8326ecaa9426bd392777a9527d84a68b",
+                "shasum": ""
+            },
+            "require": {
+                "brianium/habitat": "1.0.0",
+                "ext-pcre": "*",
+                "ext-reflection": "*",
+                "ext-simplexml": "*",
+                "php": ">=5.3.0",
+                "phpunit/php-timer": ">=1.0.4",
+                "phpunit/phpunit": ">=3.7.8",
+                "symfony/console": "2.3.*",
+                "symfony/process": "2.3.*"
+            },
+            "bin": [
+                "bin/paratest"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "ParaTest": [
+                        "src/",
+                        "test/",
+                        "it/"
+                    ]
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Scaturro",
+                    "email": "scaturrob@gmail.com",
+                    "homepage": "http://brianscaturro.com",
+                    "role": "Lead"
+                }
+            ],
+            "description": "Parallel testing for PHP",
+            "homepage": "https://github.com/brianium/paratest",
+            "keywords": [
+                "concurrent",
+                "parallel",
+                "phpunit",
+                "testing"
+            ],
+            "time": "2013-07-25 08:22:55"
+        },
+        {
+            "name": "phpunit/php-code-coverage",
+            "version": "1.2.x-dev",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+                "reference": "10c5b2c8b72a801eaad0031cd6a6a3686909c5a9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/10c5b2c8b72a801eaad0031cd6a6a3686909c5a9",
+                "reference": "10c5b2c8b72a801eaad0031cd6a6a3686909c5a9",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "phpunit/php-file-iterator": ">=1.3.0@stable",
+                "phpunit/php-text-template": ">=1.1.1@stable",
+                "phpunit/php-token-stream": ">=1.1.3@stable"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "3.7.*@dev"
+            },
+            "suggest": {
+                "ext-dom": "*",
+                "ext-xdebug": ">=2.0.5"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "PHP/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+            "keywords": [
+                "coverage",
+                "testing",
+                "xunit"
+            ],
+            "time": "2013-11-01 09:17:11"
+        },
+        {
+            "name": "phpunit/php-file-iterator",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "File/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+            "keywords": [
+                "filesystem",
+                "iterator"
+            ],
+            "time": "2013-10-10 15:34:57"
+        },
+        {
+            "name": "phpunit/php-text-template",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-text-template.git",
+                "reference": "1eeef106193d2f8c539728e566bb4793071a9e18"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/1eeef106193d2f8c539728e566bb4793071a9e18",
+                "reference": "1eeef106193d2f8c539728e566bb4793071a9e18",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "Text/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Simple template engine.",
+            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+            "keywords": [
+                "template"
+            ],
+            "time": "2013-01-07 10:56:17"
+        },
+        {
+            "name": "phpunit/php-timer",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-timer.git",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "PHP/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Utility class for timing",
+            "homepage": "https://github.com/sebastianbergmann/php-timer/",
+            "keywords": [
+                "timer"
+            ],
+            "time": "2013-08-02 07:42:54"
+        },
+        {
+            "name": "phpunit/php-token-stream",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+                "reference": "292f4d5772dad5a12775be69f4a8dd663b20f103"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/292f4d5772dad5a12775be69f4a8dd663b20f103",
+                "reference": "292f4d5772dad5a12775be69f4a8dd663b20f103",
+                "shasum": ""
+            },
+            "require": {
+                "ext-tokenizer": "*",
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "PHP/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Wrapper around PHP's tokenizer extension.",
+            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+            "keywords": [
+                "tokenizer"
+            ],
+            "time": "2013-10-21 14:03:39"
+        },
+        {
+            "name": "phpunit/phpunit",
+            "version": "3.7.x-dev",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit.git",
+                "reference": "236f65cc97d6beaa8fcb8a27b19bd278f3912677"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/236f65cc97d6beaa8fcb8a27b19bd278f3912677",
+                "reference": "236f65cc97d6beaa8fcb8a27b19bd278f3912677",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "ext-pcre": "*",
+                "ext-reflection": "*",
+                "ext-spl": "*",
+                "php": ">=5.3.3",
+                "phpunit/php-code-coverage": "~1.2.1",
+                "phpunit/php-file-iterator": ">=1.3.1",
+                "phpunit/php-text-template": ">=1.1.1",
+                "phpunit/php-timer": ">=1.0.4",
+                "phpunit/phpunit-mock-objects": "~1.2.0",
+                "symfony/yaml": "~2.0"
+            },
+            "require-dev": {
+                "pear-pear/pear": "1.9.4"
+            },
+            "suggest": {
+                "ext-json": "*",
+                "ext-simplexml": "*",
+                "ext-tokenizer": "*",
+                "phpunit/php-invoker": ">=1.1.0,<1.2.0"
+            },
+            "bin": [
+                "composer/bin/phpunit"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.7.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "PHPUnit/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                "",
+                "../../symfony/yaml/"
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "The PHP Unit Testing framework.",
+            "homepage": "http://www.phpunit.de/",
+            "keywords": [
+                "phpunit",
+                "testing",
+                "xunit"
+            ],
+            "time": "2013-11-06 01:58:51"
+        },
+        {
+            "name": "phpunit/phpunit-mock-objects",
+            "version": "1.2.x-dev",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+                "reference": "3e40f3b3f18c044a24688fe406440d7fd537744a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3e40f3b3f18c044a24688fe406440d7fd537744a",
+                "reference": "3e40f3b3f18c044a24688fe406440d7fd537744a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "phpunit/php-text-template": ">=1.1.1@stable"
+            },
+            "require-dev": {
+                "pear-pear/pear": "1.9.4",
+                "phpunit/phpunit": "3.7.*@dev"
+            },
+            "suggest": {
+                "ext-soap": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "PHPUnit/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Mock Object library for PHPUnit",
+            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+            "keywords": [
+                "mock",
+                "xunit"
+            ],
+            "time": "2013-07-23 04:42:59"
+        },
+        {
+            "name": "symfony/console",
+            "version": "2.3.x-dev",
+            "target-dir": "Symfony/Component/Console",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/Console.git",
+                "reference": "38f924338419db1ce147ef39fff1265ee64faa81"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/Console/zipball/38f924338419db1ce147ef39fff1265ee64faa81",
+                "reference": "38f924338419db1ce147ef39fff1265ee64faa81",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "symfony/event-dispatcher": "~2.1"
+            },
+            "suggest": {
+                "symfony/event-dispatcher": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.3-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\Console\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Console Component",
+            "homepage": "http://symfony.com",
+            "time": "2013-11-05 15:14:13"
+        },
+        {
+            "name": "symfony/process",
+            "version": "2.3.x-dev",
+            "target-dir": "Symfony/Component/Process",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/Process.git",
+                "reference": "82898108f79040314a7b3ba430a72c32c7f61d14"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/Process/zipball/82898108f79040314a7b3ba430a72c32c7f61d14",
+                "reference": "82898108f79040314a7b3ba430a72c32c7f61d14",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.3-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\Process\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Process Component",
+            "homepage": "http://symfony.com",
+            "time": "2013-10-30 08:30:20"
+        },
+        {
+            "name": "symfony/yaml",
+            "version": "dev-master",
+            "target-dir": "Symfony/Component/Yaml",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/Yaml.git",
+                "reference": "1f7cabb841e62ec49615bd965ac780fd994b3f64"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/Yaml/zipball/1f7cabb841e62ec49615bd965ac780fd994b3f64",
+                "reference": "1f7cabb841e62ec49615bd965ac780fd994b3f64",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\Yaml\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Yaml Component",
+            "homepage": "http://symfony.com",
+            "time": "2013-10-17 11:48:11"
+        }
+    ],
+    "packages-dev": [
+
+    ],
+    "aliases": [
+
+    ],
+    "minimum-stability": "dev",
+    "stability-flags": {
+        "brianium/paratest": 20
+    },
+    "platform": [
+
+    ],
+    "platform-dev": [
+
+    ]
+}

+ 20 - 0
OSInet/Sort/phpunit.xml.dist

@@ -0,0 +1,20 @@
+<phpunit backupGlobals="true"
+  backupStaticAttributes="false"
+  bootstrap="vendor/autoload.php"
+  cacheTokens="true"
+  colors="false"
+  convertErrorsToExceptions="true"
+  convertNoticesToExceptions="true"
+  convertWarningsToExceptions="true"
+  forceCoversAnnotation="false"
+  mapTestClassNameToCoveredClassName="false"
+  printerClass="PHPUnit_TextUI_ResultPrinter"
+  processIsolation="false"
+  stopOnError="false"
+  stopOnFailure="false"
+  stopOnIncomplete="false"
+  stopOnSkipped="false"
+  testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
+  strict="false"
+  verbose="false">
+  </phpunit>