8000 Fix test to be compatible with PHP 5.6 · symfony/symfony@a736781 · GitHub
[go: up one dir, main page]

Skip to content

Commit a736781

Browse files
committed
Fix test to be compatible with PHP 5.6
1 parent 8ca9a60 commit a736781

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Symfony/Component/Serializer/Tests/Fixtures/VariadicConstructorTypedArgsDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class VariadicConstructorTypedArgsDummy
1515
{
1616
private $foo;
1717

18-
public function __construct(NullableConstructorArgumentDummy ...$foo)
18+
public function __construct(Dummy ...$foo)
1919
{
2020
$this->foo = $foo;
2121
}

src/Symfony/Component/Serializer/Tests/Normalizer/AbstractNormalizerTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
1212
use Symfony\Component\Serializer\Serializer;
1313
use Symfony\Component\Serializer\Tests\Fixtures\AbstractNormalizerDummy;
14+
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
1415
use Symfony\Component\Serializer\Tests\Fixtures\NullableConstructorArgumentDummy;
1516
use Symfony\Component\Serializer\Tests\Fixtures\ProxyDummy;
1617
use Symfony\Component\Serializer\Tests\Fixtures\StaticConstructorDummy;
@@ -139,11 +140,13 @@ public function testObjectWithVariadicConstructorTypedArguments()
139140
{
140141
$normalizer = new PropertyNormalizer();
141142
$normalizer->setSerializer(new Serializer([$normalizer]));
142-
$dummy = $normalizer->denormalize(['foo' => [['foo' => null], ['foo' => null]]], VariadicConstructorTypedArgsDummy::class);
143-
$this->assertInstanceOf(VariadicConstructorTypedArgsDummy::class, $dummy);
143+
$data = ['foo' => [['foo' => 'Foo', 'bar' => 'Bar', 'baz' => 'Baz', 'qux' => 'Qux'], ['foo' => 'FOO', 'bar' => 'BAR', 'baz' => 'BAZ', 'qux' => 'QUX']]];
144+
$dummy = $normalizer->denormalize($data, VariadicConstructorTypedArgsDummy::class);
144145

146+
$this->assertInstanceOf(VariadicConstructorTypedArgsDummy::class, $dummy);
147+
$this->assertCount(2, $dummy->getFoo());
145148
foreach ($dummy->getFoo() as $foo) {
146-
$this->assertInstanceOf(NullableConstructorArgumentDummy::class, $foo);
149+
$this->assertInstanceOf(Dummy::class, $foo);
147150
}
148151
}
149152
}

0 commit comments

Comments
 (0)
0