public function testMakeWithAttributes() { $string = Factory::anchor('Visit my website at http://ssdtutorials.com', ['target' => '_blank']); $expected = 'Visit my website at '; $expected .= '<a href="http://ssdtutorials.com"'; $expected .= ' target="_blank">ssdtutorials.com</a>'; $this->assertEquals($expected, $string); }
public function testMakeWithHrefAndAttributes() { $string = Factory::atUser('Thanks very much @JohnDoe', '/user/', ['target' => '_blank']); $expected = 'Thanks very much '; $expected .= '<a href="/user/johndoe"'; $expected .= ' target="_blank">@JohnDoe</a>'; $this->assertEquals($expected, $string); }
<?php require "../vendor/autoload.php"; use SSD\RegexKit\Factory; echo Factory::atUser('Hey @JohnDoe, thanks for sorting this out!', '/user/', ['target' => '_blank', 'title' => 'View user profile']);
/** * @expectedException \Exception * * @expectedExceptionMessage * Class SSD\RegularExpression\Expressions\Argument does not exist */ public function testCallStaticNonExistentMethod() { $return = Factory::someClass('argument'); }
<?php require "../vendor/autoload.php"; use SSD\RegexKit\Factory; echo Factory::anchor('Visit documentation at http://github.com or for more info use http://google.com', ['target' => '_blank']);