public function until($endDate) { if (Valid::dateTimeObject($endDate)) { $this->until = clone $endDate; return $this; } throw new \InvalidArgumentException("until: Accepts valid DateTime objects"); }
/** * @expectedException InvalidArgumentException */ public function testInvalidUntil() { $test = new When(); $test->until("test"); }