Like Composer PHPUNIT can be installed on a project bases
// Get PHP unit
# composer require --dev phpunit/phpunit ^7
// Output version
# ./vendor/bin/phpunit --version
// update composer json
{
"autoload": {
"classmap": [
"src/"
]
},
"require-dev": {
"phpunit/phpunit": "^7"
}
}
// Create test code based on documnetation ...
// For example create tests in tests/EmailTest.php
// Run tests
#./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/EmailTest
No comments:
Post a Comment