Improving Code Coverage for Loklak PHP API

Tests


This week, I added tests for suggest, map, markdown, push and susi APIs and fixed tests for user topology related queries. PHPUnit was used as the testing framework since it provides code-coverage support.

Loklak PHP API now has a good test-suite support and associated examples to help you use our services

Below are the Tests that were added.

testPushto test Push API.Selection_001

testSusito test newly added Susi API. Selection_003

Refer to this and this for more info about Susi

testMap – to test map API.

testMarkdown – to test markdown API.Selection_002

For more detailed information regarding the entire Loklak PHP API test-suite, refer to this.

In above process, code-coverage was increased from 33% to 61%. Test-suite continuously updated as new APIs are added to Loklak.

Source support for Search API


Apart from that, since Loklak is scaling beyond Twitter. Source argument has been added to the search API to define the source of search results. As far as wordpress plugins are concerned, since they only require twitter results for now, source has been added as a default argument. See below code: Selection_004

Improving Code Coverage for Loklak PHP API