10000 add tests · symfony/symfony@1bc83c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bc83c5

Browse files
committed
add tests
1 parent 52aabaa commit 1bc83c5

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,23 @@
8888
),
8989
),
9090
),
91+
'service_marking_store_workflow' => array(
92+
'marking_store' => array(
93+
'service' => 'workflow_service',
94+
),
95+
'supports' => array(
96+
FrameworkExtensionTest::class,
97+
),
98+
'places' => array(
99+
'first',
100+
'last',
101+
),
102+
'transitions' => array(
103+
'go' => array(
104+
'from' => 'first',
105+
'to' => 'last',
106+
),
107+
),
108+
),
91109
),
92110
));

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/workflows.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,16 @@
7979
<framework:to>review</framework:to>
8080
</framework:transition>
8181
</framework:workflow>
82+
83+
<framework:workflow name="service_marking_store_workflow">
84+
<framework:marking-store service="workflow_service"/>
85+
<framework:support>Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest</framework:support>
86+
<framework:place>first</framework:place>
87+
<framework:place>last</framework:place>
88+
<framework:transition name="go">
89+
<framework:from>first</framework:from>
90+
<framework:to>last</framework:to>
91+
</framework:transition>
92+
</framework:workflow>
8293
</framework:config>
8394
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/workflows.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@ framework:
6363
reopen:
6464
from: closed
6565
to: review
66+
service_marking_store_workflow:
67+
marking_store:
68+
service: workflow_service
69+
supports:
70+
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
71+
places:
72+
- first
73+
- last
74+
transitions:
75+
go:
76+
from:
77+
- first
78+
to:
79+
- last

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ public function testWorkflows()
165165
$this->assertSame(array('workflow.definition' => array(array('name' => 'pull_request', 'type' => 'state_machine', 'marking_store' => 'single_state'))), $stateMachineDefinition->getTags());
166166
$this->assertCount(9, $stateMachineDefinition->getArgument(1));
167167
$this->assertSame('start', $stateMachineDefinition->getArgument(2));
168+
169+
$serviceMarkingStoreWorkflowDefinition = $container->getDefinition('workflow.service_marking_store_workflow');
170+
/** @var Reference $markingStoreRef */
171+
$markingStoreRef = $serviceMarkingStoreWorkflowDefinition->getArgument(1);
172+
$this->assertInstanceOf(Reference::class, $markingStoreRef);
173+
$this->assertEquals('workflow_service', (string) $markingStoreRef);
168174
}
169175

170176
/**

0 commit comments

Comments
 (0)
0