Ejemplo n.º 1
0
 /**
  * @param array $rules
  *
  * @return RuleList
  * @throws InvalidRuleFormatException
  */
 public function delete(array $rules)
 {
     if (!RuleList::validateRawRuleFormat($rules, false)) {
         throw new InvalidRuleFormatException();
     }
     $client = new Client();
     $client->delete($this->api_url, ['auth' => $this->auth, 'decode_content' => 'gzip', 'Content-Type' => 'application/json', 'body' => json_encode(['rules' => $rules])]);
     return $this->read();
 }
Ejemplo n.º 2
0
 public function testInvalidNoTags()
 {
     $rule = [['badkey' => 'abc']];
     $this->assertFalse(\Gnip\Models\RuleList::validateRawRuleFormat($rule, false), 'Asserts that an invalid rule, without tags, returns false');
 }