function ModulesListFormWebTest::testModulesListFormWithEmptyDescriptionInfoFile

Tests the module form with a module with an empty description in info.yml.

File

core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php, line 132

Class

ModulesListFormWebTest
Tests \Drupal\system\Form\ModulesListForm.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testModulesListFormWithEmptyDescriptionInfoFile() : void {
  $path = \Drupal::getContainer()->getParameter('site.path') . "/modules/missing_description";
  mkdir($path, 0777, TRUE);
  $file_path = "{$path}/missing_description.info.yml";
  $yml = <<<BROKEN
  name: Module with empty description
  type: module
  core_version_requirement: '*'
  description:
  BROKEN;
  file_put_contents($file_path, $yml);
  $this->drupalGet('admin/modules');
  $this->assertSession()
    ->statusCodeEquals(200);
  $this->assertSession()
    ->pageTextContains("Module with empty description");
  // Check that the module filter text box is available.
  $this->assertSession()
    ->elementExists('xpath', '//input[@name="text"]');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.