<commit_before><?php

use Mockery as m;
use Pingpong\Modules\Module;

class ModulesTest extends PHPUnit_Framework_TestCase {

    protected $finder;
    protected $config;
    protected $view;
    protected $lang;
    protected $files;
    protected $html;
    protected $url;
    protected $module;

	public function tearDown()
	{
		m::close();
	}

	protected function getPath()
	{
		return __DIR__ . '/../../public';
	}

	public function setUp()
	{
        $this->finder = m::mock('Pingpong\Modules\Finder');
        $this->config = m::mock('Illuminate\Config\Repository');
        $this->view = m::mock('Illuminate\View\Factory');
        $this->lang = m::mock('Illuminate\Translation\Translator');
        $this->files  = m::mock('Illuminate\Filesystem\Filesystem');
        $this->html = m::mock('Illuminate\Html\HtmlBuilder');
        $this->url = m::mock('Illuminate\Routing\UrlGenerator');

        $this->module = new Module($this->finder, $this->config, $this->view, $this->lang, $this->files, $this->html, $this->url);
	}

	public function testInitialize()
	{
		$this->assertInstanceOf('Pingpong\Modules\Module', $this->module);
	}

	public function testGetAllModules()
	{
		$this->finder->shouldReceive('all')->once()->andReturn(['default']);
<commit_msg>Use realpath<commit_after><?php

use Mockery as m;
use Pingpong\Modules\Module;

class ModulesTest extends PHPUnit_Framework_TestCase {

    protected $finder;
    protected $config;
    protected $view;
    protected $lang;
    protected $files;
    protected $html;
    protected $url;
    protected $module;

	public function tearDown()
	{
		m::close();
	}

	protected function getPath()
	{
		return realpath(__DIR__ . '/../../public');
	}

	public function setUp()
	{
        $this->finder = m::mock('Pingpong\Modules\Finder');
        $this->config = m::mock('Illuminate\Config\Repository');
        $this->view = m::mock('Illuminate\View\Factory');
        $this->lang = m::mock('Illuminate\Translation\Translator');
        $this->files  = m::mock('Illuminate\Filesystem\Filesystem');
        $this->html = m::mock('Illuminate\Html\HtmlBuilder');
        $this->url = m::mock('Illuminate\Routing\UrlGenerator');

        $this->module = new Module($this->finder, $this->config, $this->view, $this->lang, $this->files, $this->html, $this->url);
	}

	public function testInitialize()
	{
		$this->assertInstanceOf('Pingpong\Modules\Module', $this->module);
	}

	public function testGetAllModules()
	{
		$this->finder->shouldReceive('all')->once()->andReturn(['default']);

{'fraction_non_alphanumeric': 0.17538340542666142, 'fraction_numerical': 0.0, 'mean_word_length': 3.764044943820225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '198207', 'n_tokens_mistral': 803, 'n_tokens_neox': 818, 'n_words': 145}