Download & Extend

Add a test for image node teasers

Project:Image
Version:6.x-1.x-dev
Component:image.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Here's a extra test that checks that the image thumbnail shows in the node teaser.
Needs the admin nodes permission adding so that the user can promote the image node (in case the site is set with images not promoted by default).

Sorry I can't do a patch -- CVS patch is going mental on me and showing the entire file as the diff, even after changing line endings.

@line 16, change:
// User to create images.
$this->web_user = $this->drupalCreateUserRolePerm(array('create images', 'view original images', 'edit own images', 'edit images', 'administer nodes'));

@line 38, change:
// Create an image.
$edit = array(
'title' => $this->randomName(),
'body' => $this->randomName(),
'files[image]' => realpath($this->image),
'promote' => TRUE,
);

@line 64, add:
$this->drupalGet('node');
$this->assertWantedPattern('|Only local images are allowed.]+?' . $node->images['thumbnail'] . '[^>]+?>|', $this->drupalGetContent(), 'Image thumbnail is on the front page teaser. %s');

Comments

#1

This isn't quite perfect, as
1) the test could show a false positive if there's an earlier image node on the front page. A finer regexp is needed to find the actual thumbnail just created
2) it should also test that the thumbnail is shown as a link

#2

Status:needs review» needs work

Please provide a proper patch.

#3

I've recently committed a lot more tests. Would you mind to add another one? :)

#4

Status:needs work» fixed

Committed this patch. Tests all pass :)

AttachmentSizeStatusTest resultOperations
273426.image_.test-image-teaser.patch1.46 KBIgnored: Check issue status.NoneNone

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here