GHOP #111: Write Simpletest tests to check the node revision system

pwolanin - December 15, 2007 - 02:39
Project:SimpleTest
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:cwgordon7
Status:closed
Description

New task

#1

pwolanin - December 15, 2007 - 02:49
Title:GHOP :Write Simpletest tests to check the node revision system» GHOP #111: Write Simpletest tests to check the node revision system

link to GHOP task: http://code.google.com/p/google-highly-open-participation-drupal/issues/...

The main work for this task is to write a small suite of tests to check the basic functionality of node revisions.

Suggested tests:

1. node/#/edit: Create a new revision. Enter a log message and ensure that
it shows up at node/#/revisions
2. node/#/revisions: Revert to a previous revision. Confirm that the
reversion occurs.
3. node/#/revisions: Delete a revision. Confirm that it is gone and that
node/#/revisions/#/view is not found

#2

cwgordon7 - December 22, 2007 - 03:17
Assigned to:Anonymous» cwgordon7
Status:active» patch (code needs review)

.test file here, needs review and/or suggestions. I discovered http://drupal.org/node/202895 when creating this file, so make sure to use the HEAD version drupal 6. It's zipped because drupal won't let me upload it otherwise.

-cwgordon7

AttachmentSize
node_revisions.zip1.47 KB

#3

pwolanin - December 22, 2007 - 20:22

I won't have a chance to actually test the code until Monday

Also - it would be preferable to post the test as a patch to simpletest - see "Adding/Deleting files" at http://drupal.org/patch/create

#4

Rok Žlender - December 23, 2007 - 13:57
  • missing a global user in setup function produces a bunch of exceptions
  • it would be better if you use $this->drupalGet function instead of $this->_browser->get. Also simpletest already has a function that checks if certain text is displayed on loaded page $this->assertText. So proper flow would be use drupalGet to load page you want to test and then do a $this->assertText to check for content on that page.
  • you also have some permission problems or Drupal has them but anyway for deleting revision your new test user needs 'delete any page content' and for reverting revisions your user needs 'edit any page content'

These are my comments on your test. If you make the changes test will finish without fails also after the changes I will consider this task completed as you made all tests pwolanin asked for.

#5

cwgordon7 - December 23, 2007 - 19:59

Thank you for the review, the revised .test file is attached. I have tested this with my drupal 6 HEAD install, everything checks out fine. If you want to see some fails, try it on one of the Drupal six betas (one probably being optimal). Again, it's zipped, because I'm having trouble trying to add new files through a patch. Sorry for any inconvenience this causes.

-cwgordon7

AttachmentSize
node_revisions.zip1.47 KB

#6

cwgordon7 - December 24, 2007 - 04:54

Attached also as a .txt file for easier review.

AttachmentSize
node_revisions.txt4.45 KB

#7

dmitrig01 - December 25, 2007 - 04:00
Status:patch (code needs review)» patch (reviewed & tested by the community)

Reviewed code and functionality. Both look fine

#8

aclight - December 25, 2007 - 04:10

Since Rok and dmitrig01 both signed off on this, I'm going to give cwgordon07 credit for this. If pwolian wishes for more work to be done on this, cwgordon07 assures me that he'll finish anything necessary.

#9

Rok Žlender - December 25, 2007 - 11:53
Status:patch (reviewed & tested by the community)» fixed

committed to HEAD thanks cwgordon7

#10

pwolanin - December 25, 2007 - 14:39

If Rok is satisfied, I'm not going to hold it back.

#11

Anonymous - January 8, 2008 - 14:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.