Skip to content

Latest commit

 

History

History
90 lines (76 loc) · 2.68 KB

asserters.rst

File metadata and controls

90 lines (76 loc) · 2.68 KB

Asserters collection

To write more explicit and less wordy tests, atoum provide several asserters who give access to specific assertions related to tested var.

As atoum different asserters are specializations of manipulated items, asserters inherits from asserters they specialize. It help keep consistency between asserters and force to use same assertion names.

This is the asserters inheritance tree:

-- asserter (abstract)
    |-- error
    |-- mock
    |-- stream
    |-- variable
    |   |-- array
    |   |    `-- castToArray
    |   |-- boolean
    |   |-- class
    |   |    `-- testedClass
    |   |-- integer
    |   |   |-- float
    |   |   `-- sizeOf
    |   |-- object
    |   |   |-- dateInterval
    |   |   |-- dateTime
    |   |   |   `-- mysqlDateTime
    |   |   |-- exception
    |   |   `-- iterator
    |   |       `-- generator
    |   |-- resource
    |   `-- string
    |       |-- castToString
    |       |-- hash
    |       |-- output
    |       `-- utf8String
    `-- function

Note

The general asserter/assertion syntaxe is: $this->[asserter]($value)->[assertion];

Note

Most of the assertions are fluent, as you will see below.

Note

At the end of this chapter you will find several tips & tricks<asserter_tips> related to assertion and asserter, don't forget to read it!