Download the PHP package edgcarmu/codeigniter-phpunit without Composer
On this page you can find all versions of the php package edgcarmu/codeigniter-phpunit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download edgcarmu/codeigniter-phpunit
More information about edgcarmu/codeigniter-phpunit
Files in edgcarmu/codeigniter-phpunit
Package codeigniter-phpunit
Short Description Official adaptation of yidas/codeigniter-phpunit for CodeIgniter 3.1.11 and PHP 7.1+
License MIT
Homepage https://github.com/edgcarmu/codeigniter-phpunit
Informations about the package codeigniter-phpunit
CodeIgniter 3 PHPUnit Test extension library
Official adaptation of the yidas/codeigniter-phpunit repository for compatibility with CodeIgniter 3.1.13 and PHP 7.1+.
FEATURES
-
PHPUnit Test in Codeigniter 3 Framework
- Easy to install into your Codeigniter project by Composer
OUTLINE
- Requirements
- Installation
- Directory Structure
- Configuration
- Usage
- Test Case
REQUIREMENTS
This library requires the following:
- PHP 7.1.0+
- CodeIgniter 3.1.13+
INSTALLATION
Run Composer from the project root:
composer require edgcarmu/codeigniter-phpunit
DIRECTORY STRUCTURE
CONFIGURATION
According to Directory Structure, create and configure phpunit.xml in the project root:
For this phpunit.xml template, the test cases directory is tests/, located at the project root. Make sure to place all your test cases inside this directory.
USAGE
From the project root, run PHPUnit using the Composer-installed binary:
Or using absolute path commands like:
Then the result would like:
TEST CASE
With this extension library, you can write test cases while loading the CodeIgniter framework.
For example, create a test case at tests/CodeigniterTest.php to test a CodeIgniter component like the config loader:
Then you would get the result OK (1 test, 1 assertion) by running PHPUnit test.