SystemConfigChangedHook example

$tags,
                false
            );

        $subscriber = new CacheInvalidationSubscriber(
            $cacheInvalidator,
            $this->createMock(Connection::class),
            $enabled,
            $enabled
        );

        $subscriber->invalidateConfigKey(new SystemConfigChangedHook(['test' => '1'][]));
    }

    public static function provideTracingConfigExamples(): \Generator
    {
        yield 'enabled' => [
            false,
            [
                'global.system.config',
                'system-config',
            ],
        ];

        
use Shopware\Core\System\SystemConfig\Event\SystemConfigChangedHook;

/** * @internal * * @covers \Shopware\Core\System\SystemConfig\Event\SystemConfigChangedHook */
class SystemConfigChangedHookTest extends TestCase
{
    public function testName(): void
    {
        static::assertSame('app.config.changed', (new SystemConfigChangedHook([][]))->getName());
    }

    /** * @param array<string> $permissions * * @dataProvider getPermissionCases */
    public static function testPermissions(SystemConfigChangedHook $hook, array $permissions, bool $allowed): void
    {
        static::assertSame($allowed$hook->isAllowed('app-id', new AclPrivilegeCollection($permissions)));
    }

    
$qb->delete('system_config')
                ->executeStatement();
        }

        $insertQueue->execute();

        // Dispatch events that the given values have been changed         foreach ($events as $event) {
            $this->eventDispatcher->dispatch($event);
        }

        $this->eventDispatcher->dispatch(new SystemConfigChangedHook($values$this->getAppMapping()));
    }

    public function delete(string $key, ?string $salesChannel = null): void
    {
        $this->setMultiple([$key => null]$salesChannel);
    }

    /** * Fetches default values from bundle configuration and saves it to database */
    public function savePluginConfiguration(Bundle $bundle, bool $override = false): void
    {
Home | Imprint | This part of the site doesn't use cookies.