<commit_before><?php

namespace ModHelper\Tests;

class LinktreeTest extends \PHPUnit_Framework_TestCase
{
    protected $l;

    protected function setUp()
    {
        $this->l = new \ModHelper\Linktree();

        $this->l->add(
            'Foo',
            '/vendor/foo'
        );

        $this->l->add(
            'BarDoom',
            '/vendor/foo.bardoom'
        );

    }
}<commit_msg>Update LinktreeTest.php<commit_after><?php

namespace ModHelper\Tests;

class MockLinktree extends \ModHelper\Linktree
{
    public function getLinks()
    {
        return $this->collection;
    }
}

class LinktreeTest extends \PHPUnit_Framework_TestCase
{
    protected $l;

    protected function setUp()
    {
        $this->l = new MockLinktree;

        $this->l->add(
            'Foo',
            '/vendor/foo'
        );

        $this->l->add(
            'BarDoom',
            '/vendor/foo.bardoom'
        );

    }

    public function testExistingLink()
    {
        $expect = array(
            'Foo',
            '/vendor/foo'
        );
        $this->assertContains($expect, $this->l->getLinks());

        $expect = array(
            'BarDoom',
            '/vendor/foo.bardoom'
        );
        $this->assertContains($expect, $this->l->getLinks());
    }

    public function testMissingLink()
    {
        $expect = array(
            'Baz Dib',
            '/vendor/baz.dib'
        );
        $this->assertNotContains($expect, $this->l->getLinks());
    }

    public function testLinkCount()
    {
        $this->assertCount(2, $this->l->getLinks());
    }
}
{'fraction_non_alphanumeric': 0.14465408805031446, 'fraction_numerical': 0.0006289308176100629, 'mean_word_length': 1.6784511784511784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '7450356', 'n_tokens_mistral': 497, 'n_tokens_neox': 478, 'n_words': 82}