<commit_before><?php

namespace Estey\EvernoteOCR\Test\Unit;

use Estey\EvernoteOCR\ResourceFactory;
use Estey\EvernoteOCR\Exceptions\ResourceException;
use Mockery as m;

class ResourceFactoryTest extends TestCase
{
    /**
     * The name of the class being tested.
     * @var string
     */
    public static $className = 'Estey\EvernoteOCR\ResourceFactory';

    /**
     * Set up tests.
     */
    public function setUp()
    {
        parent::setUp();

        $this->file = m::mock('Evernote\File\FileInterface');
        $this->exception = m::mock(
            'Estey\EvernoteOCR\Exceptions\ResourceException'
        );
        $this->stub = new ResourceFactory;
    }

    /**
     * Test make() method.
     */
    public function testMake()
    {
        $this->file
            ->shouldReceive('getContent')
            ->once();

        $this->file
            ->shouldReceive('getMimeType')
            ->once();

        $this->file
            ->shouldReceive('getFilename')
            ->once();

        $resource = $this->stub->make($this->file);
        $this->assertEquals(get_class($resource), 'Evernote\Model\Resource');
    }


    /**
     * Test make() method throws exception.
     *
     * @expectedException Estey\EvernoteOCR\Exceptions\ResourceException
     */
    public function testMakeException()
    {
        $this->file
            ->shouldReceive('getContent')
            ->once()
            ->andThrow($this->exception);
        $this->stub->make($this->file);
    }
}<commit_msg>Trying to get tests working in HHVM...<commit_after><?php

namespace Estey\EvernoteOCR\Test\Unit;

use Estey\EvernoteOCR\ResourceFactory;
use Mockery as m;

class ResourceFactoryTest extends TestCase
{
    /**
     * The name of the class being tested.
     * @var string
     */
    public static $className = 'Estey\EvernoteOCR\ResourceFactory';

    /**
     * Set up tests.
     */
    public function setUp()
    {
        parent::setUp();

        $this->file = m::mock('Evernote\File\FileInterface');
        $this->stub = new ResourceFactory;
    }

    /**
     * Test make() method.
     */
    public function testMake()
    {
        $this->file
            ->shouldReceive('getContent')
            ->once();

        $this->file
            ->shouldReceive('getMimeType')
            ->once();

        $this->file
            ->shouldReceive('getFilename')
            ->once();

        $resource = $this->stub->make($this->file);
        $this->assertEquals(get_class($resource), 'Evernote\Model\Resource');
    }


    /**
     * Test make() method throws exception.
     *
     * @expectedException Estey\EvernoteOCR\Exceptions\ResourceException
     */
    public function testMakeException()
    {
        $this->file
            ->shouldReceive('getContent')
            ->once()
            ->andThrow(new \Estey\EvernoteOCR\Exceptions\ResourceException);
        $this->stub->make($this->file);
    }
}
{'fraction_non_alphanumeric': 0.14159891598915988, 'fraction_numerical': 0.0, 'mean_word_length': 2.0443298969072163, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '6795022', 'n_tokens_mistral': 877, 'n_tokens_neox': 843, 'n_words': 156}