@@ -11,23 +11,64 @@ into a single commit. Please provide ample explanation in the commit message.
1111Installation
1212------------
1313
14- Testing the Parse PHP SDK involves some set-up. You'll need to create a Parse
15- App just for testing, and deploy some cloud code to it.
14+ Testing the Parse PHP SDK requires having a working Parse Server instance to run against.
15+ Additionally you'll need to add some cloud code to it.
16+
17+ To get started:
1618
1719* [ Get Composer] , the PHP package manager.
1820* Run "composer install" to download dependencies.
19- * Create a new app here: [ Create Parse App]
20- * Use the Parse CLI to create a Cloud Code folder for the new app.
21- * Copy tests/cloudcode/cloud/main.js into the newly created cloud/ folder.
22- * Run "parse deploy" in your cloud folder.
23- * Paste your App ID, REST API Key, and Master Key in tests/Parse/Helper.php
2421
25- You should now be able to execute, from project root folder:
22+ From here you have to setup an instance of parse server.
23+
24+ To get started quickly you can clone and run this [ parse server test] project.
25+ It's setup with the appropriate configuration to run the php sdk test suite.
26+ Additionally it handles setting up mongodb for the server.
27+
28+ Alternately you can configure a compatible test server as follows:
29+
30+ * [ Setup a local Parse Server instance]
31+ * Add main.js in tests/cloudcode/cloud/ to your Parse Server configuration as a cloud code file
32+ * Ensure your App ID, REST API Key, and Master Key match those contained in tests/Parse/Helper.php
33+ * Add a mock push configuration, for example:
34+ ``` json
35+ {
36+ "android" :
37+ {
38+ "senderId" : " blank-sender-id" ,
39+ "apiKey" : " not-a-real-api-key"
40+ }
41+ }
42+ ```
43+ * Add a mock email adapter configuration, for example:
44+ ``` json
45+ {
46+ "module" : " parse-server-simple-mailgun-adapter" ,
47+ "options" : {
48+ "apiKey" : " not-a-real-api-key" ,
49+ "domain" : " example.com" ,
50+ "fromAddress" : " example@example.com"
51+ }
52+ }
53+ ```
54+ * Ensure the public url is correct. For a locally hosted instance this is probably ``` http://localhost:1337/parse ```
55+
56+
57+ You should now be able to execute the tests, from project root folder:
58+
59+ ./vendor/bin/phpunit
60+
61+ The test suite is setup for code coverage if you have [ XDebug] installed and setup.
62+ Coverage is outputted as text and as html in the phpunit-test-results/ directory within the project root.
2663
27- ./vendor/bin/phpunit --stderr .
64+ If you do not have XDebug tests will still run, just without coverage .
2865
29- At present the full suite of tests takes around 20 minutes.
66+ Please make sure that any new functionality (or issues) you are working on are covered by tests when possible.
67+ If you have XDebug setup and can view code coverage please ensure that you do your best to completely cover any new code you are adding.
3068
3169[ Get Composer ] : https://getcomposer.org/download/
3270[ Contributor License Agreement ] : https://developers.facebook.com/opensource/cla
3371[ Create Parse App ] : https://parse.com/apps/new
72+ [ XDebug ] : https://xdebug.org/
73+ [ parse server test ] : https://github.com/montymxb/parse-server-test
74+ [ Setup a local Parse Server instance ] : https://github.com/ParsePlatform/parse-server#user-content-locally
0 commit comments