More updates to stop using dev or alpha or beta versions.
[yaffs-website] / vendor / drush / drush / tests / ContainerTest.php
1 <?php
2
3 namespace Unish;
4
5 use Webmozart\PathUtil\Path;
6
7 /**
8  * Tests the Drush override of DrupalKernel.
9  *
10  * @group base
11  *
12  * @see https://github.com/drush-ops/drush/issues/3123
13  */
14 class ContainerTest extends CommandUnishTestCase
15 {
16     use TestModuleHelperTrait;
17
18     /**
19      * Tests that the existing container is available while Drush rebuilds it.
20      */
21     public function testContainer()
22     {
23         $this->setUpDrupal(1, true);
24
25         // Copy the 'woot' module over to the Drupal site we just set up.
26         $this->setupModulesForTests(['woot'], Path::join(__DIR__, 'resources/modules/d8'));
27
28         // Enable our module.
29         $this->drush('pm-enable', ['woot']);
30
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']);
34
35         // Trigger the container rebuild we need.
36         $this->drush('cr');
37
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.');
42     }
43 }