enablePluginLoadingForTests(string|null $configPath = null): void
Helper function to load plugin configuration for tests.
This function reads plugin configuration from a plugins.php file and stores it in the application configuration for later use by test cases.
Usage:
// In your tests/bootstrap.php file:
\Cake\TestSuite\enablePluginLoadingForTests();
string|null
$configPath
optional
The path to the config directory. Defaults to CONFIG.
voidRuntimeExceptionHelper for managing test connections
Materializes a directory tree under a real temporary directory so tests can exercise real iterators against a known fixture layout.
Dispatches a request capturing the response for integration testing purposes into the Cake\Http stack.
Cake TestCase class
TestEmailTransport
Set this as the email transport to capture emails for later assertions
Read only access to the session during testing.
Make assertions on emails sent through the Cake\TestSuite\TestEmailTransport
After adding the trait to your test case, all mail transports will be replaced with TestEmailTransport which is used for making assertions and will not actually send emails.
A trait intended to make integration tests of your controllers easier.
This test class provides a number of helper methods and features that make dispatching requests and checking their responses simpler. It favours full integration tests over mock objects as you can test more of your code easily and avoid some of the maintenance pitfalls that mock objects create.
Make assertions on logs
Compare a string to the contents of a file
Implementing objects are expected to modify the $compareBasePath property
before use.