]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/HashTagDetectionTest.php
beginning of hashtag tests
[quix0rs-gnu-social.git] / tests / HashTagDetectionTest.php
1 <?php
2
3 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
4     print "This script must be run from the command line\n";
5     exit();
6 }
7
8 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
9 define('LACONICA', true);
10
11 require_once INSTALLDIR . '/lib/common.php';
12
13 class HashTagDetectionTest extends PHPUnit_Framework_TestCase
14 {
15     /**
16      * @dataProvider provider
17      *
18      */
19     public function testProduction($content, $expected)
20     {
21         $rendered = common_render_text($content);
22         $this->assertEquals($expected, $rendered);
23     }
24
25     static public function provider()
26     {
27         return array(
28                      array('hello',
29                            'hello'),
30                      array('#hello',
31                            '<a href="/tag/hello">hello</a>'),
32                      );
33     }
34 }
35