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

Normalize behavior of "getText" method #182

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
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
4 changes: 1 addition & 3 deletions src/BrowserKitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/**
* @var AbstractBrowser
*/
private $client;

Check failure on line 37 in src/BrowserKitDriver.php

View workflow job for this annotation

GitHub Actions / Static analysis

Property Behat\Mink\Driver\BrowserKitDriver::$client with generic class Symfony\Component\BrowserKit\AbstractBrowser does not specify its types: TRequest, TResponse

/**
* @var array<string, Form>
Expand All @@ -54,7 +54,7 @@
*
* @param string|null $baseUrl Base URL for HttpKernel clients
*/
public function __construct(AbstractBrowser $client, ?string $baseUrl = null)

Check failure on line 57 in src/BrowserKitDriver.php

View workflow job for this annotation

GitHub Actions / Static analysis

Method Behat\Mink\Driver\BrowserKitDriver::__construct() has parameter $client with generic class Symfony\Component\BrowserKit\AbstractBrowser but does not specify its types: TRequest, TResponse
{
$this->client = $client;
$this->client->followRedirects(true);
Expand All @@ -73,7 +73,7 @@
*
* @return AbstractBrowser
*/
public function getClient()

Check failure on line 76 in src/BrowserKitDriver.php

View workflow job for this annotation

GitHub Actions / Static analysis

Method Behat\Mink\Driver\BrowserKitDriver::getClient() return type with generic class Symfony\Component\BrowserKit\AbstractBrowser does not specify its types: TRequest, TResponse
{
return $this->client;
}
Expand Down Expand Up @@ -334,9 +334,7 @@
*/
public function getText(string $xpath)
{
$text = $this->getFilteredCrawler($xpath)->text(null, true);

return $text;
return str_replace("\xc2\xa0", ' ', $this->getFilteredCrawler($xpath)->text(null, true));
}

/**
Expand Down
Loading