DefinitionTest::testCompile_Failure PHP Method

testCompile_Failure() public method

public testCompile_Failure ( )
    public function testCompile_Failure()
    {
        $response = array('response_code' => 400, 'data' => array('error' => 'The target interactin.content does not exist'), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
        DataSift_MockApiClient::setResponse($response);
        $this->setExpectedException('DataSift_Exception_InvalidData');
        $def = new DataSift_Definition($this->user, testdata('invalid_definition'));
        $this->assertEquals($def->get(), testdata('invalid_definition'), 'Definition string not set correctly');
        try {
            $def->compile();
        } catch (DataSift_Exception_APIError $e) {
            $this->fail('APIError: ' . $e->getMessage() . ' (' . $e->getCode() . ')');
        }
    }