Skip to content

Commit e17f110

Browse files
committed
Merge branch '5.1' into master
* 5.1: (25 commits) stop using the deprecated at() PHPUnit matcher fix lowest allowed version of the HTTP client contracts fix lowest allowed version for the PHPUnit bridge fix merge 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 loadRoutes shoud receive RoutingPhpFileLoader [Cache] Allow cache tags to be objects implementing __toString() [HttpKernel] Do not override max_redirects option in HttpClientKernel Log notice when no entry point is configured 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 ...
2 parents ca2bbfb + 9bb1c5b commit e17f110

File tree

7 files changed

+22
-3
lines changed

7 files changed

+22
-3
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ function ($a) {
13201320
return $middleware;
13211321
}
13221322
if (1 < \count($middleware)) {
1323-
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)));
1323+
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.');
13241324
}
13251325

13261326
return [

Kernel/MicroKernelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function loadRoutes(LoaderInterface $loader)
172172
{
173173
$file = (new \ReflectionObject($this))->getFileName();
174174
/* @var RoutingPhpFileLoader $kernelLoader */
175-
$kernelLoader = $loader->getResolver()->resolve($file);
175+
$kernelLoader = $loader->getResolver()->resolve($file, 'php');
176176
$kernelLoader->setCurrentDir(\dirname($file));
177177
$collection = new RouteCollection();
178178

Resources/config/schema/symfony-1.0.xsd

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

354354
<xsd:complexType name="metadata">
355355
<xsd:sequence>
356-
<xsd:any minOccurs="0" processContents="lax"/>
356+
<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
357357
</xsd:sequence>
358358
</xsd:complexType>
359359

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
use Symfony\Component\Workflow\WorkflowEvents;
6565
use Symfony\Contracts\Cache\CacheInterface;
6666
use Symfony\Contracts\Cache\TagAwareCacheInterface;
67+
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
6768

6869
abstract class FrameworkExtensionTest extends TestCase
6970
{
@@ -245,6 +246,12 @@ public function testWorkflows()
245246
);
246247
$this->assertCount(4, $workflowDefinition->getArgument(1));
247248
$this->assertSame(['draft'], $workflowDefinition->getArgument(2));
249+
$metadataStoreDefinition = $container->getDefinition('workflow.article.metadata_store');
250+
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
251+
$this->assertSame([
252+
'title' => 'article workflow',
253+
'description' => 'workflow for articles',
254+
], $metadataStoreDefinition->getArgument(0));
248255

249256
$this->assertTrue($container->hasDefinition('state_machine.pull_request'), 'State machine is registered as a service');
250257
$this->assertSame('state_machine.abstract', $container->getDefinition('state_machine.pull_request')->getParent());
@@ -273,6 +280,7 @@ public function testWorkflows()
273280

274281
$metadataStoreDefinition = $container->getDefinition('state_machine.pull_request.metadata_store');
275282
$this->assertSame(Workflow\Metadata\InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
283+
$this->assertSame(InMemoryMetadataStore::class, $metadataStoreDefinition->getClass());
276284

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

0 commit comments

Comments
 (0)