<?php

namespace Webfactory\ContentMapping\Test\Stubs;

use Webfactory\ContentMapping\SourceAdapter;

class SourceStub implements SourceAdapter
{
    /**
     * @var \Iterator
     */
    private $objects;

    /**
     * @param $objects
     */
    public function __construct(\Iterator $objects = null)
    {
        $this->objects = $objects ?: new \ArrayIterator();
    }

    public function getObjectsOrderedById()
    {
        return $this->objects;
    }
}

<?php

namespace Webfactory\ContentMapping\Test\Stubs;

use Webfactory\ContentMapping\SourceAdapter;

class SourceStub implements SourceAdapter
{
    /**
     * @var \Iterator
     */
    private $objects;

    /**
     * @param $objects
     */
    public function __construct(\Iterator $objects = null)
    {
        $this->objects = $objects ?: new \ArrayIterator();
    }

    public function getObjectsOrderedById()
    {
        usort($entities, function($a, $b) {
            return $a->getId() <=> $b->getId();
        });

        return $this->objects;
    }
}

--- 
+++ 
@@ -21,10 +21,6 @@
 
     public function getObjectsOrderedById()
     {
-        usort($entities, function($a, $b) {
-            return $a->getId() <=> $b->getId();
-        });
-
         return $this->objects;
     }
 }
Revert "Ensure objects are sorted by ID when calling getObjectsOrderedById()"

This reverts commit 31b3611813b22f9e981836682583807503c5c1ce.
