Tests needed for:
Updating book node types.
Setting another node type to be a book page type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

beeradb’s picture

Status: Active » Needs review
FileSize
5.42 KB

Heres a stab at this...

patch does the following:
* checks editing of book nodes. These edits modify the book structure
* adds an additional content type as a book page type, checks to ensure it can add this content type to the book outline
* checks the addition of a content type as the default book child page type

Damien Tournoud’s picture

Status: Needs review » Needs work

@beeradb: I also have a patch that could be quite similar in #299136: Add tests for deleting and editing book pages. Could you try to merge the two?

beeradb’s picture

FileSize
8.21 KB

Updated. Merged the parts of Damien's patch which weren't covered by my first one (deletion and the associated checks), and made the new book page type and default book page type tests use a dynamically generated content type. Interestingly enough I think I may have uncovered a bug in either core or the testing framework through doing this. After calling drupalWebTestCase::drupalCreateContentType() I have to do a menu_rebuild() to go to 'node/type/$type'. This rebuild is typically handled by node_type_form_submit which is never called in this context.

There are three options here...

  • The menu_rebuild should be moved to node_types_rebuild.
  • A menu_rebuild should be added to drupalCreateContentType()
  • The menu_rebuild should be the tests responsibility to invoke, in this context

depending on feedback here I'll either roll a patch for this or not. I think it probably shouldn't be the tests responsibility personally :).

Otherwise, I'd appreciate feedback on the rest of this patch as well.

beeradb’s picture

Status: Needs work » Needs review
beeradb’s picture

FileSize
8.13 KB

After a chat with chx on irc I've gone with option #1, "The menu_rebuild should be moved to node_types_rebuild.".

This patch is now dependent on #306316: Regression: node_types_rebuild should rebuild menu

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

beeradb’s picture

Status: Needs work » Needs review

Fairly certain this failed testing due to the listed dependencies. It would still be nice to have this reviewed.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

beeradb’s picture

Component: tests » book.module
Status: Needs work » Needs review

with #306316: Regression: node_types_rebuild should rebuild menu now committed, marking this back to CNR

Status: Needs review » Needs work

The last submitted patch failed testing.

kleinmp’s picture

Status: Needs work » Needs review
FileSize
4.68 KB

I rerolled this patch against the latest Drupal HEAD. I have not tested it locally, though.

calebgilbert’s picture

This is failing fairly spectacularly in local testing (all book tests results in 292 passes, 9 fails, and 17 exceptions). I hit the bot for a retest. Will try and check back to see how that goes and re-roll unless someone beats me to it.

calebgilbert’s picture

Status: Needs review » Needs work

Ok, just figured out that there is an error which is keeping the testing bot from running the book.test at all:

Fatal error: Cannot use object of type stdClass as array in /Library/WebServer/Documents/botsite/modules/book/book.test on line 121

Will fix and re-roll patch and post in a bit unless someone else beats me to it.

UPDATE: Still working on this - the last patch post was quite a mess and not well commented. Taking forever actually. If someone gets impatient I'm glad to post my progress to date, otherwise will try to post a proper patch when I can.

catch’s picture

Category: bug » task
Priority: Critical » Normal

Moving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.