774 lines
26 KiB
PHP
774 lines
26 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\Event;
|
|
use App\Models\EventCategory;
|
|
use App\Models\EventGuestsNonUsers;
|
|
use App\Models\Memo;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Str;
|
|
use Tests\TestCase;
|
|
|
|
class EventsTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
/** @test */
|
|
public function an_admin_can_create_an_event_category()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(['role' => 2]), 'api');
|
|
|
|
$response = $this->post('/api/events/categories', [
|
|
'name' => 'Test name event category',
|
|
'description' => 'Test description event category',
|
|
])->assertStatus(201);
|
|
|
|
$category = EventCategory::first();
|
|
|
|
$this->assertEquals('Test name event category', $category->name);
|
|
$this->assertEquals('Test description event category', $category->description);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $category->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $category->name,
|
|
'description' => $category->description,
|
|
]
|
|
],
|
|
],
|
|
'links' => [
|
|
'self' => url('/events/categories/'.$category->id),
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function event_category_name_are_required()
|
|
{
|
|
$this->actingAs($user = factory(\App\Models\User::class)->create(['role' => 2]), 'api');
|
|
$response = $this->post('/api/events/categories', ['name' => '', 'description' => 'test name required']);
|
|
|
|
$response->assertSessionHasErrors('name');
|
|
$this->assertCount(0, EventCategory::all());
|
|
}
|
|
|
|
/** @test */
|
|
public function only_admin_can_create_event_category()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$response = $this->post('/api/events/categories', ['name' => 'Test fail', 'description' => 'test name required']);
|
|
|
|
$response->assertStatus(403);
|
|
$this->assertCount(0, EventCategory::all());
|
|
}
|
|
|
|
/** @test */
|
|
public function an_event_category_can_be_retrieved()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
|
|
$response = $this->get('/api/events/categories/' . $category->id );
|
|
|
|
$response->assertJson([
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $category->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $category->name,
|
|
'description' => $category->description,
|
|
]
|
|
],
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function all_event_categories_can_be_retrieved()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
$categoryTwo = EventCategory::create(['name' => 'Test category 2', 'description' => 'Test description']);
|
|
$categoryTree = EventCategory::create(['name' => 'Test category 3', 'description' => 'Test description']);
|
|
|
|
$response = $this->get('/api/events/categories');
|
|
|
|
$response->assertJson([
|
|
'data' => [
|
|
[
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $category->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $category->name,
|
|
'description' => $category->description,
|
|
]
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $categoryTwo->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $categoryTwo->name,
|
|
'description' => $categoryTwo->description,
|
|
]
|
|
],
|
|
],
|
|
],
|
|
[
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $categoryTree->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $categoryTree->name,
|
|
'description' => $categoryTree->description,
|
|
]
|
|
],
|
|
],
|
|
],
|
|
],
|
|
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_event_category_can_be_patch()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(['role' => 2]), 'api');
|
|
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
|
|
$response = $this->patch('/api/events/categories/' . $category->id, ['name' => 'Update Catégory']);
|
|
|
|
$category = $category->fresh();
|
|
|
|
$this->assertEquals('Update Catégory', $category->name);
|
|
|
|
$response->assertStatus(200);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'type' => 'event categories',
|
|
'event_category_id' => $category->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $category->name,
|
|
'description' => $category->description,
|
|
]
|
|
],
|
|
],
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function only_the_admin_can_patch_the_event_category()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
|
|
$response = $this->patch('/api/events/categories/' . $category->id, ['name' => 'try to update']);
|
|
|
|
$response->assertStatus(403);
|
|
}
|
|
|
|
/** @test */
|
|
public function an_event_category_can_be_delete()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(['role' => 2]), 'api');
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
|
|
$response = $this->delete('/api/events/categories/' . $category->id);
|
|
|
|
$category = $category->fresh();
|
|
|
|
$this->assertCount(0, EventCategory::all());
|
|
|
|
$response->assertStatus(204);
|
|
}
|
|
|
|
/** @test */
|
|
public function only_admin_can_delete_an_event_category()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$category = EventCategory::create(['name' => 'Test category', 'description' => 'Test description']);
|
|
|
|
$response = $this->delete('/api/events/categories/' . $category->id);
|
|
|
|
$response->assertStatus(403);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_user_can_create_an_event()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
|
|
app(\DatabaseSeeder::class)->call(\EventCategorySeeder::class);
|
|
|
|
//dd(EventCategory::all());
|
|
$response = $this->post('/api/events', $this->data())->assertStatus(201);
|
|
|
|
$event = Event::first();
|
|
|
|
$this->assertEquals($user->id, $event->user_id);
|
|
$this->assertEquals(1, $event->category_id);
|
|
$this->assertEquals('Test name event', $event->name);
|
|
$this->assertEquals('Test description event', $event->description);
|
|
$this->assertEquals('2020-07-20 09:00:00', $event->start_date);
|
|
$this->assertEquals('2020-07-26 09:00:00', $event->end_date);
|
|
$this->assertEquals('Marcillac', $event->location);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'type' => 'events',
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $event->name,
|
|
'description' => $event->description,
|
|
'start_date' => $event->start_date,
|
|
'end_date' => $event->end_date,
|
|
'location' => $event->location,
|
|
'category' => [
|
|
'data' => [
|
|
'event_category_id' => 1
|
|
],
|
|
],
|
|
]
|
|
],
|
|
],
|
|
'links' => [
|
|
'self' => url('/events/'.$event->id),
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function event_name_are_required()
|
|
{
|
|
$this->actingAs($user = factory(\App\Models\User::class)->create(), 'api');
|
|
$response = $this->post('/api/events', array_merge($this->data(), ['name' => '']));
|
|
|
|
$response->assertSessionHasErrors('name');
|
|
$this->assertCount(0, EventCategory::all());
|
|
}
|
|
|
|
/** @test */
|
|
public function event_start_date_are_required()
|
|
{
|
|
$this->actingAs($user = factory(\App\Models\User::class)->create(), 'api');
|
|
$response = $this->post('/api/events', array_merge($this->data(), ['start_date' => '']));
|
|
|
|
$response->assertSessionHasErrors('start_date');
|
|
$this->assertCount(0, EventCategory::all());
|
|
}
|
|
|
|
/** @test */
|
|
public function an_event_can_be_retrieved()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
app(\DatabaseSeeder::class)->call(\EventCategorySeeder::class);
|
|
|
|
$event = $user->events()->create($this->data());
|
|
|
|
$response = $this->get('/api/events/' . $event->id );
|
|
|
|
$response->assertJson([
|
|
'data' => [
|
|
'type' => 'events',
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => $event->name,
|
|
'description' => $event->description,
|
|
'start_date' => $event->start_date,
|
|
'end_date' => $event->end_date,
|
|
'location' => $event->location,
|
|
'category' => [
|
|
'data' => [
|
|
'event_category_id' => 1
|
|
],
|
|
],
|
|
]
|
|
],
|
|
],
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function all_event_can_be_retrieved()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$events = factory(Event::class, 10)->create(['user_id' => $user->id]);
|
|
|
|
$response = $this->get('/api/events');
|
|
|
|
$response->assertStatus(200);
|
|
|
|
$this->assertCount(10, Event::all());
|
|
}
|
|
|
|
/** @test */
|
|
public function a_to_event_can_be_patch()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
|
|
$response = $this->patch('/api/events/' . $event->id, [
|
|
'category_id' => $event->category_id,
|
|
'name' => 'Event Update',
|
|
'description' => 'Event Update description',
|
|
'start_date' => '2020-07-20 09:00:00',
|
|
]);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertEquals('Event Update', $event->name);
|
|
$this->assertEquals('Event Update description', $event->description);
|
|
|
|
$response->assertStatus(200);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'name' => 'Event Update',
|
|
'description' => 'Event Update description',
|
|
'start_date' => '2020-07-20 09:00:00',
|
|
'category' => [
|
|
'data' => [
|
|
'event_category_id' => $event->category_id,
|
|
],
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function only_the_owner_or_staff_can_patch_the_event()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['id' => 123, 'user_id' => $user->id]);
|
|
|
|
$this->actingAs($anotherUser = factory(User::class)->create(), 'api');
|
|
|
|
$this->patch('/api/events/'. $event->id, $this->data())
|
|
->assertStatus(403);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_event_can_be_delete()
|
|
{
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
|
|
$response = $this->delete('/api/events/' . $event->id);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertCount(0, Event::all());
|
|
|
|
$response->assertStatus(204);
|
|
}
|
|
|
|
/** @test */
|
|
public function only_the_owner_can_delete_the_bookmark()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create();
|
|
|
|
$this->actingAs($anotherUser = factory(User::class)->create(), 'api');
|
|
|
|
$response = $this->delete('/api/events/' . $event->id);
|
|
|
|
$response->assertStatus(403);
|
|
}
|
|
|
|
/** @test */
|
|
public function owner_can_invite_user_to_an_event()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
$userTwo = factory(User::class)->create();
|
|
|
|
$response = $this->post('api/events/'.$event->id.'/invite/'.$userTwo->id);
|
|
$response->assertStatus(200);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
]
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function owner_can_remove_invitation()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
$userTwo = factory(User::class)->create();
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$response = $this->delete('api/events/'.$event->id.'/invite/'.$userTwo->id);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertCount(0, $event->guests);
|
|
|
|
$response->assertStatus(204);
|
|
}
|
|
|
|
/** @test */
|
|
public function owner_can_add_guest_to_staff_event()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
$userTwo = factory(User::class)->create();
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$response = $this->post('api/events/'.$event->id.'/staff/'.$userTwo->id);
|
|
$response->assertStatus(200);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
'attributes' => [
|
|
'is_staff' => true,
|
|
]
|
|
|
|
],
|
|
'links' => [
|
|
'self' => url('/users/'.$userTwo->id),
|
|
],
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function owner_can_remove_guest_to_staff_event()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
$userTwo = factory(User::class)->create();
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$response = $this->delete('api/events/'.$event->id.'/staff/'.$userTwo->id);
|
|
$response->assertStatus(200);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
'attributes' => [
|
|
'is_staff' => false,
|
|
]
|
|
|
|
],
|
|
'links' => [
|
|
'self' => url('/users/'.$userTwo->id),
|
|
],
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function staff_can_add_guest()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id]);
|
|
$this->actingAs($userTwo = factory(User::class)->create(), 'api');
|
|
$event->guests()->attach($userTwo);
|
|
$event->guests()->updateExistingPivot($userTwo, ['is_staff' => true], false);
|
|
|
|
$nexGuestUser = factory(User::class)->create();
|
|
|
|
$response = $this->post('api/events/'.$event->id.'/invite/'.$nexGuestUser->id);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$response->assertStatus(200);
|
|
$this->assertCount(2, $event->guests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
'attributes' => [
|
|
'is_staff' => 1,
|
|
]
|
|
],
|
|
],
|
|
[
|
|
'data' => [
|
|
'user_id' => $nexGuestUser->id,
|
|
'attributes' => [
|
|
'is_staff' => 0,
|
|
]
|
|
]
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function guest_can_invite_another_guest_if_public_event()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id,'private' => false]);
|
|
$this->actingAs($userTwo = factory(User::class)->create(), 'api');
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$nexGuestUser = factory(User::class)->create();
|
|
|
|
$response = $this->post('api/events/'.$event->id.'/invite/'.$nexGuestUser->id);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertCount(2, $event->guests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
],
|
|
],
|
|
[
|
|
'data' => [
|
|
'user_id' => $nexGuestUser->id,
|
|
]
|
|
]
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function guest_can_validate_event_participation()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->withoutExceptionHandling();
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id,'private' => false]);
|
|
$this->actingAs($userTwo = factory(User::class)->create(), 'api');
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$response = $this->delete('api/events/'.$event->id.'/invite/validation');
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertCount(1, $event->guests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations' => [
|
|
[
|
|
'data' => [
|
|
'user_id' => $userTwo->id,
|
|
'attributes' => [
|
|
'validated_at' => now()->toDateTimeString(),
|
|
]
|
|
],
|
|
],
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function guest_can_delete_invitation()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id,'private' => false]);
|
|
$this->actingAs($userTwo = factory(User::class)->create(), 'api');
|
|
$event->guests()->attach($userTwo);
|
|
|
|
$response = $this->delete('api/events/'.$event->id.'/invite/delete');
|
|
|
|
$event = $event->fresh();
|
|
|
|
$response->assertStatus(204);
|
|
$this->assertCount(0, $event->guests);
|
|
}
|
|
|
|
/** @test */
|
|
public function owner_or_staff_can_invite_a_non_user_with_an_email()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$this->actingAs($user = factory(User::class)->create(), 'api');
|
|
$event = factory(Event::class)->create(['user_id' => $user->id, 'private' => false]);
|
|
|
|
$response = $this->post('api/events/'.$event->id.'/invite/with-email', ['email' => 'test@mail.fr']);
|
|
|
|
$event = $event->fresh();
|
|
|
|
$this->assertCount(1, $event->emailedGuests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations-with-email' => [
|
|
'data' => [
|
|
[
|
|
'email' => 'test@mail.fr',
|
|
'read_at' => null,
|
|
'validated_at' => null,
|
|
]
|
|
],
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_guest_with_an_email_can_read_event()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id, 'private' => false]);
|
|
$token = (string) Str::uuid();
|
|
$guest = new EventGuestsNonUsers(['event_id' => $event->id, 'email' => 'test@mail.fr', 'token' => $token]);
|
|
$guest->save();
|
|
|
|
$response = $this->get('api/events/'.$event->id.'/with-email?email=test@mail.fr&token='.$token);
|
|
|
|
$response->assertStatus(200);
|
|
$this->assertCount(0, $event->guests);
|
|
$this->assertCount(1, $event->emailedGuests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations-with-email' => [
|
|
'data' => [
|
|
[
|
|
'email' => 'test@mail.fr',
|
|
'read_at' => now()->toDateTimeString(),
|
|
'validated_at' => null,
|
|
]
|
|
],
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_guest_with_an_email_can_confirm_participation()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
$user = factory(User::class)->create();
|
|
$event = factory(Event::class)->create(['user_id' => $user->id, 'private' => false]);
|
|
$token = (string) Str::uuid();
|
|
$guest = new EventGuestsNonUsers(['event_id' => $event->id, 'email' => 'test@mail.fr', 'token' => $token]);
|
|
$guest->save();
|
|
|
|
$response = $this->patch('api/events/'.$event->id.'/with-email', [ 'email' => 'test@mail.fr', 'token' => $token ]);
|
|
|
|
$response->assertStatus(200);
|
|
$this->assertCount(1, $event->emailedGuests);
|
|
$response->assertJson([
|
|
'data' => [
|
|
'event_id' => $event->id,
|
|
'attributes' => [
|
|
'data' => [
|
|
'invitations-with-email' => [
|
|
'data' => [
|
|
[
|
|
'validated_at' => now()->toDateTimeString(),
|
|
]
|
|
],
|
|
],
|
|
]
|
|
]
|
|
]
|
|
]);
|
|
}
|
|
|
|
// todo an_invitation_mail_is_seed_to_new_guest
|
|
// https://laravel.com/docs/5.8/mocking#mail-fake
|
|
|
|
// todo a_guest_can_confirm_participation_in_mail
|
|
|
|
private function data()
|
|
{
|
|
return [
|
|
'name' => 'Test name event',
|
|
'description' => 'Test description event',
|
|
'category_id' => 1,
|
|
'private' => false,
|
|
'start_date' => '2020-07-20 09:00:00',
|
|
'end_date' => '2020-07-26 09:00:00',
|
|
'location' => 'Marcillac',
|
|
];
|
|
}
|
|
}
|