Browse Source

Method "YiiRequirementChecker::check()" has been refactored to be used in method chain.

Methods "YiiRequirementChecker::getResults()" and "YiiRequirementChecker::render()" have been added.
tags/2.0.0-beta
Klimov Paul 12 years ago
parent
commit
00d04a1c30
  1. 2
      tests/unit/framework/requirements/YiiRequirementCheckerTest.php
  2. 28
      yii/requirements/YiiRequirementChecker.php

2
tests/unit/framework/requirements/YiiRequirementCheckerTest.php

@ -38,7 +38,7 @@ class YiiRequirementCheckerTest extends TestCase
),
);
$checkResult = $requirementsChecker->check($requirements);
$checkResult = $requirementsChecker->check($requirements)->getResult();
$summary = $checkResult['summary'];
$this->assertEquals(count($requirements), $summary['total'], 'Wrong summary total!');

28
yii/requirements/YiiRequirementChecker.php

@ -49,7 +49,33 @@ class YiiRequirementChecker
'summary' => $summary,
'requirements' => $requirements,
);
return $result;
$this->result = $result;
return $this;
}
/**
* Return the check results.
* @return array|null check results.
*/
function getResult()
{
if (isset($this->result)) {
return $this->result;
} else {
return null;
}
}
/**
* Renders the requirements check result.
* The output will vary depending is a script running from web or from console.
*/
function render()
{
if (isset($this->result)) {
$this->usageError('Nothing to render!');
}
// @todo render
}
/**

Loading…
Cancel
Save