Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Atoum, le framework de tests unitaires simple et moderne

Atoum, le framework de tests unitaires simple et moderne

Support de la conférence "Atoum, le framework de tests unitaires simple et moderne" donnée le 9 mars 2017 lors de la ConFoo Montréal 2017.

https://confoo.ca/fr/yul2017/session/atoum-le-framework-de-tests-unitaires-simple-et-moderne

Mikael RANDY

March 09, 2017
Tweet

More Decks by Mikael RANDY

Other Decks in Programming

Transcript

  1. Atoum 101
    @mikaelrandy
    ConFoo Montréal - 9 mars 2017

    View full-size slide

  2. Me, my and myself
    Mikael Randy (@mikaelrandy)
    Lead-developper M6Web
    RM & Core developer atoum

    View full-size slide

  3. « atoum, le framework de tests
    unitaire simple, moderne et intuitif »

    View full-size slide

  4. Un peu d’histoire

    View full-size slide

  5. Installation

    View full-size slide

  6. Fonctionnement général

    View full-size slide

  7. Anatomie d’un test

    View full-size slide

  8. Asserters
    Types scalaires : array, boolean, float, integer, string, variable
    Types élaborés : castToString, class, dateInterval, dateTime,
    error, exception, hash, mock, mysqlDateTime, object, output,
    sizeOf, stream, utf8String

    View full-size slide

  9. Asserters - Assertions
    integer()
    isEqualTo (==)
    isGreaterThan (>)
    isGreaterThanOrEqualTo (>=)
    isIdenticalTo (===)
    isLessThan (<)
    isLessThanOrEqualTo (<=)
    isNotEqualTo (!=)
    isZero ( === 0)

    View full-size slide

  10. Assertions - exemples

    View full-size slide

  11. Asserters - héritage
    variable()
    isCallable, isEqualTo, isIdenticalTo, isNotCallable,
    isNotEqualTo, isNotIdenticalTo, isNull, isNotNull,
    isNotTrue, isNotFalse
    integer()
    isEqualTo, isGreaterThan, isGreaterThanOrEqualTo,
    isIdenticalTo, isLessThan, isLessThanOrEqualTo,
    isNotEqualTo, isZero

    View full-size slide

  12. DataProviders

    View full-size slide

  13. DataProviders

    View full-size slide

  14. Mock system - asserter

    View full-size slide

  15. Exécution - mode loop

    View full-size slide

  16. Exécution - mode loop

    View full-size slide

  17. Exécution - mode loop

    View full-size slide

  18. Exécution - debug

    View full-size slide

  19. Annotations
    @dataProvider
    @extension
    @ignore
    @php
    @tags

    View full-size slide

  20. Extensions
    autoloop-extension
    deprecated-extension
    json-schema-extension
    phpunit-extension
    report-extension
    visibility-extension
    https://github.com/atoum/

    View full-size slide

  21. Code coverage

    View full-size slide

  22. Pour en savoir plus
    https://github.com/atoum
    http://atoum.org/
    http://docs.atoum.org/en/latest/

    View full-size slide