Browse Source

Some changes adopting laravel 7

laravel_7_upgrade
Nafies Luthfi 5 years ago
parent
commit
571e39d21f
  1. 2
      app/Entities/Projects/Project.php
  2. 2
      resources/views/payments/index.blade.php
  3. 2
      resources/views/projects/issues/partials/comment-section.blade.php
  4. 6
      tests/Feature/Invoices/InvoiceEntryTest.php
  5. 4
      tests/Feature/Payments/ManagePaymentsTest.php
  6. 2
      tests/Feature/Projects/ProjectIssuesTest.php
  7. 3
      tests/Unit/Models/CustomerTest.php
  8. 2
      tests/Unit/Models/JobTest.php
  9. 2
      tests/Unit/Models/ProjectTest.php

2
app/Entities/Projects/Project.php

@ -36,7 +36,7 @@ class Project extends Model
*/
public function nameLink()
{
return link_to_route('projects.show', $this->name, [$this->id], [
return link_to_route('projects.show', $this->name, [$this], [
'title' => trans(
'app.show_detail_title',
['name' => $this->name, 'type' => trans('project.project')]

2
resources/views/payments/index.blade.php

@ -47,7 +47,7 @@
<td class="text-right">{{ $payment->present()->amount }}</td>
<td>{{ $payment->description }}</td>
<td class="text-center">
{!! html_link_to_route('payments.show', '', [$payment->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => __('app.show')]) !!}
{!! html_link_to_route('payments.show', '', [$payment->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => __('app.show'), 'id' => 'show_payment-'.$payment->id]) !!}
{!! html_link_to_route('payments.pdf', '', [$payment->id], ['icon' => 'print', 'class' => 'btn btn-warning btn-xs', 'title' => __('app.print')]) !!}
</td>
</tr>

2
resources/views/projects/issues/partials/comment-section.blade.php

@ -45,7 +45,7 @@
</div>
<div class="modal-footer">
{!! Form::submit(__('comment.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.issues.show', __('app.cancel'), [$project->issue, $issue] + request(['page']), ['class' => 'btn btn-default']) }}
{{ link_to_route('projects.issues.show', __('app.cancel'), [$project, $issue] + request(['page']), ['class' => 'btn btn-default']) }}
</div>
{!! Form::close() !!}
</div>

6
tests/Feature/Invoices/InvoiceEntryTest.php

@ -81,9 +81,9 @@ class InvoiceEntryTest extends TestCase
$this->see(trans('invoice.item_added'));
// $this->type('Testing deskripsi invoice item', 'new_item_description');
// $this->type(3000, 'new_item_amount');
// $this->press(trans('invoice.add_item'));
$this->type('Testing deskripsi invoice item', 'new_item_description');
$this->type(3000, 'new_item_amount');
$this->press(trans('invoice.add_item'));
$this->seePageIs(route('invoice-drafts.show', $draft->draftKey));
$this->assertEquals(2000, $draft->getTotal());

4
tests/Feature/Payments/ManagePaymentsTest.php

@ -212,7 +212,7 @@ class ManagePaymentsTest extends TestCase
$payment = factory(Payment::class)->create();
$this->visit(route('payments.index'));
$this->click($payment->number);
$this->click('show_payment-'.$payment->id);
$this->seePageIs(route('payments.show', $payment->id));
$this->see(trans('payment.detail'));
$this->see($payment->date);
@ -253,7 +253,7 @@ class ManagePaymentsTest extends TestCase
'in_out' => 1,
'date' => '2015-05-01',
'partner_type' => Customer::class,
'partner_id' => $project->customer_id,
'partner_id' => $project->customer_id,
]);
}
}

2
tests/Feature/Projects/ProjectIssuesTest.php

@ -160,7 +160,7 @@ class ProjectIssuesTest extends TestCase
$this->visitRoute('projects.issues.show', [$issue->project, $issue]);
$this->submitForm(__('issue.update'), [
'pic_id' => null,
'pic_id' => '',
]);
$this->seeRouteIs('projects.issues.show', [$issue->project, $issue]);
$this->seeText(__('issue.updated'));

3
tests/Unit/Models/CustomerTest.php

@ -62,7 +62,8 @@ class CustomerTest extends TestCase
/** @test */
public function a_customer_has_name_link_method()
{
$customer = factory(Customer::class)->make();
$customer = factory(Customer::class)->create();
$this->assertEquals(
link_to_route('customers.show', $customer->name, [$customer->id], [
'title' => trans(

2
tests/Unit/Models/JobTest.php

@ -22,7 +22,7 @@ class JobTest extends TestCase
/** @test */
public function a_job_has_name_link_method()
{
$job = factory(Job::class)->make();
$job = factory(Job::class)->create();
$this->assertEquals(
link_to_route('jobs.show', $job->name, [$job->id], [

2
tests/Unit/Models/ProjectTest.php

@ -23,7 +23,7 @@ class ProjectTest extends TestCase
/** @test */
public function a_project_has_name_link_method()
{
$project = factory(Project::class)->make();
$project = factory(Project::class)->create();
$this->assertEquals(
link_to_route('projects.show', $project->name, [$project->id], [
'title' => trans(

Loading…
Cancel
Save