Skip to content

Commit 2314f81

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Fixes a small doc blocks syntax error Small grammar mistake in documentation [Workflow] Do not trigger extra guard
2 parents ac4429a + c562e71 commit 2314f81

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ private function setPhpDefaultLocale(string $locale)
19071907
}
19081908
}
19091909

1910-
/*
1910+
/**
19111911
* Returns the prefix as encoded in the string when the string starts with
19121912
* the given prefix, false otherwise.
19131913
*

src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface ControllerResolverInterface
2929
* As several resolvers can exist for a single application, a resolver must
3030
* return false when it is not able to determine the controller.
3131
*
32-
* The resolver must only throw an exception when it should be able to load
32+
* The resolver must only throw an exception when it should be able to load a
3333
* controller but cannot because of some errors made by the developer.
3434
*
3535
* @return callable|false A PHP callable representing the Controller,

src/Symfony/Component/Workflow/Tests/WorkflowTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,45 @@ public function testApplyWithEventDispatcher()
433433
$this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents);
434434
}
435435

436+
public function testApplyDoesNotTriggerExtraGuardWithEventDispatcher()
437+
{
438+
$transitions[] = new Transition('a-b', 'a', 'b');
439+
$transitions[] = new Transition('a-c', 'a', 'c');
440+
$definition = new Definition(['a', 'b', 'c'], $transitions);
441+
442+
$subject = new \stdClass();
443+
$subject->marking = null;
444+
$eventDispatcher = new EventDispatcherMock();
445+
$workflow = new Workflow($definition, new MultipleStateMarkingStore(), $eventDispatcher, 'workflow_name');
446+
447+
$eventNameExpected = [
448+
'workflow.guard',
449+
'workflow.workflow_name.guard',
450+
'workflow.workflow_name.guard.a-b',
451+
'workflow.leave',
452+
'workflow.workflow_name.leave',
453+
'workflow.workflow_name.leave.a',
454+
'workflow.transition',
455+
'workflow.workflow_name.transition',
456+
'workflow.workflow_name.transition.a-b',
457+
'workflow.enter',
458+
'workflow.workflow_name.enter',
459+
'workflow.workflow_name.enter.b',
460+
'workflow.entered',
461+
'workflow.workflow_name.entered',
462+
'workflow.workflow_name.entered.b',
463+
'workflow.completed',
464+
'workflow.workflow_name.completed',
465+
'workflow.workflow_name.completed.a-b',
466+
'workflow.announce',
467+
'workflow.workflow_name.announce',
468+
];
469+
470+
$marking = $workflow->apply($subject, 'a-b');
471+
472+
$this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents);
473+
}
474+
436475
public function testEventName()
437476
{
438477
$definition = $this->createComplexWorkflowDefinition();

0 commit comments

Comments
 (0)