This course relates to Magento 1 only
The tests are setup so that they exist outside the Magento webroot.
Magento is intended to be installed in a sub-folder, www
.
To install in a different folder will require updating the paths in both bootstrap.php
files.
- Create a new test configuration (Run, Edit Configurations...).
- Configure as follows. Replace
/path/to/project/root
with the path to the folder containing thewww
folder (e.g./var/www/magento.local/
):- Test Runner:
- Test Scope: Class.
- Class: Training_Example_DataTest
- File:
/path/to/project/root/tests/unit/Training/Example/Helper/DataTest.php
- Use Alternative Configuration File:
/path/to/project/root/tests/unit/phpunit-unit.xml
- Test Runner:
- Create a new test configuration (Run, Edit Configurations...).
- Configure as follows. Replace
/path/to/project/root
with the path to the folder containing thewww
folder (e.g./var/www/magento.local/
):- Test Runner:
- Test Scope: Class.
- Class: Training_Example_DataTest
- File:
/path/to/project/root/tests/integration/Training/Example/Helper/DataTest.php
- Use Alternative Configuration File:
/path/to/project/root/tests/integration/phpunit-integration.xml
- Test Runner:
- Testing in Magento 1: A Magento 1-specific overview of writing tests and of best practice
- Writing more testable code in Magento 1 and 2: Notes from the Nomad Mage talk on best practices
- Testing Jargon: Notes from LaraCasts series demystifying common testing terms
- Testing in Magento 2: Has some notes on general best practice when writing tests
- Increase Happiness and Reduce Profanity with Browser Testing: Introduction to functional (browser) testing with Magium