Filter tests fail

catch - June 4, 2008 - 10:26
Project:Drupal
Version:7.x-dev
Component:tests
Category:bug report
Priority:critical
Assigned:boombatower
Status:closed
Description

Found the requested form at admin/settings/filters/add [Other] Fail
Found the Save configuration button [Other] Fail
Failed to set field name to simpletest_w93x [Other] Fail
Failed to set field roles[2] to 1 [Other] Fail
Failed to set field filters[filter/2] to 1

There are other failures which are due to core bugs rather than the test, RTBC patch here: http://drupal.org/node/161217

#1

catch - June 4, 2008 - 11:20

Issue is with the createFormat() function which just looks like it's not building the $edit array properly (compared to the filter admin test which passes). I guess it'd be useful to have a reusable function so we could test different combinations of filters and how they interact, but it'll need some work. Definitely a bug in the test rather than anything else though.

#2

boombatower - June 5, 2008 - 18:19
Status:active» needs work

The array looks fine.

This was the culprit.

<?php
$admin_user
= $this->drupalCreateUser(array('administer filters, create page content'));
?>

should be

<?php
$admin_user
= $this->drupalCreateUser(array('administer filters', 'create page content'));
?>

Very simple to check just place the following code after a drupalGet or drupalPost.

<?php
var_dump
($this->drupalGetContent());
?>

I received an access error, so I check the permissions...

Placed that same code after

<?php
$this
->drupalGet('node/' . $page->nid);
?>

The assertions are working as they should. The page output contains the links that the code is asserting shouldn't be there. So either the assertions are wrong or the filter is broken.

I would like someone else to take a look at that since I'm not familiar with how the filter should work.

AttachmentSizeStatusTest resultOperations
filter.test.patch832 bytesIgnoredNoneNone

#3

catch - June 5, 2008 - 20:24
Status:needs work» reviewed & tested by the community

The filter's a bug in the code and there's an RTBC patch here: http://drupal.org/node/161217

This one's good.

#4

Dries - June 5, 2008 - 21:58
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Is there a way we can check a permission actually exists? That might prevent these errors.

#5

boombatower - June 5, 2008 - 22:38
Status:fixed» reviewed & tested by the community

Doesn't seem like this got committed.

#6

boombatower - June 5, 2008 - 23:36
Assigned to:Anonymous» boombatower

Also patch for checking permissions: #267308: Simpletest: check permissions to make sure they are valid.

#7

catch - June 6, 2008 - 13:01
Status:reviewed & tested by the community» fixed

I got committed as collateral here so missed getting it's own message: http://drupal.org/cvs?commit=119893

#8

Anonymous (not verified) - June 20, 2008 - 13:12
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.