Download & Extend

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

Project:SimpleTest
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:cwgordon7
Status:closed (fixed)
Issue tags:GHOP

Issue Summary

New task

Comments

#1

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

Assigned to:Anonymous» cwgordon7
Status:active» 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

AttachmentSizeStatusTest resultOperations
node_revisions.zip1.47 KBIgnored: Check issue status.NoneNone

#3

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

  • 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

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

AttachmentSizeStatusTest resultOperations
node_revisions.zip1.47 KBIgnored: Check issue status.NoneNone

#6

Attached also as a .txt file for easier review.

AttachmentSizeStatusTest resultOperations
node_revisions.txt4.45 KBIgnored: Check issue status.NoneNone

#7

Status:needs review» reviewed & tested by the community

Reviewed code and functionality. Both look fine

#8

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

Status:reviewed & tested by the community» fixed

committed to HEAD thanks cwgordon7

#10

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

#11

Status:fixed» closed (fixed)

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

nobody click here