Skip to content

Commit 00e56c1

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Fix tests that use deprecated callable syntax Make sure nested composite types do not crash ReflectionExtractor
2 parents f96b0c0 + 5e70e28 commit 00e56c1

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,25 @@ public function testDescribeCallable($callable, $expectedDescription)
208208
$this->assertDescription($expectedDescription, $callable);
209209
}
210210

211-
public function getDescribeCallableTestData()
211+
public function getDescribeCallableTestData(): array
212212
{
213213
return $this->getDescriptionTestData(ObjectsProvider::getCallables());
214214
}
215215

216+
/**
217+
* @group legacy
218+
* @dataProvider getDescribeDeprecatedCallableTestData
219+
*/
220+
public function testDescribeDeprecatedCallable($callable, $expectedDescription)
221+
{
222+
$this->assertDescription($expectedDescription, $callable);
223+
}
224+
225+
public function getDescribeDeprecatedCallableTestData(): array
226+
{
227+
return $this->getDescriptionTestData(ObjectsProvider::getDeprecatedCallables());
228+
}
229+
216230
/** @dataProvider getClassDescriptionTestData */
217231
public function testGetClassDescription($object, $expectedDescription)
218232
{

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,25 @@ public static function getEventDispatchers()
249249
return ['event_dispatcher_1' => $eventDispatcher];
250250
}
251251

252-
public static function getCallables()
252+
public static function getCallables(): array
253253
{
254254
return [
255255
'callable_1' => 'array_key_exists',
256256
'callable_2' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'],
257257
'callable_3' => [new CallableClass(), 'method'],
258258
'callable_4' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass::staticMethod',
259-
'callable_5' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'],
260259
'callable_6' => function () { return 'Closure'; },
261260
'callable_7' => new CallableClass(),
262261
'callable_from_callable' => \Closure::fromCallable(new CallableClass()),
263262
];
264263
}
264+
265+
public static function getDeprecatedCallables(): array
266+
{
267+
return [
268+
'callable_5' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'],
269+
];
270+
}
265271
}
266272

267273
class CallableClass

0 commit comments

Comments
 (0)