3 namespace Drupal\Tests\book\Functional;
5 use Drupal\Tests\BrowserTestBase;
6 use Drupal\Core\Config\PreExistingConfigException;
9 * Test installation of Book module.
13 class BookInstallTest extends BrowserTestBase {
20 public static $modules = ['node'];
25 protected function setUp() {
30 * Test Book install with pre-existing content type.
32 * Tests that Book module can be installed if content type with machine name
33 * 'book' already exists.
35 public function testBookInstallWithPreexistingContentType() {
36 // Create a 'book' content type.
37 $this->drupalCreateContentType(['type' => 'book']);
39 // Install the Book module.
41 $this->container->get('module_installer')->install(['book']);
43 catch (PreExistingConfigException $e) {
44 $this->fail("Expected exception thrown trying to install Book module: " . $e->getMessage());