From 8c9d70c5945efe6f112c875766dfd99e759398fa Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 16 Jan 2015 09:51:46 +0100 Subject: [PATCH] add apicontroller test --- developer_manual/app/tutorial.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/developer_manual/app/tutorial.rst b/developer_manual/app/tutorial.rst index 1030d3147..bcc68554c 100644 --- a/developer_manual/app/tutorial.rst +++ b/developer_manual/app/tutorial.rst @@ -996,6 +996,26 @@ You can test the API by running a GET request with **curl**:: curl -u user:password http://localhost:8080/index.php/apps/ownnotes/api/0.1/notes +Since the **NoteApiController** is basically identical to the **NoteController**, the unit test for it simply inherits its tests from the **NoteControllerTest**. Create the file **ownnotes/tests/unit/controller/NoteApiControllerTest.php**: + +.. code-block:: php + + controller = new NoteApiController( + 'ownnotes', $this->request, $this->service, $this->userId + ); + } + + } + Adding JavaScript and CSS ========================= To create a modern webapp you need to write :doc:`JavaScript`. You can use any JavaScript framework but for this tutorial we want to keep it as simple as possible and therefore only include the templating library `handlebarsjs `_. `Download the file `_ into **ownnotes/js/handlebars.js** and include it at the very top of **ownnotes/templates/main.php** before the other scripts and styles: