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')); }
/** * @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'); }