From 760868b9e504f5ac6e7033fe26dc4ff9ece16c18 Mon Sep 17 00:00:00 2001 From: thePanz <226021+thePanz@users.noreply.github.com> Date: Fri, 7 Jan 2022 16:00:02 +0100 Subject: [PATCH] Add support for BrowserKit driver --- .../Driver/BrowserKitFactorySpec.php | 24 +++++++ .../Driver/BrowserKitFactory.php | 65 +++++++++++++++++++ .../ServiceContainer/MinkExtension.php | 2 + 3 files changed, 91 insertions(+) create mode 100644 spec/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactorySpec.php create mode 100644 src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php diff --git a/spec/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactorySpec.php b/spec/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactorySpec.php new file mode 100644 index 00000000..e7d8e8b4 --- /dev/null +++ b/spec/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactorySpec.php @@ -0,0 +1,24 @@ +shouldHaveType(DriverFactory::class); + } + + function it_is_named_browserkit() + { + $this->getDriverName()->shouldReturn('browserkit_http'); + } + + function it_does_not_support_javascript() + { + $this->supportsJavascript()->shouldBe(false); + } +} diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php new file mode 100644 index 00000000..9b0e8d33 --- /dev/null +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php @@ -0,0 +1,65 @@ +registerDriverFactory(new GoutteFactory()); + $this->registerDriverFactory(new BrowserKitFactory()); $this->registerDriverFactory(new SahiFactory()); $this->registerDriverFactory(new SeleniumFactory()); $this->registerDriverFactory(new Selenium2Factory());