Skip to content
PHPUnit testing application
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classes
nbproject
testing
vendor
.gitignore
LICENSE
README.md
composer.json
composer.lock
index.php

README.md

MyTEST Project

Description

This repository is my first (serious) attempt to create, step-by-step, a basic PHPUnit testing application. This code it is not useful to anyone looking for a PHPUnit testing wrapper, it is just simple example of installing and using PHPUnit.

Programming Languages

Main programming language:

  • PHP

Installation

Below are the steps to produce this example PHPUnit application:

  • Copy the files to root folder of your server (e.g. htdocs, www )
  • Install PHPUnit (here the version for Windows was used) following the instructions here: PHPUnit installation for Windows
  • Install Composer (again the windows version is used here) following the instructions here: Composer for Windows
  • Create a json file in the root directory with name 'composer.json' open it and add the following:
{
    "require-dev": {
        "phpunit/phpunit": "6.1"
    }
}
  • PHPUnit version is the latest stable at the time of writing this code (of course you can modify the PHPUnit version)
  • Then via command line and using composer install PHPUnit with the command (from the root folder):
$ composer install
  • From that point you are ready to create your application classes and test them with PHPUnit
  • For this sample code the "classes" folder includes the apllication's classes and the folder "testing" the PHPUnit testing classes
  • For calling the test class execute the following:
$ phpunit ClassNameTest

Test Environment

  • Apache 2.4.23
  • PHP 7.0.10

About me

You can’t perform that action at this time.