Closed imjalpreet closed 8 years ago
@oparoz Changes Done.
You need to add the unit test to make sure things are working as expected.
In the next PR, you'll need to enable the API suite in Codeception to make sure the app is working as expected. Everything you need is in the Gallery app. You will need a shorter version of this to manage users and files: https://github.com/interfasys/galleryplus/blob/master/tests/_support/Helper/DataSetup.php
Any string
@oparoz I will again have to use setMapperResult, right?
If yes, then I have tried it but I am getting the following error:
1) MetadataControllerTest: Get metadata
Test tests/unit/Controller/MetadataControllerTest.php:testGetMetadata
Array (...) does not match expected type "NULL".
#1 /var/www/GSoC/apps/mediametadata/tests/unit/Controller/MetadataControllerTest.php:80
#2 OCA\MediaMetadata\Controller\MetadataControllerTest->testGetMetadata
I will again have to use setMapperResult, right?
Not this time. You simply need to mock the service. It's much easier since it returns an array.
@oparoz Done.
@oparoz Done.
CI didn't kick in. Could you please force push the last commit again?
I'm merging this as-is because we're pressed for time and you need to enable the API suite, but try to think about what your service should do in case of error.
You could get:
All these will probably crash your app and we need to make it return an error message instead.
@oparoz Yeah, I understand. I will try to think of all these errors and maybe make a list, so that I can add them afterwards.
Thank you
@oparoz I have added the API for a logged in user.
Can you check if its correct?