mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
PHTML
49 lines
1.1 KiB
PHTML
4 years ago
|
<?php
|
||
|
|
||
|
namespace Tests\Unit;
|
||
|
|
||
|
use Tests\TestCase;
|
||
|
use App\Util\Lexer\Nickname;
|
||
|
|
||
|
class WebfingerTest extends TestCase
|
||
|
{
|
||
|
/** @test */
|
||
|
public function webfingerTest()
|
||
|
{
|
||
|
$expected = [
|
||
|
"domain" => "pixelfed.org",
|
||
|
"username" => "dansup",
|
||
|
];
|
||
|
$actual = Nickname::normalizeProfileUrl('acct:dansup@pixelfed.org');
|
||
|
$this->assertEquals($expected, $actual);
|
||
|
|
||
|
$expected = [
|
||
|
"domain" => "pixelfed.org",
|
||
|
"username" => "dansup_",
|
||
|
];
|
||
|
$actual = Nickname::normalizeProfileUrl('acct:dansup@pixelfed.org');
|
||
|
$this->assertNotEquals($expected, $actual);
|
||
|
|
||
|
$expected = [
|
||
|
"domain" => "pixelfed.org",
|
||
|
"username" => "dansup",
|
||
|
];
|
||
|
$actual = Nickname::normalizeProfileUrl('acct:@dansup@pixelfed.org');
|
||
|
$this->assertEquals($expected, $actual);
|
||
|
|
||
|
$expected = [
|
||
|
"domain" => "pixelfed.org",
|
||
|
"username" => "dansup",
|
||
|
];
|
||
|
$actual = Nickname::normalizeProfileUrl('dansup@pixelfed.org');
|
||
|
$this->assertEquals($expected, $actual);
|
||
|
|
||
|
$expected = [
|
||
|
"domain" => "pixelfed.org",
|
||
|
"username" => "dansup",
|
||
|
];
|
||
|
$actual = Nickname::normalizeProfileUrl('@dansup@pixelfed.org');
|
||
|
$this->assertEquals($expected, $actual);
|
||
|
}
|
||
|
}
|