blob: 8e19b1d7e0e14214dd726eadced1790cb99df830 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
/*
* SPDX-FileCopyrightText: 2024 Hubzilla Community
* SPDX-FileContributor: Harald Eilertsen
*
* SPDX-License-Identifier: MIT
*/
namespace Zotlabs\Tests\Unit;
use PHPUnit\Framework\Attributes\DataProvider;
class CleanupBBCodeTest extends UnitTestCase {
#[DataProvider("cleanup_bbcode_provider")]
public function test_cleanup_bbcode(string $expected, string $input): void {
$this->assertEquals($expected, cleanup_bbcode($input));
}
public static function cleanup_bbcode_provider(): array {
return [
'url followed by newline' => [
"#^[url=https://example.com]https://example.com[/url]\na test link",
"https://example.com\na test link",
]
];
}
}
|