-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creación función buscar categorías para test y legibilidad de código
- Loading branch information
Showing
7 changed files
with
68 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Illuminate\Foundation\Testing\WithFaker; | ||
use Tests\TestCase; | ||
use App\Models\Category; | ||
|
||
class CategoryTest extends TestCase | ||
{ | ||
/** | ||
* A basic feature test example. | ||
*/ | ||
// public function testCreateCategory(){ | ||
// $category = [ | ||
// "name" => "Categoría ejemplo 1", | ||
// "description" => "Descripción Categoria ejemplo 1" | ||
// ]; | ||
|
||
// $response = $this->post("products/categories", $category); | ||
|
||
// $response->assertStatus(302); | ||
// $response->assertRedirect(route("categories.index")); | ||
|
||
// $this->assertDatabaseCount("categories", 3); | ||
|
||
// $lastCategoryCreated = Category::query()->latest()->first(); | ||
|
||
// $this->assertDatabaseHas("categories", [ | ||
// "name" => $lastCategoryCreated->name, | ||
// "description" => $lastCategoryCreated->description, | ||
// ]); | ||
|
||
// $this->assertDatabaseHas("categories", $category); | ||
|
||
// $this->assertEquals($category["name"], $lastCategoryCreated->name); | ||
// $this->assertEquals($category["description"], $lastCategoryCreated->description); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.