public static function PHPUnit_Framework_Assert::assertSelectCount

Assert the presence, absence, or count of elements in a document matching the CSS $selector, regardless of the contents of those elements.

The first argument, $selector, is the CSS selector used to match the elements in the $actual document.

The second argument, $count, can be either boolean or numeric. When boolean, it asserts for presence of elements matching the selector (TRUE) or absence of elements (FALSE). When numeric, it asserts the count of elements.

assertSelectCount("#binder", true, $xml); // any? assertSelectCount(".binder", 3, $xml); // exactly 3?

@since Method available since Release 3.3.0 @author Mike Naberezny <mike@maintainable.com> @author Derek DeVries <derek@maintainable.com>

Parameters

array $selector:

integer $count:

mixed $actual:

string $message:

boolean $isHtml:

18 calls to PHPUnit_Framework_Assert::assertSelectCount()
Framework_AssertTest::testAssertSelectCountChildFalse in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSelectCount @expectedException PHPUnit_Framework_AssertionFailedError
Framework_AssertTest::testAssertSelectCountChildTrue in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSelectCount
Framework_AssertTest::testAssertSelectCountDescendantFalse in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSelectCount @expectedException PHPUnit_Framework_AssertionFailedError
Framework_AssertTest::testAssertSelectCountDescendantTrue in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSelectCount
Framework_AssertTest::testAssertSelectCountGreaterThanEqualToFalse in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSelectCount @expectedException PHPUnit_Framework_AssertionFailedError

... See full list

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE) {
  self::assertSelectEquals($selector, TRUE, $count, $actual, $message, $isHtml);
}