diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9c86610 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: php +php: + - nightly +script: + - composer install + - ./vendor/bin/codecept run unit \ No newline at end of file diff --git a/README.md b/README.md index d2c848d..cecfb36 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Eventmapper PHP - +[![Build Status](https://travis-ci.org/WajoxSoftware/php-eventmapper-lib.svg?branch=version-2)](https://travis-ci.org/WajoxSoftware/php-eventmapper-lib) ## Write and use event handler 1. Create your class by extending wajox\eventmapper\AbstractEventHandler 2. Put your handler code into method run(), the method should return boolean value diff --git a/src/publishers/HttpEventPublisher.php b/src/publishers/HttpEventPublisher.php index c7cf9d7..932ac67 100644 --- a/src/publishers/HttpEventPublisher.php +++ b/src/publishers/HttpEventPublisher.php @@ -83,9 +83,13 @@ protected function sendRequest($rKey, $event) 'POST', $this->buildRequestUrl($rKey), [ - 'headers' => [ - 'Content-Type' => 'application/json' - ], + 'headers' => array_merge( + [ + 'Content-Type' => 'application/json', + 'Auth-Token' => $this->getOption('token'), + ], + $this->getOption('headers') + ), 'body' => \json_encode($event), ] ); @@ -100,8 +104,6 @@ protected function sendRequest($rKey, $event) */ protected function buildRequestUrl($rKey) { - return $this->getOption('url') - . '/' . $rKey . '/events' - . '?token=' . $this->getOption('token'); + return $this->getOption('url') . '/' . $rKey . '/events'; } }