Skip to content

Commit a28ef68

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Fix tests that use deprecated callable syntax Make sure nested composite types do not crash ReflectionExtractor
2 parents 218cc49 + bdcfd80 commit a28ef68

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
@@ -206,11 +206,25 @@ public function testDescribeCallable($callable, $expectedDescription)
206206
$this->assertDescription($expectedDescription, $callable);
207207
}
208208

209-
public function getDescribeCallableTestData()
209+
public function getDescribeCallableTestData(): array
210210
{
211211
return $this->getDescriptionTestData(ObjectsProvider::getCallables());
212212
}
213213

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

Tests/Console/Descriptor/ObjectsProvider.php

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

248-
public static function getCallables()
248+
public static function getCallables(): array
249249
{
250250
return [
251251
'callable_1' => 'array_key_exists',
252252
'callable_2' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'],
253253
'callable_3' => [new CallableClass(), 'method'],
254254
'callable_4' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass::staticMethod',
255-
'callable_5' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'],
256255
'callable_6' => function () { return 'Closure'; },
257256
'callable_7' => new CallableClass(),
258257
'callable_from_callable' => (new CallableClass())(...),
259258
];
260259
}
260+
261+
public static function getDeprecatedCallables(): array
262+
{
263+
return [
264+
'callable_5' => ['Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'],
265+
];
266+
}
261267
}
262268

263269
class CallableClass

0 commit comments

Comments
 (0)