$this->
assertSession()->
linkByHrefExists(Url::
fromRoute('system.admin'
)->
toString());
// Ensure we can reach the "Add another module" link.
$this->
clickLink('Add another module'
);
$this->
assertSession()->
statusCodeEquals(200
);
$this->
assertSession()->
addressEquals('admin/modules/install'
);
// Check that the module has the correct version before trying to update
// it. Since the module is installed in sites/simpletest, which only the
// child site has access to, standard module API functions won't find it
// when called here. To get the version, the info file must be parsed
// directly instead.
$info_parser =
new InfoParserDynamic(DRUPAL_ROOT
);
$info =
$info_parser->
parse($installedInfoFilePath);
$this->
assertEquals('8.x-1.0',
$info['version'
]);
// Enable the module.
$this->
drupalGet('admin/modules'
);
$this->
submitForm(['modules[update_test_new_module][enable]' => TRUE
], 'Install'
);
// Define the update XML such that the new module downloaded above needs an
// update from 8.x-1.0 to 8.x-1.1.
$update_test_config =
$this->
config('update_test.settings'
);
$system_info =
[