minor #33067 [VarDumper] Fix test patern to handle callstack with/without return typehint (jderusse)

This PR was merged into the 4.3 branch.

Discussion
----------

[VarDumper] Fix test patern to handle callstack with/without return typehint

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32844
| License       | MIT
| Doc PR        | NA

The TestCase::tearDownAfterClass methods does not always have the same signature which change the output of the reflection. This use another methods for testing

Commits
-------

feaadd1c0b Fix tst patern to handle callstack with/without return typehint
This commit is contained in:
Nicolas Grekas 2019-08-08 23:10:45 +02:00
commit 1b98df7c64
1 changed files with 8 additions and 3 deletions

View File

@ -89,7 +89,7 @@ EOTXT
}
$var = [
(new \ReflectionMethod($this, __FUNCTION__))->getClosure($this),
(new \ReflectionMethod(__CLASS__, 'tearDownAfterClass'))->getClosure(),
(new \ReflectionMethod(__CLASS__, 'stub'))->getClosure(),
];
$this->assertDumpMatchesFormat(
@ -100,8 +100,9 @@ array:2 [
file: "%sReflectionCasterTest.php"
line: "%d to %d"
}
1 => %sTestCase::tearDownAfterClass() {
file: "%sTestCase.php"
1 => Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest::stub(): void {
returnType: "void"
file: "%sReflectionCasterTest.php"
line: "%d to %d"
}
]
@ -244,6 +245,10 @@ Generator {
EODUMP;
$this->assertDumpMatchesFormat($expectedDump, $generator);
}
public static function stub(): void
{
}
}
function reflectionParameterFixture(NotLoadableClass $arg1 = null, $arg2)