This module should be used in acceptance and functional tests, see levels of testing for more information.
This module extends the Filesystem module adding WordPress-specific configuration parameters and methods.
The module provides methods to read, write and update the WordPress filesystem directly, without relying on WordPress methods, using WordPress functions or triggering WordPress filters.
This module also provides methods to scaffold plugins and themes on the fly in the context of tests and auto-remove them after each test.
Module requirements for Codeception 4.0+
This module requires the codeception/module-filesystem Composer package to work when wp-browser is used with Codeception 4.0.
wpRootFolderrequired The absolute, or relative to the project root folder, path to the root WordPress installation folder. The WordPress installation root folder is the one that contains the wp-load.php file.
themes - defaults to /wp-content/themes; the path, relative to the the WordPress installaion root folder, to the themes folder.
plugins - defaults to /wp-content/plugins; the path, relative to the WordPress installation root folder, to the plugins folder.
mu-plugins - defaults to wp-content/mu-plugins; the path, relative to the WordPress installation root folder, to the must-use plugins folder.
uploads - defaults to /wp-content/uploads; the path, relative to the WordPress installation root folder, to the uploads folder.
string$file - The path to the file, relative to the themes root folder.
string$contents - The contents to check the file for.
Checks that a file in the uploads folder does contain a string. The date argument can be a string compatible with strtotime or a Unix timestamp that will be used to build the Y/m uploads subfolder path.