Returns the date when the stream was first created. If the created at
date has not yet been obtained it validates the definition first.
public getCreatedAt ( ) : integer | ||
return | integer | The date as a unix timestamp. |
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'); }
public function testGetCreatedAt() { $def = new DataSift_Definition($this->user, testdata('definition')); $response = array('response_code' => 200, 'data' => array('hash' => testdata('definition_hash'), 'created_at' => date('Y-m-d H:i:s', time()), 'dpu' => 10), 'rate_limit' => 200, 'rate_limit_remaining' => 150); DataSift_MockApiClient::setResponse($response); $this->assertEquals($def->get(), testdata('definition'), 'Definition string not set correctly'); $created_at = $def->getCreatedAt(); $this->assertTrue($created_at > strtotime('2000-01-01'), 'The created_at date is earlier than Jan 1st, 2000'); }