5 use Webmozart\PathUtil\Path;
8 * Tests the Drush override of DrupalKernel.
12 * @see https://github.com/drush-ops/drush/issues/3123
14 class ContainerTest extends CommandUnishTestCase
16 use TestModuleHelperTrait;
19 * Tests that the existing container is available while Drush rebuilds it.
21 public function testContainer()
23 $this->setUpDrupal(1, true);
25 // Copy the 'woot' module over to the Drupal site we just set up.
26 $this->setupModulesForTests(['woot'], Path::join(__DIR__, 'resources/modules/d8'));
29 $this->drush('pm-enable', ['woot']);
31 // Set up for a config import with just one small piece.
32 $this->drush('config-export');
33 $this->drush('config-set', ['system.site', 'name', 'config_test']);
35 // Trigger the container rebuild we need.
38 // If the event was registered successfully, then upon a config import, we
39 // should get the error message.
40 $this->drush('config-import', [], [], null, null, CommandUnishTestCase::EXIT_ERROR);
41 $this->assertContains("woot config error", $this->getErrorOutput(), 'Event was successfully registered.');