<commit_before><?php

namespace s9e\Toolkit\Tests;

use s9e\Toolkit\TextFormatter\ConfigBuilder,
    s9e\Toolkit\TextFormatter\Parser,
    s9e\Toolkit\TextFormatter\PredefinedTags,
    s9e\Toolkit\TextFormatter\PredefinedBBCodes,
    s9e\Toolkit\TextFormatter\Renderer;

include_once __DIR__ . '/../Test.php';

/**
* covers s9e\Toolkit\TextFormatter\PredefinedTags
* @covers s9e\Toolkit\TextFormatter\PredefinedBBCodes
*/
class PredefinedBBCodesTest extends Test
{
	/**
	* @expectedException InvalidArgumentException UNKNOWN
	*/
	public function testAddPredefinedBBCodeThrowsAnExceptionOnUnknownBBCodes()
	{
		$cb = new ConfigBuilder;
		$cb->BBCodes->addPredefinedBBCode('UNKNOWN');
	}

	public function testGetCODEstx()
	{
		$cb = new ConfigBuilder;
		$cb->BBCodes->addPredefinedBBCode('CODE');

		$xml = $cb->getParser()->parse('[code=php]//[/code][code=php]//[/code][code=html][/code]');
<commit_msg>Doesn't throw a specific exception on unknown BBCodes anymore<commit_after><?php

namespace s9e\Toolkit\Tests;

use s9e\Toolkit\TextFormatter\ConfigBuilder,
    s9e\Toolkit\TextFormatter\Parser,
    s9e\Toolkit\TextFormatter\PredefinedTags,
    s9e\Toolkit\TextFormatter\PredefinedBBCodes,
    s9e\Toolkit\TextFormatter\Renderer;

include_once __DIR__ . '/../Test.php';

/**
* covers s9e\Toolkit\TextFormatter\PredefinedTags
* @covers s9e\Toolkit\TextFormatter\PredefinedBBCodes
*/
class PredefinedBBCodesTest extends Test
{
	public function testGetCODEstx()
	{
		$cb = new ConfigBuilder;
		$cb->BBCodes->addPredefinedBBCode('CODE');

		$xml = $cb->getParser()->parse('[code=php]//[/code][code=php]//[/code][code=html][/code]');

{'fraction_non_alphanumeric': 0.14276960784313725, 'fraction_numerical': 0.00980392156862745, 'mean_word_length': 5.329457364341085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5620047', 'n_tokens_mistral': 588, 'n_tokens_neox': 562, 'n_words': 76}