3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Test\src\Content\Text\BBCode;
24 use Friendica\Content\Text\BBCode\Video;
25 use Friendica\Test\MockedTest;
27 class VideoTest extends MockedTest
29 public function dataVideo()
33 'input' => '[video]https://youtube.link/4523[/video]',
34 'assert' => '[youtube]https://youtube.link/4523[/youtube]',
37 'input' => '[video]https://youtu.be.link/4523[/video]',
38 'assert' => '[youtube]https://youtu.be.link/4523[/youtube]',
41 'input' => '[video]https://vimeo.link/2343[/video]',
42 'assert' => '[vimeo]https://vimeo.link/2343[/vimeo]',
45 'input' => '[video]https://vimeo.link/2343[/video] With other [b]string[/b] [video]https://youtu.be/blaa[/video]',
46 'assert' => '[vimeo]https://vimeo.link/2343[/vimeo] With other [b]string[/b] [youtube]https://youtu.be/blaa[/youtube]',
52 * Test if the BBCode is successfully transformed for video links
54 * @dataProvider dataVideo
56 public function testTransform(string $input, string $assert)
58 $bbCodeVideo = new Video();
60 $this->assertEquals($assert, $bbCodeVideo->transform($input));