Discussion:
Simpletest Conundrum
(too old to reply)
Jeff Greenberg
2014-12-01 19:19:08 UTC
Permalink
In Drupal 7, I have a requirement to simpletest a functional group of
methods... one test comprised of about 1800 subtest permutations.

The issue I have is that these are back-end functions with no UI
interaction, yet simpletest unit test, from what I read, does not provide
the functionality for accessing the db, creating test tables and data, etc.

Do I fudge it by having a menu callback, or by having an admin page with a
button if necessary, so that I can webtest, or do I manually include
db.inc, etc. so that I can access the db, (though I think it would need to
be much dirtier than that)?

Jeff
--
---
drupal.org/user/367108
linkedin.com/in/jeffrgreenberg
accidentalcoder.com / ayendesigns.com
@accidentalcoder
Darren Oh
2014-12-01 19:44:12 UTC
Permalink
Standard practice is to create a hidden test module. https://www.drupal.org/node/302577
In Drupal 7, I have a requirement to simpletest a functional group of methods... one test comprised of about 1800 subtest permutations.
The issue I have is that these are back-end functions with no UI interaction, yet simpletest unit test, from what I read, does not provide the functionality for accessing the db, creating test tables and data, etc.
Do I fudge it by having a menu callback, or by having an admin page with a button if necessary, so that I can webtest, or do I manually include db.inc, etc. so that I can access the db, (though I think it would need to be much dirtier than that)?
Jeff Greenberg
2014-12-01 19:59:13 UTC
Permalink
Sounds good, thanks!
Post by Darren Oh
Standard practice is to create a hidden test module. https://www.drupal.org/node/302577
Loading...