PHP unit testing

These are the steps to install and set the necessary tools to run unit tests in PHP projects:

Installing Composer on Ubuntu 16.04 LTS:

curl -sS | php
sudo mv composer.phar /usr/local/bin/composer

Installing PHPUnittest:

    "require-dev": {
        "phpunit/phpunit": "^7"

Install xdebug on Ubuntu 16.04 LTS.

Run the tests:

./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/EmailTest.php 

Run the code coverage:

./vendor/bin/phpunit  --coverage-html . tests/EmailTest.php

Setting phpunit.xml file I created the phpunit.xml file in the root directory of the project:

find -not -path './vendor/*'



This is its content:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./vendor/autoload.php">
        <testsuite name='begueradj'>
            <directory suffix=".php">./src/</directory>