Browse Source

Update stubs

tags/1.2.0
Nafies Luthfi 7 years ago
parent
commit
dad57420f0
  1. 13
      src/stubs/models/model.stub
  2. 17
      src/stubs/testcases/unit/model.stub

13
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 = '<a href="'.route('masters.show', $this).'"';
$link .= ' title="'.$title.'">';
$link .= $this->name;
$link .= '</a>';
return $link;
}
public function creator()

17
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 = '<a href="'.route('vehicles.show', $singleMstr).'"';
$link .= ' title="'.$title.'">';
$link .= $singleMstr->name;
$link .= '</a>';
$this->assertEquals($link, $singleMstr->name_link);
}
/** @test */

Loading…
Cancel
Save