/**
  * @expectedException \Bayer\DataDogClient\Event\InvalidSourceTypeException
  */
 public function testInvalidSourceTypeThrowsException()
 {
     $event = new Event('Text', 'Title');
     $event->setSourceTypeName('foo');
 }
Example #2
0
 /**
  * Send an Event object to datadog
  *
  * @param Event $event
  *
  * @return Client
  */
 public function sendEvent(Event $event)
 {
     $this->send(self::ENDPOINT_EVENT . $this->getApiKey(), $event->toArray());
     return $this;
 }
 public function testSendEvent()
 {
     $event = new Event('TestEvent', 'This is a testevent');
     $event->addTag('foo', 'bar')->setAlertType(Event::TYPE_SUCCESS)->setSourceTypeName(Event::SOURCE_MYAPPS)->setAggregationKey('unittest')->setPriority(Event::PRIORITY_LOW);
     $this->client->sendEvent($event);
 }