Skip to content

Setting up ci-tests #5

@jcheron

Description

@jcheron

Code Quality

To be set up:
For monitoring the code quality:

Tests and coverage

The objective is to have a maximum coverage rate of the code by the tests (continuous) to avoid regression.

Installation

for phpUnit and codeCeption (see https://codeception.com/quickstart for more):
From the root of the project:

composer require "codeception/codeception" --dev

Unit testing setup (on windows):

vendor\bin\codecept.bat init unit

Update the .codeception.yml file (see https://github.com/phpMv/php-reactjs/blob/main/codeception.yml)

Test creation

It is possible to generate a test class from Codeception:

vendor\bin\codecept.bat g:test unit VueJSTest

Or from your IDE (With Eclipse, the generator adds the implementation of all the methods to be tested, that's the great advantage):
Select the tests folder, rigth click and then select New/PHP Unit Test case:
image

Then all that remains to be done is to implement the tests,
which will be run on Scrutinizer at each commit/push

Objective:
image

If we just want to run the tests locally:

vendor\bin\codecept.bat run unit

Test examples:

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions