Skip to content

Commit 57355e7

Browse files
committed
Fix type hints to pass tests
1 parent 395005f commit 57355e7

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function checkArguments(array $arguments): void
9797
}
9898

9999
/**
100-
* @param string $commandName The called method name defined as a key in initCommands()
100+
* @param string $commandName The called method name defined as a key in initCommands()
101101
* @param string|array|null $jsonParameters
102102
*/
103103
protected function newCommand(string $commandName, $jsonParameters): Command

PHPUnit/Extensions/Selenium2TestCase/ScreenshotListener.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,15 @@ public function addFailure(Test $test, AssertionFailedError $e, float $time): vo
4343

4444
private function storeAScreenshot(Test $test): void
4545
{
46-
if ($test instanceof Selenium2TestCase)
47-
{
46+
if ($test instanceof Selenium2TestCase) {
4847
$className = str_replace('\\', '_', get_class($test));
4948

5049
try {
5150
$file = $this->directory . '/' . $className . '__' . $test->getName() . '__' . date('Y-m-d\TH-i-s') . '.png';
52-
file_put_contents($file, $test->currentScreenshot());
51+
file_put_contents($file, $test->currentScreenshot());
5352
} catch (\Exception $e) {
5453
$file = $this->directory . '/' . $className . '__' . $test->getName() . '__' . date('Y-m-d\TH-i-s') . '.txt';
55-
file_put_contents($file, "Screenshot generation doesn't work." . "\n"
56-
. $e->getMessage() . "\n"
57-
. $e->getTraceAsString());
54+
file_put_contents($file, sprintf("Screenshot generation doesn't work.\n%s\n%s", $e->getMessage(), $e->getTraceAsString()));
5855
}
5956
}
6057
}

PHPUnit/Extensions/Selenium2TestCase/SessionCommand/File.php

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function __construct(string $argument, URL $url)
4040

4141
$file = base64_encode($contents);
4242

43-
4443
parent::__construct(['file' => $file], $url);
4544

4645
unlink($zipfilePath);

PHPUnit/Extensions/Selenium2TestCase/URL.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ final class URL
1818
/** @var string */
1919
private $value;
2020

21-
/** @param string $value */
2221
public function __construct(string $value)
2322
{
2423
$this->value = $value;

0 commit comments

Comments
 (0)