From 8002e08999ed4997f88f86aa90617d16eb1cd0bc Mon Sep 17 00:00:00 2001 From: Rafael Dohms Date: Sat, 24 May 2014 22:42:51 +0200 Subject: [PATCH] Tweaks and Mocks Fixed bad parameter Added a all-ok mock for dev environments --- composer.json | 2 +- .../Service/Superfeedr/SuperfeedrClient.php | 4 +-- .../MockClient/AllSuccessMockClient.php | 35 +++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 tests/DMS/Service/Superfeedr/MockClient/AllSuccessMockClient.php diff --git a/composer.json b/composer.json index 103aa99..4fcff91 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "autoload": { "psr-0": { - "DMS": "src/" + "DMS": ["src/", "tests/"] } } } diff --git a/src/DMS/Service/Superfeedr/SuperfeedrClient.php b/src/DMS/Service/Superfeedr/SuperfeedrClient.php index d66e58d..d2063ca 100644 --- a/src/DMS/Service/Superfeedr/SuperfeedrClient.php +++ b/src/DMS/Service/Superfeedr/SuperfeedrClient.php @@ -22,6 +22,7 @@ public function __construct($username, $password, $secret, array $config = []) 'base_url' => 'https://push.superfeedr.com', 'defaults' => [ 'auth' => [$username, $password], + 'debug' => fopen('php://output','w') ] ]; @@ -42,11 +43,10 @@ public function subscribeFeed($feed, $callbackUrl, $format = 'ATOM') 'hub.topic' => $feed, 'hub.callback' => $callbackUrl, 'hub.secret' => $this->hubSecret, - 'hub.format' => $format, + 'format' => $format, ] ]; - return $this->post('/', $options); } diff --git a/tests/DMS/Service/Superfeedr/MockClient/AllSuccessMockClient.php b/tests/DMS/Service/Superfeedr/MockClient/AllSuccessMockClient.php new file mode 100644 index 0000000..cd78057 --- /dev/null +++ b/tests/DMS/Service/Superfeedr/MockClient/AllSuccessMockClient.php @@ -0,0 +1,35 @@ +