Traits
Mantle's Test Framework uses traits to add optional functionality to a test case.
Refresh_Database
- Using this trait ensures that the database is rolled back after each test in the test case has run. Without it, data in the database will persist between tests, which almost certainly would not be desirable. That said, if your test case doesn't interact with the database, omitting this trait will provide a significant performance boost.Admin_Screen
- Using this trait sets the current "screen" to a WordPress admin screen, andis_admin()
will return true in tests in the test caseNetwork_Admin_Screen
- Same as withAdmin_Screen
except for the network admin andis_network_admin()