Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
80eccb18
Commit
80eccb18
authored
Nov 03, 2014
by
alexpott
Browse files
Issue
#2361823
by rpayanm, javivf: Remove usage of drupal_strtolower().
parent
51fcd31c
Changes
52
Hide whitespace changes
Inline
Side-by-side
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
,
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment