Open gcollombet opened 3 years ago
We should return a better error message, but it's not possible to use these assertions with Panther because WebDriver doesn't give access to the HTTP headers.
Thank you for the fast answer. Is that also the case when we use the HttpBrowserClient
?
Because the following expression work when client is a HttpBrowserClient
(created with createHttpBrowserClient()
method) :
$this->assertEquals(200, $client->getResponse()->getStatusCode(), $client->getResponse()->getContent());
If some methods of the trait BrowserKitAssertionsTrait
should never be used regardless of the client in a PantherTestCase
, maybe that methods should be made private when used in trait src/WebTestAssertionsTrait.php
?
use Symfony\Bundle\FrameworkBundle\Test\WebTestAssertionsTrait as BaseWebTestAssertionsTrait;
use BaseWebTestAssertionsTrait {
assertPageTitleSame as private baseAssertPageTitleSame;
assertPageTitleContains as private baseAssertPageTitleContains;
}
In a
PantherTestCase
When we use an assertion from the
BrowserKitAssertionsTrait
, we get aTypeError
:For exemple I have that error with that two function.
I use
BrowserKit
(createHttpBrowserClient
) as client.