Closed (fixed)
Project:
Rules
Version:
8.x-1.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Apr 2014 at 09:48 UTC
Updated:
30 Jun 2014 at 23:00 UTC
Jump to comment: Most recent
Comments
Comment #1
dasjoComment #2
dasjoComment #3
fubhy commentedComment #4
klausiDone by fubhy, thanks!
Comment #5
fubhy commentedComment #6
Torenware commentedA general question about doing this.
As we're implementing PHPUnit into Drupal 8, unit tests do not actually bootstrap Drupal itself; any part of Drupal that a unit test may need to refer to a working Drupal framework [should be mocked https://drupal.org/node/2012184]:
This is not a limitation of PHPUnit, per se: it's possible to have PHPUnit bootstrap Drupal before running tests. So it's a limitation of how we _use_ PHPUnit instead.
My main concern here is that Rules for D8 is a "system integrating" module. Our conditions test things that are implemented by Core. So a unit test that works perfectly well with mocks may be passing a condition or action plugin that will not actually work when we use that condition or action in a current build of Drupal 8.
This strikes me as strange, and probably undesirable.
We really do need to test system integration. So either:
I personally favor the latter approach (this is how I use PHPUnit in Drupal 7), since I think PHPUnit is a richer and better maintained framework. But that would require some extra work. Using SimpleTest would at least make sure we know if changes in Core are breaking our code.