Functional tests independing from your urlManager settings

If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:

public function createUrl($route,$params=array()) {
$url = explode('phpunit',Yii::app()->createUrl($route,$params));
return $url[1];

and in your tests you can use next 'open' constructions:

0 0
Viewed: 10 929 times
Version: 1.1
Category: Tips
Written by: RusAlex
Last updated by: RusAlex
Created on: Feb 18, 2011
Last updated: 9 years ago
Update Article


View all history