getAll() public static method

List recordings
public static getAll ( Datasift_User $user, $page = 1, $per_page = 20, $order_by = self::ORDERBY_CREATED_AT, $order_dir = self::ORDERDIR_ASC ) : array
$user Datasift_User The Datasift user object
return array
Beispiel #1
0
 public function testGetAll()
 {
     $response = array('response_code' => 200, 'data' => array('count' => 2, 'page' => 1, 'pages' => 1, 'per_page' => 25, 'subscriptions' => array(array('volume' => 12300, 'start' => 1436085514, 'end' => 1436089932, 'status' => 'stopped', 'name' => 'example1', 'reached_capacity' => false, 'identity_id' => '58d783dd98dd6b8bc7a39d73928fa7cf', 'hash' => '37fdfa811a6fb20785eecb9de9dd2d3e', 'remaining_index_capacity' => 998400, 'remaining_account_capacity' => 927200), array('volume' => 14700, 'start' => 1436087600, 'end' => 1436089999, 'status' => 'stopped', 'name' => 'example2', 'reached_capacity' => false, 'identity_id' => '58d783dd98dd6b8bc7a39d73928fa7cf', 'hash' => '9jrh3nq811a6fb20785eecb9de9dd2d3f', 'remaining_index_capacity' => 986500, 'remaining_account_capacity' => 927200))), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
     DataSift_MockApiClient::setResponse($response);
     $get = DataSift_Pylon::getAll($this->user);
     $this->assertCount(2, $get['subscriptions'], 'Expecting 2 subscription arrays');
     $this->assertEquals($get['subscriptions'][0]['hash'], '37fdfa811a6fb20785eecb9de9dd2d3e', 'Hash did not match');
     $this->assertEquals($get['subscriptions'][1]['hash'], '9jrh3nq811a6fb20785eecb9de9dd2d3f', 'Hash did not match');
     $this->assertEquals($get['subscriptions'][0]['name'], 'example1', 'Name did not match');
 }