DROP Task: Tests no longer work due to change to simpletest module (6.x)

gustav - March 2, 2008 - 12:40
Project:Organic groups
Version:HEAD
Component:og.module
Category:task
Priority:normal
Assigned:marvil07
Status:closed
Description

Because simpletest.module now no longer uses hook_simpletest (see http://www.lullabot.com/articles/drupal-module-developer-guide-simpletes...), the og tests no longer run because og_testcase.php is not loaded.

#1

moshe weitzman - March 2, 2008 - 12:42

And because they need to be updated for changes in og. help!

#2

marvil07 - March 3, 2008 - 15:26
Assigned to:Anonymous» marvil07

I'm new at unit testing, but I have some time. I hope I can send a patch against 5.x-5.4 shortly.

Cheers

#3

gustav - March 3, 2008 - 20:14
Version:5.x-5.4» HEAD

marvil07: that is great. Could you possible make the patch against the development code (http://drupal.org/node/95202). Due to a recent change in language strings tests that work with 5.x-5.4 will not work with the latest code.

#4

cwgordon7 - March 19, 2008 - 00:16
Title:Tests no longer work due to change to simpletest module» DROP Task: Tests no longer work due to change to simpletest module

Please claim this on the DROP site if you plan on working on it, just so we know what's going on. Thanks!

#5

marvil07 - March 21, 2008 - 00:45

OgTestCase class define 3 member functions and 1 variable to reuse in both Og post and Og Membership unit test clases.

Checking out for example, profile module unit test classes, I see they have the same problem, and they solved it re-defining the same functions in both classes.

So I've done the same. I know it's a dirty way but it's a first attempt.

BTW I only make it work on simpletest-5.x-1.x-dev. I still don't know why the tests are *not reconized* on simpletest-5.x-1.0.

I've also seen some errors while making the tests, but I don't know if they are because of the test or the module(probably the tests).

AttachmentSize
og_subscribe.test11.78 KB
og_post.test4.74 KB

#6

moshe weitzman - March 31, 2008 - 13:41
Status:active» patch (code needs work)

Please provide a patch if possible.

#7

marvil07 - March 31, 2008 - 15:48

Sorry, I forgot to generate the diff's.

Here there are.

AttachmentSize
og_subscribe.diff2.91 KB
og_post.diff2.91 KB

#8

alex_b - April 16, 2008 - 17:43
Title:DROP Task: Tests no longer work due to change to simpletest module» DROP Task: Tests no longer work due to change to simpletest module (6.x)

I tested those two patches and adapted them to the DRUPAL-5 branch. I created a new issue for them, as a lot of the assertions check against UI text and there might be differences between 5 and 6 that I am not aware of: http://drupal.org/node/247485

The issues I fixed and the ones I couldn't fix might also apply to these patches.

If the tests for 5.x and 6.x are too similar to justify two open issues, feel free to mark #247485 duplicate and attach latest version of patch to this thread.

#9

moshe weitzman - April 16, 2008 - 22:04
Status:patch (code needs work)» fixed

og_subscribe has some failed assertions still but i've reworked and committed these patches (with alex_b help). thanks.

#10

Anonymous (not verified) - April 30, 2008 - 22:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.