From dad57420f0d35afd363766df8c61dc9d806bb921 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Wed, 29 Aug 2018 22:31:13 +0800 Subject: [PATCH] Update stubs --- src/stubs/models/model.stub | 13 ++++++++----- src/stubs/testcases/unit/model.stub | 17 +++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/stubs/models/model.stub b/src/stubs/models/model.stub index e722cc5..ab427dc 100644 --- a/src/stubs/models/model.stub +++ b/src/stubs/models/model.stub @@ -11,12 +11,15 @@ class Master extends Model public function getNameLinkAttribute() { - return link_to_route('masters.show', $this->name, [$this], [ - 'title' => __( - 'app.show_detail_title', - ['name' => $this->name, 'type' => __('master.master')] - ), + $title = __('app.show_detail_title', [ + 'name' => $this->name, 'type' => __('master.master'), ]); + $link = ''; + $link .= $this->name; + $link .= ''; + + return $link; } public function creator() diff --git a/src/stubs/testcases/unit/model.stub b/src/stubs/testcases/unit/model.stub index dae5bef..3534768 100644 --- a/src/stubs/testcases/unit/model.stub +++ b/src/stubs/testcases/unit/model.stub @@ -16,14 +16,15 @@ class MasterTest extends TestCase { $singleMstr = factory(Master::class)->create(); - $this->assertEquals( - link_to_route('masters.show', $singleMstr->name, [$singleMstr], [ - 'title' => __( - 'app.show_detail_title', - ['name' => $singleMstr->name, 'type' => __('master.master')] - ), - ]), $singleMstr->name_link - ); + $title = __('app.show_detail_title', [ + 'name' => $singleMstr->name, 'type' => __('vehicle.vehicle'), + ]); + $link = ''; + $link .= $singleMstr->name; + $link .= ''; + + $this->assertEquals($link, $singleMstr->name_link); } /** @test */