Permalink
Browse files

added a changelog. Close #5

  • Loading branch information...
1 parent d5a6fe7 commit 9e2a62cdf6b2557b98bd587f115e60ca93c02698 @mgallego committed Aug 13, 2012
Showing with 37 additions and 5 deletions.
  1. +23 −0 Changelog.md
  2. +14 −3 README.md
  3. +0 −2 Tests/Adapter/WidgetHandlerTest.php
View
@@ -0,0 +1,23 @@
+#v.0.1
+####Include the connector service in the own service
+
+```php
+services:
+...
+...
+ example.ducksboard:
+ class: SFM\DucksboardBundle\Adapter\Widget
+ arguments: [@sfm.ducksboard.connector]
+ calls:
+ - [setApiKey, [%ducksboard_api%]]
+
+```
+
+####The push and pull methods dont return data. The correct way to obtain the response is this:
+```php
+ ...
+ $widgetActualData = $widget->getArrayResponse();
+ //or
+ $widgetActualData = $widget->getRawResponse();
+
+```
View
@@ -139,17 +139,28 @@ $widget->setApiKey($this->container->getParameter('ducksboard_api'));
*Get the 3 last data of a widget*
```php
- $widgetActualData = $widget->getLastValues($widgetId, 3);
+ $widget->getLastValues($widgetId, 3);
+ $widgetActualData = $widget->getArrayResponse();
+ //or
+ $widgetActualData = $widget->getRawResponse();
+
```
*Find data by seconds*
```php
- $widgetActualData = $widget->findBySeconds($widgetId, $seconds);
+ $widget->findBySeconds($widgetId, $seconds);
+ $widgetActualData = $widget->getArrayResponse();
+ //or
+ $widgetActualData = $widget->getRawResponse();
```
*Find data by timespan*
```php
- $widgetActualData = $widget->findByTimespan($widgetId, 'monthly', $timezone);
+ $widget->findByTimespan($widgetId, 'monthly', $timezone);
+ $widgetActualData = $widget->getArrayResponse();
+ //or
+ $widgetActualData = $widget->getRawResponse();
+
```
## Other resources
@@ -20,15 +20,13 @@ public function testGetApiPath(){
$this->assertEquals($this->widget->getApiPath('pull', $parameters), 'https://pull.ducksboard.com/values/2/last/?counter=1');
}
-
public function testGetRawResponse(){
$this->widget->setResponse('{"response": "ok"}');
$response = array('{"response": "ok"}');
$this->assertEquals($this->widget->getRawResponse(), $response);
}
-
public function testGetArrayResponse(){
$widget = $this->getMockBuilder('SFM\DucksboardBundle\Adapter\WidgetHandler')
->setMethods(array('getArrayResponse'))

0 comments on commit 9e2a62c

Please sign in to comment.