Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
@ -64,7 +64,7 @@ class UpdateTestController extends ControllerBase {
|
|||
}
|
||||
|
||||
$file = __DIR__ . "/../../$project_name.$availability_scenario.xml";
|
||||
$headers = array('Content-Type' => 'text/xml; charset=utf-8');
|
||||
$headers = ['Content-Type' => 'text/xml; charset=utf-8'];
|
||||
if (!is_file($file)) {
|
||||
// Return an empty response.
|
||||
return new Response('', 200, $headers);
|
||||
|
|
|
@ -32,7 +32,7 @@ class UpdateTestArchiver implements ArchiverInterface {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function extract($path, array $files = array()) {
|
||||
public function extract($path, array $files = []) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class UpdateTestArchiver implements ArchiverInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function listContents() {
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,11 +29,11 @@ class TestFileTransferWithSettingsForm extends Local {
|
|||
* Returns a settings form with a text field to input a username.
|
||||
*/
|
||||
public function getSettingsForm() {
|
||||
$form = array();
|
||||
$form['update_test_username'] = array(
|
||||
$form = [];
|
||||
$form['update_test_username'] = [
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Update Test Username'),
|
||||
);
|
||||
];
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ use Drupal\Core\Extension\Extension;
|
|||
*/
|
||||
function update_test_system_info_alter(&$info, Extension $file) {
|
||||
$setting = \Drupal::config('update_test.settings')->get('system_info');
|
||||
foreach (array('#all', $file->getName()) as $id) {
|
||||
foreach (['#all', $file->getName()] as $id) {
|
||||
if (!empty($setting[$id])) {
|
||||
foreach ($setting[$id] as $key => $value) {
|
||||
$info[$key] = $value;
|
||||
|
@ -44,7 +44,7 @@ function update_test_update_status_alter(&$projects) {
|
|||
$setting = \Drupal::config('update_test.settings')->get('update_status');
|
||||
if (!empty($setting)) {
|
||||
foreach ($projects as $project_name => &$project) {
|
||||
foreach (array('#all', $project_name) as $id) {
|
||||
foreach (['#all', $project_name] as $id) {
|
||||
if (!empty($setting[$id])) {
|
||||
foreach ($setting[$id] as $key => $value) {
|
||||
$project[$key] = $value;
|
||||
|
@ -62,11 +62,11 @@ function update_test_filetransfer_info() {
|
|||
// Define a test file transfer method, to ensure that there will always be at
|
||||
// least one method available in the user interface (regardless of the
|
||||
// environment in which the update manager tests are run).
|
||||
return array(
|
||||
'system_test' => array(
|
||||
return [
|
||||
'system_test' => [
|
||||
'title' => t('Update Test FileTransfer'),
|
||||
'class' => 'Drupal\update_test\TestFileTransferWithSettingsForm',
|
||||
'weight' => -20,
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Drupal\Tests\update\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@ class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = array('update');
|
||||
public static $modules = ['update'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -35,7 +35,7 @@ class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase {
|
|||
$this->assertIdentical(2, $config->get('fetch.max_attempts'));
|
||||
$this->assertIdentical('http://updates.drupal.org/release-history', $config->get('fetch.url'));
|
||||
$this->assertIdentical('all', $config->get('notification.threshold'));
|
||||
$this->assertIdentical(array(), $config->get('notification.emails'));
|
||||
$this->assertIdentical([], $config->get('notification.emails'));
|
||||
$this->assertIdentical(7, $config->get('check.interval_days'));
|
||||
$this->assertConfigSchema(\Drupal::service('config.typed'), 'update.settings', $config->get());
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
|
|||
class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
||||
|
||||
protected function setUp() {
|
||||
$this->directoryList = array('update' => 'core/modules/update');
|
||||
$this->directoryList = ['update' => 'core/modules/update'];
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
|
@ -22,20 +22,20 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
|||
* @dataProvider getUpdateReportRoutes
|
||||
*/
|
||||
public function testUpdateReportLocalTasks($route) {
|
||||
$this->assertLocalTasks($route, array(
|
||||
0 => array('update.status', 'update.settings', 'update.report_update'),
|
||||
));
|
||||
$this->assertLocalTasks($route, [
|
||||
0 => ['update.status', 'update.settings', 'update.report_update'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of report routes to test.
|
||||
*/
|
||||
public function getUpdateReportRoutes() {
|
||||
return array(
|
||||
array('update.status'),
|
||||
array('update.settings'),
|
||||
array('update.report_update'),
|
||||
);
|
||||
return [
|
||||
['update.status'],
|
||||
['update.settings'],
|
||||
['update.report_update'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,9 +44,9 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
|||
* @dataProvider getUpdateModuleRoutes
|
||||
*/
|
||||
public function testUpdateModuleLocalTasks($route) {
|
||||
$this->assertLocalTasks($route, array(
|
||||
0 => array('update.module_update'),
|
||||
));
|
||||
$this->assertLocalTasks($route, [
|
||||
0 => ['update.module_update'],
|
||||
]);
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,9 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
|||
* Provides a list of module routes to test.
|
||||
*/
|
||||
public function getUpdateModuleRoutes() {
|
||||
return array(
|
||||
array('update.module_update'),
|
||||
);
|
||||
return [
|
||||
['update.module_update'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,9 +65,9 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
|||
* @dataProvider getUpdateThemeRoutes
|
||||
*/
|
||||
public function testUpdateThemeLocalTasks($route) {
|
||||
$this->assertLocalTasks($route, array(
|
||||
0 => array('update.theme_update'),
|
||||
));
|
||||
$this->assertLocalTasks($route, [
|
||||
0 => ['update.theme_update'],
|
||||
]);
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -75,9 +75,9 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
|
|||
* Provides a list of theme routes to test.
|
||||
*/
|
||||
public function getUpdateThemeRoutes() {
|
||||
return array(
|
||||
array('update.theme_update'),
|
||||
);
|
||||
return [
|
||||
['update.theme_update'],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class UpdateFetcherTest extends UnitTestCase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$config_factory = $this->getConfigFactoryStub(array('update.settings' => array('fetch_url' => 'http://www.example.com')));
|
||||
$config_factory = $this->getConfigFactoryStub(['update.settings' => ['fetch_url' => 'http://www.example.com']]);
|
||||
$http_client_mock = $this->getMock('\GuzzleHttp\ClientInterface');
|
||||
$this->updateFetcher = new UpdateFetcher($config_factory, $http_client_mock);
|
||||
}
|
||||
|
@ -62,25 +62,25 @@ class UpdateFetcherTest extends UnitTestCase {
|
|||
* - 'expected' - The expected url from UpdateFetcher::buildFetchUrl().
|
||||
*/
|
||||
public function providerTestUpdateBuildFetchUrl() {
|
||||
$data = array();
|
||||
$data = [];
|
||||
|
||||
// First test that we didn't break the trivial case.
|
||||
$project['name'] = 'update_test';
|
||||
$project['project_type'] = '';
|
||||
$project['info']['version'] = '';
|
||||
$project['info']['project status url'] = 'http://www.example.com';
|
||||
$project['includes'] = array('module1' => 'Module 1', 'module2' => 'Module 2');
|
||||
$project['includes'] = ['module1' => 'Module 1', 'module2' => 'Module 2'];
|
||||
$site_key = '';
|
||||
$expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
|
||||
|
||||
$data[] = array($project, $site_key, $expected);
|
||||
$data[] = [$project, $site_key, $expected];
|
||||
|
||||
// For disabled projects it shouldn't add the site key either.
|
||||
$site_key = 'site_key';
|
||||
$project['project_type'] = 'disabled';
|
||||
$expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
|
||||
|
||||
$data[] = array($project, $site_key, $expected);
|
||||
$data[] = [$project, $site_key, $expected];
|
||||
|
||||
// For enabled projects, test adding the site key.
|
||||
$project['project_type'] = '';
|
||||
|
@ -88,7 +88,7 @@ class UpdateFetcherTest extends UnitTestCase {
|
|||
$expected .= '?site_key=site_key';
|
||||
$expected .= '&list=' . rawurlencode('module1,module2');
|
||||
|
||||
$data[] = array($project, $site_key, $expected);
|
||||
$data[] = [$project, $site_key, $expected];
|
||||
|
||||
// Test when the URL contains a question mark.
|
||||
$project['info']['project status url'] = 'http://www.example.com/?project=';
|
||||
|
@ -96,7 +96,7 @@ class UpdateFetcherTest extends UnitTestCase {
|
|||
$expected .= '&site_key=site_key';
|
||||
$expected .= '&list=' . rawurlencode('module1,module2');
|
||||
|
||||
$data[] = array($project, $site_key, $expected);
|
||||
$data[] = [$project, $site_key, $expected];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
Reference in a new issue