diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-05-10 23:18:04 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-06-06 21:04:43 +0200 |
commit | 9ccca40189652e529732683abcdf54fcf775c9ec (patch) | |
tree | 9deda85d287dcba664bbba2f0bf9228e6118fbad /tests/UtilsTest.php | |
parent | bb9ca54838e2f877635197541e8439171c83d5dc (diff) | |
download | Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.tar.gz Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.tar.zst Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.zip |
Hashtag system
* Hashtag are auto-linked with a filter search
* Supports unicode
* Compatible with markdown (excluded in code blocks)
Diffstat (limited to 'tests/UtilsTest.php')
-rw-r--r-- | tests/UtilsTest.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 3073b5eb..6a7870c4 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php | |||
@@ -253,41 +253,4 @@ class UtilsTest extends PHPUnit_Framework_TestCase | |||
253 | is_session_id_valid('c0ZqcWF3VFE2NmJBdm1HMVQ0ZHJ3UmZPbTFsNGhkNHI=') | 253 | is_session_id_valid('c0ZqcWF3VFE2NmJBdm1HMVQ0ZHJ3UmZPbTFsNGhkNHI=') |
254 | ); | 254 | ); |
255 | } | 255 | } |
256 | |||
257 | /** | ||
258 | * Test text2clickable without a redirector being set. | ||
259 | */ | ||
260 | public function testText2clickableWithoutRedirector() | ||
261 | { | ||
262 | $text = 'stuff http://hello.there/is=someone#here otherstuff'; | ||
263 | $expectedText = 'stuff <a href="http://hello.there/is=someone#here">http://hello.there/is=someone#here</a> otherstuff'; | ||
264 | $processedText = text2clickable($text, ''); | ||
265 | $this->assertEquals($expectedText, $processedText); | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * Test text2clickable a redirector set. | ||
270 | */ | ||
271 | public function testText2clickableWithRedirector() | ||
272 | { | ||
273 | $text = 'stuff http://hello.there/is=someone#here otherstuff'; | ||
274 | $redirector = 'http://redirector.to'; | ||
275 | $expectedText = 'stuff <a href="'. | ||
276 | $redirector . | ||
277 | urlencode('http://hello.there/is=someone#here') . | ||
278 | '">http://hello.there/is=someone#here</a> otherstuff'; | ||
279 | $processedText = text2clickable($text, $redirector); | ||
280 | $this->assertEquals($expectedText, $processedText); | ||
281 | } | ||
282 | |||
283 | /** | ||
284 | * Test testSpace2nbsp. | ||
285 | */ | ||
286 | public function testSpace2nbsp() | ||
287 | { | ||
288 | $text = ' Are you thrilled by flags ?'. PHP_EOL .' Really?'; | ||
289 | $expectedText = ' Are you thrilled by flags ?'. PHP_EOL .' Really?'; | ||
290 | $processedText = space2nbsp($text); | ||
291 | $this->assertEquals($expectedText, $processedText); | ||
292 | } | ||
293 | } | 256 | } |