phpbb/tests/bbcode/parser_test.php
Igor Wiedler af5b9a9640 [ticket/9556] Drop php closing tags, add trailing newline
Closing tags converted using Oleg's script.
remove-php-end-tags.py -a .

Trailing newlines added using the following where $ext is file extension.
find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;

Extensions: php, css, html, js, xml.

PHPBB3-9556
2010-11-11 19:10:55 +01:00

30 lines
843 B
PHP

<?php
/**
*
* @package testing
* @version $Id$
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
define('IN_PHPBB', true);
require_once 'test_framework/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');
}
}