/**
  * @return \Environaut\Report\Report
  */
 protected function getDefaultReport()
 {
     $report = new Report();
     $result = new Result();
     $result->addSetting(new Setting('name', 'value'));
     $result->addSetting(new Setting('foo', 'bar'));
     $result->addSetting(new Setting('custom', true, 'group'));
     $result->setStatus(Result::SUCCESS);
     $report->addResult($result);
     return $report;
 }
Esempio n. 2
0
 public function testGetSettingsAsArray()
 {
     $check = new Configurator('foo');
     $result = new Result($check);
     $result->addSetting(new Setting('foo', 'bar'));
     $result->addSetting(new Setting('blub', 'blah'));
     $result->addSetting(new Setting('yes', 'no'), false);
     // non-cachable
     $this->assertCount(2, $result->getCachableSettingsAsArray());
     $this->assertSame(array(array('name' => 'foo', 'value' => 'bar', 'group' => ICheck::DEFAULT_GROUP_NAME, 'flag' => ISetting::NORMAL), array('name' => 'blub', 'value' => 'blah', 'group' => ICheck::DEFAULT_GROUP_NAME, 'flag' => ISetting::NORMAL)), $result->getCachableSettingsAsArray());
     $this->assertCount(3, $result->getSettingsAsArray());
     $this->assertSame(array(array('name' => 'foo', 'value' => 'bar', 'group' => ICheck::DEFAULT_GROUP_NAME, 'flag' => ISetting::NORMAL), array('name' => 'blub', 'value' => 'blah', 'group' => ICheck::DEFAULT_GROUP_NAME, 'flag' => ISetting::NORMAL), array('name' => 'yes', 'value' => 'no', 'group' => ICheck::DEFAULT_GROUP_NAME, 'flag' => ISetting::NORMAL)), $result->getSettingsAsArray());
 }
 protected function getMultiSettingReport()
 {
     $report = new Report();
     $result = new Result();
     $result->addSetting(new Setting('environment', 'testing-vagrant', 'core_settings'));
     $result->addSetting(new Setting('foo', 'FOOOO', 'core_settings'));
     $result->addSetting(new Setting('bar', 'BAAAR', 'core_settings'));
     $result->setStatus(Result::SUCCESS);
     $report->addResult($result);
     return $report;
 }