diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php index bb5f4ed..44274c9 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigImportForm.php @@ -107,4 +107,3 @@ public function submitForm(array &$form, array &$form_state) { } } - diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php index c3b505e..6f18ffa 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php @@ -120,10 +120,11 @@ public function buildForm(array $form, array &$form_state, $config_type = NULL, '#suffix' => '', ); if ($config_type && $config_name) { - $fake_form_state = array('values' => array( - 'config_type' => $config_type, - 'config_name' => $config_name, - )); + $fake_form_state = array( + 'values' => array( + 'config_type' => $config_type, + 'config_name' => $config_name, + )); $form['export'] = $this->updateExport($form, $fake_form_state); } return $form; diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php index 434745e..f970e8d 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php @@ -34,7 +34,8 @@ class ConfigSingleImportForm extends ConfirmFormBase { /** * If the config exists, this is that object. Otherwise, FALSE. * - * @var \Drupal\Core\Config\Config|\Drupal\Core\Config\Entity\ConfigEntityInterface|bool + * @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ + * Entity\ConfigEntityInterface|bool */ protected $configExists = FALSE; diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php index c600001..450a96b 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php @@ -75,13 +75,13 @@ class ConfigSync extends FormBase { /** * Constructs the object. * - * @param \Drupal\Core\Config\StorageInterface $sourceStorage + * @param \Drupal\Core\Config\StorageInterface $source_storage * The source storage object. - * @param \Drupal\Core\Config\StorageInterface $targetStorage + * @param \Drupal\Core\Config\StorageInterface $target_storage * The target storage manager. * @param \Drupal\Core\Lock\LockBackendInterface $lock * The lock object. - * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher + * @param \..\..\EventDispatcher\EventDispatcherInterface $event_dispatcher * Event dispatcher. * @param \Drupal\Core\Config\ConfigManagerInterface $config_manager * Configuration manager. @@ -90,9 +90,9 @@ class ConfigSync extends FormBase { * @param \Drupal\Core\Config\TypedConfigManager $typed_config * The typed configuration manager. */ - public function __construct(StorageInterface $sourceStorage, StorageInterface $targetStorage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, UrlGeneratorInterface $url_generator, TypedConfigManager $typed_config) { - $this->sourceStorage = $sourceStorage; - $this->targetStorage = $targetStorage; + public function __construct(StorageInterface $source_storage, StorageInterface $target_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, UrlGeneratorInterface $url_generator, TypedConfigManager $typed_config) { + $this->sourceStorage = $source_storage; + $this->targetStorage = $target_storage; $this->lock = $lock; $this->eventDispatcher = $event_dispatcher; $this->configManager = $config_manager; @@ -194,7 +194,7 @@ public function buildForm(array $form, array &$form_state) { 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal', 'data-dialog-options' => json_encode(array( - 'width' => 700 + 'width' => 700, )), ), ); @@ -227,11 +227,13 @@ public function submitForm(array &$form, array &$form_state) { if ($config_importer->alreadyImporting()) { drupal_set_message($this->t('Another request may be synchronizing configuration already.')); } - else{ + else { $config_importer->initialize(); $batch = array( 'operations' => array( - array(array(get_class($this), 'processBatch'), array($config_importer)), + array( + array(get_class($this), 'processBatch'), array($config_importer), + ), ), 'finished' => array(get_class($this), 'finishBatch'), 'title' => t('Synchronizing configuration'), @@ -250,7 +252,7 @@ public function submitForm(array &$form, array &$form_state) { * * @param BatchConfigImporter $config_importer * The batch config importer object to persist. - * @param $context + * @param object $context * The batch context. */ public static function processBatch(BatchConfigImporter $config_importer, &$context) { @@ -276,7 +278,11 @@ public static function finishBatch($success, $results, $operations) { // An error occurred. // $operations contains the operations that remained unprocessed. $error_operation = reset($operations); - $message = \Drupal::translation()->translate('An error occurred while processing %error_operation with arguments: @arguments', array('%error_operation' => $error_operation[0], '@arguments' => print_r($error_operation[1], TRUE))); + $message = \Drupal::translation()->translate('An error occurred while processing %error_operation with arguments: @arguments', + array( + '%error_operation' => $error_operation[0], + '@arguments' => print_r($error_operation[1], TRUE), + )); drupal_set_message($message, 'error'); } drupal_flush_all_caches(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php index 7576163..98a2c24 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php @@ -25,6 +25,9 @@ class ConfigCRUDTest extends DrupalUnitTestBase { */ public static $modules = array('system'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'CRUD operations', @@ -36,7 +39,7 @@ public static function getInfo() { /** * Tests CRUD operations. */ - function testCRUD() { + public function testCRUD() { $storage = $this->container->get('config.storage'); $name = 'config_test.crud'; @@ -134,7 +137,7 @@ function testCRUD() { /** * Tests the validation of configuration object names. */ - function testNameValidation() { + public function testNameValidation() { // Verify that an object name without namespace causes an exception. $name = 'nonamespace'; $message = 'Expected ConfigNameException was thrown for a name without a namespace.'; @@ -158,7 +161,8 @@ function testNameValidation() { } // Verify that disallowed characters in the name cause an exception. - $characters = $test_characters = array(':', '?', '*', '<', '>', '"', '\'', '/', '\\'); + $characters = $test_characters = array( + ':', '?', '*', '<', '>', '"', '\'', '/', '\\'); foreach ($test_characters as $i => $c) { try { $name = 'namespace.object' . $c; @@ -213,7 +217,7 @@ public function testDataTypes() { $this->assertIdentical($config->get(), $data); // Re-set each key using Config::set(). - foreach($data as $key => $value) { + foreach ($data as $key => $value) { $config->set($key, $value); } $config->save(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php index 57e0553..7c510d8 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php @@ -21,6 +21,9 @@ class ConfigDiffTest extends DrupalUnitTestBase { */ public static $modules = array('config_test', 'system'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Diff functionality', @@ -32,7 +35,7 @@ public static function getInfo() { /** * Tests calculating the difference between two sets of configuration. */ - function testDiff() { + public function testDiff() { $active = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); $config_name = 'config_test.system'; @@ -61,7 +64,7 @@ function testDiff() { $this->assertEqual($diff->edits[0]->orig[0], $change_key . ': ' . $original_data[$change_key], format_string("The active value for key '%change_key' is '%original_data'.", array('%change_key' => $change_key, '%original_data' => $original_data[$change_key]))); $this->assertEqual($diff->edits[0]->closing[0], $change_key . ': ' . $change_data, format_string("The staging value for key '%change_key' is '%change_data'.", array('%change_key' => $change_key, '%change_data' => $change_data))); - // Reset data back to original, and remove a key + // Reset data back to original, and remove a key. $staging_data = $original_data; unset($staging_data[$remove_key]); $staging->write($config_name, $staging_data); @@ -73,7 +76,7 @@ function testDiff() { $this->assertEqual($diff->edits[1]->orig[0], $remove_key . ': ' . $original_data[$remove_key], format_string("The active value for key '%remove_key' is '%original_data'.", array('%remove_key' => $remove_key, '%original_data' => $original_data[$remove_key]))); $this->assertFalse($diff->edits[1]->closing, format_string("The key '%remove_key' does not exist in staging.", array('%remove_key' => $remove_key))); - // Reset data back to original and add a key + // Reset data back to original and add a key. $staging_data = $original_data; $staging_data[$add_key] = $add_data; $staging->write($config_name, $staging_data); @@ -86,4 +89,4 @@ function testDiff() { $this->assertEqual($diff->edits[1]->closing[0], $add_key . ': ' . $add_data, format_string("The staging value for key '%add_key' is '%add_data'.", array('%add_key' => $add_key, '%add_data' => $add_data))); } -} \ No newline at end of file +} diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 682aeef..74b9fe3 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -23,6 +23,9 @@ class ConfigEntityListTest extends WebTestBase { */ public static $modules = array('config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration entity list', @@ -34,7 +37,7 @@ public static function getInfo() { /** * Tests entity list controller methods. */ - function testList() { + public function testList() { $controller = \Drupal::entityManager()->getListController('config_test'); // Test getStorageController() method. @@ -51,7 +54,7 @@ function testList() { // Test getOperations() method. $expected_operations = array( - 'edit' => array ( + 'edit' => array( 'title' => t('Edit'), 'weight' => 10, ) + $entity->urlInfo(), @@ -59,7 +62,7 @@ function testList() { 'title' => t('Disable'), 'weight' => 40, ) + $entity->urlInfo('disable'), - 'delete' => array ( + 'delete' => array( 'title' => t('Delete'), 'weight' => 100, ) + $entity->urlInfo('delete-form'), @@ -111,7 +114,8 @@ function testList() { )); $entity->save(); $list = $controller->load(); - $this->assertIdentical(array_keys($list), array('beta', 'dotted.default', 'alpha', 'omega')); + $this->assertIdentical(array_keys($list), + array('beta', 'dotted.default', 'alpha', 'omega')); // Test that config entities that do not support status, do not have // enable/disable operations. @@ -142,7 +146,7 @@ function testList() { /** * Tests the listing UI. */ - function testListUI() { + public function testListUI() { // Log in as an administrative user to access the full menu trail. $this->drupalLogin($this->drupalCreateUser(array('access administration pages'))); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php index 5519de5..c16c929 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php @@ -21,6 +21,9 @@ class ConfigEntityStatusTest extends DrupalUnitTestBase { */ public static $modules = array('config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration entity status', @@ -32,7 +35,7 @@ public static function getInfo() { /** * Tests the enabling/disabling of entities. */ - function testCRUD() { + public function testCRUD() { $entity = entity_create('config_test', array( 'id' => strtolower($this->randomName()), )); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php index 89f5b00..c4127e1 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusUITest.php @@ -22,6 +22,9 @@ class ConfigEntityStatusUITest extends WebTestBase { */ public static $modules = array('config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration entity status UI', @@ -33,7 +36,7 @@ public static function getInfo() { /** * Tests status operations. */ - function testCRUD() { + public function testCRUD() { $id = strtolower($this->randomName()); $edit = array( 'id' => $id, diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php index 12a1ede..2c01593 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php @@ -22,6 +22,9 @@ class ConfigEntityStorageControllerTest extends DrupalUnitTestBase { */ public static $modules = array('config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration entity UUID conflict', diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php index 19ebaff..e09926c 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php @@ -24,6 +24,9 @@ class ConfigEntityTest extends WebTestBase { */ public static $modules = array('config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration entities', @@ -35,7 +38,7 @@ public static function getInfo() { /** * Tests CRUD operations. */ - function testCRUD() { + public function testCRUD() { $default_langcode = language_default()->id; // Verify default properties on a newly created empty entity. $empty = entity_create('config_test'); @@ -151,12 +154,17 @@ function testCRUD() { try { $same_id->save(); $this->fail('Not possible to overwrite an entity entity.'); - } catch (EntityStorageException $e) { + } + catch (EntityStorageException $e) { $this->pass('Not possible to overwrite an entity entity.'); } // Verify that renaming the ID returns correct status and properties. - $ids = array($expected['id'], 'second_' . $this->randomName(4), 'third_' . $this->randomName(4)); + $ids = array( + $expected['id'], + 'second_' . $this->randomName(4), + 'third_' . $this->randomName(4), + ); for ($i = 1; $i < 3; $i++) { $old_id = $ids[$i - 1]; $new_id = $ids[$i]; @@ -185,7 +193,7 @@ function testCRUD() { /** * Tests CRUD operations through the UI. */ - function testCRUDUI() { + public function testCRUDUI() { $id = strtolower($this->randomName()); $label1 = $this->randomName(); $label2 = $this->randomName(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index 55ded74..e6d312f 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -29,6 +29,9 @@ class ConfigEntityUnitTest extends DrupalUnitTestBase { */ protected $storage; + /** + * The config_test entity storage controller. + */ public static function getInfo() { return array( 'name' => 'Configuration entity methods', diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEventsTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEventsTest.php index 27e8845..18271ae 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEventsTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEventsTest.php @@ -23,6 +23,9 @@ class ConfigEventsTest extends DrupalUnitTestBase { */ public static $modules = array('config_events_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Config events', @@ -34,7 +37,7 @@ public static function getInfo() { /** * Tests configuration events. */ - function testConfigEvents() { + public function testConfigEvents() { $name = 'config_events_test.test'; $config = new Config($name, \Drupal::service('config.storage'), \Drupal::service('event_dispatcher'), \Drupal::service('config.typed')); @@ -67,7 +70,7 @@ function testConfigEvents() { /** * Tests configuration rename event that is fired from the ConfigFactory. */ - function testConfigRenameEvent() { + public function testConfigRenameEvent() { $name = 'config_events_test.test'; $new_name = 'config_events_test.test_rename'; $GLOBALS['config'][$name] = array('key' => 'overridden'); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php index 9095b7d..0a6529e 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php @@ -46,10 +46,13 @@ class ConfigExportImportUITest extends WebTestBase { * * @var string */ - protected $admin_role; + protected $adminRole; public static $modules = array('config'); + /** + * The name of the role with config UI administer permissions. + */ public static function getInfo() { return array( 'name' => 'Export/import UI', @@ -58,6 +61,9 @@ public static function getInfo() { ); } + /** + * The name of the role with config UI administer permissions. + */ protected function setUp() { parent::setUp(); // The initial import must be done with uid 1 because if separately named @@ -95,4 +101,3 @@ public function testExportImport() { $this->assertEqual(\Drupal::config('system.site')->get('slogan'), $this->newSlogan); } } - diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php index 45776e5..1f20b8b 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigExportUITest.php @@ -22,6 +22,9 @@ class ConfigExportUITest extends WebTestBase { */ public static $modules = array('config', 'config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Export UI', @@ -42,7 +45,7 @@ protected function setUp() { /** * Tests export of configuration. */ - function testExport() { + public function testExport() { // Verify the export page with export submit button is available. $this->drupalGet('admin/config/development/configuration/full/export'); $this->assertFieldById('edit-submit', t('Export')); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php index a73155d..c00500c 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php @@ -14,6 +14,10 @@ * Tests reading and writing file contents. */ class ConfigFileContentTest extends DrupalUnitTestBase { + + /** + * Tests reading and writing file contents. + */ public static function getInfo() { return array( 'name' => 'File content', @@ -25,7 +29,7 @@ public static function getInfo() { /** * Tests setting, writing, and reading of a configuration setting. */ - function testReadWriteConfig() { + public function testReadWriteConfig() { $storage = $this->container->get('config.storage'); $name = 'foo.bar'; @@ -188,7 +192,7 @@ function testReadWriteConfig() { /** * Tests serialization of configuration to file. */ - function testSerialization() { + public function testSerialization() { $name = $this->randomName(10) . '.' . $this->randomName(10); $config_data = array( // Indexed arrays; the order of elements is essential. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php index 89413d2..993201b 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php @@ -16,6 +16,9 @@ class ConfigImportUITest extends WebTestBase { public static $modules = array('config', 'config_test'); + /** + * Tests importing configuration from files into active store. + */ public static function getInfo() { return array( 'name' => 'Import UI', @@ -24,7 +27,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests importing configuration from files into active store. + */ + public function setUp() { parent::setUp(); $this->web_user = $this->drupalCreateUser(array('synchronize configuration')); @@ -35,7 +41,7 @@ function setUp() { /** * Tests importing configuration. */ - function testImport() { + public function testImport() { $name = 'system.site'; $dynamic_name = 'config_test.dynamic.new'; $staging = $this->container->get('config.storage.staging'); @@ -91,7 +97,7 @@ function testImport() { /** * Tests concurrent importing of configuration. */ - function testImportLock() { + public function testImportLock() { // Create updated configuration object. $new_site_name = 'Config import test ' . $this->randomString(); $this->prepareSiteNameUpdate($new_site_name); @@ -118,7 +124,7 @@ function testImportLock() { /** * Tests verification of site UUID before importing configuration. */ - function testImportSiteUuidValidation() { + public function testImportSiteUuidValidation() { $staging = \Drupal::service('config.storage.staging'); // Create updated configuration object. $config_data = \Drupal::config('system.site')->get(); @@ -135,7 +141,7 @@ function testImportSiteUuidValidation() { /** * Tests the screen that shows differences between active and staging. */ - function testImportDiff() { + public function testImportDiff() { $staging = $this->container->get('config.storage.staging'); $config_name = 'config_test.system'; $change_key = 'foo'; @@ -158,7 +164,7 @@ function testImportDiff() { $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name); $this->assertTitle(format_string('View changes of @config_name | Drupal', array('@config_name' => $config_name))); - // Reset data back to original, and remove a key + // Reset data back to original, and remove a key. $staging_data = $original_data; unset($staging_data[$remove_key]); $staging->write($config_name, $staging_data); @@ -166,7 +172,7 @@ function testImportDiff() { // Load the diff UI and verify that the diff reflects a removed key. $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name); - // Reset data back to original and add a key + // Reset data back to original and add a key. $staging_data = $original_data; $staging_data[$add_key] = $add_data; $staging->write($config_name, $staging_data); @@ -175,7 +181,10 @@ function testImportDiff() { $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name); } - function prepareSiteNameUpdate($new_site_name) { + /** + * Tests importing configuration from files into active store. + */ + public function prepareSiteNameUpdate($new_site_name) { $staging = $this->container->get('config.storage.staging'); // Create updated configuration object. $config_data = \Drupal::config('system.site')->get(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php index 025c2f4..691539e 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUploadTest.php @@ -16,15 +16,21 @@ class ConfigImportUploadTest extends WebTestBase { public static $modules = array('config'); + /** + * Tests importing configuration from an uploaded file. + */ public static function getInfo() { return array( 'name' => 'Import uploaded config', 'description' => 'Tests importing configuration from an uploaded file.', - 'group' => 'Configuration' + 'group' => 'Configuration', ); } - function setUp() { + /** + * Tests importing configuration from an uploaded file. + */ + public function setUp() { parent::setUp(); $this->web_user = $this->drupalCreateUser(array('import configuration')); @@ -34,7 +40,7 @@ function setUp() { /** * Tests importing configuration. */ - function testImport() { + public function testImport() { // Verify access to the config upload form. $this->drupalGet('admin/config/development/configuration/full/import'); $this->assertResponse(200); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php index b597aa7..4ab047a 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php @@ -31,6 +31,9 @@ class ConfigImporterTest extends DrupalUnitTestBase { */ public static $modules = array('config_test', 'system'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Import configuration', @@ -39,7 +42,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Modules to enable. + */ + public function setUp() { parent::setUp(); $this->installSchema('system', 'config_snapshot'); @@ -68,7 +74,7 @@ function setUp() { /** * Tests omission of module APIs for bare configuration operations. */ - function testNoImport() { + public function testNoImport() { $dynamic_name = 'config_test.dynamic.dotted.default'; // Verify the default configuration values exist. @@ -80,10 +86,9 @@ function testNoImport() { } /** - * Tests that trying to import from an empty staging configuration directory - * fails. + * Test import from an empty staging configuration directory fails. */ - function testEmptyImportFails() { + public function testEmptyImportFails() { try { $this->container->get('config.storage.staging')->deleteAll(); $this->configImporter->reset()->import(); @@ -97,7 +102,7 @@ function testEmptyImportFails() { /** * Tests verification of site UUID before importing configuration. */ - function testSiteUuidValidate() { + public function testSiteUuidValidate() { $staging = \Drupal::service('config.storage.staging'); // Create updated configuration object. $config_data = \Drupal::config('system.site')->get(); @@ -116,7 +121,7 @@ function testSiteUuidValidate() { /** * Tests deletion of configuration during import. */ - function testDeleted() { + public function testDeleted() { $dynamic_name = 'config_test.dynamic.dotted.default'; $storage = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); @@ -152,7 +157,7 @@ function testDeleted() { /** * Tests creation of configuration during import. */ - function testNew() { + public function testNew() { $dynamic_name = 'config_test.dynamic.new'; $storage = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); @@ -197,7 +202,7 @@ function testNew() { /** * Tests updating of configuration during import. */ - function testUpdated() { + public function testUpdated() { $name = 'config_test.system'; $dynamic_name = 'config_test.dynamic.dotted.default'; $storage = $this->container->get('config.storage'); @@ -249,4 +254,3 @@ function testUpdated() { $this->assertFalse($this->configImporter->hasUnprocessedChanges()); } } - diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php index 7188744..26eb78e 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -13,6 +13,10 @@ * Tests installation of configuration objects in installation functionality. */ class ConfigInstallTest extends DrupalUnitTestBase { + + /** + * Tests installation of configuration objects in installation functionality. + */ public static function getInfo() { return array( 'name' => 'Installation functionality unit tests', @@ -21,7 +25,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests installation of configuration objects in installation functionality. + */ + public function setUp() { parent::setUp(); // Ensure the global variable being asserted by this test does not exist; @@ -32,7 +39,7 @@ function setUp() { /** * Tests module installation. */ - function testModuleInstallation() { + public function testModuleInstallation() { $default_config = 'config_test.system'; $default_configuration_entity = 'config_test.dynamic.dotted.default'; diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php index 7116bea..2e262fc 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php @@ -14,6 +14,10 @@ * Tests installation of configuration objects in installation functionality. */ class ConfigInstallWebTest extends WebTestBase { + + /** + * Tests installation of configuration objects in installation functionality. + */ public static function getInfo() { return array( 'name' => 'Install, disable and uninstall functionality', @@ -22,7 +26,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests installation of configuration objects in installation functionality. + */ + public function setUp() { parent::setUp(); // Ensure the global variable being asserted by this test does not exist; @@ -33,7 +40,7 @@ function setUp() { /** * Tests module re-installation. */ - function testIntegrationModuleReinstallation() { + public function testIntegrationModuleReinstallation() { $default_config = 'config_integration_test.settings'; $default_configuration_entity = 'config_test.dynamic.config_integration_test'; @@ -63,10 +70,13 @@ function testIntegrationModuleReinstallation() { $config_static->set('foo', 'customized setting')->save(); $config_entity->set('label', 'Customized integration config label')->save(); - // @todo FIXME: Setting config keys WITHOUT SAVING retains the changed config - // object in memory. Every new call to \Drupal::config() MUST revert in-memory changes - // that haven't been saved! - // In other words: This test passes even without this reset, but it shouldn't. + // @todo FIXME: Setting config keys WITHOUT SAVING retains the changed + // config. + // object in memory. Every new call to \Drupal::config() MUST revert + // in-memory changes. + // that haven't been saved! + // In other words: This test passes even without this reset, but it + // shouldn't. $this->container->get('config.factory')->reset(); // Disable and uninstall the integration module. @@ -100,7 +110,7 @@ function testIntegrationModuleReinstallation() { /** * Tests install profile config changes. */ - function testInstallProfileConfigOverwrite() { + public function testInstallProfileConfigOverwrite() { $config_name = 'system.cron'; // The expected configuration from the system module. $expected_original_data = array( diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverride.php index 12ff3cd..278eb2a 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverride.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverride.php @@ -20,8 +20,17 @@ class ConfigLanguageOverride extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('config_test', 'user', 'language', 'system', 'field'); + public static $modules = array( + 'config_test', + 'user', + 'language', + 'system', + 'field', + ); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Language override', @@ -30,6 +39,9 @@ public static function getInfo() { ); } + /** + * Modules to enable. + */ public function setUp() { parent::setUp(); $this->installConfig(array('config_test')); @@ -38,7 +50,7 @@ public function setUp() { /** * Tests locale override based on language. */ - function testConfigLanguageOverride() { + public function testConfigLanguageOverride() { // The default configuration factory does not have the default language // injected unless the Language module is enabled. $config = \Drupal::config('config_test.system'); @@ -94,4 +106,3 @@ function testConfigLanguageOverride() { $this->assertIdentical(\Drupal::config($language_config_name)->get('language'), 'override'); } } - diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverrideWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverrideWebTest.php index 3ffb54f..c7d57eb 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverrideWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLanguageOverrideWebTest.php @@ -16,6 +16,9 @@ class ConfigLanguageOverrideWebTest extends WebTestBase { public static $modules = array('language', 'system'); + /** + * Tests language overrides in configuration through the request. + */ public static function getInfo() { return array( 'name' => 'Language overrides through the request', @@ -24,16 +27,19 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests language overrides in configuration through the request. + */ + public function setUp() { parent::setUp(); } /** * Tests translating the site name. */ - function testSiteNameTranslation() { - $adminUser = $this->drupalCreateUser(array('administer site configuration', 'administer languages')); - $this->drupalLogin($adminUser); + public function testSiteNameTranslation() { + $admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer languages')); + $this->drupalLogin($admin_user); // Add a custom lanugage. $langcode = 'xx'; diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php index c5c7190..29cf8d6 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigModuleOverridesTest.php @@ -16,6 +16,9 @@ class ConfigModuleOverridesTest extends DrupalUnitTestBase { public static $modules = array('system', 'config', 'config_override'); + /** + * Tests module overrides of configuration using event subscribers. + */ public static function getInfo() { return array( 'name' => 'Module overrides', @@ -24,6 +27,9 @@ public static function getInfo() { ); } + /** + * Tests module overrides of configuration using event subscribers. + */ public function testSimpleModuleOverrides() { $GLOBALS['config_test_run_module_overrides'] = TRUE; $name = 'system.site'; diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php index 90915fc..00db5ee 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOtherModuleTest.php @@ -19,6 +19,9 @@ class ConfigOtherModuleTest extends WebTestBase { */ protected $moduleHandler; + /** + * Tests default configuration provided by a module that does not own it. + */ public static function getInfo() { return array( 'name' => 'Default configuration owner', diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php index 137635d..e7c6ea3 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php @@ -21,6 +21,9 @@ class ConfigOverrideTest extends DrupalUnitTestBase { */ public static $modules = array('system', 'config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration overrides', @@ -29,6 +32,9 @@ public static function getInfo() { ); } + /** + * Modules to enable. + */ public function setUp() { parent::setUp(); $this->installSchema('system', 'config_snapshot'); @@ -37,7 +43,7 @@ public function setUp() { /** * Tests configuration override. */ - function testConfOverride() { + public function testConfOverride() { $expected_original_data = array( 'foo' => 'bar', 'baz' => NULL, diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php index 49482f9..5b4802c 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverridesPriorityTest.php @@ -17,6 +17,9 @@ class ConfigOverridesPriorityTest extends DrupalUnitTestBase { public static $modules = array('system', 'config', 'config_override'); + /** + * Tests module overrides of configuration using event subscribers. + */ public static function getInfo() { return array( 'name' => 'Override priority', @@ -25,10 +28,13 @@ public static function getInfo() { ); } + /** + * Tests module overrides of configuration using event subscribers. + */ public function testOverridePriorities() { $GLOBALS['config_test_run_module_overrides'] = FALSE; - $non_overridden_mail = 'site@example.com'; + $non_overridden_mail = 'site@example.com'; $language_overridden_mail = 'french@example.com'; $language_overridden_name = 'French site name'; @@ -38,7 +44,7 @@ public function testOverridePriorities() { $module_overridden_slogan = 'Yay for overrides!'; $non_overridden_slogan = 'Yay for defaults!'; - /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ + // @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory. $config_factory = $this->container->get('config.factory'); $config_factory ->get('system.site') diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php index e9d7562..556476b 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php @@ -21,8 +21,17 @@ class ConfigSchemaTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system', 'locale', 'field', 'image', 'config_test'); + public static $modules = array( + 'system', + 'locale', + 'field', + 'image', + 'config_test', + ); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration schema', @@ -31,6 +40,9 @@ public static function getInfo() { ); } + /** + * Modules to enable. + */ public function setUp() { parent::setUp(); $this->installConfig(array('system', 'image', 'config_test')); @@ -39,7 +51,7 @@ public function setUp() { /** * Tests the basic metadata retrieval layer. */ - function testSchemaMapping() { + public function testSchemaMapping() { // Nonexistent configuration key will have Unknown as metadata. $this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_test.no_such_key')); $definition = \Drupal::service('config.typed')->getDefinition('config_test.no_such_key'); @@ -84,7 +96,7 @@ function testSchemaMapping() { $expected['label'] = 'Maintenance mode'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; $expected['mapping']['message'] = array( - 'label' => 'Message to display when in maintenance mode', + 'label' => 'Message to display when in maintenance mode', 'type' => 'text', ); $expected['mapping']['langcode'] = array( @@ -133,8 +145,9 @@ function testSchemaMapping() { // Most complex case, get metadata for actual configuration element. $effects = \Drupal::service('config.typed')->get('image.style.medium')->get('effects'); $definition = $effects['bddf0d06-42f9-4c75-a700-a33cafa25ea0']['data']->getDataDefinition(); - // This should be the schema for image.effect.image_scale, reuse previous one. - $expected['type'] = 'image.effect.image_scale'; + // This should be the schema for image.effect.image_scale, + // reuse previous one. + $expected['type'] = 'image.effect.image_scale'; $this->assertEqual($definition, $expected, 'Retrieved the right metadata for the first effect of image.style.medium'); @@ -159,7 +172,7 @@ function testSchemaMapping() { /** * Tests metadata retrieval with several levels of %parent indirection. */ - function testSchemaMappingWithParents() { + public function testSchemaMappingWithParents() { $config_data = \Drupal::service('config.typed')->get('config_test.someschema.with_parents'); // Test fetching parent one level up. @@ -196,7 +209,7 @@ function testSchemaMappingWithParents() { /** * Tests metadata applied to configuration objects. */ - function testSchemaData() { + public function testSchemaData() { // Try some simple properties. $meta = \Drupal::service('config.typed')->get('system.site'); $property = $meta->get('name'); @@ -233,7 +246,7 @@ function testSchemaData() { $effect = $effects[$uuid]; $this->assertTrue(count($effect['data']) && $effect['id']->getValue() == 'image_scale', 'Got data for the image scale effect from metadata.'); $this->assertTrue($effect['data']['width'] instanceof IntegerInterface, 'Got the right type for the scale effect width.'); - $this->assertEqual($effect['data']['width']->getValue(), 480, 'Got the right value for the scale effect width.' ); + $this->assertEqual($effect['data']['width']->getValue(), 480, 'Got the right value for the scale effect width.'); // Finally update some object using a configuration wrapper. $new_slogan = 'Site slogan for testing configuration metadata'; @@ -257,11 +270,11 @@ public function testConfigSaveWithSchema() { // If the config schema doesn't have a type it should be casted to string. 'no_type' => 1, 'mapping' => array( - 'string' => 1 + 'string' => 1, ), 'float' => '3.14', 'null_float' => '', - 'sequence' => array (1, 0, 1), + 'sequence' => array(1, 0, 1), // Not in schema and therefore should be left untouched. 'not_present_in_schema' => TRUE, // Test a custom type. @@ -279,11 +292,11 @@ public function testConfigSaveWithSchema() { 'boolean' => TRUE, 'no_type' => '1', 'mapping' => array( - 'string' => '1' + 'string' => '1', ), 'float' => 3.14, 'null_float' => NULL, - 'sequence' => array (TRUE, FALSE, TRUE), + 'sequence' => array(TRUE, FALSE, TRUE), 'not_present_in_schema' => TRUE, 'config_test_integer' => 1, 'config_test_integer_empty_string' => NULL, diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php index 8bd1b72..c367eff 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php @@ -22,6 +22,9 @@ class ConfigSingleImportExportTest extends WebTestBase { */ public static $modules = array('config', 'config_test'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Configuration Single Import/Export UI', diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php index d8e7187..fcfa1a0 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php @@ -22,6 +22,9 @@ class ConfigSnapshotTest extends DrupalUnitTestBase { */ public static $modules = array('config_test', 'system'); + /** + * Modules to enable. + */ public static function getInfo() { return array( 'name' => 'Snapshot functionality', @@ -30,6 +33,9 @@ public static function getInfo() { ); } + /** + * Modules to enable. + */ public function setUp() { parent::setUp(); $this->installSchema('system', 'config_snapshot'); @@ -41,7 +47,7 @@ public function setUp() { /** * Tests config snapshot creation and updating. */ - function testSnapshot() { + public function testSnapshot() { $active = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); $snapshot = $this->container->get('config.storage.snapshot'); diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php index d986835..c1a4ca5 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php @@ -29,7 +29,7 @@ * @todo Coverage: Trigger PDOExceptions / Database exceptions. * @todo Coverage: Trigger Yaml's ParseException and DumpException. */ - function testCRUD() { + public function testCRUD() { $name = 'config_test.storage'; // Checking whether a non-existing name exists returns FALSE. @@ -164,7 +164,7 @@ function testCRUD() { /** * Tests storage controller writing and reading data preserving data type. */ - function testDataTypes() { + public function testDataTypes() { $name = 'config_test.types'; $data = array( 'array' => array(), @@ -185,11 +185,23 @@ function testDataTypes() { $this->assertIdentical($read_data, $data); } + /** + * Tests storage controller for reading. + */ abstract protected function read($name); + /** + * Tests storage controller for inserting. + */ abstract protected function insert($name, $data); + /** + * Tests storage controller for update. + */ abstract protected function update($name, $data); + /** + * Tests storage controller delete. + */ abstract protected function delete($name); } diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php b/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php index 516bb9d..18b5e31 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php @@ -13,6 +13,10 @@ * Tests DatabaseStorage controller operations. */ class DatabaseStorageTest extends ConfigStorageTestBase { + + /** + * Tests DatabaseStorage controller operations. + */ public static function getInfo() { return array( 'name' => 'DatabaseStorage controller operations', @@ -21,7 +25,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests DatabaseStorage controller operations. + */ + public function setUp() { parent::setUp(); $schema['config'] = array( @@ -53,19 +60,31 @@ function setUp() { $this->storage->write('system.performance', array()); } + /** + * Tests DatabaseStorage controller operations. + */ protected function read($name) { $data = db_query('SELECT data FROM {config} WHERE name = :name', array(':name' => $name))->fetchField(); return unserialize($data); } + /** + * Tests DatabaseStorage controller operations. + */ protected function insert($name, $data) { db_insert('config')->fields(array('name' => $name, 'data' => $data))->execute(); } + /** + * Tests DatabaseStorage controller operations. + */ protected function update($name, $data) { db_update('config')->fields(array('data' => $data))->condition('name', $name)->execute(); } + /** + * Tests DatabaseStorage controller operations. + */ protected function delete($name) { db_delete('config')->condition('name', $name)->execute(); } diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php index 6a99605..097d96f 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php @@ -14,6 +14,10 @@ * Tests FileStorage controller operations. */ class FileStorageTest extends ConfigStorageTestBase { + + /** + * Tests FileStorage controller operations. + */ public static function getInfo() { return array( 'name' => 'FileStorage controller operations', @@ -22,7 +26,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * Tests FileStorage controller operations. + */ + public function setUp() { parent::setUp(); $this->storage = new FileStorage($this->configDirectories[CONFIG_ACTIVE_DIRECTORY]); $this->invalidStorage = new FileStorage($this->configDirectories[CONFIG_ACTIVE_DIRECTORY] . '/nonexisting'); @@ -31,19 +38,31 @@ function setUp() { $this->storage->write('system.performance', \Drupal::config('system.performance')->get()); } + /** + * Tests FileStorage controller operations. + */ protected function read($name) { $data = file_get_contents($this->storage->getFilePath($name)); return Yaml::parse($data); } + /** + * Tests FileStorage controller operations. + */ protected function insert($name, $data) { file_put_contents($this->storage->getFilePath($name), $data); } + /** + * Tests FileStorage controller operations. + */ protected function update($name, $data) { file_put_contents($this->storage->getFilePath($name), $data); } + /** + * Tests FileStorage controller operations. + */ protected function delete($name) { unlink($this->storage->getFilePath($name)); } diff --git a/core/modules/config/tests/Drupal/config/Tests/Menu/ConfigLocalTasksTest.php b/core/modules/config/tests/Drupal/config/Tests/Menu/ConfigLocalTasksTest.php index 627f61e..e422453 100644 --- a/core/modules/config/tests/Drupal/config/Tests/Menu/ConfigLocalTasksTest.php +++ b/core/modules/config/tests/Drupal/config/Tests/Menu/ConfigLocalTasksTest.php @@ -17,6 +17,9 @@ */ class ConfigLocalTasksTest extends LocalTaskIntegrationTest { + /** + * Tests existence of config local tasks. + */ public static function getInfo() { return array( 'name' => 'Config local tasks test', @@ -25,6 +28,9 @@ public static function getInfo() { ); } + /** + * Tests existence of config local tasks. + */ public function setUp() { $this->directoryList = array('config' => 'core/modules/config'); parent::setUp(); @@ -44,11 +50,25 @@ public function testConfigAdminLocalTasks($route, $expected) { */ public function getConfigAdminRoutes() { return array( - array('config.sync', array(array('config.sync', 'config.full', 'config.single'))), - array('config.export_full', array(array('config.sync', 'config.full', 'config.single'), array('config.export_full', 'config.import_full'))), - array('config.import_full', array(array('config.sync', 'config.full', 'config.single'), array('config.export_full', 'config.import_full'))), - array('config.export_single', array(array('config.sync', 'config.full', 'config.single'), array('config.export_single', 'config.import_single'))), - array('config.import_single', array(array('config.sync', 'config.full', 'config.single'), array('config.export_single', 'config.import_single'))), + array('config.sync', array( + array('config.sync', 'config.full', 'config.single'), + )), + array('config.export_full', array( + array('config.sync', 'config.full', 'config.single'), + array('config.export_full', 'config.import_full'), + )), + array('config.import_full', array( + array('config.sync', 'config.full', 'config.single'), + array('config.export_full', 'config.import_full'), + )), + array('config.export_single', array( + array('config.sync', 'config.full', 'config.single'), + array('config.export_single', 'config.import_single'), + )), + array('config.import_single', array( + array('config.sync', 'config.full', 'config.single'), + array('config.export_single', 'config.import_single'), + )), ); } diff --git a/core/modules/config/tests/config_events_test/lib/Drupal/config_events_test/EventSubscriber.php b/core/modules/config/tests/config_events_test/lib/Drupal/config_events_test/EventSubscriber.php index 853332d..b871e02 100644 --- a/core/modules/config/tests/config_events_test/lib/Drupal/config_events_test/EventSubscriber.php +++ b/core/modules/config/tests/config_events_test/lib/Drupal/config_events_test/EventSubscriber.php @@ -44,14 +44,14 @@ public function configEventRecorder(ConfigCrudEvent $event) { 'event_name' => $event->getName(), 'current_config_data' => $config->get(), 'original_config_data' => $config->getOriginal(), - 'raw_config_data' => $config->getRawData() + 'raw_config_data' => $config->getRawData(), )); } /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = array('configEventRecorder'); $events[ConfigEvents::DELETE][] = array('configEventRecorder'); $events[ConfigEvents::RENAME][] = array('configEventRecorder'); diff --git a/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverrider.php b/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverrider.php index 2d60d33..3f96d8f 100644 --- a/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverrider.php +++ b/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverrider.php @@ -34,4 +34,3 @@ public function loadOverrides($names) { } } - diff --git a/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverriderLowPriority.php b/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverriderLowPriority.php index 1903888..ee3492d 100644 --- a/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverriderLowPriority.php +++ b/core/modules/config/tests/config_override/lib/Drupal/config_override/ConfigOverriderLowPriority.php @@ -21,13 +21,13 @@ public function loadOverrides($names) { $overrides = array(); if (!empty($GLOBALS['config_test_run_module_overrides'])) { if (in_array('system.site', $names)) { - $overrides = array('system.site' => - array( + $overrides = array( + 'system.site' => array( 'name' => 'Should not apply because of higher priority listener', // This override should apply because it is not overridden by the // higher priority listener. 'slogan' => 'Yay for overrides!', - ) + ), ); } } @@ -35,4 +35,3 @@ public function loadOverrides($names) { } } - diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php index 836b76a..c476f52 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php @@ -42,7 +42,7 @@ public function edit(ConfigTest $config_test) { * @return \Symfony\Component\HttpFoundation\RedirectResponse * A redirect response to the config_test listing page. */ - function enable(ConfigTest $config_test) { + public function enable(ConfigTest $config_test) { $config_test->enable()->save(); return new RedirectResponse(url('admin/structure/config_test', array('absolute' => TRUE))); } @@ -56,7 +56,7 @@ function enable(ConfigTest $config_test) { * @return \Symfony\Component\HttpFoundation\RedirectResponse * A redirect response to the config_test listing page. */ - function disable(ConfigTest $config_test) { + public function disable(ConfigTest $config_test) { $config_test->disable()->save(); return new RedirectResponse(url('admin/structure/config_test', array('absolute' => TRUE))); } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php index a73cffb..be9cee8 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php @@ -16,7 +16,7 @@ class ConfigTestStorageController extends ConfigStorageController { /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importCreate(). + * Overrides \..\Core\Config\Entity\ConfigStorageController::importCreate(). */ public function importCreate($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. @@ -26,7 +26,7 @@ public function importCreate($name, Config $new_config, Config $old_config) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importUpdate(). + * Overrides \..\Core\Config\Entity\ConfigStorageController::importUpdate(). */ public function importUpdate($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. @@ -36,7 +36,7 @@ public function importUpdate($name, Config $new_config, Config $old_config) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importDelete(). + * Overrides \..\Core\Config\Entity\ConfigStorageController::importDelete(). */ public function importDelete($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index d7ac61c..ca6bcb7 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -74,7 +74,7 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface { * * @var string */ - protected $protected_property; + protected $protectedProperty; /** * {@inheritdoc} @@ -82,7 +82,7 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface { public function toArray() { $properties = parent::toArray(); $protected_names = array( - 'protected_property', + 'protectedProperty', ); foreach ($protected_names as $name) { $properties[$name] = $this->get($name);