Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit e90955e

Browse files
patrickdreyerstof
authored andcommitted
Adhere to Symfony2 for activating the wunit mink driver
1 parent 061df29 commit e90955e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ default:
2424
framework_script: ../../framework/yii.php
2525
config_script: ../config/test.php
2626
mink_driver: true
27-
wunit: ~
2827
```
2928
3029
Installation

src/Behat/YiiExtension/Extension.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function load(array $config, ContainerBuilder $container)
5757
}
5858
$container->setParameter('behat.yii_extension.config_script', $config['config_script']);
5959

60-
if (isset($config['wunit'])) {
60+
if ($config['mink_driver']) {
6161
if (!class_exists('Behat\\Mink\\Driver\\WUnitDriver')) {
6262
throw new \RuntimeException(
6363
'Install WUnitDriver in order to activate wunit session.'
@@ -75,6 +75,11 @@ public function load(array $config, ContainerBuilder $container)
7575
*/
7676
public function getConfig(ArrayNodeDefinition $builder)
7777
{
78+
$boolFilter = function ($v) {
79+
$filtered = filter_var($v, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
80+
return (null === $filtered) ? $v : $filtered;
81+
};
82+
7883
$builder->
7984
children()->
8085
scalarNode('framework_script')->
@@ -83,8 +88,11 @@ public function getConfig(ArrayNodeDefinition $builder)
8388
scalarNode('config_script')->
8489
isRequired()->
8590
end()->
86-
arrayNode('wunit')->
87-
canBeUnset()->
91+
booleanNode('mink_driver')->
92+
beforeNormalization()->
93+
ifString()->then($boolFilter)->
94+
end()->
95+
defaultFalse()->
8896
end()->
8997
end()
9098
;

0 commit comments

Comments
 (0)