summaryrefslogtreecommitdiff
path: root/tests/units/Base.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-18 21:04:06 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-18 21:04:06 -0400
commit6d5ffaa848dcbc09538f79cb0cdea08f5306f4a4 (patch)
tree2b782b7bc4b7f25cfa9021f7250450c7534f86cb /tests/units/Base.php
parentdb95e96f92a15660dc043eb033a0f7737b59a030 (diff)
Send all Kanboard events to the webhook (breaking change)
Diffstat (limited to 'tests/units/Base.php')
-rw-r--r--tests/units/Base.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/units/Base.php b/tests/units/Base.php
index b6302942..20f4a8cc 100644
--- a/tests/units/Base.php
+++ b/tests/units/Base.php
@@ -11,6 +11,35 @@ use SimpleLogger\File;
date_default_timezone_set('UTC');
+class FakeHttpClient
+{
+ private $url = '';
+ private $data = array();
+
+ public function getUrl()
+ {
+ return $this->url;
+ }
+
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ public function toPrettyJson()
+ {
+ return json_encode($this->data, JSON_PRETTY_PRINT);
+ }
+
+ public function post($url, array $data)
+ {
+ $this->url = $url;
+ $this->data = $data;
+ //echo $this->toPrettyJson();
+ return true;
+ }
+}
+
abstract class Base extends PHPUnit_Framework_TestCase
{
protected $container;
@@ -43,6 +72,7 @@ abstract class Base extends PHPUnit_Framework_TestCase
$this->container['logger'] = new Logger;
$this->container['logger']->setLogger(new File('/dev/null'));
+ $this->container['httpClient'] = new FakeHttpClient;
}
public function tearDown()