Skip to content

Commit

Permalink
minor #33067 [VarDumper] Fix test patern to handle callstack with/wit…
Browse files Browse the repository at this point in the history
…hout 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
-------

feaadd1 Fix tst patern to handle callstack with/without return typehint
  • Loading branch information
nicolas-grekas committed Aug 8, 2019
2 parents 85c5011 + feaadd1 commit 1b98df7
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -89,7 +89,7 @@ public function testFromCallableClosureCaster()
}
$var = [
(new \ReflectionMethod($this, __FUNCTION__))->getClosure($this),
(new \ReflectionMethod(__CLASS__, 'tearDownAfterClass'))->getClosure(),
(new \ReflectionMethod(__CLASS__, 'stub'))->getClosure(),
];

$this->assertDumpMatchesFormat(
Expand All @@ -100,8 +100,9 @@ public function testFromCallableClosureCaster()
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"
}
]
Expand Down Expand Up @@ -244,6 +245,10 @@ public function testGenerator()
EODUMP;
$this->assertDumpMatchesFormat($expectedDump, $generator);
}

public static function stub(): void
{
}
}

function reflectionParameterFixture(NotLoadableClass $arg1 = null, $arg2)
Expand Down

0 comments on commit 1b98df7

Please sign in to comment.