-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw exception when getClient is not started
This resolves amongst other things issues with behatch also see: Behatch/contexts#284 Behatch/contexts#292
- Loading branch information
1 parent
ef04718
commit 644d9a8
Showing
2 changed files
with
67 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Behat\Mink\Tests\Driver; | ||
|
||
use Behat\Mink\Exception\DriverException; | ||
|
||
class GetContentTest extends TestCase | ||
{ | ||
public function test_throws_an_exception_if_driver_not_startet():void | ||
{ | ||
$this->expectException(DriverException::class); | ||
$this->expectExceptionMessage('Client is not (yet) started.'); | ||
$driver = $this->getSession()->getDriver(); | ||
if ($driver->isStarted()) { | ||
$driver->stop(); | ||
} | ||
$driver->getContent(); | ||
} | ||
} |