Skip to content

Commit

Permalink
bug #29444 [Workflow] Fixed BC break for Workflow metadata (lyrixx)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.1 branch.

Discussion
----------

[Workflow] Fixed BC break for Workflow metadata

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29427
| License       | MIT
| Doc PR        |

I used SplObjectStorage to store the transition metadata.
So we need to use the exact same PHP Object.

Commits
-------

5691818 [Workflow] Fixed BC break for Workflow metadata
  • Loading branch information
nicolas-grekas committed Dec 3, 2018
2 parents a256c69 + 5691818 commit b8f87e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Expand Up @@ -525,7 +525,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
}
if ($transition['metadata']) {
$transitionsMetadataDefinition->addMethodCall('attach', array(
$transitionDefinition,
new Reference($transitionId),
$transition['metadata'],
));
}
Expand All @@ -547,7 +547,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
}
if ($transition['metadata']) {
$transitionsMetadataDefinition->addMethodCall('attach', array(
$transitionDefinition,
new Reference($transitionId),
$transition['metadata'],
));
}
Expand Down
Expand Up @@ -256,10 +256,8 @@ public function testWorkflows()
$this->assertSame('attach', $transitionsMetadataCall[0]);
$params = $transitionsMetadataCall[1];
$this->assertCount(2, $params);
$this->assertInstanceOf(Definition::class, $params[0]);
$this->assertSame(Workflow\Transition::class, $params[0]->getClass());
$this->assertSame(array('submit', 'start', 'travis'), $params[0]->getArguments());
$this->assertSame(array('title' => 'transition submit title'), $params[1]);
$this->assertInstanceOf(Reference::class, $params[0]);
$this->assertSame('state_machine.pull_request.transition.0', (string) $params[0]);

$serviceMarkingStoreWorkflowDefinition = $container->getDefinition('workflow.service_marking_store_workflow');
/** @var Reference $markingStoreRef */
Expand Down

0 comments on commit b8f87e1

Please sign in to comment.