Skip to content

Commit 9bb1c5b

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: fix merge drop logger mock in favor of using the BufferingLogger catch ValueError thrown on PHP 8 [Yaml Parser] Fix edge cases when parsing multiple documents fix parsing comments not prefixed by a space [Translator] Make sure a null locale is handled properly deal with errors being thrown on PHP 8 [Cache] Allow cache tags to be objects implementing __toString() [HttpKernel] Do not override max_redirects option in HttpClientKernel remove superfluous cast [HttpClient] Support for CURLOPT_LOCALPORT. Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3). Fixed exception message formatting [FrameworkBundle] Fix error in xsd which prevent to register more than one metadata [Console] work around disabled putenv() [PhpUnitBridge] Fix error with ReflectionClass [HttpClient][HttpClientTrait] don't calculate alternatives if option is auth_ntlm Change 'cache_key' to AbstractRendererEngine::CACHE_KEY_VAR Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3).
2 parents f4b8450 + 702d50f commit 9bb1c5b

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ function ($a) {
11971197
return $middleware;
11981198
}
11991199
if (1 < \count($middleware)) {
1200-
throw new \InvalidArgumentException(sprintf('Invalid middleware at path "framework.messenger": a map with a single factory id as key and its arguments as value was expected, %s given.', json_encode($middleware)));
1200+
throw new \InvalidArgumentException('Invalid middleware at path "framework.messenger": a map with a single factory id as key and its arguments as value was expected, '.json_encode($middleware).' given.');
12011201
}
12021202

12031203
return [

Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331

332332
<xsd:complexType name="metadata">
333333
<xsd:sequence>
334-
<xsd:any minOccurs="0" processContents="lax"/>
334+
<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
335335
</xsd:sequence>
336336
</xsd:complexType>
337337

Tests/DependencyInjection/Fixtures/php/workflows.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
FrameworkExtensionTest::class,
1111
],
1212
'initial_marking' => ['draft'],
13+
'metadata' => [
14+
'title' => 'article workflow',
15+
'description' => 'workflow for articles'
16+
],
1317
'places' => [
1418
'draft',
1519
'wait_for_journalist',

Tests/DependencyInjection/Fixtures/xml/workflows.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<framework:from>approved_by_spellchecker</framework:from>
3636
<framework:to>published</framework:to>
3737
</framework:transition>
38+
<framework:metadata>
39+
<framework:title>article workflow</framework:title>
40+
<framework:description>workflow for articles</framework:description>
41+
</framework:metadata>
3842
</framework:workflow>
3943

4044
<framework:workflow name="pull_request">

Tests/DependencyInjection/Fixtures/yml/workflows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ framework:
55
supports:
66
- Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest
77
initial_marking: [draft]
8+
metadata:
9+
title: article workflow
10+
description: workflow for articles
811
places:
912
# simple format
1013
- draft

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
use Symfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPass;
5555
use Symfony\Component\Validator\Mapping\Loader\PropertyInfoLoader;
5656
use Symfony\Component\Workflow;
57+
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
5758

5859
abstract class FrameworkExtensionTest extends TestCase
5960
{
@@ -231,6 +232,12 @@ public function testWorkflows()
231232
);
232233
$this->assertCount(4, $workflowDefinition->getArgument(1));
233234
$this->assertSame(['draft'], $workflowDefinition->getArgument(2));
235+
$metadataStoreDefinition = $workflowDefinition->getArgument(3);
236+
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
237+
$this->assertSame([
238+
'title' => 'article workflow',
239+
'description' => 'workflow for articles',
240+
], $metadataStoreDefinition->getArgument(0));
234241

235242
$this->assertTrue($container->hasDefinition('state_machine.pull_request'), 'State machine is registered as a service');
236243
$this->assertSame('state_machine.abstract', $container->getDefinition('state_machine.pull_request')->getParent());
@@ -255,7 +262,7 @@ public function testWorkflows()
255262

256263
$metadataStoreDefinition = $stateMachineDefinition->getArgument(3);
257264
$this->assertInstanceOf(Definition::class, $metadataStoreDefinition);
258-
$this->assertSame(Workflow\Metadata\InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
265+
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
259266

260267
$workflowMetadata = $metadataStoreDefinition->getArgument(0);
261268
$this->assertSame(['title' => 'workflow title'], $workflowMetadata);

0 commit comments

Comments
 (0)