Skip to content

Commit

Permalink
Fix private property accessible
Browse files Browse the repository at this point in the history
enable to get private property even if
`Yii::app()->urlManager` is subclass of CUrlManager
  • Loading branch information
amashigeseiji committed Jul 10, 2016
1 parent 03a2fb2 commit d64c839
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Codeception/Module/Yii1.php
Expand Up @@ -247,7 +247,8 @@ public function getInternalDomains()
{
$domains = [$this->getDomainRegex(Yii::app()->request->getHostInfo())];
if (Yii::app()->urlManager->urlFormat === 'path') {
$rules = ReflectionHelper::readPrivateProperty(Yii::app()->urlManager, '_rules');
$parent = Yii::app()->urlManager instanceof \CUrlManager ? '\CUrlManager' : null;
$rules = ReflectionHelper::readPrivateProperty(Yii::app()->urlManager, '_rules', $parent);
foreach ($rules as $rule) {
if ($rule->hasHostInfo === true) {
$domains[] = $this->getDomainRegex($rule->template, $rule->params);
Expand Down

0 comments on commit d64c839

Please sign in to comment.