test: Add feature tests

This commit is contained in:
Attila Kerekes
2022-12-04 10:14:07 +01:00
committed by Attila Kerekes
parent 52620bc331
commit 45cc84c99c
17 changed files with 360 additions and 31 deletions

View File

@@ -4,7 +4,6 @@ namespace Database\Factories;
use App\Item;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class ItemFactory extends Factory
{
@@ -20,7 +19,7 @@ class ItemFactory extends Factory
*
* @return array
*/
public function definition()
public function definition(): array
{
return [
'title' => $this->faker->unique()->text(),

View File

@@ -0,0 +1,27 @@
<?php
namespace Database\Factories;
use App\Item;
use App\ItemTag;
use Illuminate\Database\Eloquent\Factories\Factory;
class ItemTagFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ItemTag::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [];
}
}

View File

@@ -2,11 +2,19 @@
namespace Database\Factories;
use App\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class UserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class;
/**
* Define the model's default state.
*
@@ -15,10 +23,10 @@ class UserFactory extends Factory
public function definition()
{
return [
'name' => $this->faker->name(),
'username' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'public_front' => 1,
'remember_token' => Str::random(10),
];
}