Last active
September 7, 2017 10:31
-
-
Save zlikavac32/cca9057e52404b0f5672855829861245 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 | |
| //... | |
| public function testThatOnMondayItWorks(): void { | |
| try { | |
| timecop_travel(new DateTime('2017-08-28 00:00:00')); //Monday | |
| $output = $this->runCommand('some-command'); | |
| $this->assertContains('OK', $output); | |
| } finally { | |
| timecop_return(); | |
| } | |
| } | |
| public function testThatOnTuesdayItDoesNotWork(): void { | |
| try { | |
| timecop_travel(new DateTime('2017-08-29 00:00:00')); //Tuesday | |
| $output = $this->runCommand('some-command'); | |
| $this->assertContains('Error', $output); | |
| } finally { | |
| timecop_return(); | |
| } | |
| } | |
| //and if you want to be sure, for all other days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment