From 847d9cdbc84ddb3dd581ed41816d48dac13f0dee Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 2 Jun 2025 16:08:14 +0200 Subject: [PATCH 1/7] Allow Symfony ^8.0 --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 3e2c50a..ff8561c 100644 --- a/composer.json +++ b/composer.json @@ -25,15 +25,15 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/security-core": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/validator": "^6.4|^7.0" + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/security-core": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/validator": "^6.4|^7.0|^8.0" }, "conflict": { "symfony/event-dispatcher": "<6.4" From cc9995ebafc6b05f9b964611c910f5969d3433c9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 8 Jul 2025 11:08:29 +0200 Subject: [PATCH 2/7] Various CS fixes --- DataCollector/WorkflowDataCollector.php | 2 +- DependencyInjection/WorkflowValidatorPass.php | 1 - Tests/Dumper/MermaidDumperTest.php | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/DataCollector/WorkflowDataCollector.php b/DataCollector/WorkflowDataCollector.php index 0cb7e20..6ce732b 100644 --- a/DataCollector/WorkflowDataCollector.php +++ b/DataCollector/WorkflowDataCollector.php @@ -101,7 +101,7 @@ public function buildMermaidLiveLink(string $name): string 'autoSync' => false, ]; - $compressed = zlib_encode(json_encode($payload), ZLIB_ENCODING_DEFLATE); + $compressed = zlib_encode(json_encode($payload), \ZLIB_ENCODING_DEFLATE); $suffix = rtrim(strtr(base64_encode($compressed), '+/', '-_'), '='); diff --git a/DependencyInjection/WorkflowValidatorPass.php b/DependencyInjection/WorkflowValidatorPass.php index 60072ef..d1e4622 100644 --- a/DependencyInjection/WorkflowValidatorPass.php +++ b/DependencyInjection/WorkflowValidatorPass.php @@ -14,7 +14,6 @@ use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\LogicException; /** * @author Grégoire Pineau diff --git a/Tests/Dumper/MermaidDumperTest.php b/Tests/Dumper/MermaidDumperTest.php index 3a29da6..a8d1978 100644 --- a/Tests/Dumper/MermaidDumperTest.php +++ b/Tests/Dumper/MermaidDumperTest.php @@ -104,7 +104,7 @@ public static function provideWorkflowDefinitionWithoutMarking(): iterable ."transition4-->place6\n" ."transition5[\"t6\"]\n" ."place5-->transition5\n" - ."transition5-->place6", + .'transition5-->place6', ]; yield [ self::createWorkflowWithSameNameTransition(), @@ -124,7 +124,7 @@ public static function provideWorkflowDefinitionWithoutMarking(): iterable ."transition2-->place0\n" ."transition3[\"to_a\"]\n" ."place2-->transition3\n" - ."transition3-->place0", + .'transition3-->place0', ]; yield [ self::createSimpleWorkflowDefinition(), @@ -140,7 +140,7 @@ public static function provideWorkflowDefinitionWithoutMarking(): iterable ."linkStyle 1 stroke:Grey\n" ."transition1[\"t2\"]\n" ."place1-->transition1\n" - ."transition1-->place2", + .'transition1-->place2', ]; } @@ -169,7 +169,7 @@ public static function provideWorkflowWithReservedWords(): iterable ."place1-->transition0\n" ."transition1[\"t1\"]\n" ."place2-->transition1\n" - ."transition1-->place3", + .'transition1-->place3', ]; } @@ -186,7 +186,7 @@ public static function provideStateMachine(): iterable ."place3-->|\"My custom transition label 3\"|place1\n" ."linkStyle 1 stroke:Grey\n" ."place1-->|\"t2\"|place2\n" - ."place1-->|\"t3\"|place3", + .'place1-->|"t3"|place3', ]; } @@ -212,7 +212,7 @@ public static function provideWorkflowWithMarking(): iterable ."linkStyle 1 stroke:Grey\n" ."transition1[\"t2\"]\n" ."place1-->transition1\n" - ."transition1-->place2", + .'transition1-->place2', ]; } } From c6580d0fb66e274d8b5c232a99ce0f3c0e71d38b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 9 Oct 2024 11:06:51 +0200 Subject: [PATCH 3/7] run tests using PHPUnit 11.5 --- phpunit.xml.dist | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 15e5deb..f4d8267 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,11 @@ @@ -18,7 +19,7 @@ - + ./ @@ -26,5 +27,9 @@ ./Tests ./vendor - + + + + + From 699c2abd97535ae4ea6cd8c04807731e82a617f8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 31 Jul 2025 14:36:46 +0200 Subject: [PATCH 4/7] replace PHPUnit annotations with attributes --- Tests/Attribute/AsListenerTest.php | 13 ++++--------- Tests/Debug/TraceableWorkflowTest.php | 5 ++--- Tests/Dumper/GraphvizDumperTest.php | 9 +++------ Tests/Dumper/MermaidDumperTest.php | 17 +++++------------ Tests/Dumper/PlantUmlDumperTest.php | 9 +++------ Tests/Event/EventNameTraitTest.php | 4 ++-- Tests/WorkflowTest.php | 12 +++++------- 7 files changed, 24 insertions(+), 45 deletions(-) diff --git a/Tests/Attribute/AsListenerTest.php b/Tests/Attribute/AsListenerTest.php index 0a8c232..b2a7440 100644 --- a/Tests/Attribute/AsListenerTest.php +++ b/Tests/Attribute/AsListenerTest.php @@ -11,15 +11,14 @@ namespace Symfony\Component\Workflow\Tests\Attribute; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Workflow\Attribute; use Symfony\Component\Workflow\Exception\LogicException; class AsListenerTest extends TestCase { - /** - * @dataProvider provideOkTests - */ + #[DataProvider('provideOkTests')] public function testOk(string $class, string $expectedEvent, ?string $workflow = null, ?string $node = null) { $attribute = new $class($workflow, $node); @@ -58,9 +57,7 @@ public static function provideOkTests(): iterable yield [Attribute\AsTransitionListener::class, 'workflow.w.transition.n', 'w', 'n']; } - /** - * @dataProvider provideTransitionThrowException - */ + #[DataProvider('provideTransitionThrowException')] public function testTransitionThrowException(string $class) { $this->expectException(LogicException::class); @@ -77,9 +74,7 @@ public static function provideTransitionThrowException(): iterable yield [Attribute\AsTransitionListener::class, 'workflow.transition']; } - /** - * @dataProvider providePlaceThrowException - */ + #[DataProvider('providePlaceThrowException')] public function testPlaceThrowException(string $class) { $this->expectException(LogicException::class); diff --git a/Tests/Debug/TraceableWorkflowTest.php b/Tests/Debug/TraceableWorkflowTest.php index 257ad66..d513450 100644 --- a/Tests/Debug/TraceableWorkflowTest.php +++ b/Tests/Debug/TraceableWorkflowTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Workflow\Tests\Debug; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Stopwatch\Stopwatch; @@ -38,9 +39,7 @@ protected function setUp(): void ); } - /** - * @dataProvider provideFunctionNames - */ + #[DataProvider('provideFunctionNames')] public function testCallsInner(string $function, array $args, mixed $returnValue) { $this->innerWorkflow->expects($this->once()) diff --git a/Tests/Dumper/GraphvizDumperTest.php b/Tests/Dumper/GraphvizDumperTest.php index 9356715..228c496 100644 --- a/Tests/Dumper/GraphvizDumperTest.php +++ b/Tests/Dumper/GraphvizDumperTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Workflow\Tests\Dumper; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Workflow\Dumper\GraphvizDumper; use Symfony\Component\Workflow\Marking; @@ -20,9 +21,7 @@ class GraphvizDumperTest extends TestCase { use WorkflowBuilderTrait; - /** - * @dataProvider provideWorkflowDefinitionWithoutMarking - */ + #[DataProvider('provideWorkflowDefinitionWithoutMarking')] public function testDumpWithoutMarking($definition, $expected, $withMetadata) { $dump = (new GraphvizDumper())->dump($definition, null, ['with-metadata' => $withMetadata]); @@ -30,9 +29,7 @@ public function testDumpWithoutMarking($definition, $expected, $withMetadata) $this->assertEquals($expected, $dump); } - /** - * @dataProvider provideWorkflowDefinitionWithMarking - */ + #[DataProvider('provideWorkflowDefinitionWithMarking')] public function testDumpWithMarking($definition, $marking, $expected, $withMetadata) { $dump = (new GraphvizDumper())->dump($definition, $marking, ['with-metadata' => $withMetadata]); diff --git a/Tests/Dumper/MermaidDumperTest.php b/Tests/Dumper/MermaidDumperTest.php index a8d1978..639f67c 100644 --- a/Tests/Dumper/MermaidDumperTest.php +++ b/Tests/Dumper/MermaidDumperTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Workflow\Tests\Dumper; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Workflow\Definition; use Symfony\Component\Workflow\DefinitionBuilder; @@ -23,9 +24,7 @@ class MermaidDumperTest extends TestCase { use WorkflowBuilderTrait; - /** - * @dataProvider provideWorkflowDefinitionWithoutMarking - */ + #[DataProvider('provideWorkflowDefinitionWithoutMarking')] public function testDumpWithoutMarking(Definition $definition, string $expected) { $dumper = new MermaidDumper(MermaidDumper::TRANSITION_TYPE_WORKFLOW); @@ -35,9 +34,7 @@ public function testDumpWithoutMarking(Definition $definition, string $expected) $this->assertEquals($expected, $dump); } - /** - * @dataProvider provideWorkflowWithReservedWords - */ + #[DataProvider('provideWorkflowWithReservedWords')] public function testDumpWithReservedWordsAsPlacenames(Definition $definition, string $expected) { $dumper = new MermaidDumper(MermaidDumper::TRANSITION_TYPE_WORKFLOW); @@ -47,9 +44,7 @@ public function testDumpWithReservedWordsAsPlacenames(Definition $definition, st $this->assertEquals($expected, $dump); } - /** - * @dataProvider provideStateMachine - */ + #[DataProvider('provideStateMachine')] public function testDumpAsStateMachine(Definition $definition, string $expected) { $dumper = new MermaidDumper(MermaidDumper::TRANSITION_TYPE_STATEMACHINE); @@ -59,9 +54,7 @@ public function testDumpAsStateMachine(Definition $definition, string $expected) $this->assertEquals($expected, $dump); } - /** - * @dataProvider provideWorkflowWithMarking - */ + #[DataProvider('provideWorkflowWithMarking')] public function testDumpWorkflowWithMarking(Definition $definition, Marking $marking, string $expected) { $dumper = new MermaidDumper(MermaidDumper::TRANSITION_TYPE_WORKFLOW); diff --git a/Tests/Dumper/PlantUmlDumperTest.php b/Tests/Dumper/PlantUmlDumperTest.php index a018a4e..838c9bd 100644 --- a/Tests/Dumper/PlantUmlDumperTest.php +++ b/Tests/Dumper/PlantUmlDumperTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Workflow\Tests\Dumper; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Workflow\Definition; use Symfony\Component\Workflow\Dumper\PlantUmlDumper; @@ -23,9 +24,7 @@ class PlantUmlDumperTest extends TestCase { use WorkflowBuilderTrait; - /** - * @dataProvider provideWorkflowDefinitionWithoutMarking - */ + #[DataProvider('provideWorkflowDefinitionWithoutMarking')] public function testDumpWorkflowWithoutMarking($definition, $marking, $expectedFileName, $title) { $dumper = new PlantUmlDumper(PlantUmlDumper::WORKFLOW_TRANSITION); @@ -46,9 +45,7 @@ public static function provideWorkflowDefinitionWithoutMarking(): \Generator yield [self::createComplexWorkflowDefinition(), $marking, 'complex-workflow-marking', 'ComplexDiagram']; } - /** - * @dataProvider provideStateMachineDefinitionWithoutMarking - */ + #[DataProvider('provideStateMachineDefinitionWithoutMarking')] public function testDumpStateMachineWithoutMarking($definition, $marking, $expectedFileName, $title) { $dumper = new PlantUmlDumper(PlantUmlDumper::STATEMACHINE_TRANSITION); diff --git a/Tests/Event/EventNameTraitTest.php b/Tests/Event/EventNameTraitTest.php index 3c74523..24780f4 100644 --- a/Tests/Event/EventNameTraitTest.php +++ b/Tests/Event/EventNameTraitTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Workflow\Tests\Event; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Workflow\Event\AnnounceEvent; use Symfony\Component\Workflow\Event\CompletedEvent; @@ -23,10 +24,9 @@ class EventNameTraitTest extends TestCase { /** - * @dataProvider getEvents - * * @param class-string $class */ + #[DataProvider('getEvents')] public function testEventNames(string $class, ?string $workflowName, ?string $transitionOrPlaceName, string $expected) { $name = $class::getName($workflowName, $transitionOrPlaceName); diff --git a/Tests/WorkflowTest.php b/Tests/WorkflowTest.php index 48e2209..6d12a7c 100644 --- a/Tests/WorkflowTest.php +++ b/Tests/WorkflowTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Workflow\Tests; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\TestWith; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\Workflow\Definition; @@ -439,9 +441,7 @@ public static function provideApplyWithEventDispatcherForAnnounceTests(): \Gener yield [true, []]; } - /** - * @dataProvider provideApplyWithEventDispatcherForAnnounceTests - */ + #[DataProvider('provideApplyWithEventDispatcherForAnnounceTests')] public function testApplyWithEventDispatcherForAnnounce(bool $fired, array $context) { $definition = $this->createComplexWorkflowDefinition(); @@ -820,10 +820,8 @@ public function testGetEnabledTransitionsWithSameNameTransition() $this->assertSame('to_a', $transitions[2]->getName()); } - /** - * @@testWith ["back1"] - * ["back2"] - */ + #[TestWith(['back1'])] + #[TestWith(['back2'])] public function testApplyWithSameNameBackTransition(string $transition) { $definition = $this->createWorkflowWithSameNameBackTransition(); From cefb2f2ed26a9111aa5f1b2d6b7119a9d6d04427 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 4 Aug 2025 09:53:42 +0200 Subject: [PATCH 5/7] CS fixes --- Tests/WorkflowTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/WorkflowTest.php b/Tests/WorkflowTest.php index 6d12a7c..d44d2c6 100644 --- a/Tests/WorkflowTest.php +++ b/Tests/WorkflowTest.php @@ -29,6 +29,7 @@ use Symfony\Component\Workflow\TransitionBlocker; use Symfony\Component\Workflow\Workflow; use Symfony\Component\Workflow\WorkflowEvents; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class WorkflowTest extends TestCase { @@ -876,7 +877,7 @@ private function assertPlaces(array $expected, Marking $marking) } } -class EventDispatcherMock implements \Symfony\Contracts\EventDispatcher\EventDispatcherInterface +class EventDispatcherMock implements EventDispatcherInterface { public array $dispatchedEvents = []; From 007fb4b0277ec08577607d6472f532f66f656e2c Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sun, 10 Aug 2025 00:28:14 +0200 Subject: [PATCH 6/7] chore: heredoc indentation as of PHP 7.3 https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc --- .../Dumper/StateMachineGraphvizDumperTest.php | 68 +++++++++---------- Tests/WorkflowBuilderTrait.php | 6 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Tests/Dumper/StateMachineGraphvizDumperTest.php b/Tests/Dumper/StateMachineGraphvizDumperTest.php index 20b3694..52779e4 100644 --- a/Tests/Dumper/StateMachineGraphvizDumperTest.php +++ b/Tests/Dumper/StateMachineGraphvizDumperTest.php @@ -27,23 +27,23 @@ public function testDumpWithoutMarking() $dump = (new StateMachineGraphvizDumper())->dump($definition); $expected = <<<'EOGRAPH' -digraph workflow { - ratio="compress" rankdir="LR" - node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="false" width="1"]; - edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"]; - - place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle style="filled"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle]; - place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle]; - place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle]; - place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"]; - place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="My custom transition -label 3" style="solid" fontcolor="Grey" color="Red"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid" color="Blue"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"]; -} - -EOGRAPH; + digraph workflow { + ratio="compress" rankdir="LR" + node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="false" width="1"]; + edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"]; + + place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle style="filled"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle]; + place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle]; + place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle]; + place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"]; + place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="My custom transition + label 3" style="solid" fontcolor="Grey" color="Red"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid" color="Blue"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"]; + } + + EOGRAPH; $this->assertEquals($expected, $dump); } @@ -54,23 +54,23 @@ public function testDumpWithMarking() $marking = new Marking(['b' => 1]); $expected = <<<'EOGRAPH' -digraph workflow { - ratio="compress" rankdir="LR" - node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="false" width="1"]; - edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"]; - - place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle style="filled"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle color="#FF0000" shape="doublecircle"]; - place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle]; - place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle]; - place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"]; - place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="My custom transition -label 3" style="solid" fontcolor="Grey" color="Red"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid" color="Blue"]; - place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"]; -} - -EOGRAPH; + digraph workflow { + ratio="compress" rankdir="LR" + node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="false" width="1"]; + edge [fontsize="9" fontname="Arial" color="#333333" arrowhead="normal" arrowsize="0.5"]; + + place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 [label="a", shape=circle style="filled"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="b", shape=circle color="#FF0000" shape="doublecircle"]; + place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="c", shape=circle]; + place_3c363836cf4e16666669a25da280a1865c2d2874 [label="d", shape=circle]; + place_86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="t1" style="solid"]; + place_3c363836cf4e16666669a25da280a1865c2d2874 -> place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 [label="My custom transition + label 3" style="solid" fontcolor="Grey" color="Red"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 [label="t2" style="solid" color="Blue"]; + place_e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 -> place_3c363836cf4e16666669a25da280a1865c2d2874 [label="t3" style="solid"]; + } + + EOGRAPH; $dump = (new StateMachineGraphvizDumper())->dump($definition, $marking); diff --git a/Tests/WorkflowBuilderTrait.php b/Tests/WorkflowBuilderTrait.php index 86478bb..99a07d7 100644 --- a/Tests/WorkflowBuilderTrait.php +++ b/Tests/WorkflowBuilderTrait.php @@ -129,9 +129,9 @@ private static function createComplexStateMachineDefinition(): Definition $transitionsMetadata = new \SplObjectStorage(); // PHP 7.2 doesn't allow this heredoc syntax in an array, use a dedicated variable instead $label = <<<'EOTXT' -My custom transition -label 3 -EOTXT; + My custom transition + label 3 + EOTXT; $transitionsMetadata[$transitionWithMetadataDumpStyle] = [ 'label' => $label, 'color' => 'Grey', From ab5a127df397ce2beea0966524afe8dc4db061cc Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 1 Aug 2025 14:58:41 +0200 Subject: [PATCH 7/7] run tests with PHPUnit 12.3 --- Tests/Attribute/AsListenerTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Attribute/AsListenerTest.php b/Tests/Attribute/AsListenerTest.php index b2a7440..0656574 100644 --- a/Tests/Attribute/AsListenerTest.php +++ b/Tests/Attribute/AsListenerTest.php @@ -68,10 +68,10 @@ public function testTransitionThrowException(string $class) public static function provideTransitionThrowException(): iterable { - yield [Attribute\AsAnnounceListener::class, 'workflow.announce']; - yield [Attribute\AsCompletedListener::class, 'workflow.completed']; - yield [Attribute\AsGuardListener::class, 'workflow.guard']; - yield [Attribute\AsTransitionListener::class, 'workflow.transition']; + yield [Attribute\AsAnnounceListener::class]; + yield [Attribute\AsCompletedListener::class]; + yield [Attribute\AsGuardListener::class]; + yield [Attribute\AsTransitionListener::class]; } #[DataProvider('providePlaceThrowException')] @@ -85,8 +85,8 @@ public function testPlaceThrowException(string $class) public static function providePlaceThrowException(): iterable { - yield [Attribute\AsEnteredListener::class, 'workflow.entered']; - yield [Attribute\AsEnterListener::class, 'workflow.enter']; - yield [Attribute\AsLeaveListener::class, 'workflow.leave']; + yield [Attribute\AsEnteredListener::class]; + yield [Attribute\AsEnterListener::class]; + yield [Attribute\AsLeaveListener::class]; } }