getIdCriteria example

protected function setUp(): void
    {
        $this->repository = $this->getContainer()->get('media.repository');
        $this->context = Context::createDefaultContext();
    }

    public function testWriteReadMinimalFields(): void
    {
        $media = $this->getEmptyMedia();

        $criteria = $this->getIdCriteria($media->getId());
        $result = $this->repository->search($criteria$this->context);
        $media = $result->getEntities()->first();

        static::assertInstanceOf(MediaEntity::class$media);
        static::assertEquals($media->getId()$media->getId());
    }

    public function testThumbnailsAreConvertedToStructWhenFetchedFromDb(): void
    {
        $this->setFixtureContext($this->context);
        $media = $this->getMediaWithThumbnail();

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