Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df5c849

Browse files
author
Amrouche Hamza
committed
[TwigBridge] Fix workflow test with deps=low
1 parent 72e189a commit df5c849

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,11 @@ class WorkflowExtensionTest extends TestCase
2323
{
2424
private $extension;
2525

26-
protected function setUp()
27-
{
28-
$places = array('ordered', 'waiting_for_payment', 'processed');
29-
$transitions = array(
30-
new Transition('t1', 'ordered', 'waiting_for_payment'),
31-
new Transition('t2', 'waiting_for_payment', 'processed'),
32-
);
33-
$definition = new Definition($places, $transitions);
34-
$workflow = new Workflow($definition);
35-
36-
$registry = new Registry();
37-
$registry->addWorkflow($workflow, new InstanceOfSupportStrategy(\stdClass::class));
38-
39-
$this->extension = new WorkflowExtension($registry);
40-
}
41-
4226
/**
4327
* @group legacy
28+
* @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
4429
*/
45-
protected function setUpLegacyAdd()
30+
protected function setUp()
4631
{
4732
if (!class_exists(Workflow::class)) {
4833
$this->markTestSkipped('The Workflow component is needed to run tests for this extension.');
@@ -66,16 +51,6 @@ protected function setUpLegacyAdd()
6651
* @group legacy
6752
* @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
6853
*/
69-
public function testCanTransitionLegacy()
70-
{
71-
$this->setUpLegacyAdd();
72-
$subject = new \stdClass();
73-
$subject->marking = array();
74-
75-
$this->assertTrue($this->extension->canTransition($subject, 't1'));
76-
$this->assertFalse($this->extension->canTransition($subject, 't2'));
77-
}
78-
7954
public function testCanTransition()
8055
{
8156
$subject = new \stdClass();
@@ -85,6 +60,10 @@ public function testCanTransition()
8560
$this->assertFalse($this->extension->canTransition($subject, 't2'));
8661
}
8762

63+
/**
64+
* @group legacy
65+
* @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
66+
*/
8867
public function testGetEnabledTransitions()
8968
{
9069
$subject = new \stdClass();
@@ -97,6 +76,10 @@ public function testGetEnabledTransitions()
9776
$this->assertSame('t1', $transitions[0]->getName());
9877
}
9978

79+
/**
80+
* @group legacy
81+
* @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
82+
*/
10083
public function testHasMarkedPlace()
10184
{
10285
$subject = new \stdClass();
@@ -108,6 +91,10 @@ public function testHasMarkedPlace()
10891
$this->assertFalse($this->extension->hasMarkedPlace($subject, 'processed'));
10992
}
11093

94+
/**
95+
* @group legacy
96+
* @expectedDeprecation Symfony\Component\Workflow\Registry::add is deprecated since Symfony 4.1. Use addWorkflow() instead.
97+
*/
11198
public function testGetMarkedPlaces()
11299
{
113100
$subject = new \stdClass();

0 commit comments

Comments
 (0)