You are here

public function ModuleInstallTest::testModuleInstalls in Paragraphs Sets 8.2

Test that paragraphs_sets_requirements() doesn't interrupt install flow.

File

tests/src/Functional/ModuleInstallTest.php, line 34

Class

ModuleInstallTest
Test that paragraphs_sets_requirements() does not interrupt the install flow.

Namespace

Drupal\Tests\paragraphs_sets\Functional

Code

public function testModuleInstalls() {

  // Get the "Extend" page, check "Paragraphs Sets",
  // Note that \Drupal\Tests\system\Functional\Module\ModuleTestBase::setUp()
  // logs us in with a user that can install/uninstall modules.
  $this
    ->drupalGet('admin/modules');
  $modulesPage = $this
    ->getSession()
    ->getPage();
  $modulesPage
    ->checkField('modules[paragraphs_sets][enable]');
  $modulesPage
    ->pressButton('Install');

  // Test we get a "Some required modules must be enabled" page, and not an
  // error.
  $this
    ->assertSession()
    ->statusCodeNotEquals(500);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('Some required modules must be enabled');
  $this
    ->assertSession()
    ->pageTextContains('You must enable the');
  $this
    ->assertSession()
    ->pageTextContains('modules to install Paragraphs Sets');
}