Try to run tests with Behat @ dev-master

This commit is contained in:
Kamil Kokot
2020-01-15 14:41:56 +01:00
parent 8c54ffec8e
commit 019557e8e3
5 changed files with 20 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace FriendsOfBehat\SymfonyExtension\Driver;
use Behat\Mink\Driver\BrowserKitDriver;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\HttpKernel\KernelInterface;
@@ -25,10 +26,11 @@ final class SymfonyDriver extends BrowserKitDriver
/** @var object $testClient */
$testClient = $kernel->getContainer()->get('test.client');
if (!$testClient instanceof Client) {
if (!$testClient instanceof Client && !$testClient instanceof AbstractBrowser) {
throw new \RuntimeException(sprintf(
'Service "test.client" should be an instance of "%s", "%s" given.',
'Service "test.client" should be an instance of "%s" or "%s", "%s" given.',
Client::class,
AbstractBrowser::class,
get_class($testClient)
));
}