Completed
Push — 466-configure-ajax-timeout ( 7fe6f0 )
by Jonathan
10:51
created

MinkExtension::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace Drupal\MinkExtension\ServiceContainer;
4
5
use Behat\MinkExtension\ServiceContainer\MinkExtension as BaseMinkExtension;
6
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
7
8
class MinkExtension extends BaseMinkExtension
9
{
10
11
    /**
12
     * Default wait time for AJAX to finish (in seconds).
13
     *
14
     * @var int
15
     */
16
    const AJAX_TIMEOUT = 5;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function configure(ArrayNodeDefinition $builder)
22
    {
23
        parent::configure($builder);
24
25
        // Add extended options.
26
        $builder->
27
        children()->
28
        scalarNode('ajax_timeout')->
29
            defaultValue(static::AJAX_TIMEOUT)->
30
            info(sprintf('Change the maximum time to wait for AJAX calls to complete. Defaults to %s seconds.', static::AJAX_TIMEOUT))->
31
        end();
32
    }
33
}
34