[FrameworkBundle] [Workflow] Fix service marking store configuration
This commit is contained in:
parent
a28c522790
commit
3289b10d9f
@ -268,7 +268,7 @@ class Configuration implements ConfigurationInterface
|
||||
->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()
|
||||
|
@ -88,5 +88,23 @@ $container->loadFromExtension('framework', array(
|
||||
),
|
||||
),
|
||||
),
|
||||
'service_marking_store_workflow' => array(
|
||||
'marking_store' => array(
|
||||
'service' => 'workflow_service',
|
||||
),
|
||||
'supports' => array(
|
||||
FrameworkExtensionTest::class,
|
||||
),
|
||||
'places' => array(
|
||||
'first',
|
||||
'last',
|
||||
),
|
||||
'transitions' => array(
|
||||
'go' => array(
|
||||
'from' => 'first',
|
||||
'to' => 'last',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
@ -79,5 +79,16 @@
|
||||
<framework:to>review</framework:to>
|
||||
</framework:transition>
|
||||
</framework:workflow>
|
||||
|
||||
<framework:workflow name="service_marking_store_workflow">
|
||||
<framework:marking-store service="workflow_service"/>
|
||||
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support>
|
||||
<framework:place>first</framework:place>
|
||||
<framework:place>last</framework:place>
|
||||
<framework:transition name="go">
|
||||
<framework:from>first</framework:from>
|
||||
<framework:to>last</framework:to>
|
||||
</framework:transition>
|
||||
</framework:workflow>
|
||||
</framework:config>
|
||||
</container>
|
||||
|
@ -63,3 +63,17 @@ framework:
|
||||
reopen:
|
||||
from: closed
|
||||
to: review
|
||||
service_marking_store_workflow:
|
||||
marking_store:
|
||||
service: workflow_service
|
||||
supports:
|
||||
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
|
||||
places:
|
||||
- first
|
||||
- last
|
||||
transitions:
|
||||
go:
|
||||
from:
|
||||
- first
|
||||
to:
|
||||
- last
|
||||
|
@ -165,6 +165,12 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertSame(array('workflow.definition' => array(array('name' => 'pull_request', 'type' => 'state_machine', 'marking_store' => 'single_state'))), $stateMachineDefinition->getTags());
|
||||
$this->assertCount(9, $stateMachineDefinition->getArgument(1));
|
||||
$this->assertSame('start', $stateMachineDefinition->getArgument(2));
|
||||
|
||||
$serviceMarkingStoreWorkflowDefinition = $container->getDefinition('workflow.service_marking_store_workflow');
|
||||
/** @var Reference $markingStoreRef */
|
||||
$markingStoreRef = $serviceMarkingStoreWorkflowDefinition->getArgument(1);
|
||||
$this->assertInstanceOf(Reference::class, $markingStoreRef);
|
||||
$this->assertEquals('workflow_service', (string) $markingStoreRef);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user