Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tweaks and Mocks
Fixed bad parameter
Added a all-ok mock for dev environments
  • Loading branch information
rdohms committed May 24, 2014
1 parent a2789a2 commit 8002e08
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@

"autoload": {
"psr-0": {
"DMS": "src/"
"DMS": ["src/", "tests/"]
}
}
}
4 changes: 2 additions & 2 deletions src/DMS/Service/Superfeedr/SuperfeedrClient.php
Expand Up @@ -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')
]
];

Expand All @@ -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);

}
Expand Down
35 changes: 35 additions & 0 deletions tests/DMS/Service/Superfeedr/MockClient/AllSuccessMockClient.php
@@ -0,0 +1,35 @@
<?php

namespace DMS\Service\Superfeedr\MockClient;

use DMS\Service\Superfeedr\SuperfeedrClient;
use Guzzle\Http\Message\Response;

class AllSuccessMockClient extends SuperfeedrClient
{
public function subscribeFeed($feed, $callbackUrl, $format = 'ATOM')
{
return new Response(200);
}

public function unsubscribeFeed($feed, $callbackUrl = null)
{
return new Response(200);
}

public function listFeeds($callbackUrl, $page = 1)
{
return new Response(200);
}

public function retrieveFeeds($feed, array $config = [])
{
return new Response(200);
}

public function validateRequest($signature, $content)
{
return true;
}

}

0 comments on commit 8002e08

Please sign in to comment.