forked from drush-ops/drush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContainerTest.php
43 lines (34 loc) · 1.27 KB
/
ContainerTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Unish;
use Webmozart\PathUtil\Path;
/**
* Tests the Drush override of DrupalKernel.
*
* @group base
*
* @see https://github.com/drush-ops/drush/issues/3123
*/
class ContainerTest extends CommandUnishTestCase
{
use TestModuleHelperTrait;
/**
* Tests that the existing container is available while Drush rebuilds it.
*/
public function testContainer()
{
$this->setUpDrupal(1, true);
// Copy the 'woot' module over to the Drupal site we just set up.
$this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules'));
// Enable our module.
$this->drush('pm-install', ['woot']);
// Set up for a config import with just one small piece.
$this->drush('config-export');
$this->drush('config-set', ['system.site', 'name', 'config_test']);
// Trigger the container rebuild we need.
$this->drush('cr');
// If the event was registered successfully, then upon a config import, we
// should get the error message.
$this->drush('config-import', [], [], null, null, CommandUnishTestCase::EXIT_ERROR);
$this->assertStringContainsString("woot config error", $this->getErrorOutput(), 'Event was successfully registered.');
}
}