ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\StringUtilTest Class Reference
+ Inheritance diagram for Sabre\VObject\StringUtilTest:
+ Collaboration diagram for Sabre\VObject\StringUtilTest:

Public Member Functions

 testNonUTF8 ()
 
 testIsUTF8 ()
 
 testUTF8ControlChar ()
 
 testConvertToUTF8nonUTF8 ()
 
 testConvertToUTF8IsUTF8 ()
 
 testConvertToUTF8ControlChar ()
 

Detailed Description

Definition at line 7 of file StringUtilTest.php.

Member Function Documentation

◆ testConvertToUTF8ControlChar()

Sabre\VObject\StringUtilTest::testConvertToUTF8ControlChar ( )

Definition at line 49 of file StringUtilTest.php.

49 {
50
51 $string = StringUtil::convertToUTF8(chr(0x00));
52
53 $this->assertEquals('', $string);
54
55 }
static convertToUTF8($str)
This method tries its best to convert the input string to UTF-8.
Definition: StringUtil.php:42

References Sabre\VObject\StringUtil\convertToUTF8().

+ Here is the call graph for this function:

◆ testConvertToUTF8IsUTF8()

Sabre\VObject\StringUtilTest::testConvertToUTF8IsUTF8 ( )

Definition at line 41 of file StringUtilTest.php.

41 {
42
43 $string = StringUtil::convertToUTF8('I 💚 SabreDAV');
44
45 $this->assertEquals('I 💚 SabreDAV', $string);
46
47 }

References Sabre\VObject\StringUtil\convertToUTF8().

+ Here is the call graph for this function:

◆ testConvertToUTF8nonUTF8()

Sabre\VObject\StringUtilTest::testConvertToUTF8nonUTF8 ( )

Definition at line 33 of file StringUtilTest.php.

33 {
34
35 $string = StringUtil::convertToUTF8(chr(0xbf));
36
37 $this->assertEquals(utf8_encode(chr(0xbf)), $string);
38
39 }

References Sabre\VObject\StringUtil\convertToUTF8().

+ Here is the call graph for this function:

◆ testIsUTF8()

Sabre\VObject\StringUtilTest::testIsUTF8 ( )

Definition at line 17 of file StringUtilTest.php.

17 {
18
19 $string = StringUtil::isUTF8('I 💚 SabreDAV');
20
21 $this->assertEquals(true, $string);
22
23 }
static isUTF8($str)
Returns true or false depending on if a string is valid UTF-8.
Definition: StringUtil.php:21

References Sabre\VObject\StringUtil\isUTF8().

+ Here is the call graph for this function:

◆ testNonUTF8()

Sabre\VObject\StringUtilTest::testNonUTF8 ( )

Definition at line 9 of file StringUtilTest.php.

9 {
10
11 $string = StringUtil::isUTF8(chr(0xbf));
12
13 $this->assertEquals(false, $string);
14
15 }

References Sabre\VObject\StringUtil\isUTF8().

+ Here is the call graph for this function:

◆ testUTF8ControlChar()

Sabre\VObject\StringUtilTest::testUTF8ControlChar ( )

Definition at line 25 of file StringUtilTest.php.

25 {
26
27 $string = StringUtil::isUTF8(chr(0x00));
28
29 $this->assertEquals(false, $string);
30
31 }

References Sabre\VObject\StringUtil\isUTF8().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: