mirror of
https://github.com/friendica/friendica
synced 2025-05-20 11:04:10 +02:00
Added test
This commit is contained in:
parent
3af5caa950
commit
35ae7278f7
2 changed files with 58 additions and 13 deletions
|
@ -88,6 +88,11 @@ return [
|
||||||
'uri' => 'https://friendica.local/profile/mutualcontact',
|
'uri' => 'https://friendica.local/profile/mutualcontact',
|
||||||
'guid' => '46',
|
'guid' => '46',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'id' => 49,
|
||||||
|
'uri' => 'https://domain.tld/profile/remotecontact',
|
||||||
|
'guid' => '49',
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'id' => 100,
|
'id' => 100,
|
||||||
'uri' => 'https://friendica.local/posts/100',
|
'uri' => 'https://friendica.local/posts/100',
|
||||||
|
@ -214,6 +219,23 @@ return [
|
||||||
'network' => Protocol::DFRN,
|
'network' => Protocol::DFRN,
|
||||||
'location' => 'DFRN',
|
'location' => 'DFRN',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'id' => 49,
|
||||||
|
'uid' => 0,
|
||||||
|
'uri-id' => 43,
|
||||||
|
'name' => 'Remote user',
|
||||||
|
'nick' => 'remotecontact',
|
||||||
|
'self' => 0,
|
||||||
|
'nurl' => 'http://domain.tld/profile/remotecontact',
|
||||||
|
'url' => 'https://domain.tld/profile/remotecontact',
|
||||||
|
'alias' => 'https://domain.tld/~remotecontact',
|
||||||
|
'about' => 'User used in tests',
|
||||||
|
'pending' => 0,
|
||||||
|
'blocked' => 0,
|
||||||
|
'rel' => Contact::FOLLOWER,
|
||||||
|
'network' => Protocol::ACTIVITYPUB,
|
||||||
|
'location' => 'AP',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'apcontact' => [
|
'apcontact' => [
|
||||||
[
|
[
|
||||||
|
|
|
@ -615,4 +615,27 @@ Lucas: For the right price, yes.[/share]',
|
||||||
|
|
||||||
self::assertEquals($expected, $actual);
|
self::assertEquals($expected, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dataProfileLink(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'mention' => [
|
||||||
|
'expected' => 'Test 1: <bdi>@<a href="https://domain.tld/~remotecontact" class="userinfo mention" title="Remote contact">Remote contact</a></bdi>',
|
||||||
|
'text' => 'Test 1: @[url=https://domain.tld/profile/remotecontact]Remote contact[/url]',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider dataProfileLink
|
||||||
|
*
|
||||||
|
* @param string $expected Expected BBCode output
|
||||||
|
* @param string $text Input text
|
||||||
|
*/
|
||||||
|
public function testProfileLink(string $expected, string $text)
|
||||||
|
{
|
||||||
|
$actual = BBCode::convertForUriId(0, $text);
|
||||||
|
|
||||||
|
self::assertEquals($expected, $actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue