Beispiel #1
0
 public function testEquals()
 {
     $event = new Event(array('foo' => 'bar', 'baz' => 'bla'));
     $equalEvent = new Event(array('baz' => 'bla', 'foo' => 'bar'));
     $unequalEvent = new Event(array('baz' => 'bla', 'foo' => 'butts'));
     $this->assertTrue($event->equals($equalEvent));
     $this->assertFalse($event->equals($unequalEvent));
 }
Beispiel #2
0
 /**
  * Post an event to the REST API and return decoded JSON response.
  *
  * @see https://siftscience.com/docs/references/events-api
  * @see Event
  *
  * @param Event $event
  * @return array
  */
 public function postEvent(Event $event)
 {
     $json = $event->withKey($this->apiKey)->toJson();
     return $this->send($this->httpClient->post('events', null, $json));
 }