Commit ebeccea5 authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

+ completed new feature #29 Method for expectation object with different data providers

parent 5bc5b2a8
......@@ -78,9 +78,29 @@ abstract class EcomDev_PHPUnit_Test_Case extends PHPUnit_Framework_TestCase
$this->_expectations = new Varien_Object($expectations);
}
$arguments = func_get_args();
if ($arguments) {
if (count($arguments) > 1) {
$dataKey = call_user_func_array('sprintf', $arguments);
} else {
$dataKey = array_shift($arguments);
}
$dataPart = $this->_expectations->getData($dataKey);
if (!is_array($dataPart)) {
throw new InvalidArgumentException(
'Argument values for specifying special scope of expectations should be presented '
. ' in expectation file and should be an associative list'
);
}
return new Varien_Object($dataPart);
}
return $this->_expectations;
}
/**
* Retrieves fixture model singleton
*
......
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