Changeset View
Changeset View
Standalone View
Standalone View
tests/Strings/Multibyte/StringUtilitiesTest.php
Show All 20 Lines | class StringUtilitiesTest extends TestCase { | ||||
) : void { | ) : void { | ||||
$paddedString = StringUtilities::pad( | $paddedString = StringUtilities::pad( | ||||
$input, $padLength, $padString, $padType, "UTF-8" | $input, $padLength, $padString, $padType, "UTF-8" | ||||
); | ); | ||||
$this->assertEquals($expected, $paddedString); | $this->assertEquals($expected, $paddedString); | ||||
} | } | ||||
public function testPadWithDefaultArguments () : void { | |||||
$this->assertEquals("foo ", StringUtilities::pad("foo", 4)); | |||||
$this->assertEquals("foo_", StringUtilities::pad("foo", 4, '_')); | |||||
$this->assertEquals("_foo", StringUtilities::pad("foo", 4, '_', STR_PAD_LEFT)); | |||||
} | |||||
public function testSupportedEncoding () : void { | public function testSupportedEncoding () : void { | ||||
$this->assertTrue(StringUtilities::isSupportedEncoding("UTF-8")); | $this->assertTrue(StringUtilities::isSupportedEncoding("UTF-8")); | ||||
$this->assertFalse(StringUtilities::isSupportedEncoding("notexisting")); | $this->assertFalse(StringUtilities::isSupportedEncoding("notexisting")); | ||||
} | } | ||||
/// | /// | ||||
/// Data providers | /// Data providers | ||||
/// | /// | ||||
Show All 33 Lines |
Nasqueron DevCentral · If it had been much bigger the moon would have had a core of ice. · Powered by Phabricator