Created
September 12, 2017 15:58
-
-
Save stefanledin/f76b0a043887450429303555ef0da677 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| // (Laravel) | |
| use Tests\TestCase; | |
| use Carbon\Carbon; | |
| class TimeCounterTest extends TestCase | |
| { | |
| public function test_duration() | |
| { | |
| $counter = new TimeCounter(); | |
| Carbon::setTestNow(Carbon::create(2017, 09, 12, 17, 45); | |
| $counter->start(); | |
| Carbon::setTestNow(Carbon::create(2017, 09, 12, 18, 00); | |
| $counter->stop(); | |
| Carbon::setTestNow(); | |
| $this->assertEquals($counter->duration(), 15); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @stefanledin
are missing closing brackets, should be