New tests. [skip ci]

This commit is contained in:
James Cole 2016-12-18 18:16:41 +01:00
parent 5a57398f81
commit 5c28adf266
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
9 changed files with 81 additions and 51 deletions

View File

@ -515,16 +515,53 @@ Breadcrumbs::register(
); );
Breadcrumbs::register( Breadcrumbs::register(
'reports.report', function (BreadCrumbGenerator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) { 'reports.report.audit', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index'); $breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day'); $monthFormat = (string)trans('config.month_and_day');
$title = (string)trans( $startString = $start->formatLocalized($monthFormat);
'firefly.report_' . $reportType, $endString = $end->formatLocalized($monthFormat);
['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)] $title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
);
$breadcrumbs->push($title, route('reports.report', [$reportType, $start->format('Ymd'), $end->format('Ymd'), $accountIds])); $breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
}
);
Breadcrumbs::register(
'reports.report.budget', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')]));
}
);
Breadcrumbs::register(
'reports.report.category', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')]));
}
);
Breadcrumbs::register(
'reports.report.default', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
} }
); );

View File

@ -632,10 +632,10 @@ return [
'errors' => 'Errors', 'errors' => 'Errors',
// reports: // reports:
'report_default' => 'Default financial report for :start until :end', 'report_default' => 'Default financial report between :start and :end',
'report_audit' => 'Transaction history overview for :start until :end', 'report_audit' => 'Transaction history overview between :start and :end',
'report_category' => 'Category report for :start until :end', 'report_category' => 'Category report between :start and :end',
'report_budget' => 'Budget report for :start until :end', 'report_budget' => 'Budget report between :start and :end',
'quick_link_reports' => 'Quick links', 'quick_link_reports' => 'Quick links',
'quick_link_default_report' => 'Default financial report', 'quick_link_default_report' => 'Default financial report',
'quick_link_audit_report' => 'Transaction history overview', 'quick_link_audit_report' => 'Transaction history overview',

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, budgetIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, categoryIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,7 +1,7 @@
{% extends "./layout/default" %} {% extends "./layout/default" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, accountIds, start, end) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -8,6 +8,8 @@
* *
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
use FireflyIII\Generator\Report\Audit\MonthReportGenerator as AuditGenerator;
use FireflyIII\Generator\Report\ReportGeneratorInterface;
/** /**
@ -28,85 +30,76 @@ class ReportControllerTest extends TestCase
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::auditReport * @covers \FireflyIII\Http\Controllers\ReportController::auditReport
* Implement testAuditReport().
*/ */
public function testAuditReport() public function testAuditReport()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.report.audit', [1, '20160101', '20160131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); $this->see('<ol class="breadcrumb">');
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::budgetReport * @covers \FireflyIII\Http\Controllers\ReportController::budgetReport
* Implement testBudgetReport().
*/ */
public function testBudgetReport() public function testBudgetReport()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.report.budget', [1, 1, '20160101', '20160131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); $this->see('<ol class="breadcrumb">');
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::categoryReport * @covers \FireflyIII\Http\Controllers\ReportController::categoryReport
* Implement testCategoryReport().
*/ */
public function testCategoryReport() public function testCategoryReport()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.report.category', [1, 1, '20160101', '20160131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); $this->see('<ol class="breadcrumb">');
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::defaultReport * @covers \FireflyIII\Http\Controllers\ReportController::defaultReport
* Implement testDefaultReport().
*/ */
public function testDefaultReport() public function testDefaultReport()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.report.default', [1, '20160101', '20160131']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); $this->see('<ol class="breadcrumb">');
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::index * @covers \FireflyIII\Http\Controllers\ReportController::index
* Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.index'));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); $this->see('<ol class="breadcrumb">');
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::options * @covers \FireflyIII\Http\Controllers\ReportController::options
* Implement testOptions().
*/ */
public function testOptions() public function testOptions()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('get', route('reports.options', ['default']));
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ReportController::postIndex * @covers \FireflyIII\Http\Controllers\ReportController::postIndex
* Implement testPostIndex().
*/ */
public function testPostIndex() public function testPostIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('post', route('reports.index.post'));
'This test has not been implemented yet.' $this->assertResponseStatus(302);
);
} }
} }