Skip to content

Commit 87017f4

Browse files
committed
fixed serialization test
1 parent 0eab7b5 commit 87017f4

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/Parser/RegexParser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ private function extractValue($value)
139139
*/
140140
private function isDelimitedValue($value)
141141
{
142+
/** @psalm-suppress ArgumentTypeCoercion */
142143
return strlen($value) >= 2 * $this->parameterValueDelimiterLength
143144
&& 0 === strncmp($value, $this->parameterValueDelimiter, $this->parameterValueDelimiterLength)
144145
&& substr($value, -1 * $this->parameterValueDelimiterLength) === $this->parameterValueDelimiter;

tests/FacadeTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Thunder\Shortcode\Tests;
33

4+
use Composer\InstalledVersions;
45
use Thunder\Shortcode\EventHandler\FilterRawEventHandler;
56
use Thunder\Shortcode\Events;
67
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
@@ -66,7 +67,15 @@ public function testSerialization()
6667
bbCode: null
6768
6869
EOF;
69-
$this->assertSame($yaml, $facade->serialize($s, 'yaml'));
70+
$yaml8 = <<<EOF
71+
name: c
72+
parameters: {}
73+
content: null
74+
bbCode: null
75+
76+
EOF;
77+
$symfonyYamlVersion = InstalledVersions::getVersion('symfony/yaml');
78+
$this->assertSame(preg_match('~\A8~', $symfonyYamlVersion) ? $yaml8 : $yaml, $facade->serialize($s, 'yaml'));
7079
$this->assertSame('c', $facade->unserialize($yaml, 'yaml')->getName());
7180

7281
$xml = <<<EOF

0 commit comments

Comments
 (0)