function it_should_return_if_show_is_now_playing() { $this->nowPlaying()->shouldBe(false); $today = ScheduleTime::now(); $this->airsDayOfWeek($today->dayOfWeek()); $this->startsAt($today->hour()); $this->nowPlaying()->shouldBe(true); $this->startsAt($today->hour() - 1); $this->nowPlaying()->shouldBe(false); $this->extendShowByHour(); $this->nowPlaying()->shouldBe(true); }
public function nowPlaying() { $today = ScheduleTime::now(); if ($this->airDayOfWeek() != $today->dayOfWeek()) { return false; } if ($this->startingHour > $today->hour() || $this->endingHour <= $today->hour()) { return false; } return true; }