Browse Source

Fix invalid model stub

tags/1.2.0
Nafies Luthfi 7 years ago
parent
commit
27cea6f98a
  1. 4
      src/stubs/testcases/unit/model.stub
  2. 12
      tests/Generators/ModelTestGeneratorTest.php

4
src/stubs/testcases/unit/model.stub

@ -17,9 +17,9 @@ class MasterTest extends TestCase
$singleMstr = factory(Master::class)->create();
$title = __('app.show_detail_title', [
'name' => $singleMstr->name, 'type' => __('vehicle.vehicle'),
'name' => $singleMstr->name, 'type' => __('master.master'),
]);
$link = '<a href="'.route('vehicles.show', $singleMstr).'"';
$link = '<a href="'.route('masters.show', $singleMstr).'"';
$link .= ' title="'.$title.'">';
$link .= $singleMstr->name;
$link .= '</a>';

12
tests/Generators/ModelTestGeneratorTest.php

@ -32,9 +32,9 @@ class {$this->model_name}Test extends TestCase
\${$this->single_model_var_name} = factory({$this->model_name}::class)->create();
\$title = __('app.show_detail_title', [
'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'),
'name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}'),
]);
\$link = '<a href=\"'.route('vehicles.show', \${$this->single_model_var_name}).'\"';
\$link = '<a href=\"'.route('{$this->table_name}.show', \${$this->single_model_var_name}).'\"';
\$link .= ' title=\"'.\$title.'\">';
\$link .= \${$this->single_model_var_name}->name;
\$link .= '</a>';
@ -84,9 +84,9 @@ class {$this->model_name}Test extends TestCase
\${$this->single_model_var_name} = factory({$this->model_name}::class)->create();
\$title = __('app.show_detail_title', [
'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'),
'name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}'),
]);
\$link = '<a href=\"'.route('vehicles.show', \${$this->single_model_var_name}).'\"';
\$link = '<a href=\"'.route('{$this->table_name}.show', \${$this->single_model_var_name}).'\"';
\$link .= ' title=\"'.\$title.'\">';
\$link .= \${$this->single_model_var_name}->name;
\$link .= '</a>';
@ -136,9 +136,9 @@ class {$this->model_name}Test extends TestCase
\${$this->single_model_var_name} = factory({$this->model_name}::class)->create();
\$title = __('app.show_detail_title', [
'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'),
'name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}'),
]);
\$link = '<a href=\"'.route('vehicles.show', \${$this->single_model_var_name}).'\"';
\$link = '<a href=\"'.route('{$this->table_name}.show', \${$this->single_model_var_name}).'\"';
\$link .= ' title=\"'.\$title.'\">';
\$link .= \${$this->single_model_var_name}->name;
\$link .= '</a>';

Loading…
Cancel
Save