getMediaWithManufacturer example

new EventDispatcher()
        );
    }

    public function testDeleteNotUsedMedia(): void
    {
        $this->setFixtureContext($this->context);

        $txt = $this->getTxt();
        $png = $this->getPng();
        $withProduct = $this->getMediaWithProduct();
        $withManufacturer = $this->getMediaWithManufacturer();

        $urlGenerator = $this->getContainer()->get(UrlGeneratorInterface::class);
        $firstPath = $urlGenerator->getRelativeMediaUrl($txt);
        $secondPath = $urlGenerator->getRelativeMediaUrl($png);
        $thirdPath = $urlGenerator->getRelativeMediaUrl($withProduct);
        $fourthPath = $urlGenerator->getRelativeMediaUrl($withManufacturer);

        $this->getPublicFilesystem()->writeStream($firstPath, \fopen(self::FIXTURE_FILE, 'rb'));
        $this->getPublicFilesystem()->writeStream($secondPath, \fopen(self::FIXTURE_FILE, 'rb'));
        $this->getPublicFilesystem()->writeStream($thirdPath, \fopen(self::FIXTURE_FILE, 'rb'));
        $this->getPublicFilesystem()->writeStream($fourthPath, \fopen(self::FIXTURE_FILE, 'rb'));

        
$encoded = $strategy->generatePathHash($media);

        static::assertIsString($encoded);
        static::assertSame($encoded$strategy->generatePathHash($media));
        static::assertStringEndsNotWith('/', $encoded);
        static::assertStringStartsNotWith('/', $encoded);
        static::assertSame($lengthmb_strlen($encoded));
    }

    private function assertCacheBusterGenerator(PathnameStrategyInterface $strategy): void
    {
        static::assertNull($strategy->generatePathCacheBuster($this->getMediaWithManufacturer()));
        static::assertSame('1293894181', $strategy->generatePathCacheBuster($this->getPngWithoutExtension()));
    }

    private function assertFilenameGenerator(PathnameStrategyInterface $strategy): void
    {
        $jpg = $this->getJpg();
        $mediaWithThumbnail = $this->getMediaWithThumbnail();

        static::assertSame('jpgFileWithExtension.jpg', $strategy->generatePhysicalFilename($jpg));
        static::assertSame('jpgFileWithExtension_200x200.jpg', $strategy->generatePhysicalFilename($jpg$mediaWithThumbnail->getThumbnails()->first()));
    }
}
$this->getContainer()->get('media_default_folder.repository')
        );
    }

    public function testCountNotUsedMedia(): void
    {
        $this->setFixtureContext($this->context);

        $this->getTxt();
        $this->getPngWithoutExtension();
        $this->getMediaWithProduct();
        $this->getMediaWithManufacturer();

        static::assertEquals(2, $this->deleteMediaService->countNotUsedMedia($this->context));
    }

    public function testDeleteNotUsedMedia(): void
    {
        $this->setFixtureContext($this->context);

        $txt = $this->getTxt();
        $png = $this->getPng();
        $withProduct = $this->getMediaWithProduct();
        
Home | Imprint | This part of the site doesn't use cookies.