Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
80eccb18
Commit
80eccb18
authored
Nov 03, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2361823
by rpayanm, javivf: Remove usage of drupal_strtolower().
parent
51fcd31c
Changes
52
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
133 additions
and
86 deletions
+133
-86
core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+2
-1
core/modules/block_content/src/Tests/BlockContentCreationTest.php
...ules/block_content/src/Tests/BlockContentCreationTest.php
+1
-1
core/modules/block_content/src/Tests/BlockContentFieldTest.php
...modules/block_content/src/Tests/BlockContentFieldTest.php
+3
-2
core/modules/block_content/src/Tests/PageEditTest.php
core/modules/block_content/src/Tests/PageEditTest.php
+2
-1
core/modules/color/color.module
core/modules/color/color.module
+3
-2
core/modules/config/src/Tests/ConfigExportImportUITest.php
core/modules/config/src/Tests/ConfigExportImportUITest.php
+2
-1
core/modules/contact/src/Tests/ContactSitewideTest.php
core/modules/contact/src/Tests/ContactSitewideTest.php
+6
-6
core/modules/contact/src/Tests/ContactStorageTest.php
core/modules/contact/src/Tests/ContactStorageTest.php
+2
-1
core/modules/datetime/src/Tests/DateTimeFieldTest.php
core/modules/datetime/src/Tests/DateTimeFieldTest.php
+3
-2
core/modules/entity_reference/src/EntityReferenceController.php
...odules/entity_reference/src/EntityReferenceController.php
+2
-1
core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php
...erence/src/Tests/EntityReferenceFieldDefaultValueTest.php
+2
-1
core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php
...es/entity_reference/src/Tests/EntityReferenceItemTest.php
+3
-2
core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
+2
-1
core/modules/field/src/Tests/Email/EmailFieldTest.php
core/modules/field/src/Tests/Email/EmailFieldTest.php
+2
-1
core/modules/field/src/Tests/FieldAttachStorageTest.php
core/modules/field/src/Tests/FieldAttachStorageTest.php
+5
-4
core/modules/field/src/Tests/FieldCrudTest.php
core/modules/field/src/Tests/FieldCrudTest.php
+2
-1
core/modules/field/src/Tests/FieldUnitTestBase.php
core/modules/field/src/Tests/FieldUnitTestBase.php
+2
-1
core/modules/field/src/Tests/Number/NumberFieldTest.php
core/modules/field/src/Tests/Number/NumberFieldTest.php
+7
-6
core/modules/field/src/Tests/TranslationTest.php
core/modules/field/src/Tests/TranslationTest.php
+3
-2
core/modules/field/src/Tests/TranslationWebTest.php
core/modules/field/src/Tests/TranslationWebTest.php
+2
-1
core/modules/field_ui/src/Tests/FieldUiTestBase.php
core/modules/field_ui/src/Tests/FieldUiTestBase.php
+2
-1
core/modules/filter/src/Tests/FilterAdminTest.php
core/modules/filter/src/Tests/FilterAdminTest.php
+3
-2
core/modules/filter/src/Tests/FilterDefaultFormatTest.php
core/modules/filter/src/Tests/FilterDefaultFormatTest.php
+2
-1
core/modules/filter/src/Tests/FilterFormatAccessTest.php
core/modules/filter/src/Tests/FilterFormatAccessTest.php
+2
-1
core/modules/filter/src/Tests/FilterHooksTest.php
core/modules/filter/src/Tests/FilterHooksTest.php
+2
-1
core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+2
-1
core/modules/link/src/Tests/LinkFieldTest.php
core/modules/link/src/Tests/LinkFieldTest.php
+4
-4
core/modules/link/src/Tests/LinkFieldUITest.php
core/modules/link/src/Tests/LinkFieldUITest.php
+2
-1
core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
...ules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
+2
-1
core/modules/node/src/Tests/NodeAccessFieldTest.php
core/modules/node/src/Tests/NodeAccessFieldTest.php
+2
-1
core/modules/node/src/Tests/PagePreviewTest.php
core/modules/node/src/Tests/PagePreviewTest.php
+2
-1
core/modules/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php
...les/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php
+2
-1
core/modules/responsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php
...nsive_image/src/Tests/ResponsiveImageFieldDisplayTest.php
+2
-1
core/modules/search/search.module
core/modules/search/search.module
+2
-2
core/modules/search/src/Tests/SearchTokenizerTest.php
core/modules/search/src/Tests/SearchTokenizerTest.php
+2
-1
core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
...odules/system/src/Tests/Entity/EntityLanguageTestBase.php
+3
-2
core/modules/system/src/Tests/Entity/EntityQueryRelationshipTest.php
...s/system/src/Tests/Entity/EntityQueryRelationshipTest.php
+2
-1
core/modules/system/src/Tests/Entity/EntityQueryTest.php
core/modules/system/src/Tests/Entity/EntityQueryTest.php
+3
-2
core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+2
-1
core/modules/system/src/Tests/Mail/HtmlToTextTest.php
core/modules/system/src/Tests/Mail/HtmlToTextTest.php
+1
-1
core/modules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php
...ules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php
+2
-1
core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
+2
-1
core/modules/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php
...es/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php
+2
-1
core/modules/taxonomy/src/Tests/TermFieldTest.php
core/modules/taxonomy/src/Tests/TermFieldTest.php
+3
-2
core/modules/taxonomy/src/Tests/TermIndexTest.php
core/modules/taxonomy/src/Tests/TermIndexTest.php
+3
-2
core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php
...modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php
+2
-1
core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
+3
-2
core/modules/taxonomy/src/Tests/VocabularyLanguageTest.php
core/modules/taxonomy/src/Tests/VocabularyLanguageTest.php
+3
-2
core/modules/taxonomy/src/Tests/VocabularyUiTest.php
core/modules/taxonomy/src/Tests/VocabularyUiTest.php
+3
-2
core/modules/text/src/Tests/TextFieldTest.php
core/modules/text/src/Tests/TextFieldTest.php
+5
-4
core/modules/update/update.report.inc
core/modules/update/update.report.inc
+2
-1
core/modules/views/src/Tests/DefaultViewsTest.php
core/modules/views/src/Tests/DefaultViewsTest.php
+3
-2
No files found.
core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
View file @
80eccb18
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\Core\Database\Driver\pgsql
;
use
Drupal\Component\Utility\String
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Database\Query\Condition
;
use
Drupal\Core\Database\SchemaObjectExistsException
;
...
...
@@ -294,7 +295,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to lowercase.
if
(
isset
(
$field
[
'pgsql_type'
]))
{
$field
[
'pgsql_type'
]
=
drupal_
strtolower
(
$field
[
'pgsql_type'
]);
$field
[
'pgsql_type'
]
=
Unicode
::
strtolower
(
$field
[
'pgsql_type'
]);
}
else
{
$map
=
$this
->
getFieldTypeMap
();
...
...
core/modules/block_content/src/Tests/BlockContentCreationTest.php
View file @
80eccb18
...
...
@@ -165,7 +165,7 @@ public function testBlockDelete() {
// Place the block.
$instance
=
array
(
'id'
=>
drupal_
strtolower
(
$edit
[
'info[0][value]'
]),
'id'
=>
Unicode
::
strtolower
(
$edit
[
'info[0][value]'
]),
'settings[label]'
=>
$edit
[
'info[0][value]'
],
'region'
=>
'sidebar_first'
,
);
...
...
core/modules/block_content/src/Tests/BlockContentFieldTest.php
View file @
80eccb18
...
...
@@ -6,6 +6,7 @@
*/
namespace
Drupal\block_content\Tests
;
use
Drupal\Component\Utility\Unicode
;
/**
* Tests block fieldability.
...
...
@@ -55,7 +56,7 @@ public function testBlockFields() {
// Create a field with settings to validate.
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'field_name'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'entity_type'
=>
'block_content'
,
'type'
=>
'link'
,
'cardinality'
=>
2
,
...
...
@@ -93,7 +94,7 @@ public function testBlockFields() {
$url
=
'admin/structure/block/add/block_content:'
.
$block
->
uuid
()
.
'/'
.
\
Drupal
::
config
(
'system.theme'
)
->
get
(
'default'
);
// Place the block.
$instance
=
array
(
'id'
=>
drupal_
strtolower
(
$edit
[
'info[0][value]'
]),
'id'
=>
Unicode
::
strtolower
(
$edit
[
'info[0][value]'
]),
'settings[label]'
=>
$edit
[
'info[0][value]'
],
'region'
=>
'sidebar_first'
,
);
...
...
core/modules/block_content/src/Tests/PageEditTest.php
View file @
80eccb18
...
...
@@ -6,6 +6,7 @@
*/
namespace
Drupal\block_content\Tests
;
use
Drupal\Component\Utility\Unicode
;
/**
* Create a block and test block edit functionality.
...
...
@@ -24,7 +25,7 @@ public function testPageEdit() {
$body_key
=
'body[0][value]'
;
// Create block to edit.
$edit
=
array
();
$edit
[
'info[0][value]'
]
=
drupal_
strtolower
(
$this
->
randomMachineName
(
8
));
$edit
[
'info[0][value]'
]
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
8
));
$edit
[
$body_key
]
=
$this
->
randomMachineName
(
16
);
$this
->
drupalPostForm
(
'block/add/basic'
,
$edit
,
t
(
'Save'
));
...
...
core/modules/color/color.module
View file @
80eccb18
...
...
@@ -4,6 +4,7 @@
* Allows users to change the color scheme of themes.
*/
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Asset\CssOptimizer
;
use
Drupal\Component\Utility\Bytes
;
use
Drupal\Component\Utility\Environment
;
...
...
@@ -515,7 +516,7 @@ function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
// Prepare color conversion table.
$conversion
=
$palette
;
foreach
(
$conversion
as
$k
=>
$v
)
{
$conversion
[
$k
]
=
drupal_
strtolower
(
$v
);
$conversion
[
$k
]
=
Unicode
::
strtolower
(
$v
);
}
$default
=
color_get_palette
(
$theme
,
TRUE
);
...
...
@@ -534,7 +535,7 @@ function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
// Iterate over all the parts.
foreach
(
$style
as
$chunk
)
{
if
(
$is_color
)
{
$chunk
=
drupal_
strtolower
(
$chunk
);
$chunk
=
Unicode
::
strtolower
(
$chunk
);
// Check if this is one of the colors in the default palette.
if
(
$key
=
array_search
(
$chunk
,
$default
))
{
$chunk
=
$conversion
[
$key
];
...
...
core/modules/config/src/Tests/ConfigExportImportUITest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\config\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Archiver\ArchiveTar
;
use
Drupal\simpletest\WebTestBase
;
...
...
@@ -63,7 +64,7 @@ public function testExportImport() {
$this
->
content_type
=
$this
->
drupalCreateContentType
();
// Create a field.
$this
->
fieldName
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$this
->
fieldName
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$this
->
fieldName
,
'entity_type'
=>
'node'
,
...
...
core/modules/contact/src/Tests/ContactSitewideTest.php
View file @
80eccb18
...
...
@@ -107,13 +107,13 @@ function testSiteWideContact() {
$recipients
=
array
(
'simpletest@example.com'
,
'simpletest2@example.com'
,
'simpletest3@example.com'
);
$max_length
=
EntityTypeInterface
::
BUNDLE_MAX_LENGTH
;
$max_length_exceeded
=
$max_length
+
1
;
$this
->
addContactForm
(
$id
=
drupal_
strtolower
(
$this
->
randomMachineName
(
$max_length_exceeded
)),
$label
=
$this
->
randomMachineName
(
$max_length_exceeded
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
addContactForm
(
$id
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
$max_length_exceeded
)),
$label
=
$this
->
randomMachineName
(
$max_length_exceeded
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
assertText
(
format_string
(
'Machine-readable name cannot be longer than !max characters but is currently !exceeded characters long.'
,
array
(
'!max'
=>
$max_length
,
'!exceeded'
=>
$max_length_exceeded
)));
$this
->
addContactForm
(
$id
=
drupal_
strtolower
(
$this
->
randomMachineName
(
$max_length
)),
$label
=
$this
->
randomMachineName
(
$max_length
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
addContactForm
(
$id
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
$max_length
)),
$label
=
$this
->
randomMachineName
(
$max_length
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
assertRaw
(
t
(
'Contact form %label has been added.'
,
array
(
'%label'
=>
$label
)));
// Create first valid form.
$this
->
addContactForm
(
$id
=
drupal_
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
addContactForm
(
$id
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
])),
''
,
TRUE
);
$this
->
assertRaw
(
t
(
'Contact form %label has been added.'
,
array
(
'%label'
=>
$label
)));
// Check that the form was created in site default language.
...
...
@@ -148,10 +148,10 @@ function testSiteWideContact() {
$this
->
drupalLogin
(
$admin_user
);
// Add more forms.
$this
->
addContactForm
(
drupal_
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
],
$recipients
[
1
])),
''
,
FALSE
);
$this
->
addContactForm
(
Unicode
::
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
],
$recipients
[
1
])),
''
,
FALSE
);
$this
->
assertRaw
(
t
(
'Contact form %label has been added.'
,
array
(
'%label'
=>
$label
)));
$this
->
addContactForm
(
$name
=
drupal_
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
],
$recipients
[
1
],
$recipients
[
2
])),
''
,
FALSE
);
$this
->
addContactForm
(
$name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$recipients
[
0
],
$recipients
[
1
],
$recipients
[
2
])),
''
,
FALSE
);
$this
->
assertRaw
(
t
(
'Contact form %label has been added.'
,
array
(
'%label'
=>
$label
)));
// Try adding a form that already exists.
...
...
@@ -221,7 +221,7 @@ function testSiteWideContact() {
$label
=
$this
->
randomMachineName
(
16
);
$recipients
=
implode
(
','
,
array
(
$recipients
[
0
],
$recipients
[
1
],
$recipients
[
2
]));
$contact_form
=
drupal_
strtolower
(
$this
->
randomMachineName
(
16
));
$contact_form
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
16
));
$this
->
addContactForm
(
$contact_form
,
$label
,
$recipients
,
''
,
FALSE
);
$this
->
drupalGet
(
'admin/structure/contact'
);
$this
->
clickLink
(
t
(
'Edit'
));
...
...
core/modules/contact/src/Tests/ContactStorageTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\contact\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\config\Tests\SchemaCheckTestTrait
;
use
Drupal\contact\Entity\Message
;
...
...
@@ -53,7 +54,7 @@ public function testContactStorage() {
$this
->
drupalLogin
(
$admin_user
);
// Create first valid contact form.
$mail
=
'simpletest@example.com'
;
$this
->
addContactForm
(
$id
=
drupal_
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$mail
)),
''
,
TRUE
,
[
$this
->
addContactForm
(
$id
=
Unicode
::
strtolower
(
$this
->
randomMachineName
(
16
)),
$label
=
$this
->
randomMachineName
(
16
),
implode
(
','
,
array
(
$mail
)),
''
,
TRUE
,
[
'send_a_pony'
=>
1
,
]);
$this
->
assertRaw
(
t
(
'Contact form %label has been added.'
,
array
(
'%label'
=>
$label
)));
...
...
core/modules/datetime/src/Tests/DateTimeFieldTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\datetime\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Entity\Entity\EntityViewDisplay
;
use
Drupal\simpletest\WebTestBase
;
use
Drupal\Core\Datetime\DrupalDateTime
;
...
...
@@ -52,7 +53,7 @@ protected function setUp() {
$this
->
drupalLogin
(
$web_user
);
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
@@ -283,7 +284,7 @@ function testDefaultValue() {
$this
->
drupalCreateContentType
(
array
(
'type'
=>
'date_content'
));
// Create a field storage with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$field_storage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'node'
,
...
...
core/modules/entity_reference/src/EntityReferenceController.php
View file @
80eccb18
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\entity_reference
;
use
Drupal\Component\Utility\Tags
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Controller\ControllerBase
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
...
...
@@ -86,7 +87,7 @@ public function handleAutocomplete(Request $request, $type, $field_name, $entity
// Get the typed string, if exists from the URL.
$items_typed
=
$request
->
query
->
get
(
'q'
);
$items_typed
=
Tags
::
explode
(
$items_typed
);
$last_item
=
drupal_
strtolower
(
array_pop
(
$items_typed
));
$last_item
=
Unicode
::
strtolower
(
array_pop
(
$items_typed
));
$prefix
=
''
;
// The user entered a comma-separated list of entity labels, so we generate
...
...
core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\entity_reference\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -42,7 +43,7 @@ function testEntityReferenceDefaultValue() {
// Create a node to be referenced.
$referenced_node
=
$this
->
drupalCreateNode
(
array
(
'type'
=>
'referenced_content'
));
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$field_storage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'node'
,
...
...
core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\entity_reference\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Field\FieldItemListInterface
;
use
Drupal\Core\Field\FieldItemInterface
;
use
Drupal\Core\Language\LanguageInterface
;
...
...
@@ -51,7 +52,7 @@ protected function setUp() {
$this
->
vocabulary
=
entity_create
(
'taxonomy_vocabulary'
,
array
(
'name'
=>
$this
->
randomMachineName
(),
'vid'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'vid'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'langcode'
=>
LanguageInterface
::
LANGCODE_NOT_SPECIFIED
,
));
$this
->
vocabulary
->
save
();
...
...
@@ -152,7 +153,7 @@ public function testConfigEntityReferenceItem() {
// Make sure the computed term reflects updates to the term id.
$vocabulary2
=
entity_create
(
'taxonomy_vocabulary'
,
array
(
'name'
=>
$this
->
randomMachineName
(),
'vid'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'vid'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'langcode'
=>
LanguageInterface
::
LANGCODE_NOT_SPECIFIED
,
));
$vocabulary2
->
save
();
...
...
core/modules/field/src/Tests/Boolean/BooleanFieldTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests\Boolean
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\field\Entity\FieldConfig
;
use
Drupal\simpletest\WebTestBase
;
...
...
@@ -63,7 +64,7 @@ function testBooleanField() {
$label
=
$this
->
randomMachineName
();
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$this
->
field_storage
=
FieldStorageConfig
::
create
(
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
core/modules/field/src/Tests/Email/EmailFieldTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests\Email
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -53,7 +54,7 @@ protected function setUp() {
*/
function
testEmailField
()
{
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
core/modules/field/src/Tests/FieldAttachStorageTest.php
View file @
80eccb18
...
...
@@ -6,6 +6,7 @@
*/
namespace
Drupal\field\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\field\Entity\FieldConfig
;
/**
...
...
@@ -282,7 +283,7 @@ function testEntityCreateRenameBundle() {
$cardinality
=
$this
->
fieldTestData
->
field_storage
->
getCardinality
();
// Create a new bundle.
$new_bundle
=
'test_bundle_'
.
drupal_
strtolower
(
$this
->
randomMachineName
());
$new_bundle
=
'test_bundle_'
.
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_test_create_bundle
(
$new_bundle
,
NULL
,
$entity_type
);
// Add a field to that bundle.
...
...
@@ -299,7 +300,7 @@ function testEntityCreateRenameBundle() {
$this
->
assertEqual
(
count
(
$entity
->
{
$this
->
fieldTestData
->
field_name
}),
$cardinality
,
"Data is retrieved for the new bundle"
);
// Rename the bundle.
$new_bundle
=
'test_bundle_'
.
drupal_
strtolower
(
$this
->
randomMachineName
());
$new_bundle
=
'test_bundle_'
.
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_test_rename_bundle
(
$this
->
fieldTestData
->
field_definition
[
'bundle'
],
$new_bundle
,
$entity_type
);
// Check that the field definition has been updated.
...
...
@@ -321,7 +322,7 @@ function testEntityDeleteBundle() {
$this
->
createFieldWithStorage
(
''
,
$entity_type
);
// Create a new bundle.
$new_bundle
=
'test_bundle_'
.
drupal_
strtolower
(
$this
->
randomMachineName
());
$new_bundle
=
'test_bundle_'
.
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_test_create_bundle
(
$new_bundle
,
NULL
,
$entity_type
);
// Add a field to that bundle.
...
...
@@ -329,7 +330,7 @@ function testEntityDeleteBundle() {
entity_create
(
'field_config'
,
$this
->
fieldTestData
->
field_definition
)
->
save
();
// Create a second field for the test bundle
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$field_storage
=
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
$entity_type
,
...
...
core/modules/field/src/Tests/FieldCrudTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Entity\EntityStorageException
;
use
Drupal\Core\Field\FieldException
;
use
Drupal\field\Entity\FieldStorageConfig
;
...
...
@@ -44,7 +45,7 @@ function setUp() {
parent
::
setUp
();
$this
->
fieldStorageDefinition
=
array
(
'field_name'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'field_name'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'entity_type'
=>
'entity_test'
,
'type'
=>
'test_field'
,
);
...
...
core/modules/field/src/Tests/FieldUnitTestBase.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Language\LanguageInterface
;
use
Drupal\simpletest\KernelTestBase
;
...
...
@@ -89,7 +90,7 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t
$field
=
'field'
.
$suffix
;
$field_definition
=
'field_definition'
.
$suffix
;
$this
->
fieldTestData
->
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
.
$suffix
);
$this
->
fieldTestData
->
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
.
$suffix
);
$this
->
fieldTestData
->
$field_storage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$this
->
fieldTestData
->
$field_name
,
'entity_type'
=>
$entity_type
,
...
...
core/modules/field/src/Tests/Number/NumberFieldTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests\Number
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -42,7 +43,7 @@ protected function setUp() {
*/
function
testNumberDecimalField
()
{
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
@@ -132,7 +133,7 @@ function testNumberIntegerField() {
$maximum
=
rand
(
2000
,
4000
);
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
@@ -226,7 +227,7 @@ function testNumberIntegerField() {
*/
function
testNumberFloatField
()
{
// Create a field with settings to validate.
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
'entity_type'
=>
'entity_test'
,
...
...
@@ -311,9 +312,9 @@ function testNumberFloatField() {
* Test default formatter behavior
*/
function
testNumberFormatter
()
{
$type
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$float_field
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$integer_field
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$type
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$float_field
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$integer_field
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$thousand_separators
=
array
(
''
,
'.'
,
','
,
' '
,
chr
(
8201
),
"'"
);
$decimal_separators
=
array
(
'.'
,
','
);
$prefix
=
$this
->
randomMachineName
();
...
...
core/modules/field/src/Tests/TranslationTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\language\Entity\ConfigurableLanguage
;
/**
...
...
@@ -75,7 +76,7 @@ protected function setUp() {
$this
->
installConfig
(
array
(
'language'
));
$this
->
field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$this
->
field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$this
->
entity_type
=
'entity_test'
;
...
...
@@ -138,7 +139,7 @@ function testTranslatableFieldSaveLoad() {
}
// Test default values.
$field_name_default
=
drupal_
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$field_name_default
=
Unicode
::
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$field_storage_definition
=
$this
->
field_storage_definition
;
$field_storage_definition
[
'field_name'
]
=
$field_name_default
;
$field_storage
=
entity_create
(
'field_storage_config'
,
$field_storage_definition
);
...
...
core/modules/field/src/Tests/TranslationWebTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\language\Entity\ConfigurableLanguage
;
/**
...
...
@@ -54,7 +55,7 @@ class TranslationWebTest extends FieldTestBase {
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$this
->
field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
()
.
'_field_name'
);
$field_storage
=
array
(
'field_name'
=>
$this
->
field_name
,
...
...
core/modules/field_ui/src/Tests/FieldUiTestBase.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\field_ui\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Language\LanguageInterface
;
use
Drupal\simpletest\WebTestBase
;
...
...
@@ -38,7 +39,7 @@ protected function setUp() {
$vocabulary
=
entity_create
(
'taxonomy_vocabulary'
,
array
(
'name'
=>
$this
->
randomMachineName
(),
'description'
=>
$this
->
randomMachineName
(),
'vid'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'vid'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'langcode'
=>
LanguageInterface
::
LANGCODE_NOT_SPECIFIED
,
'help'
=>
''
,
'nodes'
=>
array
(
'article'
=>
'article'
),
...
...
core/modules/filter/src/Tests/FilterAdminTest.php
View file @
80eccb18
...
...
@@ -8,6 +8,7 @@
namespace
Drupal\filter\Tests
;
use
Drupal\Component\Utility\String
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -98,7 +99,7 @@ function testFormatAdmin() {
// Add text format.
$this
->
drupalGet
(
'admin/config/content/formats'
);
$this
->
clickLink
(
'Add text format'
);
$format_id
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$format_id
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$name
=
$this
->
randomMachineName
();
$edit
=
array
(
'format'
=>
$format_id
,
...
...
@@ -231,7 +232,7 @@ function testFilterAdmin() {
// Add format.
$edit
=
array
();
$edit
[
'format'
]
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$edit
[
'format'
]
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$edit
[
'name'
]
=
$this
->
randomMachineName
();
$edit
[
'roles['
.
DRUPAL_AUTHENTICATED_RID
.
']'
]
=
1
;
$edit
[
'filters['
.
$second_filter
.
'][status]'
]
=
TRUE
;
...
...
core/modules/filter/src/Tests/FilterDefaultFormatTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\filter\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -34,7 +35,7 @@ function testDefaultTextFormats() {
$formats
=
array
();
for
(
$i
=
0
;
$i
<
2
;
$i
++
)
{
$edit
=
array
(
'format'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'format'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'name'
=>
$this
->
randomMachineName
(),
);
$this
->
drupalPostForm
(
'admin/config/content/formats/add'
,
$edit
,
t
(
'Save configuration'
));
...
...
core/modules/filter/src/Tests/FilterFormatAccessTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\filter\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Access\AccessResult
;
use
Drupal\simpletest\WebTestBase
;
...
...
@@ -86,7 +87,7 @@ protected function setUp() {
$formats
=
array
();
for
(
$i
=
0
;
$i
<
3
;
$i
++
)
{
$edit
=
array
(
'format'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'format'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'name'
=>
$this
->
randomMachineName
(),
);
$this
->
drupalPostForm
(
'admin/config/content/formats/add'
,
$edit
,
t
(
'Save configuration'
));
...
...
core/modules/filter/src/Tests/FilterHooksTest.php
View file @
80eccb18
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\filter\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\simpletest\WebTestBase
;
/**
...
...
@@ -41,7 +42,7 @@ function testFilterHooks() {
// Add a text format.
$name
=
$this
->
randomMachineName
();
$edit
=
array
();
$edit
[
'format'
]
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$edit
[
'format'
]
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$edit
[
'name'
]
=
$name
;
$edit
[
'roles['
.
DRUPAL_ANONYMOUS_RID
.
']'
]
=
1
;
$this
->
drupalPostForm
(
'admin/config/content/formats/add'
,
$edit
,
t
(
'Save configuration'
));
...
...
core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
View file @
80eccb18
...
...
@@ -6,6 +6,7 @@
*/
namespace
Drupal\image\Tests
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\file\Entity\File
;
/**
...
...
@@ -300,7 +301,7 @@ public function testDefaultImages() {
*/
public
function
testInvalidDefaultImage
()
{
$field_storage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
drupal_
strtolower
(
$this
->
randomMachineName
()),
'field_name'
=>
Unicode
::
strtolower
(
$this
->
randomMachineName
()),
'entity_type'
=>
'node'
,
'type'
=>
'image'
,
'settings'
=>
array
(
...
...
core/modules/link/src/Tests/LinkFieldTest.php
View file @
80eccb18
...
...
@@ -62,7 +62,7 @@ protected function setUp() {
* Tests link field URL validation.
*/
function
testURLValidation
()
{
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
// Create a field with settings to validate.
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
...
...
@@ -182,7 +182,7 @@ protected function assertInvalidEntries($field_name, array $invalid_entries) {
* Tests the link title settings of a link field.
*/
function
testLinkTitle
()
{
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
// Create a field with settings to validate.
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
...
...
@@ -296,7 +296,7 @@ function testLinkTitle() {
* Tests the default 'link' formatter.
*/
function
testLinkFormatter
()
{
$field_name
=
drupal_
strtolower
(
$this
->
randomMachineName
());
$field_name
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
// Create a field with settings to validate.
$this
->
fieldStorage
=
entity_create
(
'field_storage_config'
,
array
(
'field_name'
=>
$field_name
,
...
...
@@ -436,7 +436,7 @@ function testLinkFormatter() {
* merged, since they involve different configuration and output.
*/
function
testLinkSeparateFormatter
()
{