public function publish(DateRange $publication) { $this->state = $this->state->publish(); $this->recordThat(new Events\PostWasPublished($this->getId(), $publication->getStart(), $publication->getEnd())); }
/** * @expectedException PHPUnit_Framework_Exception */ public function test_change_start_does_not_allow_null_date() { $Pub = new DateRange(new \DateTimeImmutable(), new \DateTimeImmutable('+5 day')); $NewPub = $Pub->changeStart(null); }