/** * @expectedException \Opg\Common\Model\Entity\Exception\InvalidDateFormatException */ public function testGetSetPaymentDate() { $expectedDateTime = new \DateTime(); $expectedDateTimeString = $expectedDateTime->format(DateFormat::getDateFormat()); $this->assertNull($this->paymentType->getPaymentDate()); $this->assertEmpty($this->paymentType->getDateAsString('paymentDate')); $this->assertEquals($expectedDateTime, $this->paymentType->setPaymentDate($expectedDateTime)->getPaymentDate()); $this->assertEquals($expectedDateTimeString, $this->paymentType->setDateFromString($expectedDateTimeString, 'paymentDate')->getDateAsString('paymentDate')); $this->paymentType->setDateFromString('Last thursday around 3pm', 'paymentDate'); }