atoum / atoum-documentation

Documentation of atoum, a php unit test framework
http://docs.atoum.org
Other
10 stars 41 forks source link

Asserter on phpArray to get the values (version 2.9.0) #272

Closed jubianchi closed 7 years ago

jubianchi commented 7 years ago

The phpArray asserter has a new assertion: values. It was added in atoum/atoum#667.

Here is an example:

$this
    ->given($arr = [0 => 'foo', 2 => 'bar', 3 => 'baz'])
    ->then
        ->array($arr)->values
            ->string[0]->isEqualTo('foo')
            ->string[1]->isEqualTo('bar')
            ->string[2]->isEqualTo('baz')
;