示例#1
0
 /**
  * Tests the getters and setters of the model
  * @test
  */
 public function setGetTest()
 {
     $this->_model->setData('test=foo&foo[bar1]=test1&foo[bar2]=test2');
     $this->_model->setType('creditcard');
     $this->_model->setChecksum('foo-checksum');
     $this->_model->setAppId('app_123');
     $this->_model->setId('chk_123');
     $this->_model->setCreatedAt(23423142314);
     $this->_model->setUpdatedAt(23423142314);
     $this->assertEquals($this->_model->getData(), 'test=foo&foo[bar1]=test1&foo[bar2]=test2');
     $this->assertEquals($this->_model->getDataAsArray(), array('test' => 'foo', 'foo' => array('bar1' => 'test1', 'bar2' => 'test2')));
     $this->assertEquals($this->_model->getType(), 'creditcard');
     $this->assertEquals($this->_model->getChecksum(), 'foo-checksum');
     $this->assertEquals($this->_model->getAppId(), 'app_123');
     $this->assertEquals($this->_model->getId(), 'chk_123');
     $this->assertEquals($this->_model->getCreatedAt(), 23423142314);
     $this->assertEquals($this->_model->getUpdatedAt(), 23423142314);
 }
 /**
  * Creates and fills a checksum model
  *
  * @param array $response
  * @return Checksum
  */
 private function _createChecksum($response)
 {
     $model = new Checksum();
     $model->setId($response['id']);
     $model->setChecksum($response['checksum']);
     $model->setData($response['data']);
     $model->setType($response['type']);
     $model->setAction($response['action']);
     $model->setAppId($response['app_id']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     return $model;
 }