diff --git a/tests/Generators/ModelGeneratorTest.php b/tests/Generators/ModelGeneratorTest.php index 98a3e6c..5293bf6 100644 --- a/tests/Generators/ModelGeneratorTest.php +++ b/tests/Generators/ModelGeneratorTest.php @@ -26,12 +26,15 @@ class {$this->model_name} extends Model public function getNameLinkAttribute() { - return link_to_route('{$this->table_name}.show', \$this->name, [\$this], [ - 'title' => __( - 'app.show_detail_title', - ['name' => \$this->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')] - ), + \$title = __('app.show_detail_title', [ + 'name' => \$this->name, 'type' => __('{$this->lang_name}.{$this->lang_name}'), ]); + \$link = 'table_name}.show', \$this).'\"'; + \$link .= ' title=\"'.\$title.'\">'; + \$link .= \$this->name; + \$link .= ''; + + return \$link; } public function creator() @@ -63,12 +66,15 @@ class Category extends Model public function getNameLinkAttribute() { - return link_to_route('categories.show', \$this->name, [\$this], [ - 'title' => __( - 'app.show_detail_title', - ['name' => \$this->name, 'type' => __('category.category')] - ), + \$title = __('app.show_detail_title', [ + 'name' => \$this->name, 'type' => __('category.category'), ]); + \$link = ''; + \$link .= \$this->name; + \$link .= ''; + + return \$link; } public function creator() diff --git a/tests/Generators/ModelTestGeneratorTest.php b/tests/Generators/ModelTestGeneratorTest.php index cfe7940..401c251 100644 --- a/tests/Generators/ModelTestGeneratorTest.php +++ b/tests/Generators/ModelTestGeneratorTest.php @@ -31,14 +31,15 @@ class {$this->model_name}Test extends TestCase { \${$this->single_model_var_name} = factory({$this->model_name}::class)->create(); - \$this->assertEquals( - link_to_route('{$this->table_name}.show', \${$this->single_model_var_name}->name, [\${$this->single_model_var_name}], [ - 'title' => __( - 'app.show_detail_title', - ['name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')] - ), - ]), \${$this->single_model_var_name}->name_link - ); + \$title = __('app.show_detail_title', [ + 'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'), + ]); + \$link = 'single_model_var_name}).'\"'; + \$link .= ' title=\"'.\$title.'\">'; + \$link .= \${$this->single_model_var_name}->name; + \$link .= ''; + + \$this->assertEquals(\$link, \${$this->single_model_var_name}->name_link); } /** @test */ @@ -82,14 +83,15 @@ class {$this->model_name}Test extends TestCase { \${$this->single_model_var_name} = factory({$this->model_name}::class)->create(); - \$this->assertEquals( - link_to_route('{$this->table_name}.show', \${$this->single_model_var_name}->name, [\${$this->single_model_var_name}], [ - 'title' => __( - 'app.show_detail_title', - ['name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')] - ), - ]), \${$this->single_model_var_name}->name_link - ); + \$title = __('app.show_detail_title', [ + 'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'), + ]); + \$link = 'single_model_var_name}).'\"'; + \$link .= ' title=\"'.\$title.'\">'; + \$link .= \${$this->single_model_var_name}->name; + \$link .= ''; + + \$this->assertEquals(\$link, \${$this->single_model_var_name}->name_link); } /** @test */ @@ -133,14 +135,15 @@ class {$this->model_name}Test extends TestCase { \${$this->single_model_var_name} = factory({$this->model_name}::class)->create(); - \$this->assertEquals( - link_to_route('{$this->table_name}.show', \${$this->single_model_var_name}->name, [\${$this->single_model_var_name}], [ - 'title' => __( - 'app.show_detail_title', - ['name' => \${$this->single_model_var_name}->name, 'type' => __('{$this->lang_name}.{$this->lang_name}')] - ), - ]), \${$this->single_model_var_name}->name_link - ); + \$title = __('app.show_detail_title', [ + 'name' => \${$this->single_model_var_name}->name, 'type' => __('vehicle.vehicle'), + ]); + \$link = 'single_model_var_name}).'\"'; + \$link .= ' title=\"'.\$title.'\">'; + \$link .= \${$this->single_model_var_name}->name; + \$link .= ''; + + \$this->assertEquals(\$link, \${$this->single_model_var_name}->name_link); } /** @test */