Merge branch '4.2' into 4.3
* 4.2: fix typo Fixes a small doc blocks syntax error Small grammar mistake in documentation [Messenger] Use real memory usage for --memory-limit [Workflow] Do not trigger extra guard
This commit is contained in:
commit
7aeb6f5c24
@ -1907,7 +1907,7 @@ class Request
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Returns the prefix as encoded in the string when the string starts with
|
* Returns the prefix as encoded in the string when the string starts with
|
||||||
* the given prefix, false otherwise.
|
* the given prefix, false otherwise.
|
||||||
*
|
*
|
||||||
|
@ -29,7 +29,7 @@ interface ControllerResolverInterface
|
|||||||
* As several resolvers can exist for a single application, a resolver must
|
* As several resolvers can exist for a single application, a resolver must
|
||||||
* return false when it is not able to determine the controller.
|
* return false when it is not able to determine the controller.
|
||||||
*
|
*
|
||||||
* The resolver must only throw an exception when it should be able to load
|
* The resolver must only throw an exception when it should be able to load a
|
||||||
* controller but cannot because of some errors made by the developer.
|
* controller but cannot because of some errors made by the developer.
|
||||||
*
|
*
|
||||||
* @return callable|false A PHP callable representing the Controller,
|
* @return callable|false A PHP callable representing the Controller,
|
||||||
|
@ -24,7 +24,7 @@ use Symfony\Component\HttpKernel\UriSigner;
|
|||||||
* All URL paths starting with /_fragment are handled as
|
* All URL paths starting with /_fragment are handled as
|
||||||
* content fragments by this listener.
|
* content fragments by this listener.
|
||||||
*
|
*
|
||||||
* If throws an AccessDeniedHttpException exception if the request
|
* Throws an AccessDeniedHttpException exception if the request
|
||||||
* is not signed or if it is not an internal sub-request.
|
* is not signed or if it is not an internal sub-request.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
@ -419,6 +419,46 @@ class WorkflowTest extends TestCase
|
|||||||
$this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents);
|
$this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testApplyDoesNotTriggerExtraGuardWithEventDispatcher()
|
||||||
|
{
|
||||||
|
$transitions[] = new Transition('a-b', 'a', 'b');
|
||||||
|
$transitions[] = new Transition('a-c', 'a', 'c');
|
||||||
|
$definition = new Definition(['a', 'b', 'c'], $transitions);
|
||||||
|
|
||||||
|
$subject = new Subject();
|
||||||
|
$eventDispatcher = new EventDispatcherMock();
|
||||||
|
$workflow = new Workflow($definition, new MultipleStateMarkingStore(), $eventDispatcher, 'workflow_name');
|
||||||
|
|
||||||
|
$eventNameExpected = [
|
||||||
|
'workflow.entered',
|
||||||
|
'workflow.workflow_name.entered',
|
||||||
|
'workflow.guard',
|
||||||
|
'workflow.workflow_name.guard',
|
||||||
|
'workflow.workflow_name.guard.a-b',
|
||||||
|
'workflow.leave',
|
||||||
|
'workflow.workflow_name.leave',
|
||||||
|
'workflow.workflow_name.leave.a',
|
||||||
|
'workflow.transition',
|
||||||
|
'workflow.workflow_name.transition',
|
||||||
|
'workflow.workflow_name.transition.a-b',
|
||||||
|
'workflow.enter',
|
||||||
|
'workflow.workflow_name.enter',
|
||||||
|
'workflow.workflow_name.enter.b',
|
||||||
|
'workflow.entered',
|
||||||
|
'workflow.workflow_name.entered',
|
||||||
|
'workflow.workflow_name.entered.b',
|
||||||
|
'workflow.completed',
|
||||||
|
'workflow.workflow_name.completed',
|
||||||
|
'workflow.workflow_name.completed.a-b',
|
||||||
|
'workflow.announce',
|
||||||
|
'workflow.workflow_name.announce',
|
||||||
|
];
|
||||||
|
|
||||||
|
$marking = $workflow->apply($subject, 'a-b');
|
||||||
|
|
||||||
|
$this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents);
|
||||||
|
}
|
||||||
|
|
||||||
public function testApplyWithContext()
|
public function testApplyWithContext()
|
||||||
{
|
{
|
||||||
$definition = $this->createComplexWorkflowDefinition();
|
$definition = $this->createComplexWorkflowDefinition();
|
||||||
|
Reference in New Issue
Block a user