Skip to content

Commit

Permalink
Fix type hints to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pajon committed Dec 2, 2021
1 parent 395005f commit 57355e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PHPUnit/Extensions/Selenium2TestCase/CommandsHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private function checkArguments(array $arguments): void
}

/**
* @param string $commandName The called method name defined as a key in initCommands()
* @param string $commandName The called method name defined as a key in initCommands()
* @param string|array|null $jsonParameters
*/
protected function newCommand(string $commandName, $jsonParameters): Command
Expand Down
9 changes: 3 additions & 6 deletions PHPUnit/Extensions/Selenium2TestCase/ScreenshotListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,15 @@ public function addFailure(Test $test, AssertionFailedError $e, float $time): vo

private function storeAScreenshot(Test $test): void
{
if ($test instanceof Selenium2TestCase)
{
if ($test instanceof Selenium2TestCase) {
$className = str_replace('\\', '_', get_class($test));

try {
$file = $this->directory . '/' . $className . '__' . $test->getName() . '__' . date('Y-m-d\TH-i-s') . '.png';
file_put_contents($file, $test->currentScreenshot());
file_put_contents($file, $test->currentScreenshot());
} catch (\Exception $e) {
$file = $this->directory . '/' . $className . '__' . $test->getName() . '__' . date('Y-m-d\TH-i-s') . '.txt';
file_put_contents($file, "Screenshot generation doesn't work." . "\n"
. $e->getMessage() . "\n"
. $e->getTraceAsString());
file_put_contents($file, sprintf("Screenshot generation doesn't work.\n%s\n%s", $e->getMessage(), $e->getTraceAsString()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function __construct(string $argument, URL $url)

$file = base64_encode($contents);


parent::__construct(['file' => $file], $url);

unlink($zipfilePath);
Expand Down
1 change: 0 additions & 1 deletion PHPUnit/Extensions/Selenium2TestCase/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ final class URL
/** @var string */
private $value;

/** @param string $value */
public function __construct(string $value)
{
$this->value = $value;
Expand Down

0 comments on commit 57355e7

Please sign in to comment.