Webchick posted a great list of features she checks every time by hand which make great candidates for simpletests. http://groups.drupal.org/node/5974
If you write a test for any of the features on that list post here.

Comments

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new5.02 KB

here are a starting set of tests for menu module for 6.x.

My first attempt to do this- it took me all day to get right.

pwolanin’s picture

argh - ok now this is driving me insane. When testing the above patch on PHP 4.4/Apache 1.3 (as opposed to PHP 5.2, Apache 2). I get a single fail (line 68):

    $this->assertWantedText($title, 'Link created');

This is a test confirming link creation that is run twice (two different links), it passes the first time, and a subsequent test confirms that the link is created in the DB. What is wrong?!?

pwolanin’s picture

ok - ignore the comment above - the problem seems to be fixed after re-installing the DB.

Rok Žlender’s picture

pwolanin thanks for writing the tests. My review:

  • call to drupalPostRequest does not need complete url just a path as it does a call to ulr for it self
  • there is no need for $_cleanup_roles and $_cleanup_users. I know they are used in some tests but that should be fixed in another issue
  • could you please comment assertion in line 33 so we could easily know what is checked there
  • assertWantedText function is deprecated you should now use assertText
pwolanin’s picture

StatusFileSize
new5.29 KB

updated tests attached. Apparently I still need to use url() with the param array('absolute' => TRUE) for druaplGET() ? Without doing so the tests fail.

Rok Žlender’s picture

Just a quick follow up. Yes you still need url for drupalGet. Maybe this should be changed for consistenca.

pwolanin’s picture

It would e nice to have consistency between the Post and Get methods, unless there is some case where you don't want url().

Rok Žlender’s picture

Status: Needs review » Active

Patch committed.
And I completely agree with you we should have consitent use of post and get I'll write up a patch and commit it. I don't think there will be any problems as url() can also pass thru absolute urls

chx’s picture

Title: Write new tests » Write D6 menu tests
Status: Active » Fixed

Having one placeholder for the many tests webchick suggested did not work out. We had many separate issues opened and most of them coded.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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