To install phpunit framework make sure you have installed composer
If not follow instructions from this link http://codeinsightacademy.com/blog/php/composer/
Installation
Install php-xml
As we are going to use phpunit.xml we need to install php-xml
sudo apt install php-xml
#To install specific version
sudo apt install php7.4-xml
Install mbstring
sudo apt-get install php-mbstring
Create composer.json file in project root directory
{
"autoload" : {}
}
Run one of the composer command
composer dump-autoload -o
OR
composer update
Install sluggable
composer require cviebrock/eloquent-sluggable
Install intl
This is required when you are using Code Igniter framework
apt-get install php-intl
#OR specific version
apt-get install php7.4-intl
Install php unit framework
composer require phpunit/phpunit ^9
Create function
global_functions.php
<?php
function add($x = 0, $y = 0) {
return $x + $y;
}
index.php
<?php
require_once("vendor/autoload.php");
echo add(5, 6);
composer.json
{
"autoload": {
"files": ["global_functions.php"]
},
"require": {
"cviebrock/eloquent-sluggable": "^8.0",
"phpunit/phpunit": "^9"
}
}
Run index.php file
php index.php
Write Testcase
phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap = "vendor/autoload.php"
colors = "true">
<testsuites>
<testsuite name="Sample test suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
tests/GlobalFunctionsTest.php
NOTE: MAKE SURE TO GIVE test PREFIX TO YOUR TEST FUNCTION
<?php
class GlobalFunctionsTest extends \PHPUnit\Framework\TestCase {
public function testAdd() {
$result = add(5, 6);
$this->assertEquals(11, $result);
}
}
Get all assertions functions from here
https://phpunit.readthedocs.io/en/9.5/assertions.html
Run TestCase from root directory
./vendor/bin/phpunit

./vendor/bin/phpunit --testdox

project directory structure
tree -I "vendor"

eurocopa casa de apuestas minimo 5 euros
tarjeta roja vale por dos en apuestas
Also visit my blog post: Basketball-Wetten.Com
apuestas deportivas rugby
Also visit my web-site basketball-Wetten.Com
bono por registro Pronosticador De apuestas nba
sportwetten bonus code (https://projektorszerviz.hu) anbieter ausland
sitio de Apuestas Carreras De caballos españa de fútbol
wett tipps heute net
Feel free to surf to my site Virtuelle basketball-Wetten
wetten dass tickets gewinnen
Feel free to visit my website; wettbüRo hannover
Wetten Gewinn Ideen schweiz
sportwetten Bonus auszahlen gratiswette
risiko wett tipps
my blog online wetten deutschland legal
80 free spins no deposit uk, online gambling uk statistics and poker run thousand islands 2021, or bouka spins no deposit bonus
2021
Look into my page … goplayslots.net
united kingdom pokies online real money, canada online casino
no deposit play game and earn money app (Kelvin) dollar 1 deposit casino new zealand, or 100 slots bonus usa
wettbüro bergedorf
Review my web site – online sportwetten tipps (https://B1Funds.com/2026/01/22/wett-tipps-eishockey-experten)
online gambling sites in the usa, bitcoin gambling united kingdom and
how best apps to make money playing games (Stephanie) make
money online without paying anything usa, or top ten slots usa
new zealand table a roulette casino (Boyce) no deposit
bonus codes 2021, do you have to pay taxes on gambling winnings
in australia and how to win china africa bonausaa slot machine, or real poker online
australia