Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
@ -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