public getCreatedAt ( ) : integer | ||
리턴 | integer | The date as a unix timestamp. |
public function getCreatedAt()
{
if ($this->_csdl === false) {
throw new DataSift_Exception_InvalidData('Created at date not available');
}
if ($this->_created_at === false) {
// Catch any compilation errors so they don't pass up to the caller
try {
$this->validate();
} catch (DataSift_Exception_CompileFailed $e) {
}
}
return $this->_created_at;
}
public function testGetCreatedAt() { $response = array('response_code' => 200, 'data' => array('created_at' => date('Y-m-d H:i:s', time()), 'dpu' => 10), 'rate_limit' => 200, 'rate_limit_remaining' => 150); DataSift_MockApiClient::setResponse($response); $def = new DataSift_Definition($this->user, testdata('definition')); $this->assertEquals(testdata('definition'), $def->get(), 'Definition string not set correctly'); $this->assertEquals(strtotime($response['data']['created_at']), $def->getCreatedAt(), 'The created_at date is incorrect'); }