Skip to content

Commit

Permalink
Run type verification tests of ReflectionSourceStubber tests for PH…
Browse files Browse the repository at this point in the history
…P 8.1 through the adapter layer (for compatibility)

Nullable types in BetterReflection are represented as union types: using the adapter layer as part of the test,
even if just for a small string cast, helps us avoiding custom code here.
  • Loading branch information
Ocramius committed Dec 5, 2021
1 parent df5d877 commit 33a5645
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ private function assertSameMethodAttributes(CoreReflectionMethod $original, Refl

if (method_exists($original, 'hasTentativeReturnType')) {
self::assertSame($original->hasTentativeReturnType(), $stubbed->hasTentativeReturnType(), $original->getName());
self::assertSame((string) $original->getTentativeReturnType(), (string) $stubbed->getTentativeReturnType(), $original->getName());
self::assertSame(
(string) $original->getTentativeReturnType(),
(string) ReflectionType::fromTypeOrNull($stubbed->getTentativeReturnType()),
$original->getName(),
);
}

self::assertSame($original->hasReturnType(), $stubbed->hasReturnType(), $original->getName());
Expand Down

0 comments on commit 33a5645

Please sign in to comment.