Skip to content

Commit 85ca9dd

Browse files
authored
BbifyTest.php: add a couple more test cases (#2079)
1 parent bb02d3f commit 85ca9dd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/SmrTest/lib/functions/BbifyTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
#[CoversFunction('smrBBCode')]
1111
class BbifyTest extends TestCase {
1212

13+
#[TestWith(['No tag', 'No tag'])]
14+
#[TestWith(["Multi\nline", "Multi<br />\nline"])]
15+
public function test_no_tag(string $input, string $expect): void {
16+
$result = bbify($input, gameID: 0);
17+
self::assertSame($expect, $result);
18+
}
19+
1320
public function test_verbatim(): void {
1421
$result = bbify('[verbatim]Hello[/verbatim]', gameID: 0, noLinks: true);
1522
$expect = '<tt>Hello</tt>';
@@ -24,4 +31,11 @@ public function test_race(bool $noLinks, string $expect): void {
2431
self::assertSame($expect, $result);
2532
}
2633

34+
public function test_race_invalid_id(): void {
35+
// Returned unmodified if an exception is thrown (e.g. invalid race)
36+
$input = '[race=700]';
37+
$result = bbify($input, gameID: 0);
38+
self::assertSame($input, $result);
39+
}
40+
2741
}

0 commit comments

Comments
 (0)