From 819063c58b14f54ea46e21ca40bb5ab8332ee781 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 3 Dec 2014 01:41:38 +0100 Subject: [PATCH] Unset the custom-data node when it is empty Closes #179 --- .../ServiceContainer/Driver/SauceLabsFactory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php index 98d6a57..7cbcc49 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php @@ -84,6 +84,14 @@ class SauceLabsFactory extends Selenium2Factory ->booleanNode('capture-html')->end() ->booleanNode('disable-popup-handler')->end() ->end() + ->validate() + ->ifTrue(function ($v) {return empty($v['custom-data']);}) + ->then(function ($v) { + unset ($v['custom-data']); + + return $v; + }) + ->end() ; return $node;