DefinitionTest::testGetBuffered PHP Method

testGetBuffered() public method

public testGetBuffered ( )
    public function testGetBuffered()
    {
        $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);
        $def = new DataSift_Definition($this->user, testdata('definition'));
        $this->assertEquals($def->get(), testdata('definition'), 'Definition string not set correctly');
        $def->getHash();
        $response = array('response_code' => 200, 'data' => array('stream' => array(0 => array('interaction' => array('source' => 'Snaptu', 'author' => array('username' => 'nittolexia', 'name' => 'nittosoetreznoe', 'id' => 172192091, 'link' => 'http://johndoe.tumblr.com/'), 'type' => 'tumblr', 'link' => 'http://johndoe.tumblr.com/post', 'created_at' => 'Sat, 09 Jul 2011 05:46:51 +0000', 'content' => 'Mending gak ush maen dehh..', 'id' => '1e0a9eedc207acc0e074ea8aecb2c5ea'), 'tumblr' => array('user' => array('name' => 'nittosoetreznoe', 'description' => 'oh dear', 'location' => 'denpasar, bali', 'statuses_count' => 6830, 'followers_count' => 88, 'friends_count' => 111, 'screen_name' => 'nittolexia', 'lang' => 'en', 'time_zone' => 'Alaska', 'id' => 172192091, 'geo_enabled' => true), 'mentions' => array(0 => 'ayyuchadel', 1 => 'nittolexia', 2 => 'sansan_arie'), 'id' => '89571192838684672', 'text' => 'Mending gak ush maen dehh..', 'source' => '<a href="http://www.snaptu.com" rel="nofollow">Snaptu</a>', 'created_at' => 'Sat, 09 Jul 2011 05:46:51 +0000'), 'klout' => array('score' => 45, 'network' => 55, 'amplification' => 17, 'true_reach' => 31, 'slope' => 0, 'class' => 'Networker'), 'peerindex' => array('score' => 30), 'language' => array('tag' => 'da')))), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
        DataSift_MockApiClient::setResponse($response);
        $interactions = $def->getBuffered();
        $this->assertEquals($response['data']['stream'], $interactions, 'Buffered interactions are not as expected');
    }