开发者

Drupal SimpleTest: Any Way to Call setup() Once for All Tests?

开发者 https://www.devze.com 2023-01-29 13:08 出处:网络
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 t

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消