Skip to content
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

add getters to private properties, re: #148 #150

Open
wants to merge 5 commits into
base: 1.x
Choose a base branch
from

Conversation

tacman
Copy link

@tacman tacman commented Jun 10, 2024

so the user can do something with the saved screenshots.

@tacman
Copy link
Author

tacman commented Jul 21, 2024

Can you accept this PR, or give me some guidance on how to improve it? Thx.

Comment on lines +251 to +259
public function setScreenshotDir(?string $screenshotDir): void
{
$this->screenshotDir = $screenshotDir;
}

public function setConsoleLogDir(?string $consoleLogDir): void
{
$this->consoleLogDir = $consoleLogDir;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to mutate these ones, WDYT @kbond?

Comment on lines +231 to +239
public function getScreenshotDir(): ?string
{
return $this->screenshotDir;
}

public function getConsoleLogDir(): ?string
{
return $this->consoleLogDir;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe i'ts time to bump php 8.1, and change these two properties to public readonly?

unfortunately, we can't do this for savedScreenshots / savedConsoleLogs... I really hope https://wiki.php.net/rfc/asymmetric-visibility-v2 will land in PHP some day 🤞

src/Browser/PantherBrowser.php Show resolved Hide resolved
@kbond
Copy link
Member

kbond commented Jul 24, 2024

@tacman, you can't use the BROWSER_SCREENSHOT_DIR env var?

I think it would be better to update HasBrowser::pantherBrowser() to accept these as options (I don't think the following works right now):

$this->pantherBrowser(['screenshot_dir' => 'some/dir']);

I'm really trying to keep the public api of browsers confined to just actions/assertions if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants