Skip to content

Commit 33f4f3e

Browse files
committed
Merge pull request #450
2 parents 5b1d89f + 843cc0d commit 33f4f3e

File tree

2 files changed

+12
-111
lines changed

2 files changed

+12
-111
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ jobs:
144144
- php-version: '8.4'
145145
db-type: 'mariadb'
146146
db-version: '10.11'
147+
- php-version: '8.5'
148+
db-type: 'mariadb'
149+
db-version: '10.11'
147150
steps:
148151
- name: Checkout phpBB
149152
uses: actions/checkout@v6
@@ -245,6 +248,9 @@ jobs:
245248
- php-version: '8.4'
246249
db-type: 'postgres'
247250
db-version: '18-alpine'
251+
- php-version: '8.5'
252+
db-type: 'postgres'
253+
db-version: '18-alpine'
248254
steps:
249255
- name: Checkout phpBB
250256
uses: actions/checkout@v6

tests/functional/markdown_test.php

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,13 @@ public function test_post_markdown()
6565
$this->sid
6666
));
6767

68-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
69-
{
70-
$expected = <<<EOT
68+
$expected = <<<EOT
7169
<p>Code:</p>
7270
7371
<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>echo 'message';</code></pre></div>
7472
7573
<p>Inline <code>code</code></p>
7674
EOT;
77-
}
78-
else
79-
{
80-
$expected = <<<EOT
81-
<p>Code:</p>
82-
83-
<div class="codebox">
84-
<p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p>
85-
<pre><code>echo 'message';</code></pre>
86-
</div>
87-
88-
<p>Inline <code>code</code></p>
89-
EOT;
90-
}
9175

9276
$result = $crawler->filter(sprintf(
9377
'#post_content%d .content',
@@ -120,29 +104,13 @@ public function test_private_message()
120104
$this->sid
121105
));
122106

123-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
124-
{
125-
$expected = <<<EOT
107+
$expected = <<<EOT
126108
<p>Code:</p>
127109
128110
<div class="codebox"><p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p><pre><code>echo 'message';</code></pre></div>
129111
130112
<p>Inline <code>code</code></p>
131113
EOT;
132-
}
133-
else
134-
{
135-
$expected = <<<EOT
136-
<p>Code:</p>
137-
138-
<div class="codebox">
139-
<p>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></p>
140-
<pre><code>echo 'message';</code></pre>
141-
</div>
142-
143-
<p>Inline <code>code</code></p>
144-
EOT;
145-
}
146114

147115
$result = $crawler->filter(sprintf(
148116
'#post-%d .content',
@@ -172,28 +140,10 @@ public function test_simple_table()
172140
$this->sid
173141
));
174142

175-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
176-
{
177-
$expected = <<<EOT
143+
$expected = <<<EOT
178144
<table class="markdown"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead>
179145
<tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>
180146
EOT;
181-
}
182-
else
183-
{
184-
$expected = <<<EOT
185-
<table class="markdown">
186-
<thead><tr>
187-
<th>Header 1</th>
188-
<th>Header 2</th>
189-
</tr></thead>
190-
<tbody><tr>
191-
<td>Cell 1</td>
192-
<td>Cell 2</td>
193-
</tr></tbody>
194-
</table>
195-
EOT;
196-
}
197147

198148
$result = $crawler->filter(sprintf(
199149
'#post_content%d .content',
@@ -224,28 +174,10 @@ public function test_compact_table()
224174
$this->sid
225175
));
226176

227-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
228-
{
229-
$expected = <<<EOT
177+
$expected = <<<EOT
230178
<table class="markdown"><thead><tr><th>Header 1</th><th>Header 2</th></tr></thead>
231179
<tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody></table>
232180
EOT;
233-
}
234-
else
235-
{
236-
$expected = <<<EOT
237-
<table class="markdown">
238-
<thead><tr>
239-
<th>Header 1</th>
240-
<th>Header 2</th>
241-
</tr></thead>
242-
<tbody><tr>
243-
<td>Cell 1</td>
244-
<td>Cell 2</td>
245-
</tr></tbody>
246-
</table>
247-
EOT;
248-
}
249181

250182
$result = $crawler->filter(sprintf(
251183
'#post_content%d .content',
@@ -276,30 +208,10 @@ public function test_table_text_aligntment()
276208
$this->sid
277209
));
278210

279-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
280-
{
281-
$expected = <<<EOT
211+
$expected = <<<EOT
282212
<table class="markdown"><thead><tr><th style="text-align:left">Left</th><th style="text-align:center">Center</th><th style="text-align:right">Right</th></tr></thead>
283213
<tbody><tr><td style="text-align:left">x</td><td style="text-align:center">x</td><td style="text-align:right">x</td></tr></tbody></table>
284214
EOT;
285-
}
286-
else
287-
{
288-
$expected = <<<EOT
289-
<table class="markdown">
290-
<thead><tr>
291-
<th style="text-align:left">Left</th>
292-
<th style="text-align:center">Center</th>
293-
<th style="text-align:right">Right</th>
294-
</tr></thead>
295-
<tbody><tr>
296-
<td style="text-align:left">x</td>
297-
<td style="text-align:center">x</td>
298-
<td style="text-align:right">x</td>
299-
</tr></tbody>
300-
</table>
301-
EOT;
302-
}
303215

304216
$result = $crawler->filter(sprintf(
305217
'#post_content%d .content',
@@ -407,28 +319,11 @@ public function test_task_list()
407319
$this->assertSame(2, $list->count());
408320
$this->assertSame(3, $items->count());
409321

410-
if (version_compare(PHP_VERSION, '7.3.0', '>='))
411-
{
412-
$expected = <<<EOT
322+
$expected = <<<EOT
413323
<ul class="markdown"><li data-task-id="..." data-task-state="checked"><input data-task-id="..." type="checkbox" checked disabled> Task 1
414324
<ul class="markdown"><li data-task-id="..." data-task-state="checked"><input data-task-id="..." type="checkbox" checked disabled> Task 1.1</li></ul></li>
415325
<li data-task-id="..." data-task-state="unchecked"><input data-task-id="..." type="checkbox" disabled> Task 2</li></ul>
416326
EOT;
417-
}
418-
else
419-
{
420-
$expected = <<<EOT
421-
<ul class="markdown">
422-
<li data-task-id="..." data-task-state="checked">
423-
<input data-task-id="..." type="checkbox" checked disabled> Task 1
424-
<ul class="markdown"><li data-task-id="..." data-task-state="checked">
425-
<input data-task-id="..." type="checkbox" checked disabled> Task 1.1</li></ul>
426-
</li>
427-
<li data-task-id="..." data-task-state="unchecked">
428-
<input data-task-id="..." type="checkbox" disabled> Task 2</li>
429-
</ul>
430-
EOT;
431-
}
432327

433328
$html = $this->task_id_placeholder($result->html());
434329
$expected = $this->task_id_placeholder($expected);

0 commit comments

Comments
 (0)