createEntitySearchResult example

$entityCollection,
            null,
            $criteria,
            Context::createDefaultContext()
        );

        static::assertSame($page$result->getPage());
    }

    public function testSlice(): void
    {
        $entitySearchResult = $this->createEntitySearchResult();

        $newInstance = $entitySearchResult->slice(2);

        $firstInstance = $newInstance->first();
        static::assertNotNull($firstInstance);
        static::assertSame(ArrayEntity::class$newInstance->getEntity());
        static::assertSame(ArrayEntity::class$firstInstance::class);
        static::assertSame(8, $newInstance->getTotal());
        static::assertSame($entitySearchResult->getAggregations()$newInstance->getAggregations());
        static::assertSame($entitySearchResult->getCriteria()$newInstance->getCriteria());
        static::assertSame($entitySearchResult->getContext()$newInstance->getContext());
    }
Home | Imprint | This part of the site doesn't use cookies.