Unit Testing
1. Install packages
The following dependencies must be installed directly in the root folder of your OctoberCMS installation, and not inside the plugins/offline/mall
plugins root directory.
sh
composer require --dev "fakerphp/faker:^1.23" "mockery/mockery:^1.6"
2. Run tests
You can either use Octobers plugin:test OFFLINE.Mall
console command, or you can visit the plugins/offline/mall
plugins root directory and run the whole test suite using the composer command composer test
.
You can also use the PHPUnits --filter
option to test only specific classes or methods. Visit the official documentation for more information.
Examples:
sh
# To run a single class
composer test -- --filter 'OFFLINE\\Mall\\Tests\\TestClass'
# To run a single method
composer test -- --filter 'OFFLINE\\Mall\\Tests\\TestClass::methodName'