$this->assertResponse(200,t('Image style %original renamed to %new',array('%original'=>$style['label'],'%new'=>$style_name)));
$this->assertResponse(200,format_string('Image style %original renamed to %new',array('%original'=>$style['label'],'%new'=>$style_name)));
// Check that the image was flushed after updating the style.
// This is especially important when renaming the style. Make sure that
...
...
@@ -190,7 +190,7 @@ function testStyle() {
$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.
...
...
@@ -242,7 +242,7 @@ function testStyleReplacement() {
// Test that image is displayed using newly created style.
$this->drupalGet('node/'.$nid);
$this->assertRaw(image_style_url($style_name,file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),t('Image displayed using style @style.',array('@style'=>$style_name)));
$this->assertRaw(image_style_url($style_name,file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),format_string('Image displayed using style @style.',array('@style'=>$style_name)));
// Rename the style and make sure the image field is updated.
$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.'),format_string('Style %name was renamed to %new_name.',array('%name'=>$style_name,'%new_name'=>$new_style_name)));
$this->drupalGet('node/'.$nid);
$this->assertRaw(image_style_url($new_style_name,file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),t('Image displayed using style replacement style.'));
$this->assertRaw(image_style_url($new_style_name,file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),'Image displayed using style replacement style.');
// Delete the style and choose a replacement style.
$edit=array(
...
...
@@ -265,7 +265,7 @@ function testStyleReplacement() {
$this->assertRaw($message);
$this->drupalGet('node/'.$nid);
$this->assertRaw(image_style_url('thumbnail',file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),t('Image displayed using style replacement style.'));
$this->assertRaw(image_style_url('thumbnail',file_load($node->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['fid'])->uri),'Image displayed using style replacement style.');
$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.');
// Verify that the image can be downloaded.
$this->assertEqual(file_get_contents($test_image->uri),$this->drupalGet(file_create_url($image_uri)),t('File was downloaded successfully.'));
$this->assertEqual(file_get_contents($test_image->uri),$this->drupalGet(file_create_url($image_uri)),'File was downloaded successfully.');
if($scheme=='private'){
// Only verify HTTP headers when using private scheme and the headers are
// sent by Drupal.
$this->assertEqual($this->drupalGetHeader('Content-Type'),'image/png',t('Content-Type header was sent.'));
$this->assertEqual($this->drupalGetHeader('Content-Disposition'),'inline; filename="'.$test_image->filename.'"',t('Content-Disposition header was sent.'));
$this->assertTrue(strstr($this->drupalGetHeader('Cache-Control'),'private')!==FALSE,t('Cache-Control header was sent.'));
$this->assertEqual($this->drupalGetHeader('Content-Type'),'image/png','Content-Type header was sent.');
$this->assertEqual($this->drupalGetHeader('Content-Disposition'),'inline; filename="'.$test_image->filename.'"','Content-Disposition header was sent.');
$this->assertTrue(strstr($this->drupalGetHeader('Cache-Control'),'private')!==FALSE,'Cache-Control header was sent.');
// Log out and try to access the file.
$this->drupalLogout();
$this->drupalGet(file_create_url($image_uri));
$this->assertResponse('403',t('Access denied to original image as anonymous user.'));
$this->assertResponse('403','Access denied to original image as anonymous user.');
// Log in again.
$this->drupalLogin($this->admin_user);
...
...
@@ -95,7 +95,7 @@ function _testImageFieldFormatters($scheme) {
$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.');
// Verify that alt/title longer than allowed results in a validation error.
$test_size=2000;
...
...
@@ -214,7 +214,7 @@ function testImageFieldDefaultImage() {
$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 public imagefield instance.
$images=$this->drupalGetTestFiles('image');
...
...
@@ -226,10 +226,10 @@ function testImageFieldDefaultImage() {
$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.');
$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.');