-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kyle Milloy
committed
Feb 10, 2019
1 parent
0c2376e
commit 0770b65
Showing
9 changed files
with
140 additions
and
15 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
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,26 @@ | ||
<?php | ||
|
||
namespace Tests\NowCal; | ||
|
||
use Carbon\Carbon; | ||
use Tests\TestCase; | ||
|
||
class EndAttributeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_get_and_set_a_end_time() | ||
{ | ||
$this->nowcal->end($time = 'now'); | ||
|
||
$this->assertEquals($time, $this->nowcal->end); | ||
} | ||
|
||
/** @test */ | ||
public function it_casts_end_as_a_datetime() | ||
{ | ||
$this->nowcal->end($time = 'October 5, 2019 6:03PM'); | ||
$format = 'Ymd\THis\Z'; | ||
|
||
$this->assertStringContainsString(Carbon::parse($time)->format($format), $this->nowcal->plain); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Tests\NowCal; | ||
|
||
use Tests\TestCase; | ||
|
||
class LocationAttributeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_get_and_set_a_end_time() | ||
{ | ||
$this->nowcal->location($location = '123 Fake Street NW'); | ||
|
||
$this->assertEquals($location, $this->nowcal->location); | ||
} | ||
|
||
/** @test */ | ||
public function it_includes_location_in_its_output() | ||
{ | ||
$this->nowcal->location($location = '123 Fake Street NW'); | ||
|
||
$this->assertStringContainsString($location, $this->nowcal->plain); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace Tests\NowCal; | ||
|
||
use Carbon\Carbon; | ||
use Tests\TestCase; | ||
|
||
class StartAttributeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_get_and_set_a_start_time() | ||
{ | ||
$this->nowcal->start($time = 'now'); | ||
|
||
$this->assertEquals($time, $this->nowcal->start); | ||
} | ||
|
||
/** @test */ | ||
public function it_casts_start_as_a_datetime() | ||
{ | ||
$this->nowcal->start($time = 'October 5, 2019 6:03PM'); | ||
$format = 'Ymd\THis\Z'; | ||
|
||
$this->assertStringContainsString(Carbon::parse($time)->format($format), $this->nowcal->plain); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Tests\NowCal; | ||
|
||
use Tests\TestCase; | ||
|
||
class SummaryAttributeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_get_and_set_a_summary() | ||
{ | ||
$this->nowcal->summary($summary = 'lorem ipsum dolor sit'); | ||
|
||
$this->assertEquals($summary, $this->nowcal->summary); | ||
} | ||
|
||
/** @test */ | ||
public function it_includes_the_summary_in_its_output() | ||
{ | ||
$this->nowcal->summary($summary = 'This is my summary'); | ||
|
||
$this->assertStringContainsString($summary, $this->nowcal->plain); | ||
} | ||
} |
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