Question

Is there a way to have the setup() function once per test case class, like you can do in Junit?

My setup is quite expensive and there are times I'd like to run it once, then run all tests.

Was it helpful?

Solution

Not really - keep in mind that every time a test is being run, and entire drupal setup is being run, with all variables set to their install values, then your test is run, and then the drupal setup is destroyed.

If you want to run all of your tests inside of one run of Drupal, however, you could instead change it around so that in your one testEverything() method, you then call in turn all of your other test functions in the class before exiting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top