Mercurial > hg > isophonics-drupal-site
annotate core/modules/book/tests/src/Functional/BookInstallTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Tests\book\Functional; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Tests\BrowserTestBase; |
Chris@0 | 6 use Drupal\Core\Config\PreExistingConfigException; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Test installation of Book module. |
Chris@0 | 10 * |
Chris@0 | 11 * @group book |
Chris@0 | 12 */ |
Chris@0 | 13 class BookInstallTest extends BrowserTestBase { |
Chris@0 | 14 |
Chris@0 | 15 /** |
Chris@0 | 16 * Modules to install. |
Chris@0 | 17 * |
Chris@0 | 18 * @var array |
Chris@0 | 19 */ |
Chris@0 | 20 public static $modules = ['node']; |
Chris@0 | 21 |
Chris@0 | 22 /** |
Chris@0 | 23 * {@inheritdoc} |
Chris@0 | 24 */ |
Chris@0 | 25 protected function setUp() { |
Chris@0 | 26 parent::setUp(); |
Chris@0 | 27 } |
Chris@0 | 28 |
Chris@0 | 29 /** |
Chris@0 | 30 * Test Book install with pre-existing content type. |
Chris@0 | 31 * |
Chris@0 | 32 * Tests that Book module can be installed if content type with machine name |
Chris@0 | 33 * 'book' already exists. |
Chris@0 | 34 */ |
Chris@0 | 35 public function testBookInstallWithPreexistingContentType() { |
Chris@0 | 36 // Create a 'book' content type. |
Chris@0 | 37 $this->drupalCreateContentType(['type' => 'book']); |
Chris@0 | 38 |
Chris@0 | 39 // Install the Book module. |
Chris@0 | 40 try { |
Chris@0 | 41 $this->container->get('module_installer')->install(['book']); |
Chris@0 | 42 } |
Chris@0 | 43 catch (PreExistingConfigException $e) { |
Chris@0 | 44 $this->fail("Expected exception thrown trying to install Book module: " . $e->getMessage()); |
Chris@0 | 45 } |
Chris@0 | 46 } |
Chris@0 | 47 |
Chris@0 | 48 } |