receiving example

$configBuilder = $this->generateConfigBuilder(NodeInitialValues::class);
        $this->expectException(InvalidConfigurationException::class);
        $configBuilder->someCleverName(['not_exists' => 'foo']);
    }

    public function testSetExtraKeyMethodIsNotGeneratedWhenAllowExtraKeysIsFalse()
    {
        /** @var AddToListConfig $configBuilder */
        $configBuilder = $this->generateConfigBuilder(AddToList::class);

        $this->assertFalse(method_exists($configBuilder->translator(), 'set'));
        $this->assertFalse(method_exists($configBuilder->messenger()->receiving(), 'set'));
    }

    /** * Generate the ConfigBuilder or return an already generated instance. */
    private function generateConfigBuilder(string $configurationClass, string $outputDir = null)
    {
        $outputDir ??= sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf_config_builder', true);
        if (!str_contains($outputDir, __DIR__)) {
            $this->tempDir[] = $outputDir;
        }

        
'routing' => [
            'Foo\\MyArrayMessage' => [
                'senders' => ['workqueue'],
            ],
        ],
    ]);
    $config->messenger()
        ->routing('Foo\\Message')->senders(['workqueue']);
    $config->messenger()
        ->routing('Foo\\DoubleMessage')->senders(['sync', 'workqueue']);

    $config->messenger()->receiving()
        ->color('blue')
        ->priority(10);
    $config->messenger()->receiving()
        ->color('red')
        ->priority(5);
};
Home | Imprint | This part of the site doesn't use cookies.