<commit_before><?php
/**
 * @author        <NAME> <<EMAIL>>
 * @package       Metrol_Lib
 * @copyright (c) 2015, <NAME>
 * @license       Included with package files
 */

use \Metrol\HTML\Tag;

/**
 * Testing the Tag class
 *
 */
class TagTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Try out different closure types
     *
     */
    public function testTagClosureTypes()
    {
        $tag = new Tag('xyz', Tag::CLOSE_CONTENT);
        $this->assertEquals('<xyz></xyz>', (string) $tag);
        $this->assertEquals('<xyz>', $tag->getOpen());
        $this->assertEquals('</xyz>', $tag->getClose());

        $tag->setClosureType(Tag::CLOSE_SELF);
        $this->assertEquals('<xyz />', (string) $tag);

        $tag->setClosureType(Tag::CLOSE_NONE);
        $this->assertEquals('<xyz>', (string) $tag);
    }

    /**
     * Add some content within, before, and after a tag.
     *
     */
    public function testAddContentAroundTag()
    {
        $tag = new Tag('xyz', Tag::CLOSE_CONTENT);
        $tag->setContent('Howdy');

        $this->assertEquals('<xyz>Howdy</xyz>', $tag->output());

        $tag->setBefore('Hey &')->setAfter('There!');
        $this->assertEquals('Hey &amp;<xyz>Howdy</xyz>There!', $tag->output());

        $this->assertEquals('Hey &amp;', $tag->getBefore());
        $this->assertEquals('Howdy', $tag->getContent());
        $this->assertEquals('There!', $tag->getAfter());
    }

    /**<commit_msg>The custom entity handler is a bit more robust then I had initially tested for.  Fixing that up to pass.<commit_after><?php
/**
 * @author        <NAME> <<EMAIL>>
 * @package       Metrol_Lib
 * @copyright (c) 2015, <NAME>
 * @license       Included with package files
 */

use \Metrol\HTML\Tag;

/**
 * Testing the Tag class
 *
 */
class TagTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Try out different closure types
     *
     */
    public function testTagClosureTypes()
    {
        $tag = new Tag('xyz', Tag::CLOSE_CONTENT);
        $this->assertEquals('<xyz></xyz>', (string) $tag);
        $this->assertEquals('<xyz>', $tag->getOpen());
        $this->assertEquals('</xyz>', $tag->getClose());

        $tag->setClosureType(Tag::CLOSE_SELF);
        $this->assertEquals('<xyz />', (string) $tag);

        $tag->setClosureType(Tag::CLOSE_NONE);
        $this->assertEquals('<xyz>', (string) $tag);
    }

    /**
     * Add some content within, before, and after a tag.
     *
     */
    public function testAddContentAroundTag()
    {
        $tag = new Tag('xyz', Tag::CLOSE_CONTENT);
        $tag->setContent('Howdy');

        $this->assertEquals('<xyz>Howdy</xyz>', $tag->output());

        $tag->setBefore('Hey &')->setAfter('There!');
        $this->assertEquals('Hey &amp;<xyz>Howdy</xyz>There&excl;', $tag->output());

        $this->assertEquals('Hey &amp;', $tag->getBefore());
        $this->assertEquals('Howdy', $tag->getContent());
        $this->assertEquals('There&excl;', $tag->getAfter());
    }

    /**
{'fraction_non_alphanumeric': 0.19833055091819699, 'fraction_numerical': 0.002671118530884808, 'mean_word_length': 2.826309067688378, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '65140', 'n_tokens_mistral': 973, 'n_tokens_neox': 926, 'n_words': 185}