Issue #3138746 by jungle, rajandro, sja112, longwave, jameszhang023, quietone, dww: Fix 45 "shouldBeCamelCased" and related typos in core

merge-requests/25/head
Alex Pott 2020-11-09 11:14:31 +00:00
parent 231165730f
commit 0eec7fe50d
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
52 changed files with 178 additions and 221 deletions

View File

@ -230,9 +230,9 @@ $databases = [];
* Sample Database configuration format for a driver in a contributed module: * Sample Database configuration format for a driver in a contributed module:
* @code * @code
* $databases['default']['default'] = [ * $databases['default']['default'] = [
* 'driver' => 'mydriver', * 'driver' => 'my_driver',
* 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver', * 'namespace' => 'Drupal\my_module\Driver\Database\my_driver',
* 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/', * 'autoload' => 'modules/my_module/src/Driver/Database/my_driver/',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'sqlusername', * 'username' => 'sqlusername',
* 'password' => 'sqlpassword', * 'password' => 'sqlpassword',

View File

@ -382,10 +382,10 @@
* be an admin path). Here's an example using the configurable_language config * be an admin path). Here's an example using the configurable_language config
* entity: * entity:
* @code * @code
* mymodule.myroute: * my_module.my_route:
* path: '/admin/mypath/{configurable_language}' * path: '/admin/my-path/{configurable_language}'
* defaults: * defaults:
* _controller: '\Drupal\mymodule\MyController::myMethod' * _controller: '\Drupal\my_module\MyController::myMethod'
* options: * options:
* parameters: * parameters:
* configurable_language: * configurable_language:
@ -809,7 +809,7 @@
* arguments, but they all include an argument $container of type * arguments, but they all include an argument $container of type
* \Symfony\Component\DependencyInjection\ContainerInterface. * \Symfony\Component\DependencyInjection\ContainerInterface.
* If you are defining one of these classes, in the create() or * If you are defining one of these classes, in the create() or
* createInstance() method, call $container->get('myservice.name') to * createInstance() method, call $container->get('my_service.name') to
* instantiate a service. The results of these calls are generally passed to * instantiate a service. The results of these calls are generally passed to
* the class constructor and saved as member variables in the class. * the class constructor and saved as member variables in the class.
* - For functions and class methods that do not have access to either of * - For functions and class methods that do not have access to either of
@ -837,7 +837,7 @@
* @section sec_define Defining a service * @section sec_define Defining a service
* If your module needs to define a new service, here are the steps: * If your module needs to define a new service, here are the steps:
* - Choose a unique machine name for your service. Typically, this should * - Choose a unique machine name for your service. Typically, this should
* start with your module name. Example: mymodule.myservice. * start with your module name. Example: my_module.my_service.
* - Create a PHP interface to define what your service does. * - Create a PHP interface to define what your service does.
* - Create a default class implementing your interface that provides your * - Create a default class implementing your interface that provides your
* service. If your class needs to use existing services (such as database * service. If your class needs to use existing services (such as database

View File

@ -577,7 +577,7 @@ function template_preprocess_form_element_label(&$variables) {
* array('my_function_2', array()), * array('my_function_2', array()),
* ), * ),
* 'finished' => 'my_finished_callback', * 'finished' => 'my_finished_callback',
* 'file' => 'path_to_file_containing_myfunctions', * 'file' => 'path_to_file_containing_my_functions',
* ); * );
* batch_set($batch); * batch_set($batch);
* // Only needed if not inside a form _submit handler. * // Only needed if not inside a form _submit handler.

View File

@ -184,7 +184,7 @@ class PhpBackend implements CacheBackendInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function invalidate($cid) { public function invalidate($cid) {
$this->invalidatebyHash($this->normalizeCid($cid)); $this->invalidateByHash($this->normalizeCid($cid));
} }
/** /**
@ -193,7 +193,7 @@ class PhpBackend implements CacheBackendInterface {
* @param string $cidhash * @param string $cidhash
* The hashed version of the original cache ID after being normalized. * The hashed version of the original cache ID after being normalized.
*/ */
protected function invalidatebyHash($cidhash) { protected function invalidateByHash($cidhash) {
if ($item = $this->getByHash($cidhash)) { if ($item = $this->getByHash($cidhash)) {
$item->expire = REQUEST_TIME - 1; $item->expire = REQUEST_TIME - 1;
$this->writeItem($cidhash, $item); $this->writeItem($cidhash, $item);
@ -214,7 +214,7 @@ class PhpBackend implements CacheBackendInterface {
*/ */
public function invalidateAll() { public function invalidateAll() {
foreach ($this->storage()->listAll() as $cidhash) { foreach ($this->storage()->listAll() as $cidhash) {
$this->invalidatebyHash($cidhash); $this->invalidateByHash($cidhash);
} }
} }

View File

@ -175,7 +175,7 @@ use Drupal\Core\Database\Query\SelectInterface;
* try { * try {
* $id = $connection->insert('example') * $id = $connection->insert('example')
* ->fields(array( * ->fields(array(
* 'field1' => 'mystring', * 'field1' => 'string',
* 'field2' => 5, * 'field2' => 5,
* )) * ))
* ->execute(); * ->execute();

View File

@ -421,51 +421,51 @@ function hook_install_tasks(&$install_state) {
// Here, we define a variable to allow tasks to indicate that a particular, // Here, we define a variable to allow tasks to indicate that a particular,
// processor-intensive batch process needs to be triggered later on in the // processor-intensive batch process needs to be triggered later on in the
// installation. // installation.
$myprofile_needs_batch_processing = \Drupal::state()->get('myprofile.needs_batch_processing', FALSE); $my_profile_needs_batch_processing = \Drupal::state()->get('my_profile.needs_batch_processing', FALSE);
$tasks = [ $tasks = [
// This is an example of a task that defines a form which the user who is // This is an example of a task that defines a form which the user who is
// installing the site will be asked to fill out. To implement this task, // installing the site will be asked to fill out. To implement this task,
// your profile would define a function named myprofile_data_import_form() // your profile would define a function named my_profile_data_import_form()
// as a normal form API callback function, with associated validation and // as a normal form API callback function, with associated validation and
// submit handlers. In the submit handler, in addition to saving whatever // submit handlers. In the submit handler, in addition to saving whatever
// other data you have collected from the user, you might also call // other data you have collected from the user, you might also call
// \Drupal::state()->set('myprofile.needs_batch_processing', TRUE) if the // \Drupal::state()->set('my_profile.needs_batch_processing', TRUE) if the
// user has entered data which requires that batch processing will need to // user has entered data which requires that batch processing will need to
// occur later on. // occur later on.
'myprofile_data_import_form' => [ 'my_profile_data_import_form' => [
'display_name' => t('Data import options'), 'display_name' => t('Data import options'),
'type' => 'form', 'type' => 'form',
], ],
// Similarly, to implement this task, your profile would define a function // Similarly, to implement this task, your profile would define a function
// named myprofile_settings_form() with associated validation and submit // named my_profile_settings_form() with associated validation and submit
// handlers. This form might be used to collect and save additional // handlers. This form might be used to collect and save additional
// information from the user that your profile needs. There are no extra // information from the user that your profile needs. There are no extra
// steps required for your profile to act as an "installation wizard"; you // steps required for your profile to act as an "installation wizard"; you
// can simply define as many tasks of type 'form' as you wish to execute, // can simply define as many tasks of type 'form' as you wish to execute,
// and the forms will be presented to the user, one after another. // and the forms will be presented to the user, one after another.
'myprofile_settings_form' => [ 'my_profile_settings_form' => [
'display_name' => t('Additional options'), 'display_name' => t('Additional options'),
'type' => 'form', 'type' => 'form',
], ],
// This is an example of a task that performs batch operations. To // This is an example of a task that performs batch operations. To
// implement this task, your profile would define a function named // implement this task, your profile would define a function named
// myprofile_batch_processing() which returns a batch API array definition // my_profile_batch_processing() which returns a batch API array definition
// that the installer will use to execute your batch operations. Due to the // that the installer will use to execute your batch operations. Due to the
// 'myprofile.needs_batch_processing' variable used here, this task will be // 'my_profile.needs_batch_processing' variable used here, this task will be
// hidden and skipped unless your profile set it to TRUE in one of the // hidden and skipped unless your profile set it to TRUE in one of the
// previous tasks. // previous tasks.
'myprofile_batch_processing' => [ 'my_profile_batch_processing' => [
'display_name' => t('Import additional data'), 'display_name' => t('Import additional data'),
'display' => $myprofile_needs_batch_processing, 'display' => $my_profile_needs_batch_processing,
'type' => 'batch', 'type' => 'batch',
'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP, 'run' => $my_profile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
], ],
// This is an example of a task that will not be displayed in the list that // This is an example of a task that will not be displayed in the list that
// the user sees. To implement this task, your profile would define a // the user sees. To implement this task, your profile would define a
// function named myprofile_final_site_setup(), in which additional, // function named my_profile_final_site_setup(), in which additional,
// automated site setup operations would be performed. Since this is the // automated site setup operations would be performed. Since this is the
// last task defined by your profile, you should also use this function to // last task defined by your profile, you should also use this function to
// call \Drupal::state()->delete('myprofile.needs_batch_processing') and // call \Drupal::state()->delete('my_profile.needs_batch_processing') and
// clean up the state that was used above. If you want the user to pass // clean up the state that was used above. If you want the user to pass
// to the final Drupal installation tasks uninterrupted, return no output // to the final Drupal installation tasks uninterrupted, return no output
// from this function. Otherwise, return themed output that the user will // from this function. Otherwise, return themed output that the user will
@ -473,7 +473,7 @@ function hook_install_tasks(&$install_state) {
// tasks are complete, with a link to reload the current page and therefore // tasks are complete, with a link to reload the current page and therefore
// pass on to the final Drupal installation tasks when the user is ready to // pass on to the final Drupal installation tasks when the user is ready to
// do so). // do so).
'myprofile_final_site_setup' => [], 'my_profile_final_site_setup' => [],
]; ];
return $tasks; return $tasks;
} }
@ -499,7 +499,7 @@ function hook_install_tasks(&$install_state) {
function hook_install_tasks_alter(&$tasks, $install_state) { function hook_install_tasks_alter(&$tasks, $install_state) {
// Replace the entire site configuration form provided by Drupal core // Replace the entire site configuration form provided by Drupal core
// with a custom callback function defined by this installation profile. // with a custom callback function defined by this installation profile.
$tasks['install_configure_form']['function'] = 'myprofile_install_configure_form'; $tasks['install_configure_form']['function'] = 'my_profile_install_configure_form';
} }
/** /**
@ -647,7 +647,7 @@ function hook_update_N(&$sandbox) {
'not null' => FALSE, 'not null' => FALSE,
]; ];
$schema = Database::getConnection()->schema(); $schema = Database::getConnection()->schema();
$schema->addField('mytable1', 'newcol', $spec); $schema->addField('my_table', 'newcol', $spec);
// Example of what to do if there is an error during your update. // Example of what to do if there is an error during your update.
if ($some_error_condition_met) { if ($some_error_condition_met) {
@ -660,26 +660,26 @@ function hook_update_N(&$sandbox) {
// This must be the first run. Initialize the sandbox. // This must be the first run. Initialize the sandbox.
$sandbox['progress'] = 0; $sandbox['progress'] = 0;
$sandbox['current_pk'] = 0; $sandbox['current_pk'] = 0;
$sandbox['max'] = Database::getConnection()->query('SELECT COUNT([myprimarykey]) FROM {mytable1}')->fetchField(); $sandbox['max'] = Database::getConnection()->query('SELECT COUNT([my_primary_key]) FROM {my_table}')->fetchField();
} }
// Update in chunks of 20. // Update in chunks of 20.
$records = Database::getConnection()->select('mytable1', 'm') $records = Database::getConnection()->select('my_table', 'm')
->fields('m', ['myprimarykey', 'otherfield']) ->fields('m', ['my_primary_key', 'other_field'])
->condition('myprimarykey', $sandbox['current_pk'], '>') ->condition('my_primary_key', $sandbox['current_pk'], '>')
->range(0, 20) ->range(0, 20)
->orderBy('myprimarykey', 'ASC') ->orderBy('my_primary_key', 'ASC')
->execute(); ->execute();
foreach ($records as $record) { foreach ($records as $record) {
// Here, you would make an update something related to this record. In this // Here, you would make an update something related to this record. In this
// example, some text is added to the other field. // example, some text is added to the other field.
Database::getConnection()->update('mytable1') Database::getConnection()->update('my_table')
->fields(['otherfield' => $record->otherfield . '-suffix']) ->fields(['other_field' => $record->other_field . '-suffix'])
->condition('myprimarykey', $record->myprimarykey) ->condition('my_primary_key', $record->my_primary_key)
->execute(); ->execute();
$sandbox['progress']++; $sandbox['progress']++;
$sandbox['current_pk'] = $record->myprimarykey; $sandbox['current_pk'] = $record->my_primary_key;
} }
$sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);

View File

@ -70,7 +70,7 @@ abstract class EntityReferenceFormatterBase extends FormatterBase {
* {@inheritdoc} * {@inheritdoc}
* *
* @see ::prepareView() * @see ::prepareView()
* @see ::getEntitiestoView() * @see ::getEntitiesToView()
*/ */
public function view(FieldItemListInterface $items, $langcode = NULL) { public function view(FieldItemListInterface $items, $langcode = NULL) {
$elements = parent::view($items, $langcode); $elements = parent::view($items, $langcode);

View File

@ -186,7 +186,7 @@
* @code * @code
* function THEME_page_attachments_alter(array &$page) { * function THEME_page_attachments_alter(array &$page) {
* if ($some_condition) { * if ($some_condition) {
* $page['#attached']['library'][] = 'mytheme/something'; * $page['#attached']['library'][] = 'my_theme/something';
* } * }
* } * }
* @endcode * @endcode

View File

@ -111,7 +111,7 @@
* *
* If the route has placeholders (see @ref sec_placeholders above) the * If the route has placeholders (see @ref sec_placeholders above) the
* placeholders will be passed to the method (using reflection) by name. * placeholders will be passed to the method (using reflection) by name.
* For example, the placeholder '{myvar}' in a route will become the $myvar * For example, the placeholder '{my_var}' in a route will become the $my_var
* parameter to the method. * parameter to the method.
* *
* Additionally, if a parameter is typed to one of the following special classes * Additionally, if a parameter is typed to one of the following special classes

View File

@ -11,7 +11,7 @@ use Twig\Loader\FilesystemLoader as TwigFilesystemLoader;
* *
* This loader adds module and theme template paths as namespaces to the Twig * This loader adds module and theme template paths as namespaces to the Twig
* filesystem loader so that templates can be referenced by namespace, like * filesystem loader so that templates can be referenced by namespace, like
* @block/block.html.twig or @mytheme/page.html.twig. * @block/block.html.twig or @my_theme/page.html.twig.
*/ */
class FilesystemLoader extends TwigFilesystemLoader { class FilesystemLoader extends TwigFilesystemLoader {

View File

@ -462,7 +462,7 @@
// 1. /nojs/ // 1. /nojs/
// 2. /nojs$ - The end of a URL string. // 2. /nojs$ - The end of a URL string.
// 3. /nojs? - Followed by a query (e.g. path/nojs?destination=foobar). // 3. /nojs? - Followed by a query (e.g. path/nojs?destination=foobar).
// 4. /nojs# - Followed by a fragment (e.g.: path/nojs#myfragment). // 4. /nojs# - Followed by a fragment (e.g.: path/nojs#my-fragment).
const originalUrl = this.url; const originalUrl = this.url;
/** /**

View File

@ -144,7 +144,6 @@ bazinga
bazqux bazqux
bazs bazs
beatle beatle
becalled
beforeclose beforeclose
beforecreate beforecreate
beforeend beforeend
@ -355,7 +354,6 @@ data's
databasefilename databasefilename
databasename databasename
datapoint datapoint
dataprovider
datas datas
datatypes datatypes
datefield datefield
@ -438,6 +436,7 @@ discoverability
displaymessage displaymessage
displayname displayname
distincted distincted
distro
ditka ditka
divs divs
dnumber dnumber
@ -528,7 +527,6 @@ enim
enoki enoki
enregistrer enregistrer
entit entit
entitiesto
entitynodeedit entitynodeedit
entityreference entityreference
entitytype entitytype
@ -580,7 +578,6 @@ fieldable
fieldapi fieldapi
fieldblock fieldblock
fieldbody fieldbody
fieldby
fieldgroups fieldgroups
fielditem fielditem
fieldlinks fieldlinks
@ -778,7 +775,6 @@ installable
instantiator instantiator
internal's internal's
introspectable introspectable
invalidateby
invalidators invalidators
invalididentifier invalididentifier
invokable invokable
@ -788,7 +784,6 @@ isam
isdst isdst
isid isid
isinstallable isinstallable
isnew
items's items's
itoa itoa
itok itok
@ -862,7 +857,6 @@ libc
libellé libellé
libicu libicu
libmysqlclient libmysqlclient
librariesby
libyaml libyaml
licious licious
lified lified
@ -1021,37 +1015,10 @@ muuh
muun muun
muuuh muuuh
myclabs myclabs
myclass
mydistro
mydriver
myeditor
myeditoroverride
myfragment
myfrontpage
myfunctions
mymenu
mymodule mymodule
mynewpassword
myothermenu
mypath
myprimarykey
myprofile
myproject
myrootuser
myroute
myselect
myservice
mysetting
mysite mysite
mysqladmin mysqladmin
mysqldump mysqldump
mystring
mytab
mytable
mytheme
mytype
myvalue
myvar
myverylongurl myverylongurl
myverylongurlexample myverylongurlexample
műveletek műveletek
@ -1120,9 +1087,6 @@ noschema
noslash noslash
nosniff nosniff
nostart nostart
nosuchcolumn
nosuchindex
nosuchtable
notag notag
notawordenglish notawordenglish
notawordgerman notawordgerman
@ -1175,11 +1139,6 @@ orgchart
origdir origdir
oring oring
ossp ossp
otherfield
otherjob
othername
otherpage
otherprofile
otsikko otsikko
outdata outdata
outdent outdent
@ -1694,7 +1653,6 @@ testkey
testlist testlist
testload testload
testname testname
testnoschema
testproject testproject
testproperty testproperty
testservice testservice
@ -1906,7 +1864,6 @@ uri's
url's url's
urlalias urlalias
urldecoding urldecoding
urlto
usecase usecase
userid userid
userinfo userinfo

View File

@ -156,7 +156,7 @@ class BlockContentAccessHandlerTest extends KernelTestBase {
} }
/** /**
* Dataprovider for testAccess(). * Data provider for testAccess().
*/ */
public function providerTestAccess() { public function providerTestAccess() {
$cases = [ $cases = [

View File

@ -134,7 +134,7 @@ class DependentAccessTest extends UnitTestCase {
} }
/** /**
* Dataprovider for all test methods. * Data provider for all test methods.
* *
* Provides test cases for calling setAccessDependency() or * Provides test cases for calling setAccessDependency() or
* mergeAccessDependency() first. A call to either should behave the same on a * mergeAccessDependency() first. A call to either should behave the same on a

View File

@ -2,4 +2,4 @@ testitem: 'Since this file at least has top level schema in config_test.schema.y
testlist: testlist:
- 'Direct string items are identified and other items are' - 'Direct string items are identified and other items are'
- 'recognized as undefined types.' - 'recognized as undefined types.'
testnoschema: 12 test_no_schema: 12

View File

@ -23,7 +23,7 @@ use Drupal\filter\FilterFormatInterface;
*/ */
function hook_editor_info_alter(array &$editors) { function hook_editor_info_alter(array &$editors) {
$editors['some_other_editor']['label'] = t('A different name'); $editors['some_other_editor']['label'] = t('A different name');
$editors['some_other_editor']['library']['module'] = 'myeditoroverride'; $editors['some_other_editor']['library']['module'] = 'my_editor_override';
} }
/** /**

View File

@ -28,7 +28,7 @@ use Drupal\Component\Annotation\Plugin;
* *
* @code * @code
* @Editor( * @Editor(
* id = "myeditor", * id = "my_editor",
* label = @Translation("My Editor"), * label = @Translation("My Editor"),
* supports_content_filtering = FALSE, * supports_content_filtering = FALSE,
* supports_inline_editing = FALSE, * supports_inline_editing = FALSE,

View File

@ -190,11 +190,11 @@ function hook_field_widget_info_alter(array &$info) {
* @see hook_field_widget_multivalue_form_alter() * @see hook_field_widget_multivalue_form_alter()
*/ */
function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) {
// Add a css class to widget form elements for all fields of type mytype. // Add a css class to widget form elements for all fields of type my_type.
$field_definition = $context['items']->getFieldDefinition(); $field_definition = $context['items']->getFieldDefinition();
if ($field_definition->getType() == 'mytype') { if ($field_definition->getType() == 'my_type') {
// Be sure not to overwrite existing attributes. // Be sure not to overwrite existing attributes.
$element['#attributes']['class'][] = 'myclass'; $element['#attributes']['class'][] = 'my-class';
} }
} }
@ -257,11 +257,11 @@ function hook_field_widget_WIDGET_TYPE_form_alter(&$element, \Drupal\Core\Form\F
* @see hook_field_widget_multivalue_WIDGET_TYPE_form_alter() * @see hook_field_widget_multivalue_WIDGET_TYPE_form_alter()
*/ */
function hook_field_widget_multivalue_form_alter(array &$elements, \Drupal\Core\Form\FormStateInterface $form_state, array $context) { function hook_field_widget_multivalue_form_alter(array &$elements, \Drupal\Core\Form\FormStateInterface $form_state, array $context) {
// Add a css class to widget form elements for all fields of type mytype. // Add a css class to widget form elements for all fields of type my_type.
$field_definition = $context['items']->getFieldDefinition(); $field_definition = $context['items']->getFieldDefinition();
if ($field_definition->getType() == 'mytype') { if ($field_definition->getType() == 'my_type') {
// Be sure not to overwrite existing attributes. // Be sure not to overwrite existing attributes.
$elements['#attributes']['class'][] = 'myclass'; $elements['#attributes']['class'][] = 'my-class';
} }
} }

View File

@ -122,7 +122,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
$values[$index][$field_name] = mt_rand(1, 127); $values[$index][$field_name] = mt_rand(1, 127);
$entity->$field_name->setValue(['value' => $values[$index][$field_name]]); $entity->$field_name->setValue(['value' => $values[$index][$field_name]]);
} }
$entity->enforceIsnew(); $entity->enforceIsNew();
$entity->save(); $entity->save();
} }

View File

@ -91,7 +91,7 @@ function hook_field_widget_third_party_settings_form(\Drupal\Core\Field\WidgetIn
*/ */
function hook_field_formatter_settings_summary_alter(array &$summary, array $context) { function hook_field_formatter_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_formatter has // Append a message to the summary when an instance of foo_formatter has
// mysetting set to TRUE for the current view mode. // my_setting set to TRUE for the current view mode.
if ($context['formatter']->getPluginId() == 'foo_formatter') { if ($context['formatter']->getPluginId() == 'foo_formatter') {
if ($context['formatter']->getThirdPartySetting('my_module', 'my_setting')) { if ($context['formatter']->getThirdPartySetting('my_module', 'my_setting')) {
$summary[] = t('My setting enabled.'); $summary[] = t('My setting enabled.');
@ -114,7 +114,7 @@ function hook_field_formatter_settings_summary_alter(array &$summary, array $con
*/ */
function hook_field_widget_settings_summary_alter(array &$summary, array $context) { function hook_field_widget_settings_summary_alter(array &$summary, array $context) {
// Append a message to the summary when an instance of foo_widget has // Append a message to the summary when an instance of foo_widget has
// mysetting set to TRUE for the current view mode. // my_setting set to TRUE for the current view mode.
if ($context['widget']->getPluginId() == 'foo_widget') { if ($context['widget']->getPluginId() == 'foo_widget') {
if ($context['widget']->getThirdPartySetting('my_module', 'my_setting')) { if ($context['widget']->getThirdPartySetting('my_module', 'my_setting')) {
$summary[] = t('My setting enabled.'); $summary[] = t('My setting enabled.');

View File

@ -572,11 +572,11 @@ class LayoutBuilderTest extends BrowserTestBase {
// Create a new menu. // Create a new menu.
$this->drupalGet('admin/structure/menu/add'); $this->drupalGet('admin/structure/menu/add');
$page->fillField('label', 'My Menu'); $page->fillField('label', 'My Menu');
$page->fillField('id', 'mymenu'); $page->fillField('id', 'my-menu');
$page->pressButton('Save'); $page->pressButton('Save');
$this->drupalGet('admin/structure/menu/add'); $this->drupalGet('admin/structure/menu/add');
$page->fillField('label', 'My Menu'); $page->fillField('label', 'My Menu');
$page->fillField('id', 'myothermenu'); $page->fillField('id', 'my-other-menu');
$page->pressButton('Save'); $page->pressButton('Save');
$page->clickLink('Add link'); $page->clickLink('Add link');
@ -595,7 +595,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->elementExists('css', '.layout--layout-test-dependencies-plugin'); $assert_session->elementExists('css', '.layout--layout-test-dependencies-plugin');
$assert_session->elementExists('css', '.field--name-body'); $assert_session->elementExists('css', '.field--name-body');
$page->pressButton('Save layout'); $page->pressButton('Save layout');
$this->drupalPostForm('admin/structure/menu/manage/myothermenu/delete', [], 'Delete'); $this->drupalPostForm('admin/structure/menu/manage/my-other-menu/delete', [], 'Delete');
$this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout'); $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout');
$assert_session->elementNotExists('css', '.layout--layout-test-dependencies-plugin'); $assert_session->elementNotExists('css', '.layout--layout-test-dependencies-plugin');
$assert_session->elementExists('css', '.field--name-body'); $assert_session->elementExists('css', '.field--name-body');
@ -617,17 +617,17 @@ class LayoutBuilderTest extends BrowserTestBase {
// Assert that the blocks are visible, and save the layout. // Assert that the blocks are visible, and save the layout.
$assert_session->pageTextContains('Powered by Drupal'); $assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextContains('My Menu'); $assert_session->pageTextContains('My Menu');
$assert_session->elementExists('css', '.block.menu--mymenu'); $assert_session->elementExists('css', '.block.menu--my-menu');
$page->pressButton('Save layout'); $page->pressButton('Save layout');
// Delete the menu. // Delete the menu.
$this->drupalPostForm('admin/structure/menu/manage/mymenu/delete', [], 'Delete'); $this->drupalPostForm('admin/structure/menu/manage/my-menu/delete', [], 'Delete');
// Ensure that the menu block is gone, but that the other block remains. // Ensure that the menu block is gone, but that the other block remains.
$this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout'); $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default/layout');
$assert_session->pageTextContains('Powered by Drupal'); $assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextNotContains('My Menu'); $assert_session->pageTextNotContains('My Menu');
$assert_session->elementNotExists('css', '.block.menu--mymenu'); $assert_session->elementNotExists('css', '.block.menu--my-menu');
} }
/** /**

View File

@ -46,7 +46,7 @@ class LayoutEntityHelperTraitTest extends KernelTestBase {
} }
/** /**
* Dataprovider for testGetSectionStorageForEntity(). * Data provider for testGetSectionStorageForEntity().
*/ */
public function providerTestGetSectionStorageForEntity() { public function providerTestGetSectionStorageForEntity() {
$data = []; $data = [];
@ -119,7 +119,7 @@ class LayoutEntityHelperTraitTest extends KernelTestBase {
} }
/** /**
* Dataprovider for testOriginalEntityUsesDefaultStorage(). * Data provider for testOriginalEntityUsesDefaultStorage().
*/ */
public function providerTestOriginalEntityUsesDefaultStorage() { public function providerTestOriginalEntityUsesDefaultStorage() {
return [ return [

View File

@ -43,7 +43,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
protected $blockManager; protected $blockManager;
/** /**
* Dataprovider for test functions that should test block types. * Data provider for test functions that should test block types.
*/ */
public function providerBlockTypes() { public function providerBlockTypes() {
return [ return [

View File

@ -18,7 +18,7 @@ use Drupal\Tests\UnitTestCase;
class LayoutEntityHelperTraitTest extends UnitTestCase { class LayoutEntityHelperTraitTest extends UnitTestCase {
/** /**
* Dataprovider method for tests that need sections with inline blocks. * Data provider method for tests that need sections with inline blocks.
*/ */
public function providerSectionsWithInlineComponents() { public function providerSectionsWithInlineComponents() {
$components = []; $components = [];

View File

@ -125,8 +125,8 @@ function locale_translation_project_list() {
* *
* Custom modules or themes can bring their own gettext translation file. To * Custom modules or themes can bring their own gettext translation file. To
* enable import of this file the module or theme defines "interface translation * enable import of this file the module or theme defines "interface translation
* project = myproject" in its .info.yml file. This function will add a project * project = my_project" in its .info.yml file. This function will add a project
* "myproject" to the info data. * "my_project" to the info data.
* *
* @param \Drupal\Core\Extension\Extension[] $data * @param \Drupal\Core\Extension\Extension[] $data
* Array of .info.yml file data. * Array of .info.yml file data.

View File

@ -70,8 +70,8 @@ class NodeQueryAlterTest extends NodeTestBase {
public function testNodeQueryAlterLowLevelWithAccess() { public function testNodeQueryAlterLowLevelWithAccess() {
// User with access should be able to view 4 nodes. // User with access should be able to view 4 nodes.
try { try {
$query = Database::getConnection()->select('node', 'mytab') $query = Database::getConnection()->select('node', 'n')
->fields('mytab'); ->fields('n');
$query->addTag('node_access'); $query->addTag('node_access');
$query->addMetaData('op', 'view'); $query->addMetaData('op', 'view');
$query->addMetaData('account', $this->accessUser); $query->addMetaData('account', $this->accessUser);
@ -111,8 +111,8 @@ class NodeQueryAlterTest extends NodeTestBase {
public function testNodeQueryAlterLowLevelNoAccess() { public function testNodeQueryAlterLowLevelNoAccess() {
// User without access should be able to view 0 nodes. // User without access should be able to view 0 nodes.
try { try {
$query = Database::getConnection()->select('node', 'mytab') $query = Database::getConnection()->select('node', 'n')
->fields('mytab'); ->fields('n');
$query->addTag('node_access'); $query->addTag('node_access');
$query->addMetaData('op', 'view'); $query->addMetaData('op', 'view');
$query->addMetaData('account', $this->noAccessUser); $query->addMetaData('account', $this->noAccessUser);
@ -134,8 +134,8 @@ class NodeQueryAlterTest extends NodeTestBase {
public function testNodeQueryAlterLowLevelEditAccess() { public function testNodeQueryAlterLowLevelEditAccess() {
// User with view-only access should not be able to edit nodes. // User with view-only access should not be able to edit nodes.
try { try {
$query = Database::getConnection()->select('node', 'mytab') $query = Database::getConnection()->select('node', 'n')
->fields('mytab'); ->fields('n');
$query->addTag('node_access'); $query->addTag('node_access');
$query->addMetaData('op', 'update'); $query->addMetaData('op', 'update');
$query->addMetaData('account', $this->accessUser); $query->addMetaData('account', $this->accessUser);
@ -175,8 +175,8 @@ class NodeQueryAlterTest extends NodeTestBase {
// privilege after adding the node_access record. // privilege after adding the node_access record.
drupal_static_reset('node_access_view_all_nodes'); drupal_static_reset('node_access_view_all_nodes');
try { try {
$query = $connection->select('node', 'mytab') $query = $connection->select('node', 'n')
->fields('mytab'); ->fields('n');
$query->addTag('node_access'); $query->addTag('node_access');
$query->addMetaData('op', 'view'); $query->addMetaData('op', 'view');
$query->addMetaData('account', $this->noAccessUser); $query->addMetaData('account', $this->noAccessUser);
@ -197,8 +197,8 @@ class NodeQueryAlterTest extends NodeTestBase {
\Drupal::state()->set('node_access_test.no_access_uid', $this->noAccessUser->id()); \Drupal::state()->set('node_access_test.no_access_uid', $this->noAccessUser->id());
drupal_static_reset('node_access_view_all_nodes'); drupal_static_reset('node_access_view_all_nodes');
try { try {
$query = $connection->select('node', 'mytab') $query = $connection->select('node', 'n')
->fields('mytab'); ->fields('n');
$query->addTag('node_access'); $query->addTag('node_access');
$query->addMetaData('op', 'view'); $query->addMetaData('op', 'view');
$query->addMetaData('account', $this->noAccessUser); $query->addMetaData('account', $this->noAccessUser);

View File

@ -27,7 +27,7 @@ class LayoutTestDependenciesPlugin extends LayoutDefault implements DependentPlu
*/ */
public function calculateDependencies() { public function calculateDependencies() {
$dependencies = []; $dependencies = [];
$dependencies['config'][] = 'system.menu.myothermenu'; $dependencies['config'][] = 'system.menu.my-other-menu';
return $dependencies; return $dependencies;
} }

View File

@ -122,7 +122,7 @@ abstract class OffCanvasTestBase extends WebDriverTestBase {
} }
/** /**
* Dataprovider that returns theme name as the sole argument. * Data provider that returns theme name as the sole argument.
*/ */
public function themeDataProvider() { public function themeDataProvider() {
$themes = $this->getTestThemes(); $themes = $this->getTestThemes();

View File

@ -445,7 +445,7 @@ class UpdateCoreTest extends UpdateTestBase {
} }
/** /**
* Dataprovider for testSecurityCoverageMessage(). * Data provider for testSecurityCoverageMessage().
* *
* These test cases rely on the following fixtures containing the following * These test cases rely on the following fixtures containing the following
* releases: * releases:

View File

@ -75,8 +75,8 @@ class QueryGroupByTest extends ViewsKernelTestBase {
$types[$item->entity_test_name] = $item->num_records; $types[$item->entity_test_name] = $item->num_records;
} }
$this->assertEqual($types['name1'], 4, 'Groupby the name: name1 returned the expected amount of results.'); $this->assertEquals(4, $types['name1']);
$this->assertEqual($types['name2'], 3, 'Groupby the name: name2 returned the expected amount of results.'); $this->assertEquals(3, $types['name2']);
} }
/** /**

View File

@ -36,8 +36,8 @@ if (in_array('--help', $_SERVER['argv']) || empty($_SERVER['argv'])) {
Generate Drupal password hashes from the shell. Generate Drupal password hashes from the shell.
Usage: {$script} [OPTIONS] "<plan-text password>" Usage: {$script} [OPTIONS] "<plaintext password>"
Example: {$script} "mynewpassword" Example: {$script} "my-new-password"
All arguments are long options. All arguments are long options.
@ -45,7 +45,7 @@ All arguments are long options.
"<password1>" ["<password2>" ["<password3>" ...]] "<password1>" ["<password2>" ["<password3>" ...]]
One or more plan-text passwords enclosed by double quotes. The One or more plaintext passwords enclosed by double quotes. The
output hash may be manually entered into the output hash may be manually entered into the
{users_field_data}.pass field to change a password via SQL to a {users_field_data}.pass field to change a password via SQL to a
known value. known value.

View File

@ -43,9 +43,9 @@ class DistributionProfileExistingSettingsTest extends InstallerTestBase {
], ],
]; ];
// File API functions are not available yet. // File API functions are not available yet.
$path = $this->siteDirectory . '/profiles/mydistro'; $path = $this->siteDirectory . '/profiles/my_distro';
mkdir($path, 0777, TRUE); mkdir($path, 0777, TRUE);
file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); file_put_contents("$path/my_distro.info.yml", Yaml::encode($this->info));
// Pre-configure hash salt. // Pre-configure hash salt.
// Any string is valid, so simply use the class name of this test. // Any string is valid, so simply use the class name of this test.
@ -120,11 +120,11 @@ class DistributionProfileExistingSettingsTest extends InstallerTestBase {
$this->assertText($this->rootUser->getAccountName()); $this->assertText($this->rootUser->getAccountName());
// Confirm that Drupal recognizes this distribution as the current profile. // Confirm that Drupal recognizes this distribution as the current profile.
$this->assertEqual(\Drupal::installProfile(), 'mydistro'); $this->assertEqual(\Drupal::installProfile(), 'my_distro');
$this->assertEqual($this->config('core.extension')->get('profile'), 'mydistro', 'The install profile has been written to core.extension configuration.'); $this->assertEqual($this->config('core.extension')->get('profile'), 'my_distro', 'The install profile has been written to core.extension configuration.');
$this->rebuildContainer(); $this->rebuildContainer();
$this->assertEqual(\Drupal::installProfile(), 'mydistro'); $this->assertEqual(\Drupal::installProfile(), 'my_distro');
} }
} }

View File

@ -33,15 +33,15 @@ class DistributionProfileTest extends InstallerTestBase {
'name' => 'My Distribution', 'name' => 'My Distribution',
'install' => [ 'install' => [
'theme' => 'bartik', 'theme' => 'bartik',
'finish_url' => '/myrootuser', 'finish_url' => '/root-user',
], ],
], ],
]; ];
// File API functions are not available yet. // File API functions are not available yet.
$path = $this->siteDirectory . '/profiles/mydistro'; $path = $this->siteDirectory . '/profiles/my_distro';
mkdir($path, 0777, TRUE); mkdir($path, 0777, TRUE);
file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); file_put_contents("$path/my_distro.info.yml", Yaml::encode($this->info));
file_put_contents("$path/mydistro.install", "<?php function mydistro_install() {\Drupal::entityTypeManager()->getStorage('path_alias')->create(['path' => '/user/1', 'alias' => '/myrootuser'])->save();}"); file_put_contents("$path/my_distro.install", "<?php function my_distro_install() {\Drupal::entityTypeManager()->getStorage('path_alias')->create(['path' => '/user/1', 'alias' => '/root-user'])->save();}");
} }
/** /**
@ -71,14 +71,14 @@ class DistributionProfileTest extends InstallerTestBase {
* Confirms that the installation succeeded. * Confirms that the installation succeeded.
*/ */
public function testInstalled() { public function testInstalled() {
$this->assertSession()->addressEquals('myrootuser'); $this->assertSession()->addressEquals('root-user');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
// Confirm that we are logged-in after installation. // Confirm that we are logged-in after installation.
$this->assertText($this->rootUser->getAccountName()); $this->assertText($this->rootUser->getAccountName());
// Confirm that Drupal recognizes this distribution as the current profile. // Confirm that Drupal recognizes this distribution as the current profile.
$this->assertEqual(\Drupal::installProfile(), 'mydistro'); $this->assertEqual(\Drupal::installProfile(), 'my_distro');
$this->assertEqual($this->config('core.extension')->get('profile'), 'mydistro', 'The install profile has been written to core.extension configuration.'); $this->assertEqual($this->config('core.extension')->get('profile'), 'my_distro', 'The install profile has been written to core.extension configuration.');
} }
} }

View File

@ -48,9 +48,9 @@ class DistributionProfileTranslationQueryTest extends InstallerTestBase {
], ],
]; ];
// File API functions are not available yet. // File API functions are not available yet.
$path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/mydistro'; $path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/my_distro';
mkdir($path, 0777, TRUE); mkdir($path, 0777, TRUE);
file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); file_put_contents("$path/my_distro.info.yml", Yaml::encode($this->info));
// Place a custom local translation in the translations directory. // Place a custom local translation in the translations directory.
mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE); mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
file_put_contents($this->root . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de')); file_put_contents($this->root . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));

View File

@ -50,9 +50,9 @@ class DistributionProfileTranslationTest extends InstallerTestBase {
], ],
]; ];
// File API functions are not available yet. // File API functions are not available yet.
$path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/mydistro'; $path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/my_distro';
mkdir($path, 0777, TRUE); mkdir($path, 0777, TRUE);
file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); file_put_contents("$path/my_distro.info.yml", Yaml::encode($this->info));
// Place a custom local translation in the translations directory. // Place a custom local translation in the translations directory.
mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE); mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);

View File

@ -96,7 +96,7 @@ class ConfigSchemaTest extends KernelTestBase {
$expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition'; $expected['definition_class'] = '\Drupal\Core\TypedData\DataDefinition';
$expected['unwrap_for_canonical_representation'] = TRUE; $expected['unwrap_for_canonical_representation'] = TRUE;
$this->assertEqual($definition, $expected, 'Automatic type detected for a list is undefined.'); $this->assertEqual($definition, $expected, 'Automatic type detected for a list is undefined.');
$definition = $config->get('testnoschema')->getDataDefinition()->toArray(); $definition = $config->get('test_no_schema')->getDataDefinition()->toArray();
$expected = []; $expected = [];
$expected['label'] = 'Undefined'; $expected['label'] = 'Undefined';
$expected['class'] = Undefined::class; $expected['class'] = Undefined::class;

View File

@ -39,7 +39,7 @@ class RegressionTest extends DatabaseTestBase {
*/ */
public function testDBTableExists() { public function testDBTableExists() {
$this->assertTrue($this->connection->schema()->tableExists('test'), 'Returns true for existent table.'); $this->assertTrue($this->connection->schema()->tableExists('test'), 'Returns true for existent table.');
$this->assertFalse($this->connection->schema()->tableExists('nosuchtable'), 'Returns false for nonexistent table.'); $this->assertFalse($this->connection->schema()->tableExists('no_such_table'), 'Returns false for nonexistent table.');
} }
/** /**
@ -48,7 +48,7 @@ class RegressionTest extends DatabaseTestBase {
public function testDBFieldExists() { public function testDBFieldExists() {
$schema = $this->connection->schema(); $schema = $this->connection->schema();
$this->assertTrue($schema->fieldExists('test', 'name'), 'Returns true for existent column.'); $this->assertTrue($schema->fieldExists('test', 'name'), 'Returns true for existent column.');
$this->assertFalse($schema->fieldExists('test', 'nosuchcolumn'), 'Returns false for nonexistent column.'); $this->assertFalse($schema->fieldExists('test', 'no_such_column'), 'Returns false for nonexistent column.');
} }
/** /**
@ -56,7 +56,7 @@ class RegressionTest extends DatabaseTestBase {
*/ */
public function testDBIndexExists() { public function testDBIndexExists() {
$this->assertTrue($this->connection->schema()->indexExists('test', 'ages'), 'Returns true for existent index.'); $this->assertTrue($this->connection->schema()->indexExists('test', 'ages'), 'Returns true for existent index.');
$this->assertFalse($this->connection->schema()->indexExists('test', 'nosuchindex'), 'Returns false for nonexistent index.'); $this->assertFalse($this->connection->schema()->indexExists('test', 'no_such_index'), 'Returns false for nonexistent index.');
} }
} }

View File

@ -324,12 +324,12 @@ class SelectComplexTest extends DatabaseTestBase {
public function testJoinTwice() { public function testJoinTwice() {
$query = $this->connection->select('test')->fields('test'); $query = $this->connection->select('test')->fields('test');
$alias = $query->join('test', 'test', 'test.job = %alias.job'); $alias = $query->join('test', 'test', 'test.job = %alias.job');
$query->addField($alias, 'name', 'othername'); $query->addField($alias, 'name', 'other_name');
$query->addField($alias, 'job', 'otherjob'); $query->addField($alias, 'job', 'other_job');
$query->where("$alias.name <> test.name"); $query->where("$alias.name <> test.name");
$crowded_job = $query->execute()->fetch(); $crowded_job = $query->execute()->fetch();
$this->assertEqual($crowded_job->job, $crowded_job->otherjob, 'Correctly joined same table twice.'); $this->assertEqual($crowded_job->job, $crowded_job->other_job, 'Correctly joined same table twice.');
$this->assertNotEqual($crowded_job->name, $crowded_job->othername, 'Correctly joined same table twice.'); $this->assertNotEqual($crowded_job->name, $crowded_job->other_name, 'Correctly joined same table twice.');
} }
/** /**

View File

@ -517,7 +517,7 @@ class EntityQueryAggregateTest extends EntityKernelTestBase {
['field_test_1' => 1, 'field_test_2_count' => 2], ['field_test_1' => 1, 'field_test_2_count' => 2],
]); ]);
// Groupby and aggregate by fieldapi field, and sort by the aggregated // Group by and aggregate by Field API field, and sort by the aggregated
// field. // field.
$this->queryResult = $this->entityStorage->getAggregateQuery() $this->queryResult = $this->entityStorage->getAggregateQuery()
->groupBy('field_test_1') ->groupBy('field_test_1')

View File

@ -99,7 +99,7 @@ class ModuleInstallerTest extends KernelTestBase {
} }
/** /**
* Dataprovider for testInvalidCoreInstall(). * Data provider for testInvalidCoreInstall().
*/ */
public function providerTestInvalidCoreInstall() { public function providerTestInvalidCoreInstall() {
return [ return [

View File

@ -22,7 +22,7 @@ class ZfExtensionManagerSfContainerTest extends TestCase {
*/ */
public function testGet() { public function testGet() {
$service = new \stdClass(); $service = new \stdClass();
$service->value = 'myvalue'; $service->value = 'my_value';
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$container->set('foo', $service); $container->set('foo', $service);
$bridge = new ZfExtensionManagerSfContainer(); $bridge = new ZfExtensionManagerSfContainer();
@ -42,7 +42,7 @@ class ZfExtensionManagerSfContainerTest extends TestCase {
*/ */
public function testHas() { public function testHas() {
$service = new \stdClass(); $service = new \stdClass();
$service->value = 'myvalue'; $service->value = 'my_value';
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$container->set('foo', $service); $container->set('foo', $service);
$bridge = new ZfExtensionManagerSfContainer(); $bridge = new ZfExtensionManagerSfContainer();
@ -84,7 +84,7 @@ class ZfExtensionManagerSfContainerTest extends TestCase {
*/ */
public function testPrefix() { public function testPrefix() {
$service = new \stdClass(); $service = new \stdClass();
$service->value = 'myvalue'; $service->value = 'my_value';
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$container->set('foo.bar', $service); $container->set('foo.bar', $service);
$bridge = new ZfExtensionManagerSfContainer('foo.'); $bridge = new ZfExtensionManagerSfContainer('foo.');
@ -100,7 +100,7 @@ class ZfExtensionManagerSfContainerTest extends TestCase {
*/ */
public function testCanonicalizeName($name, $canonical_name) { public function testCanonicalizeName($name, $canonical_name) {
$service = new \stdClass(); $service = new \stdClass();
$service->value = 'myvalue'; $service->value = 'my_value';
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$container->set($canonical_name, $service); $container->set($canonical_name, $service);
$bridge = new ZfExtensionManagerSfContainer(); $bridge = new ZfExtensionManagerSfContainer();

View File

@ -35,7 +35,7 @@ class UuidTest extends TestCase {
} }
/** /**
* Dataprovider for UUID instance tests. * Data provider for UUID instance tests.
* *
* @return array * @return array
*/ */
@ -74,7 +74,7 @@ class UuidTest extends TestCase {
} }
/** /**
* Dataprovider for UUID instance tests. * Data provider for UUID instance tests.
* *
* @return array * @return array
* An array of arrays containing * An array of arrays containing

View File

@ -170,10 +170,10 @@ class AssertLegacyTraitTest extends UnitTestCase {
$option_field->hasAttribute('selected')->willReturn(TRUE); $option_field->hasAttribute('selected')->willReturn(TRUE);
$this->webAssert $this->webAssert
->optionExists('myselect', 'two') ->optionExists('my_select', 'two')
->willReturn($option_field->reveal()); ->willReturn($option_field->reveal());
$this->assertOptionSelected('myselect', 'two'); $this->assertOptionSelected('my_select', 'two');
} }
/** /**
@ -185,11 +185,11 @@ class AssertLegacyTraitTest extends UnitTestCase {
$option_field->hasAttribute('selected')->willReturn(FALSE); $option_field->hasAttribute('selected')->willReturn(FALSE);
$this->webAssert $this->webAssert
->optionExists('myselect', 'two') ->optionExists('my_select', 'two')
->willReturn($option_field->reveal()); ->willReturn($option_field->reveal());
$this->expectException(ExpectationFailedException::class); $this->expectException(ExpectationFailedException::class);
$this->assertOptionSelected('myselect', 'two'); $this->assertOptionSelected('my_select', 'two');
} }
/** /**

View File

@ -80,14 +80,14 @@ class LibraryDiscoveryTest extends UnitTestCase {
* @covers ::getLibrariesByExtension * @covers ::getLibrariesByExtension
*/ */
public function testGetLibrariesByExtension() { public function testGetLibrariesByExtension() {
$this->libraryDiscovery->getLibrariesbyExtension('test'); $this->libraryDiscovery->getLibrariesByExtension('test');
// Verify that subsequent calls don't trigger hook_library_info_alter() // Verify that subsequent calls don't trigger hook_library_info_alter()
// and hook_js_settings_alter() invocations, nor do they talk to the // and hook_js_settings_alter() invocations, nor do they talk to the
// collector again. This ensures that the alterations made by // collector again. This ensures that the alterations made by
// hook_library_info_alter() and hook_js_settings_alter() implementations // hook_library_info_alter() and hook_js_settings_alter() implementations
// are statically cached, as desired. // are statically cached, as desired.
$this->libraryDiscovery->getLibraryByName('test', 'test_1'); $this->libraryDiscovery->getLibraryByName('test', 'test_1');
$this->libraryDiscovery->getLibrariesbyExtension('test'); $this->libraryDiscovery->getLibrariesByExtension('test');
} }
/** /**

View File

@ -19,7 +19,7 @@ use Drupal\Tests\UnitTestCase;
class ConnectionTest extends UnitTestCase { class ConnectionTest extends UnitTestCase {
/** /**
* Dataprovider for testPrefixRoundTrip(). * Data provider for testPrefixRoundTrip().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -68,7 +68,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testPrefixTables(). * Data provider for testPrefixTables().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -117,7 +117,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testGetDriverClass(). * Data provider for testGetDriverClass().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -290,7 +290,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testSchema(). * Data provider for testSchema().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -366,7 +366,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testMakeComments(). * Data provider for testMakeComments().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -402,7 +402,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testFilterComments(). * Data provider for testFilterComments().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -644,7 +644,7 @@ class ConnectionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testQueryTrim(). * Data provider for testQueryTrim().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:

View File

@ -47,7 +47,7 @@ class InstallerObjectTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testDbUrltoConnectionConversion(). * Data provider for testDbUrlToConnectionConversion().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:

View File

@ -48,13 +48,13 @@ class UrlConversionTest extends UnitTestCase {
* *
* @dataProvider providerConvertDbUrlToConnectionInfo * @dataProvider providerConvertDbUrlToConnectionInfo
*/ */
public function testDbUrltoConnectionConversion($root, $url, $database_array) { public function testDbUrlToConnectionConversion($root, $url, $database_array) {
$result = Database::convertDbUrlToConnectionInfo($url, $root ?: $this->root); $result = Database::convertDbUrlToConnectionInfo($url, $root ?: $this->root);
$this->assertEquals($database_array, $result); $this->assertEquals($database_array, $result);
} }
/** /**
* Dataprovider for testDbUrltoConnectionConversion(). * Data provider for testDbUrlToConnectionConversion().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -216,7 +216,7 @@ class UrlConversionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testGetInvalidArgumentExceptionInUrlConversion(). * Data provider for testGetInvalidArgumentExceptionInUrlConversion().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -248,7 +248,7 @@ class UrlConversionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testGetConnectionInfoAsUrl(). * Data provider for testGetConnectionInfoAsUrl().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:
@ -376,7 +376,7 @@ class UrlConversionTest extends UnitTestCase {
} }
/** /**
* Dataprovider for testGetInvalidArgumentGetConnectionInfoAsUrl(). * Data provider for testGetInvalidArgumentGetConnectionInfoAsUrl().
* *
* @return array * @return array
* Array of arrays with the following elements: * Array of arrays with the following elements:

View File

@ -78,7 +78,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
// Situations with context: front page, English, no query. // Situations with context: front page, English, no query.
$context = [ $context = [
'path' => 'myfrontpage', 'path' => 'my-front-page',
'front' => TRUE, 'front' => TRUE,
'language' => 'en', 'language' => 'en',
'query' => [], 'query' => [],
@ -87,7 +87,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
$situations[] = ['context' => $context, 'is active' => FALSE, 'attributes' => []]; $situations[] = ['context' => $context, 'is active' => FALSE, 'attributes' => []];
// Matching path, plus all matching variations. // Matching path, plus all matching variations.
$attributes = [ $attributes = [
'data-drupal-link-system-path' => 'myfrontpage', 'data-drupal-link-system-path' => 'my-front-page',
]; ];
$situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes]; $situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes];
$situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes + ['hreflang' => 'en']]; $situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes + ['hreflang' => 'en']];
@ -217,7 +217,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
// Situations with context: front page, English, query. // Situations with context: front page, English, query.
$context = [ $context = [
'path' => 'myfrontpage', 'path' => 'my-front-page',
'front' => TRUE, 'front' => TRUE,
'language' => 'en', 'language' => 'en',
'query' => ['foo' => 'bar'], 'query' => ['foo' => 'bar'],
@ -225,7 +225,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
$situations[] = ['context' => $context, 'is active' => FALSE, 'attributes' => []]; $situations[] = ['context' => $context, 'is active' => FALSE, 'attributes' => []];
// Matching path, plus all matching variations. // Matching path, plus all matching variations.
$attributes = [ $attributes = [
'data-drupal-link-system-path' => 'myfrontpage', 'data-drupal-link-system-path' => 'my-front-page',
'data-drupal-link-query' => Json::encode(['foo' => 'bar']), 'data-drupal-link-query' => Json::encode(['foo' => 'bar']),
]; ];
$situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes]; $situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes];
@ -254,13 +254,13 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
// Query with unsorted keys must match when the attribute is in sorted form. // Query with unsorted keys must match when the attribute is in sorted form.
$context = [ $context = [
'path' => 'myfrontpage', 'path' => 'my-front-page',
'front' => TRUE, 'front' => TRUE,
'language' => 'en', 'language' => 'en',
'query' => ['foo' => 'bar', 'baz' => 'qux'], 'query' => ['foo' => 'bar', 'baz' => 'qux'],
]; ];
$attributes = [ $attributes = [
'data-drupal-link-system-path' => 'myfrontpage', 'data-drupal-link-system-path' => 'my-front-page',
'data-drupal-link-query' => Json::encode(['baz' => 'qux', 'foo' => 'bar']), 'data-drupal-link-query' => Json::encode(['baz' => 'qux', 'foo' => 'bar']),
]; ];
$situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes]; $situations[] = ['context' => $context, 'is active' => TRUE, 'attributes' => $attributes];
@ -329,11 +329,11 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
// - the special matching path ('<front>') // - the special matching path ('<front>')
$front_special_link = '<a data-drupal-link-system-path="&lt;front&gt;">Front</a>'; $front_special_link = '<a data-drupal-link-system-path="&lt;front&gt;">Front</a>';
$front_special_link_active = '<a data-drupal-link-system-path="&lt;front&gt;" class="is-active">Front</a>'; $front_special_link_active = '<a data-drupal-link-system-path="&lt;front&gt;" class="is-active">Front</a>';
$front_path_link = '<a data-drupal-link-system-path="myfrontpage">Front Path</a>'; $front_path_link = '<a data-drupal-link-system-path="my-front-page">Front Path</a>';
$front_path_link_active = '<a data-drupal-link-system-path="myfrontpage" class="is-active">Front Path</a>'; $front_path_link_active = '<a data-drupal-link-system-path="my-front-page" class="is-active">Front Path</a>';
$data[] = [ $data[] = [
0 => $front_path_link . ' ' . $front_special_link, 0 => $front_path_link . ' ' . $front_special_link,
1 => 'myfrontpage', 1 => 'my-front-page',
2 => TRUE, 2 => TRUE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -341,7 +341,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
]; ];
$data[] = [ $data[] = [
0 => $front_special_link . ' ' . $front_path_link, 0 => $front_special_link . ' ' . $front_path_link,
1 => 'myfrontpage', 1 => 'my-front-page',
2 => TRUE, 2 => TRUE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -350,11 +350,11 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
// Test cases to verify that links to the front page do not get the // Test cases to verify that links to the front page do not get the
// 'is-active' class when not on the front page. // 'is-active' class when not on the front page.
$other_link = '<a data-drupal-link-system-path="otherpage">Other page</a>'; $other_link = '<a data-drupal-link-system-path="other-page">Other page</a>';
$other_link_active = '<a data-drupal-link-system-path="otherpage" class="is-active">Other page</a>'; $other_link_active = '<a data-drupal-link-system-path="other-page" class="is-active">Other page</a>';
$data['<front>-and-other-link-on-other-path'] = [ $data['<front>-and-other-link-on-other-path'] = [
0 => $front_special_link . ' ' . $other_link, 0 => $front_special_link . ' ' . $other_link,
1 => 'otherpage', 1 => 'other-page',
2 => FALSE, 2 => FALSE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -362,7 +362,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
]; ];
$data['front-and-other-link-on-other-path'] = [ $data['front-and-other-link-on-other-path'] = [
0 => $front_path_link . ' ' . $other_link, 0 => $front_path_link . ' ' . $other_link,
1 => 'otherpage', 1 => 'other-page',
2 => FALSE, 2 => FALSE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -370,7 +370,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
]; ];
$data['other-and-<front>-link-on-other-path'] = [ $data['other-and-<front>-link-on-other-path'] = [
0 => $other_link . ' ' . $front_special_link, 0 => $other_link . ' ' . $front_special_link,
1 => 'otherpage', 1 => 'other-page',
2 => FALSE, 2 => FALSE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -378,7 +378,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
]; ];
$data['other-and-front-link-on-other-path'] = [ $data['other-and-front-link-on-other-path'] = [
0 => $other_link . ' ' . $front_path_link, 0 => $other_link . ' ' . $front_path_link,
1 => 'otherpage', 1 => 'other-page',
2 => FALSE, 2 => FALSE,
3 => 'en', 3 => 'en',
4 => [], 4 => [],
@ -435,7 +435,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
); );
// A link that might otherwise be set 'active'. // A link that might otherwise be set 'active'.
$content = '<a data-drupal-link-system-path="otherpage">Other page</a>'; $content = '<a data-drupal-link-system-path="other-page">Other page</a>';
// Assert response with non-html content type gets ignored. // Assert response with non-html content type gets ignored.
$response = new Response(); $response = new Response();

View File

@ -47,7 +47,7 @@ class ExtensionDiscoveryTest extends UnitTestCase {
} }
if ($type === 'profile') { if ($type === 'profile') {
// Set profile directories for discovery of the other extension types. // Set profile directories for discovery of the other extension types.
$extension_discovery->setProfileDirectories(['myprofile' => 'profiles/myprofile']); $extension_discovery->setProfileDirectories(['my_profile' => 'profiles/my_profile']);
} }
} }
@ -119,15 +119,15 @@ class ExtensionDiscoveryTest extends UnitTestCase {
'sites/default/profiles/minimal/minimal.info.yml' => [ 'sites/default/profiles/minimal/minimal.info.yml' => [
'type' => 'profile', 'type' => 'profile',
], ],
'profiles/myprofile/myprofile.info.yml' => [ 'profiles/my_profile/my_profile.info.yml' => [
'type' => 'profile', 'type' => 'profile',
], ],
'profiles/myprofile/modules/myprofile_nested_module/myprofile_nested_module.info.yml' => [], 'profiles/my_profile/modules/my_profile_nested_module/my_profile_nested_module.info.yml' => [],
'profiles/otherprofile/otherprofile.info.yml' => [ 'profiles/other_profile/other_profile.info.yml' => [
'type' => 'profile', 'type' => 'profile',
], ],
'core/modules/user/user.info.yml' => [], 'core/modules/user/user.info.yml' => [],
'profiles/otherprofile/modules/otherprofile_nested_module/otherprofile_nested_module.info.yml' => [], 'profiles/other_profile/modules/other_profile_nested_module/other_profile_nested_module.info.yml' => [],
'core/modules/system/system.info.yml' => [], 'core/modules/system/system.info.yml' => [],
'core/themes/seven/seven.info.yml' => [ 'core/themes/seven/seven.info.yml' => [
'type' => 'theme', 'type' => 'theme',
@ -167,7 +167,7 @@ class ExtensionDiscoveryTest extends UnitTestCase {
$this->addFileToFilesystemStructure($filesystem_structure, $pieces, $content); $this->addFileToFilesystemStructure($filesystem_structure, $pieces, $content);
} }
unset($files_by_type_and_name_expected['module']['otherprofile_nested_module']); unset($files_by_type_and_name_expected['module']['other_profile_nested_module']);
return $files_by_type_and_name_expected; return $files_by_type_and_name_expected;
} }

View File

@ -334,7 +334,7 @@ CORE_8X;
} }
/** /**
* Dataprovider for testCore8x(). * Data provider for testCore8x().
*/ */
public function providerCore8x() { public function providerCore8x() {
return [ return [
@ -444,7 +444,7 @@ INVALID_CORE_VERSION_REQUIREMENT;
} }
/** /**
* Dataprovider for testCoreVersionRequirementInvalid(). * Data provider for testCoreVersionRequirementInvalid().
*/ */
public function providerCoreVersionRequirementInvalid() { public function providerCoreVersionRequirementInvalid() {
return [ return [
@ -583,7 +583,7 @@ CORE_INCOMPATIBILITY;
} }
/** /**
* Dataprovider for testCoreIncompatibility(). * Data provider for testCoreIncompatibility().
*/ */
public function providerCoreIncompatibility() { public function providerCoreIncompatibility() {
list($major, $minor) = explode('.', \Drupal::VERSION); list($major, $minor) = explode('.', \Drupal::VERSION);

View File

@ -182,7 +182,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*/ */
public function testSetExecuted() { public function testSetExecuted() {
$this->decoratedFormState->setExecuted() $this->decoratedFormState->setExecuted()
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setExecuted()); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setExecuted());
} }
@ -277,7 +277,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*/ */
public function testSetLimitValidationErrors($limit_validation_errors) { public function testSetLimitValidationErrors($limit_validation_errors) {
$this->decoratedFormState->setLimitValidationErrors($limit_validation_errors) $this->decoratedFormState->setLimitValidationErrors($limit_validation_errors)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setLimitValidationErrors($limit_validation_errors)); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setLimitValidationErrors($limit_validation_errors));
} }
@ -323,7 +323,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*/ */
public function testSetMethod($method) { public function testSetMethod($method) {
$this->decoratedFormState->setMethod($method) $this->decoratedFormState->setMethod($method)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setMethod($method)); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setMethod($method));
} }
@ -340,7 +340,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
public function testIsMethodType($expected_return_value, $method_type) { public function testIsMethodType($expected_return_value, $method_type) {
$this->decoratedFormState->isMethodType($method_type) $this->decoratedFormState->isMethodType($method_type)
->willReturn($expected_return_value) ->willReturn($expected_return_value)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($expected_return_value, $this->formStateDecoratorBase->isMethodType($method_type)); $this->assertSame($expected_return_value, $this->formStateDecoratorBase->isMethodType($method_type));
} }
@ -405,7 +405,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
public function testIsValidationEnforced($must_validate) { public function testIsValidationEnforced($must_validate) {
$this->decoratedFormState->isValidationEnforced() $this->decoratedFormState->isValidationEnforced()
->willReturn($must_validate) ->willReturn($must_validate)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($must_validate, $this->formStateDecoratorBase->isValidationEnforced()); $this->assertSame($must_validate, $this->formStateDecoratorBase->isValidationEnforced());
} }
@ -463,7 +463,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
public function testIsProcessingInput($process_input) { public function testIsProcessingInput($process_input) {
$this->decoratedFormState->isProcessingInput() $this->decoratedFormState->isProcessingInput()
->willReturn($process_input) ->willReturn($process_input)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($process_input, $this->formStateDecoratorBase->isProcessingInput()); $this->assertSame($process_input, $this->formStateDecoratorBase->isProcessingInput());
} }
@ -477,7 +477,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*/ */
public function testSetProgrammed($programmed) { public function testSetProgrammed($programmed) {
$this->decoratedFormState->setProgrammed($programmed) $this->decoratedFormState->setProgrammed($programmed)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammed($programmed)); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammed($programmed));
} }
@ -492,7 +492,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
public function testIsProgrammed($programmed) { public function testIsProgrammed($programmed) {
$this->decoratedFormState->isProgrammed() $this->decoratedFormState->isProgrammed()
->willReturn($programmed) ->willReturn($programmed)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($programmed, $this->formStateDecoratorBase->isProgrammed()); $this->assertSame($programmed, $this->formStateDecoratorBase->isProgrammed());
} }
@ -506,7 +506,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*/ */
public function testSetProgrammedBypassAccessCheck($programmed_bypass_access_check) { public function testSetProgrammedBypassAccessCheck($programmed_bypass_access_check) {
$this->decoratedFormState->setProgrammedBypassAccessCheck($programmed_bypass_access_check) $this->decoratedFormState->setProgrammedBypassAccessCheck($programmed_bypass_access_check)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammedBypassAccessCheck($programmed_bypass_access_check)); $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammedBypassAccessCheck($programmed_bypass_access_check));
} }
@ -824,7 +824,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
$this->decoratedFormState->getValidateHandlers() $this->decoratedFormState->getValidateHandlers()
->willReturn($validate_handlers) ->willReturn($validate_handlers)
->shouldBecalled(); ->shouldBeCalled();
$this->assertSame($validate_handlers, $this->formStateDecoratorBase->getValidateHandlers()); $this->assertSame($validate_handlers, $this->formStateDecoratorBase->getValidateHandlers());
} }

View File

@ -230,9 +230,9 @@ $databases = [];
* Sample Database configuration format for a driver in a contributed module: * Sample Database configuration format for a driver in a contributed module:
* @code * @code
* $databases['default']['default'] = [ * $databases['default']['default'] = [
* 'driver' => 'mydriver', * 'driver' => 'my_driver',
* 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver', * 'namespace' => 'Drupal\my_module\Driver\Database\my_driver',
* 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/', * 'autoload' => 'modules/my_module/src/Driver/Database/my_driver/',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'sqlusername', * 'username' => 'sqlusername',
* 'password' => 'sqlpassword', * 'password' => 'sqlpassword',