public static function PHPUnit_Framework_Assert::assertSameSize

Assert that the size of two arrays (or `Countable` or `Iterator` objects) is the same.

Parameters

array|Countable|Iterator $expected:

array|Countable|Iterator $actual:

string $message:

3 calls to PHPUnit_Framework_Assert::assertSameSize()
Framework_AssertTest::testAssertSameSize in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSameSize
Framework_AssertTest::testAssertSameSizeThrowsExceptionIfActualIsNotCountable in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSameSize
Framework_AssertTest::testAssertSameSizeThrowsExceptionIfExpectedIsNotCoutable in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSameSize

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertSameSize($expected, $actual, $message = '') {
  if (!$expected instanceof Countable && !$expected instanceof Iterator && !is_array($expected)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'countable');
  }
  if (!$actual instanceof Countable && !$actual instanceof Iterator && !is_array($actual)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'countable');
  }
  self::assertThat($actual, new PHPUnit_Framework_Constraint_SameSize($expected), $message);
}