@@ -19,90 +19,4 @@ public function test_create_tournament(
1919
2020 }
2121
22- /**
23- * @covers BMInterfaceTournament::truncate_tournament_description
24- */
25- public function test_truncate_tournament_description () {
26- $ reflection = new ReflectionMethod ($ this ->object , 'truncate_tournament_description ' );
27- $ reflection ->setAccessible (true );
28-
29- $ roundDescription = 'Tournament Round 1 ' ;
30-
31- $ description = 'short ' ;
32- $ shortDescription = $ reflection ->invoke ($ this ->object , $ description , $ roundDescription );
33- $ this ->assertEquals ($ description , $ shortDescription , 'Short descriptions should not be truncated ' );
34-
35- $ description = '12345678901234567890123456789012345678901234567890 ' .
36- '12345678901234567890123456789012345678901234567890 ' .
37- '12345678901234567890123456789012345678901234567890 ' .
38- '12345678901234567890123456789012345678901234567890 ' .
39- '12345678901234567890123456789012345678901234567890 ' .
40- '12345678901234567890123456789012345678901234567890 ' ;
41- $ shortDescription = $ reflection ->invoke ($ this ->object , $ description , $ roundDescription );
42- $ this ->assertEquals (
43- '12345678901234567890123456789012345678901234567890 ' .
44- '12345678901234567890123456789012345678901234567890 ' .
45- '12345678901234567890123456789012345678901234567890 ' .
46- '12345678901234567890123456789012345678901234567890 ' .
47- '12345678901234567890123456789012... ' ,
48- $ shortDescription ,
49- 'Long text descriptions should be truncated appropriately '
50- );
51-
52- $ description = '[forum=1,6]text[/forum]56789012345678901234567890 ' .
53- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
54- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
55- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
56- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
57- '12345678901234567890123456789012345678901234567890 ' ;
58- $ shortDescription = $ reflection ->invoke ($ this ->object , $ description , $ roundDescription );
59- $ this ->assertEquals (
60- 'text56789012345678901234567890 ' .
61- 'text56789012345678901234567890 ' .
62- 'text56789012345678901234567890 ' .
63- 'text56789012345678901234567890 ' .
64- 'text56789012345678901234567890 ' .
65- '12345678901234567890123456789012345678901234567890 ' ,
66- $ shortDescription ,
67- 'Markup should be removed even with no late BBCode '
68- );
69-
70- $ description = '[forum=1,6]text[/forum]56789012345678901234567890 ' .
71- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
72- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
73- '[forum=1,6]text[/forum]56789012345678901234567890 ' .
74- '1234567890[forum=1,6]text[/forum]45678901234567890 ' .
75- '12345678901234567890123456789012345678901234567890 ' ;
76- $ shortDescription = $ reflection ->invoke ($ this ->object , $ description , $ roundDescription );
77- $ this ->assertEquals (
78- 'text56789012345678901234567890 ' .
79- 'text56789012345678901234567890 ' .
80- 'text56789012345678901234567890 ' .
81- 'text56789012345678901234567890 ' .
82- '1234567890text45678901234567890 ' .
83- '12345678901234567890123456789012345678901234567890 ' ,
84- $ shortDescription ,
85- 'Markup should be removed with late BBCode '
86- );
87- }
88-
89- /**
90- * @covers BMInterfaceTournament::strip_nonessential_bbcode
91- */
92- public function test_strip_nonessential_bbcode () {
93- $ reflection = new ReflectionMethod ($ this ->object , 'strip_nonessential_bbcode ' );
94- $ reflection ->setAccessible (true );
95-
96- $ text = '[button=Abe Caine] is [b][i]very[/i] annoying[/b] ' .
97- '[spoiler]according to [player=tasha][/spoiler], ' .
98- 'see [forum=1335,32790]this forum thread[/forum] ' ;
99- $ strippedText = $ reflection ->invoke ($ this ->object , $ text );
100- $ this ->assertEquals (
101- '[button=Abe Caine] is very annoying ' .
102- '[spoiler]according to [player=tasha][/spoiler], ' .
103- 'see this forum thread ' ,
104- $ strippedText ,
105- 'BBCode stripping should be correct '
106- );
107- }
10822}
0 commit comments