* @package generis */ class common_configuration_Mock extends common_configuration_Component { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- /** * The expected report status. * * @access private * @var int */ private $expectedStatus = 0; // --- OPERATIONS --- /** * Create a new Mock configuration component with an expected report status, * a name. * * @access public * @author Jerome Bogaerts, * @param int expectedStatus The expected status of the report that will be provided by the check method. Must correspond to a constant of the Report class. * @param string name The name of the mock configuration component to make it identifiable among others. * @return mixed */ public function __construct($expectedStatus, $name) { $this->setExpectedStatus($expectedStatus); $this->setName($name); } /** * Fake configuration check that will provide a Report with the expected * * @access public * @author Jerome Bogaerts, * @return mixed */ public function check() { $message = 'Mock configuration report.'; $report = new common_configuration_Report($this->getExpectedStatus(), $message, $this); return $report; } /** * Provide the expected status and contains a value defined by the status * of the Report class. * * @access public * @author Jerome Bogaerts, * @return int */ public function getExpectedStatus() { $returnValue = (int) 0; $returnValue = $this->expectedStatus; return (int) $returnValue; } /** * Set the expected status of the Mock configuration component. * * @access public * @author Jerome Bogaerts, * @param int expectedStatus A status corresponding to a constant value of the Report class. * @return void */ public function setExpectedStatus($expectedStatus) { $this->expectedStatus = $expectedStatus; } }