Example #1
0
 public function testConvert()
 {
     $dom = new \DOMDocument();
     $xmlFile = __DIR__ . '/_files/cache_config.xml';
     $dom->loadXML(file_get_contents($xmlFile));
     $convertedFile = __DIR__ . '/_files/cache_config.php';
     $expectedResult = (include $convertedFile);
     $this->assertEquals($expectedResult, $this->_model->convert($dom));
 }
Example #2
0
 /**
  * @param string $xmlData
  * @dataProvider wrongXmlDataProvider
  * @expectedException \Exception
  */
 public function testMapThrowsExceptionWhenXmlHasWrongFormat($xmlData)
 {
     $dom = new \DOMDocument();
     $dom->loadXML($xmlData);
     $this->_model->convert($dom);
 }