ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
StringUtilTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\VObject
;
4
5
use
PHPUnit\Framework\TestCase
;
6
7
class
StringUtilTest
extends
TestCase {
8
9
function
testNonUTF8
() {
10
11
$string =
StringUtil::isUTF8
(chr(0xbf));
12
13
$this->assertEquals(
false
, $string);
14
15
}
16
17
function
testIsUTF8
() {
18
19
$string =
StringUtil::isUTF8
(
'I 💚 SabreDAV'
);
20
21
$this->assertEquals(
true
, $string);
22
23
}
24
25
function
testUTF8ControlChar
() {
26
27
$string =
StringUtil::isUTF8
(chr(0x00));
28
29
$this->assertEquals(
false
, $string);
30
31
}
32
33
function
testConvertToUTF8nonUTF8
() {
34
35
$string =
StringUtil::convertToUTF8
(chr(0xbf));
36
37
$this->assertEquals(utf8_encode(chr(0xbf)), $string);
38
39
}
40
41
function
testConvertToUTF8IsUTF8
() {
42
43
$string =
StringUtil::convertToUTF8
(
'I 💚 SabreDAV'
);
44
45
$this->assertEquals(
'I 💚 SabreDAV'
, $string);
46
47
}
48
49
function
testConvertToUTF8ControlChar
() {
50
51
$string =
StringUtil::convertToUTF8
(chr(0x00));
52
53
$this->assertEquals(
''
, $string);
54
55
}
56
57
}
Sabre\VObject\StringUtilTest\testConvertToUTF8ControlChar
testConvertToUTF8ControlChar()
Definition:
StringUtilTest.php:49
Sabre\VObject
Definition:
mergeduplicates.php:4
Sabre\VObject\StringUtilTest\testIsUTF8
testIsUTF8()
Definition:
StringUtilTest.php:17
Sabre\VObject\StringUtil\isUTF8
static isUTF8($str)
Returns true or false depending on if a string is valid UTF-8.
Definition:
StringUtil.php:21
Sabre\VObject\StringUtilTest
Definition:
StringUtilTest.php:7
Sabre\VObject\StringUtil\convertToUTF8
static convertToUTF8($str)
This method tries its best to convert the input string to UTF-8.
Definition:
StringUtil.php:42
Sabre\VObject\StringUtilTest\testUTF8ControlChar
testUTF8ControlChar()
Definition:
StringUtilTest.php:25
Sabre\VObject\StringUtilTest\testConvertToUTF8nonUTF8
testConvertToUTF8nonUTF8()
Definition:
StringUtilTest.php:33
Sabre\VObject\StringUtilTest\testConvertToUTF8IsUTF8
testConvertToUTF8IsUTF8()
Definition:
StringUtilTest.php:41
Sabre\VObject\StringUtilTest\testNonUTF8
testNonUTF8()
Definition:
StringUtilTest.php:9
php
TestCase
libs
composer
vendor
sabre
vobject
tests
VObject
StringUtilTest.php
Generated on Thu Jan 30 2025 19:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)