8000 bug #38169 [PhpUnitBridge] Internal classes are not legacy (derrabus) · symfony/symfony@efb255c · GitHub
[go: up one dir, main page]

Skip to content

Commit efb255c

Browse files
committed
bug #38169 [PhpUnitBridge] Internal classes are not legacy (derrabus)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead. Discussion ---------- [PhpUnitBridge] Internal classes are not legacy | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #37564 | License | MIT | Doc PR | N/A This change works around the issue that we can observe in the failed Travis build of #38103. We must not call PHPUnit's internal `Test::getGroups()` method with a built-in class, otherwise we will run into a TypeError. This won't be fixed on PHPUnit's side, so we need to prevent that call. Our DeprecationErrorHander might run into this case if a deprecation is triggered while autoloading a class. And forgive me, I've had a really hard time trying to craft a test case for that. 🙈 Commits ------- 7d55e0c Internal classes are not legacy.
2 parents 25941ff + 7d55e0c commit efb255c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public function getMessage()
143143
public function isLegacy()
144144
{
145145
$class = $this->originatingClass();
146+
if ((new \ReflectionClass($class))->isInternal()) {
147+
return false;
148+
}
149+
146150
$method = $this->originatingMethod();
147151

148152
return 0 === strpos($method, 'testLegacy')

0 commit comments

Comments
 (0)
0