Security update for permissions_by_term
[yaffs-website] / vendor / behat / mink-extension / src / Behat / MinkExtension / ServiceContainer / Driver / BrowserStackFactory.php
1 <?php
2
3 /*
4  * This file is part of the Behat MinkExtension.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\MinkExtension\ServiceContainer\Driver;
12
13 use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
14
15 class BrowserStackFactory extends Selenium2Factory
16 {
17     /**
18      * {@inheritdoc}
19      */
20     public function getDriverName()
21     {
22         return 'browser_stack';
23     }
24
25     /**
26      * {@inheritdoc}
27      */
28     public function configure(ArrayNodeDefinition $builder)
29     {
30         $builder
31             ->children()
32                 ->scalarNode('username')->defaultValue(getenv('BROWSERSTACK_USERNAME'))->end()
33                 ->scalarNode('access_key')->defaultValue(getenv('BROWSERSTACK_ACCESS_KEY'))->end()
34                 ->scalarNode('browser')->defaultValue('firefox')->end()
35                 ->append($this->getCapabilitiesNode())
36             ->end()
37         ;
38     }
39
40     /**
41      * {@inheritdoc}
42      */
43     public function buildDriver(array $config)
44     {
45         $config['wd_host'] = sprintf('%s:%s@hub.browserstack.com/wd/hub', $config['username'], $config['access_key']);
46
47         return parent::buildDriver($config);
48     }
49
50     protected function getCapabilitiesNode()
51     {
52         $node = parent::getCapabilitiesNode();
53
54         $node
55             ->children()
56                 ->scalarNode('project')->end()
57                 ->scalarNode('resolution')->end()
58                 ->scalarNode('build')->info('will be set automatically based on the TRAVIS_JOB_NUMBER environment variable if available')->end()
59                 ->scalarNode('os')->end()
60                 ->scalarNode('os_version')->end()
61                 ->scalarNode('device')->end()
62                 ->booleanNode('browserstack-debug')->end()
63                 ->booleanNode('browserstack-tunnel')->end()
64                 ->booleanNode('emulator')->end()
65             ->end()
66         ;
67
68         return $node;
69     }
70 }