public static function PHPUnit_Framework_Assert::assertStringEndsWith

Asserts that a string ends with a given prefix.

@since Method available since Release 3.4.0

Parameters

string $suffix:

string $string:

string $message:

3 calls to PHPUnit_Framework_Assert::assertStringEndsWith()
Framework_AssertTest::testAssertStringEndsWith in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringEndsWith
Framework_AssertTest::testAssertStringEndsWithThrowsException in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringEndsWith @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertStringEndsWithThrowsException2 in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringEndsWith @expectedException PHPUnit_Framework_Exception

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertStringEndsWith($suffix, $string, $message = '') {
  if (!is_string($suffix)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
  }
  if (!is_string($string)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
  }
  $constraint = new PHPUnit_Framework_Constraint_StringEndsWith($suffix);
  self::assertThat($string, $constraint, $message);
}