owncloud-archive / maps

:globe_with_meridians: Maps app for ownCloud
GNU Affero General Public License v3.0
42 stars 20 forks source link

Reorganize phpunit #83

Closed Henni closed 8 years ago

Henni commented 8 years ago

There are currently (almost) no tests. This pull request simply reorganizes the test files.

Until now the phpunit.xml in the root folder wasn't used at all and lead to errors if one tried ( see #80 ). Now this file is actually used and i moved all tests from the subfolder tests/unit/ to tests/.

The only existing test is for the pagecontroller and isn't complete. So let's start building tests!

cc @nutzmdm @v1r0x @DJaeger fixes #80

jancborchardt commented 8 years ago

@nutzmdm can you test & review this since it fixes your reported issue #80 :)

Henni commented 8 years ago

@v1r0x could you take a look, please? This PR would allow us to start writing tests for our backend.

v1r0x commented 8 years ago

@Henni any instructions what to do? I tried to test it, but got a couple of errors.

Henni commented 8 years ago

@v1r0x Which errors did you get?

v1r0x commented 8 years ago

PHP Fatal error: Class 'OCA\Maps\AppInfo\Application' not found in maps/tests/controller/pagecontrollertest.php on line 27 if I try to run it from inside the tests/ folder

Henni commented 8 years ago

@v1r0x The idea is that you can now run phpunit from the root folder (maps/).

v1r0x commented 8 years ago

@Henni then I get this error: Cannot open file "/var/www/html/owncloud/apps/maps/../../tests/bootstrap.php".

Henni commented 8 years ago

@v1r0x Could you verify that this file actually doesn't exist?

v1r0x commented 8 years ago

the folder tests in the oc root folder does not exists. Do I need something for that?

Henni commented 8 years ago

@v1r0x You probably installed owncloud using the archives from owncloud.org which don't contain tests. Think about using ocdev instead which actually clones the git repo and has some additional functionality like code checks.

v1r0x commented 8 years ago

@Henni thanks for the link, will test later

DeepDiver1975 commented 8 years ago

:+1: