DataSift_Pylon::validate PHP Method

validate() public static method

Validate CSDL
public static validate ( Datasift_User $user, string $csdl ) : array
$user Datasift_User The Datasift user object
$csdl string The CSDL to validate
return array The response from validating the CSDL
    public static function validate($user, $csdl)
    {
        return $user->post('pylon/validate', array('csdl' => $csdl));
    }

Usage Example

Beispiel #1
0
 public function testCanCompile()
 {
     $response = array('response_code' => 200, 'data' => array('created_at' => 1424280706, 'hash' => '1a4268c9b924d2c48ed1946d6a7e6272'), 'rate_limit' => 200, 'rate_limit_remaining' => 150);
     DataSift_MockApiClient::setResponse($response);
     $csdl = '(fb.content any "coffee" OR fb.hashtags in "tea") AND fb.language in "en"';
     $validate = DataSift_Pylon::validate($this->user, $csdl);
     $this->assertEquals($validate['created_at'], 1424280706, 'Created at did not match');
     $this->assertEquals($validate['hash'], '1a4268c9b924d2c48ed1946d6a7e6272', 'Name did not match');
 }
All Usage Examples Of DataSift_Pylon::validate