What is the user of the test database used by the test site? root.What is the host of the test database used by the test site? localhost.What is the name of the test database used by the test site? tests.What is the path, relative to WordPress root URL, of the admin area of the test site? /wp-admin.What is the path of the WordPress root directory? /Applications/MAMP/htdocs.How would you like to call the env configuration file?.How would you like the WordPress unit and integration suite to be called? wpunit.How would you like the functional suite to be called? functional.How would you like the acceptance suite to be called? acceptance.Would you like to set up the suites interactively now? y.I acknowledge wp-browser should run on development servers.In the screenshots below are the answers I used to configure wp-browser. The initialization guide will ask a number of questions. You can create a backup of the current site database contents using phpMyAdmin, at under the "Export" tab:Īt any moment you can re-import the site database dump using, again, phpMyAdmin, under the "Import" tab:Īfter the backup is done it's time to bootstrap wp-browser using its interactive mode:Ĭd /Applications/MAMP/htdocs/wp-content/plugins/my-plugin How to connect to the database dedicated to the integration and "WordPress unit" tests: this database will be used to install WordPress during integration and "WordPress unit" tests.Īny test suite using a database should never run on a database containing data of any value this means that your first step should be to backup the site database. How to connect to the WordPress site "normal" database: this is the database that stores the data of the site I would see when visiting the local installation URL at.Where the WordPress installation files are located: they will be loaded in integration and "WordPress unit" tests.Setting up wp-browserįor those that might get lost while trying to set up wp-browser for the first time the VVV context provides an excellent base to understand the process. Since wp-browser requires Codeception, there is no need to require Codeception explicitly as a development dependency. The first step is to create the bare minimum code required to make the plugin show up among the available WordPress plugins.Ĭreate the main plugin file in the WordPress installation plugins directory, in the /Applications/MAMP/htdocs/wp-content/plugins/my-plugin/my-plugin.php file: I'm assuming the scope of the development is to test the my-plugin plugin. Make sure you can visit the WordPress installation at and that you can correctly access the administration area at Scaffolding the project folder Use admin as administrator user name and password as password for the administrator user. The database credentials for the installation are: Unzip the the WordPress files into the /Applications/MAMP/htdocs and head over to to install WordPress. tests is the database you will use for the tests.wordpress is the database you will use for WordPress.Go to the page and create two new databases: If your document root lies elsewhere, replace the /Applications/MAMP/htdocs path with the actual directory in each command. In the context of this guide I'm assuming the "Document Root" directory is the default one, in the /Applications/MAMP/htdocs directory. This walk-through starts after MAMP has been installed and is correctly running on the host machine you can download MAMP from the site and follow the installation instructions. MAMP PRO provides more features, but the setup instructions should remain valid. The version of MAMP used in this tutorial is the free, non PRO, one. Composer installed and working on your terminal PATH, you should be able to run composer -version at the terminal and see the version correctly.You should be able to create sites and visit them from your browser without issues.Setting up wp-browser with MAMP on Mac to test a plugin Requirements The current version is version 4 and the documentation can be found here. This is the documentation for version 3 of the project. Setting up wp-browser on Local by Flywheel to test a plugin Setting up wp-browser on WAMP for Windows to test a plugin Using the tests database in acceptance and functional tests Setting up wp-browser with MAMP on Mac to test a pluginĬreating the databases and installing WordPress Setting up wp-browser on MAMP for Mac to test a plugin Setting up wp-browser on VVV to test a plugin Setting up a minimum WordPress installationĪutomatically change database during acceptance and functional tests
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |