Commit 00d04a1c by Klimov Paul

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

Methods "YiiRequirementChecker::getResults()" and "YiiRequirementChecker::render()" have been added.
parent 07fabfd6
...@@ -38,7 +38,7 @@ class YiiRequirementCheckerTest extends TestCase ...@@ -38,7 +38,7 @@ class YiiRequirementCheckerTest extends TestCase
), ),
); );
$checkResult = $requirementsChecker->check($requirements); $checkResult = $requirementsChecker->check($requirements)->getResult();
$summary = $checkResult['summary']; $summary = $checkResult['summary'];
$this->assertEquals(count($requirements), $summary['total'], 'Wrong summary total!'); $this->assertEquals(count($requirements), $summary['total'], 'Wrong summary total!');
......
...@@ -49,7 +49,33 @@ class YiiRequirementChecker ...@@ -49,7 +49,33 @@ class YiiRequirementChecker
'summary' => $summary, 'summary' => $summary,
'requirements' => $requirements, '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
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment