SproutCMS

This is the code documentation for the SproutCMS project

class BbCode

Source code (2 results)

/sprout/Helpers/BbCode.php   Highlighted file source

Line 16: class BbCode
Line 22: * Supports the following bbcode tags:
Line 50: * Convert multi-line text into HTML, with support for bbcode.

/sprout/tests/bbcodeTest.php   Highlighted file source

Line 14: use Sprout\Helpers\BbCode;
Line 17: class bbcodeTest extends PHPUnit_Framework_TestCase
Line 22: $this->assertTrue(BbCode::inline('aaa') === 'aaa');
Line 23: $this->assertTrue(BbCode::inline('aa[b]a[/b]') === 'aa<b>a</b>');
Line 24: $this->assertTrue(BbCode::inline('aa[b]a') === 'aa[b]a');
Line 25: $this->assertTrue(BbCode::inline('aa[b]a[/b]', array('b')) === 'aa<b>a</b>');
Line 26: $this->assertTrue(BbCode::inline('aa[b]a[/b]', array()) === 'aa[b]a[/b]');
Line 31: $this->assertTrue(BbCode::inline('aaa') === 'aaa');
Line 32: $this->assertTrue(BbCode::inline('aa[url=http://example.com]a[/url]') === 'aa<a href="http://example.com">a</a>');
Line 33: $this->assertTrue(BbCode::inline('aa[url=http://example.com]a') === 'aa[url=http://example.com]a');
Line 34: $this->assertTrue(BbCode::inline('aa[url http://example.com]a') === 'aa[url http://example.com]a');
Line 35: $this->assertTrue(BbCode::inline('aa[url http://example.com]a[/url]') === 'aa[url http://example.com]a[/url]');
Line 36: $this->assertTrue(BbCode::inline('aa[url]a') === 'aa[url]a');
Line 37: $this->assertTrue(BbCode::inline('aa[url=http://example.com]a[/url]', array('url')) === 'aa<a href="http://example.com">a</a>');
Line 38: $this->assertTrue(BbCode::inline('aa[url]a[/url]', array()) === 'aa[url]a[/url]');

A total of 18 lines in 2 files were found