/** @test */ public function github_username_can_be_in_brackets() { $transformer = new GitHubUsernameTransformer(); $this->assertEquals('Adam Wathan (<a href="http://github.com/adamwathan" target="_blank">@adamwathan</a>)', $transformer->transform('Adam Wathan (@adamwathan)')); $this->assertEquals('Adam Wathan [<a href="http://github.com/adamwathan" target="_blank">@adamwathan</a>]', $transformer->transform('Adam Wathan [@adamwathan]')); $this->assertEquals('Adam Wathan {<a href="http://github.com/adamwathan" target="_blank">@adamwathan</a>}', $transformer->transform('Adam Wathan {@adamwathan}')); $this->assertEquals('Adam Wathan <<a href="http://github.com/adamwathan" target="_blank">@adamwathan</a>>', $transformer->transform('Adam Wathan <@adamwathan>')); }
/** @test */ public function it_doesnt_convert_usernames_in_links() { $transformer = new GitHubUsernameTransformer(); $this->assertEquals('I am <a href="http://twitter.com/stauffermatt">@stauffermatt</a> on Twitter', $transformer->transform('I am <a href="http://twitter.com/stauffermatt">@stauffermatt</a> on Twitter')); $this->assertEquals('I am <a href="http://twitter.com/michaeldyrynda">little known @michaeldyrynda</a> on Twitter', $transformer->transform('I am <a href="http://twitter.com/michaeldyrynda">little known @michaeldyrynda</a> on Twitter')); }
/** @test */ public function it_doesnt_match_an_at_symbol_on_its_own() { $transformer = new GitHubUsernameTransformer(); $this->assertEquals('Meet me @ the place', $transformer->transform('Meet me @ the place')); }