ILIAS
trunk Revision v11.0_alpha-1753-gb21ca8c4367
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace 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
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
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
y
z
Ö
+
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
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
PostingReplySubjectBuilderTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
PHPUnit\Framework\TestCase
;
22
23
class
PostingReplySubjectBuilderTest
extends
TestCase
24
{
28
public
static
function
postingSubjectProvider
():
Generator
29
{
30
yield
'Subject without reply prefix'
=> [
31
'subject'
=>
'This is a subject'
,
32
'reply_prefix'
=>
'Re:'
,
33
'optimized_repeated_reply_prefix'
=>
'Re (%s):'
,
34
'expected_result'
=>
'Re: This is a subject'
35
];
36
37
yield
'Subject without reply prefix and prefix without expected end character'
=> [
38
'subject'
=>
'This is a subject'
,
39
'reply_prefix'
=>
'Re'
,
40
'optimized_repeated_reply_prefix'
=>
'Re (%s):'
,
41
'expected_result'
=>
'Re: This is a subject'
42
];
43
44
yield
'Subject with repeated reply prefix'
=> [
45
'subject'
=>
'Re: Re: Re: This is a subject'
,
46
'reply_prefix'
=>
'Re:'
,
47
'optimized_repeated_reply_prefix'
=>
'Re (%s):'
,
48
'expected_result'
=>
'Re (4): This is a subject'
49
];
50
51
yield
'Subject with optimized repeated reply prefix'
=> [
52
'subject'
=>
'Re (3): This is a subject'
,
53
'reply_prefix'
=>
'Re:'
,
54
'optimized_repeated_reply_prefix'
=>
'Re (%s):'
,
55
'expected_result'
=>
'Re (4): This is a subject'
56
];
57
58
yield
'Subject with optimized repeated reply prefix (without spaces)'
=> [
59
'subject'
=>
'Re(3): This is a subject'
,
60
'reply_prefix'
=>
'Re:'
,
61
'optimized_repeated_reply_prefix'
=>
'Re (%s):'
,
62
'expected_result'
=>
'Re(4): This is a subject'
63
];
64
65
yield
'Subject with repeated reply prefix and repetition-prefix without expected end character'
=> [
66
'subject'
=>
'Re: Re: Re: This is a subject'
,
67
'reply_prefix'
=>
'Re:'
,
68
'optimized_repeated_reply_prefix'
=>
'Re (%s)'
,
69
'expected_result'
=>
'Re (4): This is a subject'
70
];
71
72
yield
'Subject with optimized repeated reply prefix and repetition-prefix without expected end character'
=> [
73
'subject'
=>
'Re (3): This is a subject'
,
74
'reply_prefix'
=>
'Re:'
,
75
'optimized_repeated_reply_prefix'
=>
'Re (%s)'
,
76
'expected_result'
=>
'Re (4): This is a subject'
77
];
78
79
yield
'Subject with optimized repeated reply prefix (without spaces) and repetition-prefix without expected end character'
=> [
80
'subject'
=>
'Re(3): This is a subject'
,
81
'reply_prefix'
=>
'Re:'
,
82
'optimized_repeated_reply_prefix'
=>
'Re (%s)'
,
83
'expected_result'
=>
'Re(4): This is a subject'
84
];
85
}
86
90
public
function
testPostingSubjectBuilder
(
91
string
$subject,
92
string
$reply_prefix,
93
string
$optimized_repeated_reply_prefix,
94
string
$expected_result
95
): void {
96
$posting_subject_builder = new \ILIAS\components\Forum\Subject\PostingReplySubjectBuilder(
97
$reply_prefix,
98
$optimized_repeated_reply_prefix
99
);
100
$result = $posting_subject_builder->build($subject);
101
102
$this->assertSame($expected_result, $result);
103
}
104
}
PostingReplySubjectBuilderTest\testPostingSubjectBuilder
testPostingSubjectBuilder(string $subject, string $reply_prefix, string $optimized_repeated_reply_prefix, string $expected_result)
postingSubjectProvider
Definition:
PostingReplySubjectBuilderTest.php:90
PostingReplySubjectBuilderTest\postingSubjectProvider
static postingSubjectProvider()
Definition:
PostingReplySubjectBuilderTest.php:28
Generator
PostingReplySubjectBuilderTest
Definition:
PostingReplySubjectBuilderTest.php:23
TestCase
TestCase
components
ILIAS
Forum
tests
PostingReplySubjectBuilderTest.php
Generated on Thu Apr 10 2025 23:03:17 for ILIAS by
1.8.13 (using
Doxyfile
)