setDate() public method

Set the date
public setDate ( DateTime $date ) : Error
$date DateTime The DateTime instance to set
return Error
Esempio n. 1
0
 /**
  * @covers Imbo\Model\Error::getDate
  * @covers Imbo\Model\Error::setDate
  */
 public function testCanSetAndGetDate()
 {
     $date = new DateTime();
     $this->assertNull($this->model->getDate());
     $this->assertSame($this->model, $this->model->setDate($date));
     $this->assertSame($date, $this->model->getDate());
 }
Esempio n. 2
0
 /**
  * @covers Imbo\Model\Error::getData
  */
 public function testGetData()
 {
     $date = new DateTime();
     $this->model->setHttpCode(404);
     $this->model->setErrorMessage('message');
     $this->model->setDate($date);
     $this->model->setImboErrorCode(100);
     $this->model->setImageIdentifier('identifier');
     $this->assertSame(['httpCode' => 404, 'errorMessage' => 'message', 'date' => $date, 'imboErrorCode' => 100, 'imageIdentifier' => 'identifier'], $this->model->getData());
 }