DefinitionTest::testGetDPUBreakdown PHP Метод

testGetDPUBreakdown() публичный Метод

public testGetDPUBreakdown ( )
    public function testGetDPUBreakdown()
    {
        $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('dpu' => array('contains' => array('count' => 1, 'dpu' => 4, 'targets' => array('interaction.content' => array('count' => 1, 'dpu' => 4)))), 'dpu' => 4), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
        DataSift_MockApiClient::setResponse($response);
        $dpu = $def->getDPUBreakdown();
        $this->assertEquals(array(), array_diff($dpu, $response['data']), 'The DPU breakdown is not what was expected');
        $this->assertEquals($response['data']['dpu'], 4, 'The total DPU is incorrect');
    }