|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Drupal\df\Command; |
|
4
|
|
|
|
|
5
|
|
|
use Drupal\lightning\Command\BehatInitCommand; |
|
6
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
7
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* A command to generate Behat configuration for an installed Drupal site. |
|
11
|
|
|
*/ |
|
12
|
|
|
class DFBehatInitCommand extends BehatInitCommand { |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* BehatInitCommand constructor. |
|
16
|
|
|
* |
|
17
|
|
|
* @param \Drupal\Core\File\FileSystemInterface $file_system |
|
18
|
|
|
* The file system service. |
|
19
|
|
|
* @param string $app_root |
|
20
|
|
|
* The Drupal application root. |
|
21
|
|
|
*/ |
|
22
|
|
|
public function __construct($file_system, $app_root) { |
|
23
|
|
|
parent::__construct($file_system, $app_root); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* {@inheritdoc} |
|
28
|
|
|
*/ |
|
29
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) { |
|
30
|
|
|
parent::execute($input, $output); |
|
31
|
|
|
|
|
32
|
|
|
$config = $this->readConfig(); |
|
33
|
|
|
|
|
34
|
|
|
// Use the Drupal Extension, if available. |
|
35
|
|
|
if (class_exists('\Drupal\DrupalExtension\ServiceContainer\DrupalExtension')) { |
|
36
|
|
|
// Use DF-specific message selectors. |
|
37
|
|
|
$config['default']['extensions']['Drupal\DrupalExtension']['selectors']['message_selector'] = '.zurb-foundation-callout'; |
|
38
|
|
|
$config['default']['extensions']['Drupal\DrupalExtension']['selectors']['error_message_selector'] = '.zurb-foundation-callout.alert'; |
|
39
|
|
|
$config['default']['extensions']['Drupal\DrupalExtension']['selectors']['success_message_selector'] = '.zurb-foundation-callout.success'; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
$this->writeConfig($config, $input->getOption('merge')); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
} |
|
46
|
|
|
|