Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

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 :ref:`tips & tricks<asserter_tips>` related to assertion and asserter, don't forget to read it!