3 namespace Friendica\Test\Content\Text\BBCode;
5 use Friendica\Content\Text\BBCode\Video;
6 use Friendica\Test\MockedTest;
8 class VideoTest extends MockedTest
10 public function dataVideo()
14 'input' => '[video]https://youtube.link/4523[/video]',
15 'assert' => '[youtube]https://youtube.link/4523[/youtube]',
18 'input' => '[video]https://youtu.be.link/4523[/video]',
19 'assert' => '[youtube]https://youtu.be.link/4523[/youtube]',
22 'input' => '[video]https://vimeo.link/2343[/video]',
23 'assert' => '[vimeo]https://vimeo.link/2343[/vimeo]',
26 'input' => '[video]https://vimeo.link/2343[/video] With other [b]string[/b] [video]https://youtu.be/blaa[/video]',
27 'assert' => '[vimeo]https://vimeo.link/2343[/vimeo] With other [b]string[/b] [youtube]https://youtu.be/blaa[/youtube]',
33 * Test if the BBCode is successfully transformed for video links
35 * @dataProvider dataVideo
37 public function testTransform(string $input, string $assert)
39 $bbCodeVideo = new Video();
41 $this->assertEquals($assert, $bbCodeVideo->transform($input));