<commit_before><?php
/**
 * ReportControllerTest.php
 * Copyright (C) 2016 <EMAIL>
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

use FireflyIII\Helpers\Collection\Account as AccountCollection;
use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Collection\Bill as BillCollection;
use FireflyIII\Helpers\Collection\Budget as BudgetCollection;
use FireflyIII\Helpers\Collection\Category as CategoryCollection;
use FireflyIII\Helpers\Collection\Expense;
use FireflyIII\Helpers\Collection\Income;
use Illuminate\Support\Collection;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:28.
 */
class ReportControllerTest extends TestCase
{

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::index
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testIndex($range)
    {
        $this->be($this->user());
        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports');
        $this->assertResponseStatus(200);

    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::__construct
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultMonth
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testReportDefaultMonth($range)
    {
        // mock some stuff.
        $accountHelper = $this->mock('FireflyIII\Helpers\Report\AccountReportHelperInterface');
        $budgetHelper  = $this->mock('FireflyIII\Helpers\Report\BudgetReportHelperInterface');
        $balanceHelper = $this->mock('FireflyIII\Helpers\Report\BalanceReportHelperInterface');
        $defaultHelper = $this->mock('FireflyIII\Helpers\Report\ReportHelperInterface');


        $accountHelper->shouldReceive('getAccountReport')->once()->andReturn(new AccountCollection);
        $defaultHelper->shouldReceive('getIncomeReport')->once()->andReturn(new Income);
        $defaultHelper->shouldReceive('getExpenseReport')->once()->andReturn(new Expense);
        $budgetHelper->shouldReceive('getBudgetReport')->once()->andReturn(new BudgetCollection);
        $defaultHelper->shouldReceive('getCategoryReport')->once()->andReturn(new CategoryCollection);
        $balanceHelper->shouldReceive('getBalanceReport')->once()->andReturn(new Balance);
        $defaultHelper->shouldReceive('getBillReport')->once()->andReturn(new BillCollection);
        $defaultHelper->shouldReceive('tagReport')->once()->andReturn([]);

        $this->be($this->user());
        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports/report/default/20160101/20160131/1,2');
        $this->assertResponseStatus(200);
    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultMultiYear
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testReportDefaultMultiYear($range)
    {
        $this->be($this->user());

        // mock some stuff.
        $accountHelper = $this->mock('FireflyIII\Helpers\Report\AccountReportHelperInterface');
        $defaultHelper = $this->mock('FireflyIII\Helpers\Report\ReportHelperInterface');
        $budgetRepos   = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
        $categoryRepos = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');

        $budgetRepos->shouldReceive('getActiveBudgets')->once()->andReturn(new Collection);
        $categoryRepos->shouldReceive('listCategories')->once()->andReturn(new Collection);


        $accountHelper->shouldReceive('getAccountReport')->once()->andReturn(new AccountCollection);
        $defaultHelper->shouldReceive('getIncomeReport')->once()->andReturn(new Income);
        $defaultHelper->shouldReceive('getExpenseReport')->once()->andReturn(new Expense);
        $defaultHelper->shouldReceive('tagReport')->once()->andReturn([]);

        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports/report/default/20160101/20171231/1,2');
        $this->assertResponseStatus(200);
    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultYear
     * @dataProvider dateRangeProvider<commit_msg>Should fix test.<commit_after><?php
/**
 * ReportControllerTest.php
 * Copyright (C) 2016 <EMAIL>
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

use FireflyIII\Helpers\Collection\Account as AccountCollection;
use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Collection\Bill as BillCollection;
use FireflyIII\Helpers\Collection\Budget as BudgetCollection;
use FireflyIII\Helpers\Collection\Category as CategoryCollection;
use FireflyIII\Helpers\Collection\Expense;
use FireflyIII\Helpers\Collection\Income;
use Illuminate\Support\Collection;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:28.
 */
class ReportControllerTest extends TestCase
{

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::index
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testIndex($range)
    {
        $this->be($this->user());
        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports');
        $this->assertResponseStatus(200);

    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::__construct
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultMonth
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testReportDefaultMonth($range)
    {
        // mock some stuff.
        $accountHelper = $this->mock('FireflyIII\Helpers\Report\AccountReportHelperInterface');
        $budgetHelper  = $this->mock('FireflyIII\Helpers\Report\BudgetReportHelperInterface');
        $balanceHelper = $this->mock('FireflyIII\Helpers\Report\BalanceReportHelperInterface');
        $defaultHelper = $this->mock('FireflyIII\Helpers\Report\ReportHelperInterface');


        $accountHelper->shouldReceive('getAccountReport')->once()->andReturn(new AccountCollection);
        $defaultHelper->shouldReceive('getIncomeReport')->once()->andReturn(new Income);
        $defaultHelper->shouldReceive('getExpenseReport')->once()->andReturn(new Expense);
        $budgetHelper->shouldReceive('getBudgetReport')->once()->andReturn(new BudgetCollection);
        $defaultHelper->shouldReceive('getCategoryReport')->once()->andReturn(new CategoryCollection);
        $balanceHelper->shouldReceive('getBalanceReport')->once()->andReturn(new Balance);
        $defaultHelper->shouldReceive('getBillReport')->once()->andReturn(new BillCollection);
        $defaultHelper->shouldReceive('tagReport')->once()->andReturn([]);

        $this->be($this->user());
        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports/report/default/20160101/20160131/1,2');
        $this->assertResponseStatus(200);
    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultMultiYear
     * @dataProvider dateRangeProvider
     *
     * @param $range
     */
    public function testReportDefaultMultiYear($range)
    {
        $this->be($this->user());

        // mock some stuff.
        $accountHelper = $this->mock('FireflyIII\Helpers\Report\AccountReportHelperInterface');
        $defaultHelper = $this->mock('FireflyIII\Helpers\Report\ReportHelperInterface');
        $budgetRepos   = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
        $categoryRepos = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');

        $budgetRepos->shouldReceive('getActiveBudgets')->once()->andReturn(new Collection);
        $categoryRepos->shouldReceive('getCategories')->once()->andReturn(new Collection);


        $accountHelper->shouldReceive('getAccountReport')->once()->andReturn(new AccountCollection);
        $defaultHelper->shouldReceive('getIncomeReport')->once()->andReturn(new Income);
        $defaultHelper->shouldReceive('getExpenseReport')->once()->andReturn(new Expense);
        $defaultHelper->shouldReceive('tagReport')->once()->andReturn([]);

        $this->changeDateRange($this->user(), $range);
        $this->call('GET', '/reports/report/default/20160101/20171231/1,2');
        $this->assertResponseStatus(200);
    }

    /**
     * @covers       FireflyIII\Http\Controllers\ReportController::report
     * @covers       FireflyIII\Http\Controllers\ReportController::defaultYear
     * @dataProvider dateRangeProvider
{'fraction_non_alphanumeric': 0.14277875329236173, 'fraction_numerical': 0.01382791922739245, 'mean_word_length': 3.985229759299781, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 141, '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': '4819196', 'n_tokens_mistral': 2588, 'n_tokens_neox': 2470, 'n_words': 333}