<commit_before><?php
namespace Zepto\FileLoader;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-11-03 at 13:49:12.
 */
class MarkdownLoaderTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers Zepto\FileLoader\MarkdownLoader::__construct()
     * @covers Zepto\FileLoader\MarkdownLoader::get_parser()
     */
    public function testConstructWithMarkdown()
    {
        $parser = $this->getMock('Michelf\Markdown', array('defaultTransform'));
        $loader = new MarkdownLoader($parser);

        $this->assertInstanceOf('Michelf\Markdown', $loader->get_parser());
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::__construct()
     * @covers Zepto\FileLoader\MarkdownLoader::get_parser()
     */
    public function testConstructWithMarkdownExtra()
    {
        $parser = $this->getMock('Michelf\MarkdownExtra', array('defaultTransform'));
        $loader = new MarkdownLoader($parser);

        $this->assertInstanceOf('Michelf\MarkdownExtra', $loader->get_parser());
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::load
     */
    public function testLoad()
    {
        $parsed_text = "<h1>Error 404</h1>" . PHP_EOL. PHP_EOL
            . "<p>Woops. Looks like this page doesn't exist.</p>". PHP_EOL;

        // Create a stub for the SomeClass class.
        $parser = $this->getMock('Michelf\MarkdownInterface', array('defaultTransform', 'transform'));

        $parser::staticExpects($this->any())
                ->method('defaultTransform')
                ->will($this->returnValue($parsed_text));

        $loader = new MarkdownLoader($parser);

        $files['404.md'] = array(
            'meta'    => array(
                'title'         => 'Error 404',
                'robots'        => 'noindex,nofollow'
            ),
            'content' => $parsed_text
        );

        $result = $loader->load(ROOT_DIR . 'content/404.md', array('md'));
        $this->assertEquals($files, $result);
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::load()
     */
    public function testLoadMultipleFiles()
    {
        $done_text_1 = "<h2>This is a Sub Page Index</h2>" . PHP_EOL . PHP_EOL
            . "<p>This is index.md in the 'sub' folder.</p>" . PHP_EOL . PHP_EOL
            . "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>" . PHP_EOL . PHP_EOL
            . "<p>Donec ultricies tristique nulla et mattis.</p>" . PHP_EOL. PHP_EOL
            . "<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>" . PHP_EOL;

        $done_text_2 = "<h2>This is a Sub Page</h2>" . PHP_EOL . PHP_EOL
                . "<p>This is page.md in the 'sub' folder.</p>" . PHP_EOL . PHP_EOL
                . "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>" . PHP_EOL . PHP_EOL
                . "<p>Donec ultricies tristique nulla et mattis.</p>" . PHP_EOL . PHP_EOL
                . "<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>". PHP_EOL;

        // Create a stub for the SomeClass class.
        $parser = $this->getMock('Michelf\MarkdownInterface', array('defaultTransform', 'transform'));

        $parser::staticExpects($this->any())
                ->method('defaultTransform')
                ->will($this->onConsecutiveCalls($done_text_1, $done_text_2));

        $loader = new MarkdownLoader($parser);

        $files['sub/index.md'] = array(
            'meta'    => array(
                'title'         => 'Sub Page Index'
            ),
            'content' => $done_text_1
        );

        $files['sub/page.md'] = array(
            'meta'    => array(
                'title'         => 'Sub Page'
            ),
            'content' => $done_text_2
        );<commit_msg>Not sure if code is shit, or found bug in Travis-CI<commit_after><?php
namespace Zepto\FileLoader;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-11-03 at 13:49:12.
 */
class MarkdownLoaderTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers Zepto\FileLoader\MarkdownLoader::__construct()
     * @covers Zepto\FileLoader\MarkdownLoader::get_parser()
     */
    public function testConstructWithMarkdown()
    {
        $parser = $this->getMock('Michelf\Markdown', array('defaultTransform'));
        $loader = new MarkdownLoader($parser);

        $this->assertInstanceOf('Michelf\Markdown', $loader->get_parser());
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::__construct()
     * @covers Zepto\FileLoader\MarkdownLoader::get_parser()
     */
    public function testConstructWithMarkdownExtra()
    {
        $parser = $this->getMock('Michelf\MarkdownExtra', array('defaultTransform'));
        $loader = new MarkdownLoader($parser);

        $this->assertInstanceOf('Michelf\MarkdownExtra', $loader->get_parser());
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::load
     */
    public function testLoad()
    {
        $parsed_text = "<h1>Error 404</h1>" . PHP_EOL. PHP_EOL
            . "<p>Woops. Looks like this page doesn't exist.</p>". PHP_EOL;

        // Create a stub for the SomeClass class.
        $parser = $this->getMock('Michelf\MarkdownInterface', array('defaultTransform', 'transform'));

        $parser::staticExpects($this->any())
                ->method('defaultTransform')
                ->will($this->returnValue($parsed_text));

        $loader = new MarkdownLoader($parser);

        $files['404.md'] = array(
            'meta'    => array(
                'title'         => 'Error 404',
                'robots'        => 'noindex,nofollow'
            ),
            'content' => $parsed_text
        );

        $result = $loader->load(ROOT_DIR . 'content/404.md', array('md'));
        $this->assertEquals($files, $result);
    }

    /**
     * @covers Zepto\FileLoader\MarkdownLoader::load()
     */
    public function testLoadMultipleFiles()
    {
        $sub_page_index_content = "<h2>This is a Sub Page Index</h2>" . PHP_EOL . PHP_EOL
            . "<p>This is index.md in the 'sub' folder.</p>" . PHP_EOL . PHP_EOL
            . "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>" . PHP_EOL . PHP_EOL
            . "<p>Donec ultricies tristique nulla et mattis.</p>" . PHP_EOL. PHP_EOL
            . "<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>" . PHP_EOL;

        $sub_page_content = "<h2>This is a Sub Page</h2>" . PHP_EOL . PHP_EOL
                . "<p>This is page.md in the 'sub' folder.</p>" . PHP_EOL . PHP_EOL
                . "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>" . PHP_EOL . PHP_EOL
                . "<p>Donec ultricies tristique nulla et mattis.</p>" . PHP_EOL . PHP_EOL
                . "<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>". PHP_EOL;

        // Create a stub for the SomeClass class.
        $parser = $this->getMock('Michelf\MarkdownInterface', array('defaultTransform', 'transform'));

        $parser::staticExpects($this->any())
                ->method('defaultTransform')
                ->will($this->onConsecutiveCalls($sub_page_index_content, $sub_page_content));

        $loader = new MarkdownLoader($parser);

        $files['sub/index.md'] = array(
            'meta'    => array(
                'title'         => 'Sub Page Index'
            ),
            'content' => $sub_page_index_content
        );

        $files['sub/page.md'] = array(
            'meta'    => array(
                'title'         => 'Sub Page'
            ),
            'content' => $sub_page_content
        );
{'fraction_non_alphanumeric': 0.14579488531505405, 'fraction_numerical': 0.010018455048774057, 'mean_word_length': 2.2312606473594547, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2226672', 'n_tokens_mistral': 2445, 'n_tokens_neox': 2335, 'n_words': 478}