8000 Support PHPUnit 10 by arderyp · Pull Request #589 · symfony/panther · GitHub
[go: up one dir, main page]

Skip to content

Support PHPUnit 10 #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
thought I removed new isGetClientStaticMethodAvailable function but I…
… guess I didn't, removing now at @dunglas request
  • Loading branch information
Philip Ardery committed Mar 4, 2023
commit bf31fda6265f7d035f30d9f8538370a39d77bbad
11 changes: 4 additions & 7 deletions src/PantherTestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function takeScreenshotIfTestFailed(): void
protected static function createPantherClient(array $options = [], array $kernelOptions = [], array $managerOptions = []): PantherClient
{
$browser = ($options['browser'] ?? self::$defaultOptions['browser'] ?? PantherTestCase::CHROME);
$callGetClient = self::isGetClientStaticMethodAvailable();
$callGetClient = method_exists(self::class, 'getClient') && (new \ReflectionMethod(self::class, 'getClient'))->isStatic();
if (null !== self::$pantherClient) {
$browserManager = self::$pantherClient->getBrowserManager();
if (
Expand Down Expand Up @@ -231,7 +231,9 @@ protected static function createHttpBrowserClient(array $options = [], array $ke
self::$httpBrowserClient->setServerParameter('HTTPS', 'true');
}

return self::isGetClientStaticMethodAvailable() ? self::getClient(self::$httpBrowserClient) : self::$httpBrowserClient; // @phpstan-ignore-line
// @phpstan-ignore-next-line
return method_exists(self::class, 'getClient') && (new \ReflectionMethod(self::class, 'getClient'))->isStatic() ?
self::getClient(self::$httpBrowserClient) : self::$httpBrowserClient;
}

private static function getWebServerDir(array $options): string
Expand All @@ -254,9 +256,4 @@ private static function getWebServerDir(array $options): string

return $_SERVER['PANTHER_WEB_SERVER_DIR'];
}

private static function isGetClientStaticMethodAvailable(): bool
{
return method_exists(self::class, 'getClient') && (new \ReflectionMethod(self::class, 'getClient'))->isStatic();
}
}
0