Testing collections in PHPUnit

Code
<?php

use PHPUnit\Framework\TestCase;

class 
Foo{}

class 
CollectionTypeTest extends TestCase
{
    public function 
testCollection()
    {
        
$collection = [
            new 
Foo(),
            new 
Foo(),
            new 
Foo(),
        ];
        
        
$iterator = new ArrayIterator(
            
$collection
        
);
        
        
// assertCount/assertNotCount works on
        // Traversable too
        
$this->assertNotCount(0$collection);
        
$this->assertNotCount(0$iterator);
        
        
// collection with no elements is not
        // covered by this assert
        
$this->assertContainsOnlyInstancesOf('Foo'$collection);
        
$this->assertContainsOnlyInstancesOf('Foo'$iterator);
    }
}
Result
Time: 86 ms, Memory: 4.00MB

OK (1 test, 0 assertions)