configureRegistry example

/** * @internal * * @covers \Shopware\Core\Content\Media\UnusedMediaPurger */
#[Package('buyers-experience')] class UnusedMediaPurgerTest extends TestCase
{
    public function testGetNotUsedMediaOnlyAppliesValidAssociationsToCriteria(): void
    {
        $this->configureRegistry([
            'Media' => $mediaDefinition = $this->getMediaDefinition([]),
        ]);

        $id1 = Uuid::randomHex();
        $id2 = Uuid::randomHex();

        $media1 = $this->createMedia($id1);
        $media2 = $this->createMedia($id2);

        /** @var StaticEntityRepository<MediaCollection> $repo */
        $repo = new StaticEntityRepository(
            [
Home | Imprint | This part of the site doesn't use cookies.