mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 12:30:42 +02:00
adding a bbcode test suite
git-svn-id: file:///svn/phpbb/trunk@8541 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
22
tests/bbcode/parser_test.php
Normal file
22
tests/bbcode/parser_test.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
define('IN_PHPBB', true);
|
||||
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
require_once '../phpBB/includes/bbcode/bbcode_parser_base.php';
|
||||
require_once '../phpBB/includes/bbcode/bbcode_parser.php';
|
||||
|
||||
class phpbb_bbcode_parser_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function test_both_passes()
|
||||
{
|
||||
$parser = new phpbb_bbcode_parser();
|
||||
|
||||
$result = $parser->first_pass('[i]Italic [u]underlined text[/u][/i]');
|
||||
$result = $parser->second_pass($result);
|
||||
|
||||
$expected = '<span style="font-style: italic">Italic <span style="text-decoration: underline">underlined text</span></span>';
|
||||
|
||||
$this->assertEquals($expected, $result, 'Simple nested BBCode first+second pass');
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user