/** * Create configuration array from xml file * * @param string $fileName * @param array $configuration * @return void */ public function createConfiguration($fileName, array $configuration) { $domDocument = $this->_createDOMDocument($configuration); if (@(!$domDocument->schemaValidate($this->_fileSchemaPath))) { $this->_logger->add($this->_removeBasePath($fileName), AbstractLogger::FILE_KEY_INVALID); } else { $this->_logger->add($this->_removeBasePath($fileName), AbstractLogger::FILE_KEY_VALID); } $output = $this->_xmlFormatter->parseString($domDocument->saveXml(), array('indent' => true, 'input-xml' => true, 'output-xml' => true, 'add-xml-space' => false, 'indent-spaces' => 4, 'wrap' => 1000)); $newFileName = $this->_getPathToSave($fileName); $this->_fileManager->write($newFileName, $output); }
/** * Put report to file * * @return void */ public function report() { $this->_fileManager->write($this->_file, (string) $this); }
public function testWrite() { $this->_writerMock->expects($this->once())->method('write')->with('someFile', 'someContent'); $this->_model->write('someFile', 'someContent'); }