Mercurial > packages > magicforger
comparison src/Generator/Test/stubs/test.stub @ 39:b5c6ebd33547 ls_dev_2025_09
Improving the factories, tests, and requests
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Thu, 25 Sep 2025 23:16:13 -0400 |
| parents | 116b36f5e73b |
| children | 2cf26b593f4a |
comparison
equal
deleted
inserted
replaced
| 38:c062f013fd19 | 39:b5c6ebd33547 |
|---|---|
| 103 $response | 103 $response |
| 104 ->assertSessionHasErrors() | 104 ->assertSessionHasErrors() |
| 105 ->assertRedirect(route('{{ tableName }}.edit', $item)); | 105 ->assertRedirect(route('{{ tableName }}.edit', $item)); |
| 106 | 106 |
| 107 // Make sure no entry was added | 107 // Make sure no entry was added |
| 108 $this->assertDatabaseHas('games', array_intersect(array_flip($item->getFillable()), $item->toArray())); | 108 $this->assertDatabaseHas('{{ tableName }}', array_intersect_key($item->toArray(), array_flip($item->getFillable()))); |
| 109 } | 109 } |
| 110 | 110 |
| 111 public function test_{{ modelVariable }}_crud_delete_usage(): void | 111 public function test_{{ modelVariable }}_crud_delete_usage(): void |
| 112 { | 112 { |
| 113 $item = {{ model }}::factory()->create(); | 113 $item = {{ model }}::factory()->create(); |
