The main work for this task is to write a small suite of tests to check the functionality of blogapi module, specifically:
* create, a post, check the recent posting list for it, edit and finally delete a post.
* Upload a file.
* get and set categories

You will need to call xmlrpc() and issue proper blogapi requests against the Drupal install itself. The supported methods can be found in blogapi_xmlrpc .

Comments

aclight’s picture

boombatower’s picture

Edit: double post.

boombatower’s picture

StatusFileSize
new5.6 KB

I have most of the test working, but I'm not sure if the file upload and get category part are complete.

I know that the mt.setPostCategories works since I tested it on an existing Blog node that I could manual check. I ran the mt.getPostCategories on that same node and still didn't work. Not sure if I'm not using it right or what.

After line 99: $this->assertTrue($result, 'Category list successfully retreived.'); I will need to add a check that ensures that the list of categories is correct, but since it never returns anything that hasn't been added.

The documentation for metaWeblog.newMediaObject say it should be base64-encoded binary. It appears that the BlogAPI simply takes the input and directly places that in the uploaded files folder so I just send normal text. Not sure if that is correct or not.

boombatower’s picture

Status: Active » Needs review
StatusFileSize
new5.62 KB

Fixed a small issue with uploading a file.

The categories issue that I have as described above seems to be a bug and is outside the scope of the issue. The test is complete and simple needs to check that the category returned (when it works) is the same as the category added. I can't really write that since I haven't seen a correct response from the call.

Since the GHOP deadline is approaching and this issue is as complete as I can make it I would like to be able to work on some other tasks. If this is possible I would much appreciate it.

webchick’s picture

Myself and earlmred took a look at this tonight. We confirmed that there's definitely a problem w/ blogAPI's category retrieval functions. One of the fixes was simple (the arguments to taxonomy_node_get_terms changed), but it's still not retrieving a list of categories as expected...

At any rate, the failed test is definitely not a problem w/ the test itself, and has everything to do with blogapi being neglected and forlorn. ;) If Rok/chx/pwolanin give their ok on the tests themselves, we can mark this sucker complete.

boombatower’s picture

Thanks for working on that. Once the BlogAPI is fixed I would be happy to complete the test, even after GHOP. I plan to continue working with Drupal.

Just let me know.

Rok Žlender’s picture

Status: Needs review » Reviewed & tested by the community

Some comments:

  • you could check if what xmlrpc calls return holds correct value and not just that it returns something i.e. when you call blogger.getUserBlogs you can check for blog name and what url it returns
  • check if getCategories gives you back category you previously set

You have done an awesome job this test is super clean and well built.

And as webchick said we have a problem somewhere in Drupal. http://drupal.org/node/211067 . I also noticed bunch of php errors in watchdog originating from line 70 in xmlrpcs.inc function returns are usually not objects so this produces an error.

I'll commit this tmrw morning when my head is clearer :)

boombatower’s picture

StatusFileSize
new5.79 KB

Since the patch seems to fix the category issue I have added the necessary test code as described above.

Summary:

  • I believe I check to make sure that the call returns something. I use the url returned to get the user's blog id. If there is something else you would like me to add please let me know.
  • It now checks the category list returned.
Rok Žlender’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks

Anonymous’s picture

Status: Fixed » Closed (fixed)

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