ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PostingReplySubjectBuilderTest Class Reference
+ Inheritance diagram for PostingReplySubjectBuilderTest:
+ Collaboration diagram for PostingReplySubjectBuilderTest:

Public Member Functions

 testPostingSubjectBuilder (string $subject, string $reply_prefix, string $optimized_repeated_reply_prefix, string $expected_result)
 

Static Public Member Functions

static postingSubjectProvider ()
 

Detailed Description

Definition at line 24 of file PostingReplySubjectBuilderTest.php.

Member Function Documentation

◆ postingSubjectProvider()

static PostingReplySubjectBuilderTest::postingSubjectProvider ( )
static
Returns
Generator<string, array{"subject": string, "reply_prefix": string, "optimized_repeated_reply_prefix": string, "expected_result": string}>

Definition at line 29 of file PostingReplySubjectBuilderTest.php.

29 : Generator
30 {
31 yield 'Subject without reply prefix' => [
32 'subject' => 'This is a subject',
33 'reply_prefix' => 'Re:',
34 'optimized_repeated_reply_prefix' => 'Re (%s):',
35 'expected_result' => 'Re: This is a subject'
36 ];
37
38 yield 'Subject without reply prefix and prefix without expected end character' => [
39 'subject' => 'This is a subject',
40 'reply_prefix' => 'Re',
41 'optimized_repeated_reply_prefix' => 'Re (%s):',
42 'expected_result' => 'Re: This is a subject'
43 ];
44
45 yield 'Subject with repeated reply prefix' => [
46 'subject' => 'Re: Re: Re: This is a subject',
47 'reply_prefix' => 'Re:',
48 'optimized_repeated_reply_prefix' => 'Re (%s):',
49 'expected_result' => 'Re (4): This is a subject'
50 ];
51
52 yield 'Subject with optimized repeated reply prefix' => [
53 'subject' => 'Re (3): This is a subject',
54 'reply_prefix' => 'Re:',
55 'optimized_repeated_reply_prefix' => 'Re (%s):',
56 'expected_result' => 'Re (4): This is a subject'
57 ];
58
59 yield 'Subject with optimized repeated reply prefix (without spaces)' => [
60 'subject' => 'Re(3): This is a subject',
61 'reply_prefix' => 'Re:',
62 'optimized_repeated_reply_prefix' => 'Re (%s):',
63 'expected_result' => 'Re(4): This is a subject'
64 ];
65
66 yield 'Subject with repeated reply prefix and repetition-prefix without expected end character' => [
67 'subject' => 'Re: Re: Re: This is a subject',
68 'reply_prefix' => 'Re:',
69 'optimized_repeated_reply_prefix' => 'Re (%s)',
70 'expected_result' => 'Re (4): This is a subject'
71 ];
72
73 yield 'Subject with optimized repeated reply prefix and repetition-prefix without expected end character' => [
74 'subject' => 'Re (3): This is a subject',
75 'reply_prefix' => 'Re:',
76 'optimized_repeated_reply_prefix' => 'Re (%s)',
77 'expected_result' => 'Re (4): This is a subject'
78 ];
79
80 yield 'Subject with optimized repeated reply prefix (without spaces) and repetition-prefix without expected end character' => [
81 'subject' => 'Re(3): This is a subject',
82 'reply_prefix' => 'Re:',
83 'optimized_repeated_reply_prefix' => 'Re (%s)',
84 'expected_result' => 'Re(4): This is a subject'
85 ];
86 }

◆ testPostingSubjectBuilder()

PostingReplySubjectBuilderTest::testPostingSubjectBuilder ( string  $subject,
string  $reply_prefix,
string  $optimized_repeated_reply_prefix,
string  $expected_result 
)

Definition at line 89 of file PostingReplySubjectBuilderTest.php.

94 : void {
95 $posting_subject_builder = new \ILIAS\components\Forum\Subject\PostingReplySubjectBuilder(
96 $reply_prefix,
97 $optimized_repeated_reply_prefix
98 );
99 $result = $posting_subject_builder->build($subject);
100
101 $this->assertSame($expected_result, $result);
102 }

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