sixty-nine / DrupalTesting

PHPUnit with Drupal 7
4 stars 6 forks source link

Fix bug with polluted Drupal static cache #4

Closed andreiashu closed 11 years ago

lapistano commented 11 years ago

Thx Andreas!

sixty-nine commented 11 years ago

did you consider performances of running drupal_static_reset before each single test?

additionally, to me this does not belong to WebTestCase but to DrupalTestCase.

finally, since this code uses the LiipDrupalConnector, the call to drupal_static_reset should also be wrapped through it.

andreiashu commented 11 years ago

@sixty-nine very good point about drupal_static_reset having to be wrapped. I'll investigate the point about DrupalTC vs WebTC as well.

Re performance: I haven't profiled it but I think the performance implications of calling this function are outweighed by enforcing isolation between tests (see also #5)

sixty-nine commented 11 years ago

I took the liberty to move your code to DrupalTestCase. The reason is that WebTestCase does actually not contain anything related to Drupal. Theoretically WebTC could be used outside of a Drupal project.

Furthermore I wrapped the call to drupal_static_reset in the DrupalConnector class to follow the conventions of the rest of the code.

Thank you for your contribution.