Skip to content

Commit

Permalink
Move test cases to GeneratorTestContract
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Feb 19, 2024
1 parent 14bc6d5 commit 9524544
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 24 deletions.
24 changes: 24 additions & 0 deletions tests/Generators/GeneratorTestContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,28 @@ public function it_can_generate_a_description_is_html_code_event_link_with_allda
$this->generator()->generate($this->createDescriptionIsHtmlCodeEventLink())
);
}

/** @test */
public function it_correctly_generates_all_day_events_by_days(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createAllDayEventMultipleDaysWithTimezoneLink())
);
}

/** @test */
public function it_correctly_generates_all_day_events_by_dates(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createEventMultipleDaysViaStartEndWithTimezoneLink())
);
}

/** @test */
public function it_correctly_generates_all_day_events_by_dates_diff_tz(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createEventMultipleDaysViaStartEndWithDiffTimezoneLink())
);
}
}
24 changes: 0 additions & 24 deletions tests/Generators/GoogleGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,6 @@ protected function linkMethodName(): string
return 'google';
}

/** @test */
public function it_correctly_generates_all_day_events_by_days(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createAllDayEventMultipleDaysWithTimezoneLink())
);
}

/** @test */
public function it_correctly_generates_all_day_events_by_dates(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createEventMultipleDaysViaStartEndWithTimezoneLink())
);
}

/** @test */
public function it_correctly_generates_all_day_events_by_dates_diff_tz(): void
{
$this->assertMatchesSnapshot(
$this->generator()->generate($this->createEventMultipleDaysViaStartEndWithDiffTimezoneLink())
);
}

/** @test */
public function it_can_generate_an_url_with_custom_parameters(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:Spatie calendar-links
BEGIN:VEVENT
UID:cb8469bae9cf10a9ee8f1179c6a932f5
SUMMARY:All day bugs
DTSTAMP:20240125
DTSTART:20240125
DURATION:P6D
END:VEVENT
END:VCALENDAR
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-31&allday=true&subject=All%20day%20bugs&body=Testing%20all%20day
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-31&allday=true&subject=All%20day%20bugs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-30&allday=true&subject=All%20day%20bugs&body=Testing%20all%20day
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.live.com/calendar/action/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-31&allday=true&subject=All%20day%20bugs&body=Testing%20all%20day
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.live.com/calendar/action/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-31&allday=true&subject=All%20day%20bugs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://outlook.live.com/calendar/action/compose?path=/calendar/action/compose&rru=addevent&startdt=2024-01-25&enddt=2024-01-30&allday=true&subject=All%20day%20bugs&body=Testing%20all%20day
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://calendar.yahoo.com/?v=60&view=d&type=20&ST=20240125&DUR=allday&ET=20240131&TITLE=All%20day%20bugs&DESC=Testing%20all%20day
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://calendar.yahoo.com/?v=60&view=d&type=20&ST=20240125&DUR=allday&ET=20240131&TITLE=All%20day%20bugs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://calendar.yahoo.com/?v=60&view=d&type=20&ST=20240125&DUR=allday&ET=20240130&TITLE=All%20day%20bugs&DESC=Testing%20all%20day

0 comments on commit 9524544

Please sign in to comment.