sebastianbergmann/phpunit — pull request #596 by JCook21 (2012-06-25 12:10:52+00:00)
Title: Added assertion to check if Traversable contains instances of a given classname

I had a situation the other week where I needed to check if an array or traversable object contained an instance of a given class. After digging around I found that PHPUnit doesn't seem to have an easy way to do this so I created this pull request to add that functionality. It allows a user to assert that an array or traversable object contains at least X instances of a given classname (where X is an integer, defaulting to 1) or that an array or traversable object contains exactly X instances of a given classname. There's also an assertion to assert that an array or traversable object contains no instances of a given class.