TYPO3CMS
9.5
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
$
d
e
r
u
Functions
Variables
$
e
r
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
CharsetConverterTest.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types = 1);
3
4
namespace
TYPO3\CMS\Core\Tests\Unit\Charset
;
5
6
/*
7
* This file is part of the TYPO3 CMS project.
8
*
9
* It is free software; you can redistribute it and/or modify it under
10
* the terms of the GNU General Public License, either version 2
11
* of the License, or any later version.
12
*
13
* For the full copyright and license information, please read the
14
* LICENSE.txt file that was distributed with this source code.
15
*
16
* The TYPO3 project - inspiring people to share!
17
*/
18
19
use
TYPO3\CMS\Core\Charset\CharsetConverter
;
20
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21
25
class
CharsetConverterTest
extends
UnitTestCase
26
{
32
public
function
validInputForSpecCharsToAscii
(): array
33
{
34
return
[
35
'scandinavian input'
=> [
36
'Näe ja koe'
,
37
// See issue #20612 - this is actually a wrong transition, but the way the method currently works
38
'Naee ja koe'
,
39
],
40
'german input'
=> [
41
'Größere Änderungswünsche Weißräm'
,
42
'Groessere AEnderungswuensche Weissraem'
,
43
],
44
];
45
}
46
53
public
function
specCharsToAsciiConvertsUmlautsToAscii
(
54
string
$input,
55
string
$expectedString
56
) {
57
$subject =
new
CharsetConverter
();
58
$this->assertSame($expectedString, $subject->specCharsToASCII(
'utf-8'
, $input));
59
}
60
66
public
function
invalidInputForSpecCharsToAscii
(): array
67
{
68
return
[
69
'integer input'
=> [
70
1,
71
],
72
'null input'
=> [
73
null
,
74
],
75
'boolean input'
=> [
76
true
,
77
],
78
'floating point input'
=> [
79
3.14,
80
],
81
];
82
}
83
89
public
function
specCharsToAsciiConvertsInvalidInputToEmptyString
($input)
90
{
91
$subject =
new
CharsetConverter
();
92
$this->assertSame(
''
, $subject->specCharsToASCII(
'utf-8'
, $input));
93
}
94
}
TYPO3\CMS\Core\Tests\Unit\Charset\CharsetConverterTest\specCharsToAsciiConvertsUmlautsToAscii
specCharsToAsciiConvertsUmlautsToAscii(string $input, string $expectedString)
Definition:
CharsetConverterTest.php:53
TYPO3\CMS\Core\Tests\Unit\Charset\CharsetConverterTest\invalidInputForSpecCharsToAscii
array[] invalidInputForSpecCharsToAscii()
Definition:
CharsetConverterTest.php:66
TYPO3\CMS\Core\Tests\Unit\Charset\CharsetConverterTest\specCharsToAsciiConvertsInvalidInputToEmptyString
specCharsToAsciiConvertsInvalidInputToEmptyString($input)
Definition:
CharsetConverterTest.php:89
TYPO3\CMS\Core\Charset\CharsetConverter
Definition:
CharsetConverter.php:54
TYPO3\CMS\Core\Tests\Unit\Charset
Definition:
CharsetConverterTest.php:4
TYPO3\CMS\Core\Tests\Unit\Charset\CharsetConverterTest\validInputForSpecCharsToAscii
string[][] validInputForSpecCharsToAscii()
Definition:
CharsetConverterTest.php:32
TYPO3\CMS\Core\Tests\Unit\Charset\CharsetConverterTest
Definition:
CharsetConverterTest.php:26
doxygen
typo3
sysext
core
Tests
Unit
Charset
CharsetConverterTest.php
Generated on Tue Oct 5 2021 01:57:22 for TYPO3CMS by
1.8.18