PHPUnit_Framework_Assert::assertStringEndsWith PHP Method

assertStringEndsWith() public static method

Asserts that a string ends with a given suffix.
public static assertStringEndsWith ( string $suffix, string $string, string $message = '' )
$suffix string
$string string
$message string
    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);
        static::assertThat($string, $constraint, $message);
    }

Usage Example

Example #1
0
/**
 * Asserts that a string ends with a given prefix.
 *
 * @param  string $suffix
 * @param  string $string
 * @param  string $message
 * @since  Method available since Release 3.4.0
 */
function assertStringEndsWith($suffix, $string, $message = '')
{
    return PHPUnit_Framework_Assert::assertStringEndsWith($suffix, $string, $message);
}
All Usage Examples Of PHPUnit_Framework_Assert::assertStringEndsWith
PHPUnit_Framework_Assert