public static function PHPUnit_Framework_Assert::assertCount

Asserts the number of elements of an array, Countable or Iterator.

Parameters

integer $expectedCount:

mixed $haystack:

string $message:

5 calls to PHPUnit_Framework_Assert::assertCount()

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php, line 375

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertCount($expectedCount, $haystack, $message = '') {
  if (!is_int($expectedCount)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer');
  }
  if (!$haystack instanceof Countable && !$haystack instanceof Iterator && !is_array($haystack)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable');
  }
  self::assertThat($haystack, new PHPUnit_Framework_Constraint_Count($expectedCount), $message);
}