- bar
+ bar
Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
bar
baz
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow-legacy.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow-legacy.yml
index 7ff70074d400c..19f51dc9f4119 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow-legacy.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow-legacy.yml
@@ -1,7 +1,11 @@
framework:
workflows:
legacy:
- type: workflow
+ type: state_machine
+ marking_store:
+ type: single_state
+ arguments:
+ - state
initial_place: draft
supports:
- stdClass
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_arguments_and_service.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_legacy_with_arguments_and_service.yml
similarity index 100%
rename from src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_arguments_and_service.yml
rename to src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_legacy_with_arguments_and_service.yml
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_type_and_service.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_legacy_with_type_and_service.yml
similarity index 92%
rename from src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_type_and_service.yml
rename to src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_legacy_with_type_and_service.yml
index 000ba10dfb8d2..33ee68b1bc810 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_type_and_service.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_legacy_with_type_and_service.yml
@@ -2,7 +2,7 @@ framework:
workflows:
my_workflow:
marking_store:
- type: multiple_state
+ type: method
service: workflow_service
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml
index 433771601c3d7..80a85a307b738 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml
@@ -2,18 +2,16 @@ framework:
workflows:
article:
type: workflow
- marking_store:
- type: multiple_state
supports:
- - Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [draft]
+ - Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
+ initial_marking: [draft]
places:
- - draft
- - wait_for_journalist
- - approved_by_journalist
- - wait_for_spellchecker
- - approved_by_spellchecker
- - published
+ - draft
+ - wait_for_journalist
+ - approved_by_journalist
+ - wait_for_spellchecker
+ - approved_by_spellchecker
+ - published
transitions:
request_review:
from: [draft]
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml
index fee71c2645693..12df7b79e7c4f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml
@@ -2,11 +2,9 @@ framework:
workflows:
article:
type: workflow
- marking_store:
- type: multiple_state
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [draft]
+ initial_marking: [draft]
places:
- draft
- wait_for_journalist
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml
index 743708485ce65..de0b36d8fa491 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml
@@ -1,8 +1,7 @@
framework:
workflows:
my_workflow:
- marking_store:
- type: multiple_state
+ type: workflow
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
support_strategy: foobar
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml
index 6dc848d936b21..de74adbe59b20 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml
@@ -1,8 +1,7 @@
framework:
workflows:
my_workflow:
- marking_store:
- type: multiple_state
+ type: workflow
places:
- first
- last
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml
index 894d5dcde207c..225106383d1fd 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml
@@ -2,11 +2,9 @@ framework:
workflows:
article:
type: workflow
- marking_store:
- type: multiple_state
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [draft]
+ initial_marking: [draft]
places:
# simple format
- draft
@@ -29,11 +27,9 @@ framework:
from: [approved_by_journalist, approved_by_spellchecker]
to: [published]
pull_request:
- marking_store:
- type: single_state
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [start]
+ initial_marking: start
metadata:
title: workflow title
places:
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml
index d1545374705d3..bee231736b233 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml
@@ -6,7 +6,7 @@ framework:
type: workflow
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [bar]
+ initial_marking: [bar]
places:
- bar
- baz
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml
index bb468254aca0b..c0462c9ab8c9d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml
@@ -5,7 +5,7 @@ framework:
type: workflow
supports:
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
- initial_places: [bar]
+ initial_marking: [bar]
places:
- bar
- baz
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 1b8a785a303db..7085327e5c054 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -275,15 +275,18 @@ public function testWorkflows()
$this->assertGreaterThan(0, \count($registryDefinition->getMethodCalls()));
}
+ /**
+ * @group legacy
+ */
public function testWorkflowLegacy()
{
$container = $this->createContainerFromFile('workflow-legacy');
- $this->assertTrue($container->hasDefinition('workflow.legacy'), 'Workflow is registered as a service');
- $this->assertSame('workflow.abstract', $container->getDefinition('workflow.legacy')->getParent());
- $this->assertTrue($container->hasDefinition('workflow.legacy.definition'), 'Workflow definition is registered as a service');
+ $this->assertTrue($container->hasDefinition('state_machine.legacy'), 'Workflow is registered as a service');
+ $this->assertSame('state_machine.abstract', $container->getDefinition('state_machine.legacy')->getParent());
+ $this->assertTrue($container->hasDefinition('state_machine.legacy.definition'), 'Workflow definition is registered as a service');
- $workflowDefinition = $container->getDefinition('workflow.legacy.definition');
+ $workflowDefinition = $container->getDefinition('state_machine.legacy.definition');
$this->assertSame(['draft'], $workflowDefinition->getArgument(2));
@@ -312,7 +315,7 @@ public function testWorkflowAreValidated()
*/
public function testWorkflowCannotHaveBothTypeAndService()
{
- $this->createContainerFromFile('workflow_with_type_and_service');
+ $this->createContainerFromFile('workflow_legacy_with_type_and_service');
}
/**
@@ -336,10 +339,11 @@ public function testWorkflowShouldHaveOneOfSupportsAndSupportStrategy()
/**
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage "arguments" and "service" cannot be used together.
+ * @group legacy
*/
public function testWorkflowCannotHaveBothArgumentsAndService()
{
- $this->createContainerFromFile('workflow_with_arguments_and_service');
+ $this->createContainerFromFile('workflow_legacy_with_arguments_and_service');
}
public function testWorkflowMultipleTransitionsWithSameName()
@@ -412,7 +416,7 @@ public function testWorkflowMultipleTransitionsWithSameName()
], $container->getDefinition($transitions[4])->getArguments());
}
- public function testGuardExpressions()
+ public function testWorkflowGuardExpressions()
{
$container = $this->createContainerFromFile('workflow_with_guard_expression');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php
index 19bad8e825a0a..a67a35844769f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php
@@ -89,10 +89,10 @@ public function testWorkflowValidationStateMachine()
}
/**
- * @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException
- * @expectedExceptionMessage The marking store of workflow "article" can not store many places. But the transition "a_to_b" has too many output (2). Only one is accepted.
+ * @group legacy
+ * @expectedDeprecation Using a workflow with type=workflow and a marking_store=single_state is deprecated since Symfony 4.3. Use type=state_machine instead.
*/
- public function testWorkflowValidationMethodSingle()
+ public function testWorkflowDeprecateWorkflowSingleState()
{
$this->createContainerFromClosure(function ($container) {
$container->loadFromExtension('framework', [
@@ -100,43 +100,7 @@ public function testWorkflowValidationMethodSingle()
'article' => [
'type' => 'workflow',
'marking_store' => [
- 'type' => 'method',
- 'arguments' => [
- true,
- ],
- ],
- 'supports' => [
- __CLASS__,
- ],
- 'places' => [
- 'a',
- 'b',
- 'c',
- ],
- 'transitions' => [
- 'a_to_b' => [
- 'from' => ['a'],
- 'to' => ['b', 'c'],
- ],
- ],
- ],
- ],
- ]);
- });
- }
-
- public function testWorkflowValidationMethodNotSingle()
- {
- $this->createContainerFromClosure(function ($container) {
- $container->loadFromExtension('framework', [
- 'workflows' => [
- 'article' => [
- 'type' => 'workflow',
- 'marking_store' => [
- 'type' => 'method',
- 'arguments' => [
- false,
- ],
+ 'type' => 'single_state',
],
'supports' => [
__CLASS__,
@@ -149,18 +113,18 @@ public function testWorkflowValidationMethodNotSingle()
'transitions' => [
'a_to_b' => [
'from' => ['a'],
- 'to' => ['b', 'c'],
+ 'to' => ['b'],
],
],
],
],
]);
});
-
- // the test ensures that the validation does not fail (i.e. it does not throw any exceptions)
- $this->addToAssertionCount(1);
}
+ /**
+ * @group legacy
+ */
public function testWorkflowValidationMultipleState()
{
$this->createContainerFromClosure(function ($container) {
@@ -197,6 +161,7 @@ public function testWorkflowValidationMultipleState()
/**
* @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException
* @expectedExceptionMessage The marking store of workflow "article" can not store many places. But the transition "a_to_b" has too many output (2). Only one is accepted.
+ * @group legacy
*/
public function testWorkflowValidationSingleState()
{
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy