Code Monkey home page Code Monkey logo

config-extension's Introduction

atoum/config-extension Build Status

This extension will allow you to configure atoum using a YAML file and/or environnement variables.

Example

When using this extension, you can put a .atoum.yml on the root of your repository to configure atoum. Here is an exemple on how to tell atoum to look for unit tests in the tests/units/classes folder.

# .atoum.yml

atoum:
    directories:
        - ./tests/units/classes

Install it

Install extension using composer:

composer require --dev atoum/config-extension

Enable the extension using atoum configuration file:

<?php

// .atoum.php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

use mageekguy\atoum\config;

$runner->addExtension(new config\extension($script));

// Or

new config\extension($script);

Use it

# .atoum.yml

atoum:
    directories:
        - ./tests/units/classes

    fields:
        report.default:
            - field.logo
            - field.logo.result
            - field.coverage

    reports:
        - report.default
        - report.coverage.clover

Configuration reference

atoum.loop

boolean : enable/disable atoum's loop mode. Defaults on ATOUM_LOOP environnement variable.

Exemple:

atoum:
  loop: true

atoum.debug

boolean : enable/disable atoum's debug mode. Defaults on ATOUM_DEBUG environnement variable.

Exemple:

atoum:
  debug: true

atoum.verbosity

integer : value between 1 and 3 determining atoum's verbosity level'. Defaults on ATOUM_VERBOSITY environnement variable.

Exemple:

atoum:
  verbosity: 2

atoum.directories

array : List of directories where atoum will look for unit tests. Defaults on ATOUM_DIRECTORIES environnement variable (a coma separated list of directories).

atoum:
    directories:
        - ./tests/units/classes

atoum.reports

array : List of reports. Defaults on ATOUM_REPORTS environnement variable (a coma separated list of reports).

Example:

atoum:
    reports:
        - report.default
        - report.coverage.clover

Possible values :

report.default

adds atoum's default reporter (when the reports key is defined, atoum's default reporter is no longer used).

report.coverage.clover

Adds a clover coverage reporter.

Path to were the report will be written could be configured using the coverage.clover.filename parameter.

report.xunit

Adds an xUnit reporter.

Path to were the report will be written could be configured using the xunit.filename parameter.

report.tap

Adds a TAP reporter.

report.vim

Adds a vim reporter.

report.nyancat

Adds a reporter that displays a nyancat.

report.santa

Adds a santa reporter.

atoum.fields

Fields allows you to customize reports. You can add fields for each report.

You need to add the report name as key, then add an array of fields.

This example adds the logo field to the default report :

atoum:
    reports:
        - report.default

    fields:
        report.default:
            - field.logo

field.logo

Displays atoum's logo at the begining of the report. Only works on cli reports.

field.logo.result

Displays atoum's logo at the end of the report. Only works on cli reports.

field.coverage.html

Generate an HTML coverage reports. Needs the php extension xdebug to be installed.

The project name in generated report and folder where the report will be generated could by configured with the project.name and coverage.html.directory and parameters.

parameters

You can customize the way reports or fields are generated using the parameters section on the .atoum.yml file.

Here is an example that changes the path where the xunit report is generated:

atoum:
    reports:
        - report.xml
parameters:
    xunit.filename: "mylogs/file.xml"

xunit.filename

Default value : xunit.xml.

Path were the xUnit report will be written in the report.xunit report.

The directory where the file is generated must exists, it will not be created by atoum.

coverage.html.directory

Default value : ./coverage.

Path to the folder where the HTML coverage files will be written. See field.coverage.html field.

project.name

Default value : atoum.

Will be used when generating the field.coverage.html field.

coverage.clover.filename

Default value : clover.xml.

Path where the clover report will be written in the report.clover report.

Links

License

config-extension is released under the BSD-3-Clause License. See the bundled LICENSE file for details.

atoum

config-extension's People

Contributors

agallou avatar grummfy avatar jubianchi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.