Unit tests for WebService with code coverage

Hi,

I’m developing web service with Yii and would like to create some unit test for it.

I created test case in tests/unit folder and I’m using SoapClient class for testing.

Unfortunately this way I cannot get code coverage for my web service.

Is there any other way for testing WebService with Yii ?

Thanks,

Krzysiek

I’m interested in this too. Have you find the solution?

Hi,

Now I’m using in my test cases:




$ctr = Yii::app()->createController('webservice/wsdl');

if ($ctr !== null) {

  list($controller, $actionId) = $ctr;

  $controller->getPosts();

}



Where getPosts() is web service function.

This way I can cover code. I’m not sure if it is right way but it works for me.