Skip to content

[FrameworkBundle] [Workflow]: fixed configuration so service & arguments won't throw an exception #20825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
->thenInvalid('"type" and "service" cannot be used together.')
->end()
->validate()
->ifTrue(function ($v) { return isset($v['arguments']) && isset($v['service']); })
->ifTrue(function ($v) { return !empty($v['arguments']) && isset($v['service']); })
->thenInvalid('"arguments" and "service" cannot be used together.')
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,38 @@ public function testInvalidPackageVersionStrategy()
));
}

public function testMarkingStoreWithService()
{
$processor = new Processor();
$configuration = new Configuration(true);

$processedConfiguration = $processor->processConfiguration($configuration, array(
array(
'workflows' => array(
'example' => array(
'type' => 'workflow',
'supports' => self::class,
'marking_store' => array(
'service' => 'my_example_service',
),
'places' => array(
'first_place',
'second_place',
),
'transitions' => array(
'transform' => array(
'from' => 'first_place',
'to' => 'second_place',
),
),
),
),
),
));

$this->assertArrayHasKey('workflows', $processedConfiguration);
}

protected static function getBundleDefaultConfig()
{
return array(
Expand Down