summaryrefslogtreecommitdiff
path: root/modules/image/image.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/image/image.test')
-rw-r--r--modules/image/image.test174
1 files changed, 87 insertions, 87 deletions
diff --git a/modules/image/image.test b/modules/image/image.test
index 9f0604d1d..a31dfc240 100644
--- a/modules/image/image.test
+++ b/modules/image/image.test
@@ -133,11 +133,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
function testImageStylePath() {
$actual = image_style_path($this->style_name, 'public://foo/bar.gif');
$expected = 'public://styles/' . $this->style_name . '/foo/bar.gif';
- $this->assertEqual($actual, $expected, t('Got the path for a file URI.'));
+ $this->assertEqual($actual, $expected, 'Got the path for a file URI.');
$actual = image_style_path($this->style_name, 'foo/bar.gif');
$expected = 'public://styles/' . $this->style_name . '/foo/bar.gif';
- $this->assertEqual($actual, $expected, t('Got the path for a relative file path.'));
+ $this->assertEqual($actual, $expected, 'Got the path for a relative file path.');
}
/**
@@ -167,53 +167,53 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
// Create the directories for the styles.
$d = $scheme . '://styles/' . $this->style_name;
$status = file_prepare_directory($d, FILE_CREATE_DIRECTORY);
- $this->assertNotIdentical(FALSE, $status, t('Created the directory for the generated images for the test style.'));
+ $this->assertNotIdentical(FALSE, $status, 'Created the directory for the generated images for the test style.');
// Create a working copy of the file.
$files = $this->drupalGetTestFiles('image');
$file = reset($files);
$image_info = image_get_info($file->uri);
$original_uri = file_unmanaged_copy($file->uri, $scheme . '://', FILE_EXISTS_RENAME);
- $this->assertNotIdentical(FALSE, $original_uri, t('Created the generated image file.'));
+ $this->assertNotIdentical(FALSE, $original_uri, 'Created the generated image file.');
// Get the URL of a file that has not been generated yet and try to access
// it before image_style_url has been called.
$generated_uri = $scheme . '://styles/' . $this->style_name . '/' . basename($original_uri);
- $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+ $this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$expected_generate_url = url('image/generate/' . $this->style_name . '/' . $scheme . '/' . basename($original_uri), array('absolute' => TRUE));
$this->drupalGet($expected_generate_url);
- $this->assertResponse(403, t('Access to generate URL was denied.'));
+ $this->assertResponse(403, 'Access to generate URL was denied.');
// Check that a generate URL is returned.
$actual_generate_url = image_style_url($this->style_name, $original_uri);
- $this->assertEqual($actual_generate_url, $expected_generate_url, t('Got the generate URL for a non-existent file.'));
+ $this->assertEqual($actual_generate_url, $expected_generate_url, 'Got the generate URL for a non-existent file.');
// Fetch the URL that generates the file while another process appears to
// be generating the same file (this is signaled using a lock).
$lock_name = 'image_style_generate:' . $this->style_name . ':' . drupal_hash_base64($original_uri);
- $this->assertTrue(lock_acquire($lock_name), t('Lock was acquired.'));
+ $this->assertTrue(lock_acquire($lock_name), 'Lock was acquired.');
$this->drupalGet($expected_generate_url);
- $this->assertResponse(503, t('Service Unavailable response received.'));
- $this->assertTrue($this->drupalGetHeader('Retry-After'), t('Retry-After header received.'));
+ $this->assertResponse(503, 'Service Unavailable response received.');
+ $this->assertTrue($this->drupalGetHeader('Retry-After'), 'Retry-After header received.');
lock_release($lock_name);
// Fetch the URL that generates the file.
$this->drupalGet($expected_generate_url);
- $this->assertTrue(file_exists($generated_uri), t('Generated file was created.'));
- $this->assertRaw(file_get_contents($generated_uri), t('URL returns expected file.'));
+ $this->assertTrue(file_exists($generated_uri), 'Generated file was created.');
+ $this->assertRaw(file_get_contents($generated_uri), 'URL returns expected file.');
$generated_image_info = image_get_info($generated_uri);
- $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], t('Expected Content-Type was reported.'));
- $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], t('Expected Content-Length was reported.'));
- $this->assertTrue(lock_may_be_available($lock_name), t('Lock was released.'));
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], 'Expected Content-Type was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], 'Expected Content-Length was reported.');
+ $this->assertTrue(lock_may_be_available($lock_name), 'Lock was released.');
// Check that the URL points directly to the generated file.
$expected_generated_url = file_create_url($generated_uri);
$actual_generated_url = image_style_url($this->style_name, $original_uri);
$this->drupalGet($expected_generated_url);
- $this->assertEqual($actual_generated_url, $expected_generated_url, t('Got the download URL for an existing file.'));
- $this->assertRaw(file_get_contents($generated_uri), t('URL returns expected file.'));
- $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], t('Expected Content-Type was reported.'));
- $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], t('Expected Content-Length was reported.'));
+ $this->assertEqual($actual_generated_url, $expected_generated_url, 'Got the download URL for an existing file.');
+ $this->assertRaw(file_get_contents($generated_uri), 'URL returns expected file.');
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], 'Expected Content-Type was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], 'Expected Content-Length was reported.');
}
}
@@ -239,13 +239,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
* Test the image_resize_effect() function.
*/
function testResizeEffect() {
- $this->assertTrue(image_resize_effect($this->image, array('width' => 1, 'height' => 2)), t('Function returned the expected value.'));
+ $this->assertTrue(image_resize_effect($this->image, array('width' => 1, 'height' => 2)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['resize'][0][1], 1, t('Width was passed correctly'));
- $this->assertEqual($calls['resize'][0][2], 2, t('Height was passed correctly'));
+ $this->assertEqual($calls['resize'][0][1], 1, 'Width was passed correctly');
+ $this->assertEqual($calls['resize'][0][2], 2, 'Height was passed correctly');
}
/**
@@ -253,13 +253,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testScaleEffect() {
// @todo: need to test upscaling.
- $this->assertTrue(image_scale_effect($this->image, array('width' => 10, 'height' => 10)), t('Function returned the expected value.'));
+ $this->assertTrue(image_scale_effect($this->image, array('width' => 10, 'height' => 10)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['resize'][0][1], 10, t('Width was passed correctly'));
- $this->assertEqual($calls['resize'][0][2], 5, t('Height was based off aspect ratio and passed correctly'));
+ $this->assertEqual($calls['resize'][0][1], 10, 'Width was passed correctly');
+ $this->assertEqual($calls['resize'][0][2], 5, 'Height was based off aspect ratio and passed correctly');
}
/**
@@ -267,42 +267,42 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testCropEffect() {
// @todo should test the keyword offsets.
- $this->assertTrue(image_crop_effect($this->image, array('anchor' => 'top-1', 'width' => 3, 'height' => 4)), t('Function returned the expected value.'));
+ $this->assertTrue(image_crop_effect($this->image, array('anchor' => 'top-1', 'width' => 3, 'height' => 4)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['crop'][0][1], 0, t('X was passed correctly'));
- $this->assertEqual($calls['crop'][0][2], 1, t('Y was passed correctly'));
- $this->assertEqual($calls['crop'][0][3], 3, t('Width was passed correctly'));
- $this->assertEqual($calls['crop'][0][4], 4, t('Height was passed correctly'));
+ $this->assertEqual($calls['crop'][0][1], 0, 'X was passed correctly');
+ $this->assertEqual($calls['crop'][0][2], 1, 'Y was passed correctly');
+ $this->assertEqual($calls['crop'][0][3], 3, 'Width was passed correctly');
+ $this->assertEqual($calls['crop'][0][4], 4, 'Height was passed correctly');
}
/**
* Test the image_scale_and_crop_effect() function.
*/
function testScaleAndCropEffect() {
- $this->assertTrue(image_scale_and_crop_effect($this->image, array('width' => 5, 'height' => 10)), t('Function returned the expected value.'));
+ $this->assertTrue(image_scale_and_crop_effect($this->image, array('width' => 5, 'height' => 10)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize', 'crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['crop'][0][1], 7.5, t('X was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][2], 0, t('Y was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][3], 5, t('Width was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][4], 10, t('Height was computed and passed correctly'));
+ $this->assertEqual($calls['crop'][0][1], 7.5, 'X was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][2], 0, 'Y was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][3], 5, 'Width was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][4], 10, 'Height was computed and passed correctly');
}
/**
* Test the image_desaturate_effect() function.
*/
function testDesaturateEffect() {
- $this->assertTrue(image_desaturate_effect($this->image, array()), t('Function returned the expected value.'));
+ $this->assertTrue(image_desaturate_effect($this->image, array()), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('desaturate'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual(count($calls['desaturate'][0]), 1, t('Only the image was passed.'));
+ $this->assertEqual(count($calls['desaturate'][0]), 1, 'Only the image was passed.');
}
/**
@@ -310,13 +310,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testRotateEffect() {
// @todo: need to test with 'random' => TRUE
- $this->assertTrue(image_rotate_effect($this->image, array('degrees' => 90, 'bgcolor' => '#fff')), t('Function returned the expected value.'));
+ $this->assertTrue(image_rotate_effect($this->image, array('degrees' => 90, 'bgcolor' => '#fff')), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('rotate'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['rotate'][0][1], 90, t('Degrees were passed correctly'));
- $this->assertEqual($calls['rotate'][0][2], 0xffffff, t('Background color was passed correctly'));
+ $this->assertEqual($calls['rotate'][0][1], 90, 'Degrees were passed correctly');
+ $this->assertEqual($calls['rotate'][0][2], 0xffffff, 'Background color was passed correctly');
}
}
@@ -400,7 +400,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
'name' => $style_name,
);
$this->drupalPost('admin/config/media/image-styles/add', $edit, t('Create new style'));
- $this->assertRaw(t('Style %name was created.', array('%name' => $style_name)), t('Image style successfully created.'));
+ $this->assertRaw(t('Style %name was created.', array('%name' => $style_name)), 'Image style successfully created.');
// Add effect form.
@@ -422,7 +422,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
foreach ($style['effects'] as $ieid => $effect) {
$this->drupalGet($style_path . '/effects/' . $ieid);
foreach ($effect_edits[$effect['name']] as $field => $value) {
- $this->assertFieldByName($field, $value, t('The %field field in the %effect effect has the correct value of %value.', array('%field' => $field, '%effect' => $effect['name'], '%value' => $value)));
+ $this->assertFieldByName($field, $value, 'The ' . $field . ' field in the ' . $effect['name'] . ' effect has the correct value of ' . $value . '.');
}
}
@@ -438,7 +438,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$order_correct = FALSE;
}
}
- $this->assertTrue($order_correct, t('The order of the effects is correctly set by default.'));
+ $this->assertTrue($order_correct, 'The order of the effects is correctly set by default.');
// Test the style overview form.
// Change the name of the style and adjust the weights of effects.
@@ -454,7 +454,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Create an image to make sure it gets flushed after saving.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
$this->drupalPost($style_path, $edit, t('Update style'));
@@ -463,12 +463,12 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Check that the URL was updated.
$this->drupalGet($style_path);
- $this->assertResponse(200, t('Image style %original renamed to %new', array('%original' => $style['name'], '%new' => $style_name)));
+ $this->assertResponse(200, 'Image style ' . $style['name'] . ' renamed to ' . $style_name);
// Check that the image was flushed after updating the style.
// This is especially important when renaming the style. Make sure that
// the old image directory has been deleted.
- $this->assertEqual($this->getImageCount($style), 0, t('Image style %style was flushed after renaming the style and updating the order of effects.', array('%style' => $style['name'])));
+ $this->assertEqual($this->getImageCount($style), 0, 'Image style ' . $style['name'] . ' was flushed after renaming the style and updating the order of effects.');
// Load the style by the new name with the new weights.
drupal_static_reset('image_styles');
@@ -483,18 +483,18 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$order_correct = FALSE;
}
}
- $this->assertTrue($order_correct, t('The order of the effects is correctly set by default.'));
+ $this->assertTrue($order_correct, 'The order of the effects is correctly set by default.');
// Image effect deletion form.
// Create an image to make sure it gets flushed after deleting an effect.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Test effect deletion form.
$effect = array_pop($style['effects']);
$this->drupalPost($style_path . '/effects/' . $effect['ieid'] . '/delete', array(), t('Delete'));
- $this->assertRaw(t('The image effect %name has been deleted.', array('%name' => $effect['label'])), t('Image effect deleted.'));
+ $this->assertRaw(t('The image effect %name has been deleted.', array('%name' => $effect['label'])), 'Image effect deleted.');
// Style deletion form.
@@ -503,10 +503,10 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Confirm the style directory has been removed.
$directory = file_directory_path() . '/styles/' . $style_name;
- $this->assertFalse(is_dir($directory), t('Image style %style directory removed on style deletion.', array('%style' => $style['name'])));
+ $this->assertFalse(is_dir($directory), 'Image style ' . $style['name'] . ' directory removed on style deletion.');
drupal_static_reset('image_styles');
- $this->assertFalse(image_style_load($style_name), t('Image style %style successfully deleted.', array('%style' => $style['name'])));
+ $this->assertFalse(image_style_load($style_name), 'Image style ' . $style['name'] . ' successfully deleted.');
}
@@ -522,28 +522,28 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Ensure deleting a default is not possible.
$this->drupalGet($delete_path);
- $this->assertText(t('Page not found'), t('Default styles may not be deleted.'));
+ $this->assertText(t('Page not found'), 'Default styles may not be deleted.');
// Ensure that editing a default is not possible (without overriding).
$this->drupalGet($edit_path);
- $this->assertNoField('edit-name', t('Default styles may not be renamed.'));
- $this->assertNoField('edit-submit', t('Default styles may not be edited.'));
- $this->assertNoField('edit-add', t('Default styles may not have new effects added.'));
+ $this->assertNoField('edit-name', 'Default styles may not be renamed.');
+ $this->assertNoField('edit-submit', 'Default styles may not be edited.');
+ $this->assertNoField('edit-add', 'Default styles may not have new effects added.');
// Create an image to make sure the default works before overriding.
drupal_static_reset('image_styles');
$style = image_style_load($style_name);
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Verify that effects attached to a default style do not have an ieid key.
foreach ($style['effects'] as $effect) {
- $this->assertFalse(isset($effect['ieid']), t('The %effect effect does not have an ieid.', array('%effect' => $effect['name'])));
+ $this->assertFalse(isset($effect['ieid']), 'The ' . $effect['name'] . ' effect does not have an ieid.');
}
// Override the default.
$this->drupalPost($edit_path, array(), t('Override defaults'));
- $this->assertRaw(t('The %style style has been overridden, allowing you to change its settings.', array('%style' => $style_name)), t('Default image style may be overridden.'));
+ $this->assertRaw(t('The %style style has been overridden, allowing you to change its settings.', array('%style' => $style_name)), 'Default image style may be overridden.');
// Add sample effect to the overridden style.
$this->drupalPost($edit_path, array('new' => 'image_desaturate'), t('Add'));
@@ -552,22 +552,22 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Verify that effects attached to the style have an ieid now.
foreach ($style['effects'] as $effect) {
- $this->assertTrue(isset($effect['ieid']), t('The %effect effect has an ieid.', array('%effect' => $effect['name'])));
+ $this->assertTrue(isset($effect['ieid']), 'The ' . $effect['name'] . ' effect has an ieid.');
}
// The style should now have 2 effect, the original scale provided by core
// and the desaturate effect we added in the override.
$effects = array_values($style['effects']);
- $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the overridden style.'));
- $this->assertEqual($effects[1]['name'], 'image_desaturate', t('The added effect exists in the overridden style.'));
+ $this->assertEqual($effects[0]['name'], 'image_scale', 'The default effect still exists in the overridden style.');
+ $this->assertEqual($effects[1]['name'], 'image_desaturate', 'The added effect exists in the overridden style.');
// Check that we are unable to rename an overridden style.
$this->drupalGet($edit_path);
- $this->assertNoField('edit-name', t('Overridden styles may not be renamed.'));
+ $this->assertNoField('edit-name', 'Overridden styles may not be renamed.');
// Create an image to ensure the override works properly.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Revert the image style.
$this->drupalPost($revert_path, array(), t('Revert'));
@@ -576,8 +576,8 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// The style should now have the single effect for scale.
$effects = array_values($style['effects']);
- $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the reverted style.'));
- $this->assertFalse(array_key_exists(1, $effects), t('The added effect has been removed in the reverted style.'));
+ $this->assertEqual($effects[0]['name'], 'image_scale', 'The default effect still exists in the reverted style.');
+ $this->assertFalse(array_key_exists(1, $effects), 'The added effect has been removed in the reverted style.');
}
/**
@@ -602,7 +602,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Test that image is displayed using newly created style.
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style @style.', array('@style' => $style_name)));
+ $this->assertRaw(image_style_url($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style ' . $style_name . '.');
// Rename the style and make sure the image field is updated.
$new_style_name = strtolower($this->randomName(10));
@@ -610,9 +610,9 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
'name' => $new_style_name,
);
$this->drupalPost('admin/config/media/image-styles/edit/' . $style_name, $edit, t('Update style'));
- $this->assertText(t('Changes to the style have been saved.'), t('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name)));
+ $this->assertText(t('Changes to the style have been saved.'), 'Style ' . $style_name . ' was renamed to ' . $new_style_name . '.');
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.'));
+ $this->assertRaw(image_style_url($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style replacement style.');
// Delete the style and choose a replacement style.
$edit = array(
@@ -623,7 +623,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$this->assertRaw($message, $message);
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.'));
+ $this->assertRaw(image_style_url('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style replacement style.');
}
}
@@ -658,7 +658,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
'getsize' => TRUE,
);
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Default formatter displaying correctly on full node view.');
// Test the image linked to file formatter.
$instance = field_info_instance('node', $field_name, 'article');
@@ -666,14 +666,14 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
field_update_instance($instance);
$default_output = l(theme('image', $image_info), file_create_url($image_uri), array('html' => TRUE));
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image linked to file formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image linked to file formatter displaying correctly on full node view.');
// Test the image linked to content formatter.
$instance['display']['default']['type'] = 'image_link_content';
field_update_instance($instance);
$default_output = l(theme('image', $image_info), 'node/' . $nid, array('html' => TRUE, 'attributes' => array('class' => 'active')));
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image linked to content formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image linked to content formatter displaying correctly on full node view.');
// Test the image style 'thumbnail' formatter.
$instance['display']['default']['type'] = 'image__thumbnail';
@@ -685,7 +685,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$image_info['getsize'] = FALSE;
$default_output = theme('image', $image_info);
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image style thumbnail formatter displaying correctly on full node view.');
}
/**
@@ -710,16 +710,16 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$instance = field_info_instance('node', $field_name, 'article');
$this->drupalGet('node/add/article');
- $this->assertText(t('Files must be less than 50 KB.'), t('Image widget max file size is displayed on article form.'));
- $this->assertText(t('Allowed file types: ' . $test_image_extension . '.'), t('Image widget allowed file types displayed on article form.'));
- $this->assertText(t('Images must be between 10x10 and 100x100 pixels.'), t('Image widget allowed resolution displayed on article form.'));
+ $this->assertText(t('Files must be less than 50 KB.'), 'Image widget max file size is displayed on article form.');
+ $this->assertText(t('Allowed file types: ' . $test_image_extension . '.'), 'Image widget allowed file types displayed on article form.');
+ $this->assertText(t('Images must be between 10x10 and 100x100 pixels.'), 'Image widget allowed resolution displayed on article form.');
// We have to create the article first and then edit it because the alt
// and title fields do not display until the image has been attached.
$nid = $this->uploadNodeImage($test_image, $field_name, 'article');
$this->drupalGet('node/' . $nid . '/edit');
- $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][alt]', '', t('Alt field displayed on article form.'));
- $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][title]', '', t('Title field displayed on article form.'));
+ $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][alt]', '', 'Alt field displayed on article form.');
+ $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][title]', '', 'Title field displayed on article form.');
// Verify that the attached image is being previewed using the 'medium'
// style.
$node = node_load($nid, NULL, TRUE);
@@ -728,7 +728,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
'getsize' => FALSE,
);
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style."));
+ $this->assertRaw($default_output, "Preview image is displayed using 'medium' style.");
// Add alt/title fields to the image and verify that they are displayed.
$image_info = array(
@@ -743,7 +743,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
);
$this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t('Image displayed using user supplied alt and title attributes.'));
+ $this->assertRaw($default_output, 'Image displayed using user supplied alt and title attributes.');
}
/**
@@ -760,7 +760,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$this->drupalGet('node/' . $node->nid);
// Verify that no image is displayed on the page by checking for the class
// that would be used on the image field.
- $this->assertNoPattern('<div class="(.*?)field-name-' . strtr($field_name, '_', '-') . '(.*?)">', t('No image displayed when no image is attached and no default image specified.'));
+ $this->assertNoPattern('<div class="(.*?)field-name-' . strtr($field_name, '_', '-') . '(.*?)">', 'No image displayed when no image is attached and no default image specified.');
// Add a default image to the imagefield instance.
$images = $this->drupalGetTestFiles('image');
@@ -774,7 +774,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$image = file_load($field['settings']['default_image']);
$default_output = theme('image', array('path' => $image->uri, 'getsize' => TRUE));
$this->drupalGet('node/' . $node->nid);
- $this->assertRaw($default_output, t('Default image displayed when no user supplied image is present.'));
+ $this->assertRaw($default_output, 'Default image displayed when no user supplied image is present.');
// Create a node with an image attached and ensure that the default image
// is not displayed.
@@ -786,8 +786,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
);
$image_output = theme('image', $image_info);
$this->drupalGet('node/' . $nid);
- $this->assertNoRaw($default_output, t('Default image is not displayed when user supplied image is present.'));
- $this->assertRaw($image_output, t('User supplied image is displayed.'));
+ $this->assertNoRaw($default_output, 'Default image is not displayed when user supplied image is present.');
+ $this->assertRaw($image_output, 'User supplied image is displayed.');
// Remove default image from the field and make sure it is no longer used.
$edit = array(
@@ -797,7 +797,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
// Clear field info cache so the new default image is detected.
field_info_cache_clear();
$field = field_info_field($field_name);
- $this->assertFalse($field['settings']['default_image'], t('Default image removed from field.'));
+ $this->assertFalse($field['settings']['default_image'], 'Default image removed from field.');
}
}
@@ -843,8 +843,8 @@ class ImageFieldValidateTestCase extends ImageFieldTestCase {
}
}
$nid = $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.'), t('Node save failed when minimum image resolution was not met.'));
+ $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.');
$nid = $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.'), t('Image exceeding max resolution was properly resized.'));
+ $this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'), 'Image exceeding max resolution was properly resized.');
}
}