Commit 01372dd5 authored by alexpott's avatar alexpott

Issue #2323521 by herom: Fixed a couple of t() calls in core.

parent 06278dc4
......@@ -118,14 +118,11 @@ protected function checkEncoding() {
$this->pass(t('Database is encoded in UTF-8'));
}
else {
$replacements = array(
$this->fail(t('The %driver database must use %encoding encoding to work with Drupal. Recreate the database with %encoding encoding. See !link for more details.', array(
'%encoding' => 'UTF8',
'%driver' => $this->name(),
'!link' => '<a href="INSTALL.pgsql.txt">INSTALL.pgsql.txt</a>'
);
$text = 'The %driver database must use %encoding encoding to work with Drupal.';
$text .= 'Recreate the database with %encoding encoding. See !link for more details.';
$this->fail(t($text, $replacements));
)));
}
}
catch (\Exception $e) {
......
......@@ -182,7 +182,7 @@ function template_preprocess_file_upload_help(&$variables) {
$descriptions[] = t('!size limit.', array('!size' => format_size($upload_validators['file_validate_size'][0])));
}
if (isset($upload_validators['file_validate_extensions'])) {
$descriptions[] = t('Allowed types: !extensions.', array('!extensions' => String::checkPlain($upload_validators['file_validate_extensions'][0])));
$descriptions[] = t('Allowed types: @extensions.', array('@extensions' => $upload_validators['file_validate_extensions'][0]));
}
if (isset($upload_validators['file_validate_image_resolution'])) {
......
......@@ -184,7 +184,7 @@ function testImageFieldSettings() {
$this->drupalGet('node/add/article');
$this->assertText(t('50 KB limit.'), 'Image widget max file size is displayed on article form.');
$this->assertText(t('Allowed types: ' . $test_image_extension . '.'), 'Image widget allowed file types displayed on article form.');
$this->assertText(t('Allowed types: @extensions.', array('@extensions' => $test_image_extension)), 'Image widget allowed file types displayed on article form.');
$this->assertText(t('Images must be larger than 10x10 pixels. Images larger than 100x100 pixels will be resized.'), 'Image widget allowed resolution displayed on article form.');
// We have to create the article first and then edit it because the alt
......
......@@ -44,7 +44,7 @@ function testResolution() {
}
}
$this->uploadNodeImage($image_that_is_too_small, $field_name, 'article');
$this->assertText(t('The specified file ' . $image_that_is_too_small->filename . ' could not be uploaded. The image is too small; the minimum dimensions are 50x50 pixels.'), 'Node save failed when minimum image resolution was not met.');
$this->assertRaw(t('The specified file %name could not be uploaded.', array('%name' => $image_that_is_too_small->filename)) . ' ' . t('The image is too small; the minimum dimensions are %dimensions pixels.', array('%dimensions' => '50x50')), 'Node save failed when minimum image resolution was not met.');
$this->uploadNodeImage($image_that_is_too_big, $field_name, 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'), 'Image exceeding max resolution was properly resized.');
}
......
......@@ -382,8 +382,8 @@ function testFieldUpdateIndexesWithData() {
// Verify the indexes we will create do not exist yet.
foreach ($tables as $table) {
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value'), t("No index named value exists in $table"));
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value_format'), t("No index named value_format exists in $table"));
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value'), t("No index named value exists in @table", array('@table' => $table)));
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, 'value_format'), t("No index named value_format exists in @table", array('@table' => $table)));
}
// Add data so the table cannot be dropped.
......@@ -399,15 +399,15 @@ function testFieldUpdateIndexesWithData() {
$field_storage->indexes = array('value' => array(array('value', 255)));
$field_storage->save();
foreach ($tables as $table) {
$this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value created in $table"));
$this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value created in @table", array('@table' => $table)));
}
// Add a different index, removing the existing custom one.
$field_storage->indexes = array('value_format' => array(array('value', 127), array('format', 127)));
$field_storage->save();
foreach ($tables as $table) {
$this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value_format"), t("Index on value_format created in $table"));
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value removed in $table"));
$this->assertTrue(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value_format"), t("Index on value_format created in @table", array('@table' => $table)));
$this->assertFalse(Database::getConnection()->schema()->indexExists($table, "{$field_name}_value"), t("Index on value removed in @table", array('@table' => $table)));
}
// Verify that the tables were not dropped in the process.
......
......@@ -301,21 +301,32 @@ function testSelect() {
// Posting without any values should throw validation errors.
$this->drupalPostForm(NULL, array(), 'Submit');
$this->assertNoText(t($error, array('!name' => $form['select']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['select_required']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['select_optional']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['empty_value']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['empty_value_one']['#title'])));
$this->assertText(t($error, array('!name' => $form['no_default']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['no_default_optional']['#title'])));
$this->assertText(t($error, array('!name' => $form['no_default_empty_option']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['no_default_empty_option_optional']['#title'])));
$this->assertText(t($error, array('!name' => $form['no_default_empty_value']['#title'])));
$this->assertText(t($error, array('!name' => $form['no_default_empty_value_one']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['no_default_empty_value_optional']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['multiple']['#title'])));
$this->assertNoText(t($error, array('!name' => $form['multiple_no_default']['#title'])));
$this->assertText(t($error, array('!name' => $form['multiple_no_default_required']['#title'])));
$no_errors = array(
'select',
'select_required',
'select_optional',
'empty_value',
'empty_value_one',
'no_default_optional',
'no_default_empty_option_optional',
'no_default_empty_value_optional',
'multiple',
'multiple_no_default',
);
foreach ($no_errors as $key) {
$this->assertNoText(t('!name field is required.', array('!name' => $form[$key]['#title'])));
}
$expected_errors = array(
'no_default',
'no_default_empty_option',
'no_default_empty_value',
'no_default_empty_value_one',
'multiple_no_default_required',
);
foreach ($expected_errors as $key) {
$this->assertText(t('!name field is required.', array('!name' => $form[$key]['#title'])));
}
// Post values for required fields.
$edit = array(
......
......@@ -112,7 +112,7 @@ function testDateFormatConfiguration() {
$this->clickLink(t('Delete'));
$this->drupalPostForm('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete', array(), t('Remove'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('Removed date format ' . $name), 'Custom date format removed.');
$this->assertRaw(t('Removed date format %format.', array('%format' => $name)), 'Custom date format removed.');
// Make sure the date does not exist in config.
$date_format = entity_load('date_format', $date_format_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment