<commit_before><?php

namespace Simphotonics\Dom\Tests;

use Simphotonics\Dom\Leaf;

/**
 * @author <NAME> <<EMAIL>>
 * @copyright 2015 Simphotonics
 * Description: Tests methods of class \Simphotonics\Dom\Leaf.
 */

class LeafTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test instance of leaf
     * @var Simphotonics\Dom\Leaf
     */
    private static $l;

    public function __construct()
    {
        self::$l = new Leaf([
            'kind' => 'div',
            'attr' => ['class' => 'main emph','id' => 'div1'],
            'cont' => 'This is a test!'
            ]);
        die();
    }

    public function testSetKind()
    {
        self::$l->setKind('span');
        $this->assertEquals('span', self::$l->getKind());
        self::$l->setKind('div');
    }

    public function testSetAttr()
    {
        // Test mode 'add'
        self::$l->setAttr(['class' => 'bold'], 'add');
        $this->assertEquals('main emph bold', self::$l->getAttr()['class']);
        <commit_msg>Removed die() statement.<commit_after><?php

namespace Simphotonics\Dom\Tests;

use Simphotonics\Dom\Leaf;

/**
 * @author <NAME> <<EMAIL>>
 * @copyright 2015 Simphotonics
 * Description: Tests methods of class \Simphotonics\Dom\Leaf.
 */

class LeafTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test instance of leaf
     * @var Simphotonics\Dom\Leaf
     */
    private static $l;

    public function __construct()
    {
        self::$l = new Leaf([
            'kind' => 'div',
            'attr' => ['class' => 'main emph','id' => 'div1'],
            'cont' => 'This is a test!'
            ]);
    }

    public function testSetKind()
    {
        self::$l->setKind('span');
        $this->assertEquals('span', self::$l->getKind());
        self::$l->setKind('div');
    }

    public function testSetAttr()
    {
        // Test mode 'add'
        self::$l->setAttr(['class' => 'bold'], 'add');
        $this->assertEquals('main emph bold', self::$l->getAttr()['class']);
        
{'fraction_non_alphanumeric': 0.18127490039840638, 'fraction_numerical': 0.0049800796812749, 'mean_word_length': 2.3427620632279536, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 35, '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': '6843492', 'n_tokens_mistral': 643, 'n_tokens_neox': 624, 'n_words': 139}