diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2010-07-06 15:36:34 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2010-07-06 15:36:34 +0400 |
commit | fccd0e0f6f98eb83cc89a36a818792ad918afc5d (patch) | |
tree | e0716ff341bab14285ab0b630b7f21601ba640b9 /plugins/ExampleAPI | |
parent | 1d034366e148a1e718267572914c49fed677db85 (diff) |
Now testing various API exports for ExampleAPI plugins, for all API formats: xml, csv, tsv, json, etc.
Any breaking or modifying change in the renderer or data conversion should trigger a test fail.
Improved parameters in ExampleAPI API.php
Refs #1446
git-svn-id: http://dev.piwik.org/svn/trunk@2431 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/ExampleAPI')
53 files changed, 184 insertions, 21 deletions
diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php index ce568e13d5..2ffb0bdcc2 100644 --- a/plugins/ExampleAPI/API.php +++ b/plugins/ExampleAPI/API.php @@ -11,12 +11,26 @@ */ /** - * ExampleAPI API - * - * <p><b>HOW TO VIEW THE API IN ACTION</b></p> - * <p>Go to the API page in the Piwik user interface - * and try the API of the plugin ExampleAPI</p> - * + * This is an example of a basic API file. Each plugin can have one public API. + * Each public function in this class will be available to be called via the API. + * Protected and private members will not be callable. + * + * Functions can be called internally using the PHP objects directly, or via the + * Piwik Web APIs, using HTTP requests. For more information, check out: + * http://dev.piwik.org/trac/wiki/API/CallingTechniques + * + * Parameters are passed automatically from the GET request to the API functions. + * + * Common API uses include: + * - requesting stats for a given date and period, for one or several websites + * - creating, editing, deleting entities (Goals, Websites, Users) + * - any logic that could be useful to a larger scope than the Controller (make a setting editable for example) + * + * It is highly recommended that all the plugin logic is done inside API implementations, and the + * Controller and other objects would all call the API internally using, eg. + * Piwik_ExampleAPI_API::getInstance()->getSum(1, 2); + * + * * @package Piwik_ExampleAPI */ class Piwik_ExampleAPI_API @@ -57,27 +71,37 @@ class Piwik_ExampleAPI_API } /** - * Get Golden Ratio - * @return float + * Returns a custom object. + * API format conversion will fail for this custom object. + * If used internally, the data structure can be returned untouched by using + * the API parameter 'format=original' + * + * @return Piwik_MagicObject Will return a standard Piwik error when called from the Web APIs */ - public function getGoldenRatio() + public function getObject() { - //http://en.wikipedia.org/wiki/Golden_ratio - return 1.618033988749894848204586834365; + return new Piwik_MagicObject(); } /** - * Get object - * @return Piwik_MagicObject + * Sums two floats and returns the result. + * The paramaters are set automatically from the GET request + * when the API function is called. You can also use default values + * as shown in this example. + * + * @param $a + * @param $b + * @return float */ - public function getObject() + public function getSum($a = 0, $b = 0) { - return new Piwik_MagicObject(); + return (float)($a + $b); } - + /** - * Get null - * @return null + * Returns null value + * + * @return null */ public function getNull() { @@ -86,15 +110,21 @@ class Piwik_ExampleAPI_API /** * Get array of descriptive text + * When called from the Web API, you see that simple arrays like this one + * are automatically converted in the various formats (xml, csv, etc.) + * * @return array */ public function getDescriptionArray() { - return array('piwik','open source','web analytics','free'); + return array('piwik','open source','web analytics','free', 'Strong message: Свободный Тибет'); } /** - * Get data table + * Returns a custom data table. + * This data table will be converted to all available formats + * when requested in the API request. + * * @return Piwik_DataTable */ public function getCompetitionDatatable() @@ -103,6 +133,10 @@ class Piwik_ExampleAPI_API $row1 = new Piwik_DataTable_Row(); $row1->setColumns( array('name' => 'piwik', 'license' => 'GPL')); + + // Rows Metadata is useful to store non stats data for example (logos, urls, etc.) + // When printed out, they are simply merged with columns + $row1->setMetadata('logo', 'logo.png'); $dataTable->addRow($row1); $dataTable->addRowFromSimpleArray( array('name' => 'google analytics', 'license' => 'commercial') ); @@ -112,6 +146,7 @@ class Piwik_ExampleAPI_API /** * Get more information on the Answer to Life... + * * @return string */ public function getMoreInformationAnswerToLife() diff --git a/plugins/ExampleAPI/tests/Integration.test.php b/plugins/ExampleAPI/tests/Integration.test.php index ba71996848..2fa76ffaab 100644 --- a/plugins/ExampleAPI/tests/Integration.test.php +++ b/plugins/ExampleAPI/tests/Integration.test.php @@ -32,6 +32,7 @@ class Test_Piwik_Integration_ExampleAPI extends Test_Integration // one could generate fake inputs, and check that ouputs are processed as expected // @see tests/integration/ for more info $this->setApiToCall( 'ExampleAPI' ); - $this->callGetApiCompareOutput(__FUNCTION__); + $renderers = Piwik_DataTable_Renderer::getRenderers(); + $this->callGetApiCompareOutput(__FUNCTION__, $renderers); } }
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.csv Binary files differnew file mode 100644 index 0000000000..818221bae8 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.html new file mode 100644 index 0000000000..fe98977c10 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.html @@ -0,0 +1,12 @@ +<table id="ExampleAPI_getAnswerToLife" border="1"> +<thead> + <tr> + <th>value</th> + </tr> +</thead> +<tbody> + <tr> + <td>42</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.json new file mode 100644 index 0000000000..861b99d7da --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.json @@ -0,0 +1 @@ +{"value":42}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.original new file mode 100644 index 0000000000..f70d7bba4a --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.original @@ -0,0 +1 @@ +42
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.php new file mode 100644 index 0000000000..cabd0e3f55 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.php @@ -0,0 +1 @@ +i:42;
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.tsv Binary files differnew file mode 100644 index 0000000000..818221bae8 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getAnswerToLife.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.csv Binary files differnew file mode 100644 index 0000000000..e9fa1f701d --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.html new file mode 100644 index 0000000000..f6bf56e74d --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.html @@ -0,0 +1,21 @@ +<table id="ExampleAPI_getCompetitionDatatable" border="1"> +<thead> + <tr> + <th>name</th> + <th>license</th> + <th>_metadata</th> + </tr> +</thead> +<tbody> + <tr> + <td>piwik</td> + <td>GPL</td> + <td>'logo' => 'logo.png'</td> + </tr> + <tr> + <td>google analytics</td> + <td>commercial</td> + <td>-</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.json new file mode 100644 index 0000000000..ffb42eda93 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.json @@ -0,0 +1 @@ +[{"name":"piwik","license":"GPL","logo":"logo.png"},{"name":"google analytics","license":"commercial"}]
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.original new file mode 100644 index 0000000000..47aa8bf2fd --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.original @@ -0,0 +1,2 @@ +- 1 ['name' => 'piwik', 'license' => 'GPL'] ['logo' => 'logo.png'] [idsubtable = ]<br /> +- 2 ['name' => 'google analytics', 'license' => 'commercial'] [] [idsubtable = ]<br /> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.php new file mode 100644 index 0000000000..1c91da4ecc --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.php @@ -0,0 +1 @@ +a:2:{i:0;a:3:{s:4:"name";s:5:"piwik";s:7:"license";s:3:"GPL";s:4:"logo";s:8:"logo.png";}i:1;a:2:{s:4:"name";s:16:"google analytics";s:7:"license";s:10:"commercial";}}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.tsv Binary files differnew file mode 100644 index 0000000000..2a7083d16f --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.xml b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.xml index b3f152f190..3940117f9d 100644 --- a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.xml +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getCompetitionDatatable.xml @@ -3,6 +3,7 @@ <row> <name>piwik</name> <license>GPL</license> + <logo>logo.png</logo> </row> <row> <name>google analytics</name> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.csv Binary files differnew file mode 100644 index 0000000000..b9706fdbf4 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.html new file mode 100644 index 0000000000..b0ed075106 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.html @@ -0,0 +1,24 @@ +<table id="ExampleAPI_getDescriptionArray" border="1"> +<thead> + <tr> + <th>value</th> + </tr> +</thead> +<tbody> + <tr> + <td>piwik</td> + </tr> + <tr> + <td>open source</td> + </tr> + <tr> + <td>web analytics</td> + </tr> + <tr> + <td>free</td> + </tr> + <tr> + <td>Strong message: Свободный Тибет</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.json new file mode 100644 index 0000000000..7553c70fb4 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.json @@ -0,0 +1 @@ +[["piwik"],["open source"],["web analytics"],["free"],["Strong message: \u0421\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0422\u0438\u0431\u0435\u0442"]]
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.original new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.original diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.php new file mode 100644 index 0000000000..3a1a782a95 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.php @@ -0,0 +1 @@ +a:5:{i:0;a:1:{i:0;s:5:"piwik";}i:1;a:1:{i:0;s:11:"open source";}i:2;a:1:{i:0;s:13:"web analytics";}i:3;a:1:{i:0;s:4:"free";}i:4;a:1:{i:0;s:45:"Strong message: Свободный Тибет";}}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.tsv Binary files differnew file mode 100644 index 0000000000..b9706fdbf4 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.xml b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.xml index 1714bdf97a..ca48f01970 100644 --- a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.xml +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getDescriptionArray.xml @@ -4,4 +4,5 @@ <row>open source</row> <row>web analytics</row> <row>free</row> + <row>Strong message: Свободный Тибет</row> </result>
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.csv Binary files differnew file mode 100644 index 0000000000..0e6b852ec5 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.html new file mode 100644 index 0000000000..2a251be9e6 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.html @@ -0,0 +1,12 @@ +<table id="ExampleAPI_getMoreInformationAnswerToLife" border="1"> +<thead> + <tr> + <th>value</th> + </tr> +</thead> +<tbody> + <tr> + <td>Check http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.json new file mode 100644 index 0000000000..f66f45e348 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.json @@ -0,0 +1 @@ +{"value":"Check http:\/\/en.wikipedia.org\/wiki\/The_Answer_to_Life,_the_Universe,_and_Everything"}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.original new file mode 100644 index 0000000000..02e25bf586 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.original @@ -0,0 +1 @@ +Check http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.php new file mode 100644 index 0000000000..b041c9d9a6 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.php @@ -0,0 +1 @@ +s:83:"Check http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything";
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.tsv Binary files differnew file mode 100644 index 0000000000..345534d535 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getMoreInformationAnswerToLife.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.csv new file mode 100644 index 0000000000..1a1d751354 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.csv @@ -0,0 +1,2 @@ +message +ok
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.html new file mode 100644 index 0000000000..a68a872077 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.html @@ -0,0 +1 @@ +Success:ok
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.json new file mode 100644 index 0000000000..b6935263ec --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.json @@ -0,0 +1 @@ +{"result":"success", "message":"ok"}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.original new file mode 100644 index 0000000000..a68a872077 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.original @@ -0,0 +1 @@ +Success:ok
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.php new file mode 100644 index 0000000000..6f039be5ce --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.php @@ -0,0 +1 @@ +a:2:{s:6:"result";s:7:"success";s:7:"message";s:2:"ok";}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.tsv new file mode 100644 index 0000000000..a68a872077 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getNull.tsv @@ -0,0 +1 @@ +Success:ok
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.csv new file mode 100644 index 0000000000..6f022df26d --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.csv @@ -0,0 +1 @@ +Error: The API cannot handle this data structure.
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.html new file mode 100644 index 0000000000..9798700436 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.html @@ -0,0 +1 @@ +The API cannot handle this data structure.
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.json new file mode 100644 index 0000000000..6be6be4293 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.json @@ -0,0 +1 @@ +{"result":"error", "message":"The API cannot handle this data structure."}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.original new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.original diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.php new file mode 100644 index 0000000000..e7c405b36b --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.php @@ -0,0 +1 @@ +a:2:{s:6:"result";s:5:"error";s:7:"message";s:42:"The API cannot handle this data structure.";}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.tsv new file mode 100644 index 0000000000..6f022df26d --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getObject.tsv @@ -0,0 +1 @@ +Error: The API cannot handle this data structure.
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.csv Binary files differnew file mode 100644 index 0000000000..f538888e84 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.html new file mode 100644 index 0000000000..d0a9a2e252 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.html @@ -0,0 +1,12 @@ +<table id="ExampleAPI_getPiwikVersion" border="1"> +<thead> + <tr> + <th>value</th> + </tr> +</thead> +<tbody> + <tr> + <td>0.6.3</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.json new file mode 100644 index 0000000000..cb1de4ec3a --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.json @@ -0,0 +1 @@ +{"value":"0.6.3"}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.original new file mode 100644 index 0000000000..a0a15177f3 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.original @@ -0,0 +1 @@ +0.6.3
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.php new file mode 100644 index 0000000000..384d7c1b0e --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.php @@ -0,0 +1 @@ +s:5:"0.6.3";
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.tsv Binary files differnew file mode 100644 index 0000000000..f538888e84 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getPiwikVersion.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.csv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.csv Binary files differnew file mode 100644 index 0000000000..15022e49a2 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.csv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.html b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.html new file mode 100644 index 0000000000..ed26b648c5 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.html @@ -0,0 +1,12 @@ +<table id="ExampleAPI_getSum" border="1"> +<thead> + <tr> + <th>value</th> + </tr> +</thead> +<tbody> + <tr> + <td>0</td> + </tr> +</tbody> +</table> diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.json b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.json new file mode 100644 index 0000000000..a45b788953 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.json @@ -0,0 +1 @@ +{"value":0}
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.original b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.original new file mode 100644 index 0000000000..c227083464 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.original @@ -0,0 +1 @@ +0
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.php b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.php new file mode 100644 index 0000000000..8f66b5ba64 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.php @@ -0,0 +1 @@ +d:0;
\ No newline at end of file diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.tsv b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.tsv Binary files differnew file mode 100644 index 0000000000..15022e49a2 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.tsv diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.xml b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.xml new file mode 100644 index 0000000000..f5722c2b94 --- /dev/null +++ b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getSum.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result>0</result>
\ No newline at end of file |