File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 33namespace Behat \Mink \Tests \Driver \Custom ;
44
55use Behat \Mink \Driver \Selenium2Driver ;
6+ use Behat \Mink \Exception \DriverException ;
67use Behat \Mink \Tests \Driver \TestCase ;
8+ use WebDriver \WebDriver ;
79
810class WebDriverTest extends TestCase
911{
@@ -18,4 +20,21 @@ public function testGetWebDriverSessionId()
1820 $ driver = new Selenium2Driver ();
1921 $ this ->assertNull ($ driver ->getWebDriverSessionId (), 'Not started session don \'t have an ID ' );
2022 }
23+
24+ public function testUnsupportedStatusResponseHandling (): void
25+ {
26+ $ mockWebDriver = $ this ->createMock (WebDriver::class);
27+ $ mockWebDriver ->expects ($ this ->once ())
28+ ->method ('__call ' )
29+ ->with ($ this ->equalTo ('status ' ))
30+ ->willThrowException (new \RuntimeException ('some internal error ' ));
31+
32+ $ driver = new Selenium2Driver ();
33+ $ driver ->setWebDriver ($ mockWebDriver );
34+
35+ $ this ->expectException (DriverException::class);
36+ $ this ->expectExceptionMessage ('Selenium Server version could not be detected: some internal error ' );
37+
38+ $ driver ->start ();
39+ }
2140}
You can’t perform that action at this time.
0 commit comments