public function testThisWeekSeriesOfWeeks() { $current = date('W'); $this->carbon->shouldReceive('format')->andReturn($current); $months = [1, 2, $current]; $this->scheduler->shouldReceive('getScheduleWeek')->andReturn($months); $this->assertTrue($this->interpreter->thisWeek($this->scheduler)); }
public function testThisWeekOddWeek() { $this->carbon->shouldReceive('format')->with('j')->andReturn(3); $this->scheduler->shouldReceive('getScheduleWeek')->andReturn('odd'); $parser = new ScheduleInterpreter($this->scheduler, $this->carbon); $this->assertFalse($parser->thisWeek($this->scheduler)); $this->carbon->shouldReceive('format')->with('W')->andReturn(1); $this->assertTrue($parser->thisWeek($this->scheduler)); }