示例#1
0
 public function testConvert()
 {
     $inputData = new \DOMDocument();
     $inputData->load(__DIR__ . '/_files/attributes_config_merged.xml');
     $expectedResult = (require __DIR__ . '/_files/attributes_config_merged.php');
     $this->assertEquals($expectedResult, $this->_model->convert($inputData));
 }
示例#2
0
 public function testRead()
 {
     $expectedResult = new \stdClass();
     $constraint = function (\DOMDocument $actual) {
         try {
             $expected = __DIR__ . '/_files/attributes_config_merged.xml';
             \PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expected, $actual->saveXML());
             return true;
         } catch (\PHPUnit_Framework_AssertionFailedError $e) {
             return false;
         }
     };
     $this->_converter->expects($this->once())->method('convert')->with($this->callback($constraint))->will($this->returnValue($expectedResult));
     $this->assertSame($expectedResult, $this->_model->read('scope'));
 }
示例#3
0
 /**
  * @expectedException \UnexpectedValueException
  * @expectedExceptionMessage Unable to determine a module
  */
 public function testReadUnknownModule()
 {
     $this->_moduleDirResolver->expects($this->once())->method('getModuleName')->will($this->returnValue(null));
     $this->_converter->expects($this->never())->method('convert');
     $this->_model->read('scope');
 }