AutomaticUpdatesFunctionalTestBase.php in Automatic Updates 8.2
File
tests/src/Functional/AutomaticUpdatesFunctionalTestBase.php
View source
<?php
namespace Drupal\Tests\automatic_updates\Functional;
use Drupal\Tests\BrowserTestBase;
abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
protected static $modules = [
'automatic_updates_test_disable_validators',
'update',
'update_test',
];
protected function prepareSettings() {
parent::prepareSettings();
$settings['settings']['automatic_updates_disable_validators'] = (object) [
'value' => [
'automatic_updates.validator.file_system_permissions',
],
'required' => TRUE,
];
$this
->writeSettings($settings);
}
protected function setCoreVersion(string $version) : void {
$this
->config('update_test.settings')
->set('system_info.#all.version', $version)
->save();
}
protected function setReleaseMetadata(string $file) : void {
$this
->config('update.settings')
->set('fetch.url', $this->baseUrl . '/automatic-update-test')
->save();
[
$project,
$fixture,
] = explode('.', basename($file, '.xml'), 2);
$this
->config('update_test.settings')
->set('xml_map', [
$project => $fixture,
])
->save();
}
protected function checkForUpdates() : void {
$this
->drupalGet('/admin/reports/updates');
$this
->getSession()
->getPage()
->clickLink('Check manually');
$this
->checkForMetaRefresh();
}
}