A PHP project to calculate shopping basket totals with various discount schemes.
- Add items to the basket.
- Apply various discount schemes (e.g., Buy One Get One Free).
- Calculate the total price of the shopping basket.
-
name and description:
- Add a meaningful project name and description.
-
autoload:
- PSR-4 autoloading is configured for the src directory.
-
autoload-dev:
- PSR-4 autoloading for development files (like tests).
-
PHP Requirement:
- Ensures the project is compatible with PHP 8.0 and above.
-
Dev Dependencies:
- Includes phpunit/phpunit for testing.
-
Scripts:
- Adds a test script to easily run PHPUnit with composer test.
-
Config Options:
- Optimizes the autoloader for production.
- Ensures package sorting for cleaner composer.json.
-
Stability:
- Uses minimum-stability: stable and prefer-stable: true to avoid unstable packages.
To run your tests, use this command:
vendor/bin/phpunit --bootstrap vendor/autoload.php tests