You are here

public static function PHPUnit_Framework_Assert::assertNotSameSize in Zircon Profile 8

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

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

Parameters

array|Countable|Traversable $expected:

array|Countable|Traversable $actual:

string $message:

3 calls to PHPUnit_Framework_Assert::assertNotSameSize()
Framework_AssertTest::testAssertNotSameSize in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSameSize
Framework_AssertTest::testAssertNotSameSizeThrowsExceptionIfActualIsNotCountable in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSameSize @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertNotSameSizeThrowsExceptionIfExpectedIsNotCountable in vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSameSize @expectedException PHPUnit_Framework_Exception

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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