Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让每个测试用例类都有一次 setup() 函数,就像在 Junit 中一样?
我的设置非常昂贵,有时我想运行一次,然后运行所有测试。
不是真的 - 请记住,每次运行测试时,整个drupal设置都在运行,所有变量都设置为它们的安装值,然后你的测试运行,然后drupal设置被破坏。
但是,如果您想在一次 Drupal 中运行所有测试,则可以改为更改它,以便在您的一个 testEverything() 方法中,然后在退出之前依次调用类中的所有其他测试函数.