public static function PHPUnit_Framework_Assert::assertStringStartsWith

Asserts that a string starts with a given prefix.

@since Method available since Release 3.4.0

Parameters

string $prefix:

string $string:

string $message:

6 calls to PHPUnit_Framework_Assert::assertStringStartsWith()
Framework_AssertTest::testAssertStringStartsWith in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringStartsWith
Framework_AssertTest::testAssertStringStartsWithThrowsException in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringStartsWith @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertStringStartsWithThrowsException2 in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertStringStartsWith @expectedException PHPUnit_Framework_Exception
Framework_MockObjectTest::testCreateMockFromWsdl in drupal/core/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php
@requires extension soap
Framework_MockObjectTest::testCreateNamespacedMockFromWsdl in drupal/core/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php
@requires extension soap

... See full list

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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