-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Panther driver for Sylius 1.12
- Loading branch information
Showing
5 changed files
with
48 additions
and
8 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
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\FluxSE\SyliusPayumStripePlugin\Behat\Bug; | ||
|
||
use Behat\Mink\Driver\PantherDriver; | ||
use Behat\Mink\Session; | ||
use Sylius\Behat\Service\Setter\CookieSetterInterface; | ||
|
||
final class PantherCookieSetter implements CookieSetterInterface | ||
{ | ||
public function __construct( | ||
private Session $minkSession, | ||
private CookieSetterInterface $decoratedCookieSetter | ||
) { | ||
} | ||
|
||
public function setCookie($name, $value): void | ||
{ | ||
$driver = $this->minkSession->getDriver(); | ||
|
||
if ($driver instanceof PantherDriver) { | ||
if (!$driver->isStarted()) { | ||
$driver->start(); | ||
} | ||
} | ||
|
||
$this->decoratedCookieSetter->setCookie($name, $value); | ||
} | ||
} |
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<service id="Tests\FluxSE\SyliusPayumStripePlugin\Behat\Bug\PantherCookieSetter" decorates="sylius.behat.cookie_setter"> | ||
<argument type="service" id="behat.mink.default_session" /> | ||
<argument type="service" id="Tests\FluxSE\SyliusPayumStripePlugin\Behat\Bug\PantherCookieSetter.inner" /> | ||
</service> | ||
</services> | ||
</container> |