symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.94k stars 222 forks source link

Panther only supports getting normalized text #325

Closed iceuponfire closed 4 years ago

iceuponfire commented 4 years ago

since the symfony 4.4.6 update i get the "Panther only supports getting normalized text" when running tests.

Maybe it could be related to https://github.com/symfony/symfony/pull/34151 ??

lsdlp commented 4 years ago

Hello same issue here. i have this error on my test "Panther only supports getting normalized text" when running tests." since the symfony 4.4.6 update

raphaChoquet commented 4 years ago

I agree. The problem seem to come from this release. On constraint, they change : $crawler->text() by $crawler->text(null, false) however in the Panther crawler if you pass false as second parameter, this throw the exception "Panther only supports getting normalized text" :

public function text(string $default = null, bool $normalizeWhitespace = true): string
{
    if (!$normalizeWhitespace) {
        throw new \InvalidArgumentException('Panther only supports getting normalized text.');
    }
    [...]
}
iceuponfire commented 4 years ago

image

dom-crawler seem to send false as the second argument?

iceuponfire commented 4 years ago

https://github.com/symfony/symfony/pull/35899 https://github.com/symfony/symfony/commit/ff2c362195db857238c543952ed54843030cba1d