AfterSortCollection example

use Shopware\Core\Framework\Uuid\Uuid;

/** * @internal * * @covers \Shopware\Core\Framework\DataAbstractionLayer\Util\AfterSort */
class AfterSortTest extends TestCase
{
    public function testSortingAfterIdWithoutData(): void
    {
        $collection = new AfterSortCollection();
        $collection->sortByAfter();

        static::assertCount(0, $collection->getElements());
    }

    public function testSortingWithSingleElement(): void
    {
        $entity1 = new TestEntity();
        $entity1->setId(Uuid::randomHex());
        $entity1->setName('Root #1');

        
Home | Imprint | This part of the site doesn't use cookies.