You are here

public static function PHPUnit_Framework_Assert::assertNotCount in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Assert.php \PHPUnit_Framework_Assert::assertNotCount()

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

Parameters

int $expectedCount:

mixed $haystack:

string $message:

4 calls to PHPUnit_Framework_Assert::assertNotCount()
Framework_AssertTest::testAssertNotCount in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotCount
Framework_AssertTest::testAssertNotCountThrowsExceptionIfElementIsNotCountable in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotCount @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertNotCountThrowsExceptionIfExpectedCountIsNoInteger in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotCount @expectedException PHPUnit_Framework_Exception
PHPUnit_Framework_Assert::assertAttributeNotCount in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts the number of elements of an array, Countable or Traversable that is stored in an attribute.

File

vendor/phpunit/phpunit/src/Framework/Assert.php, line 441

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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