本文整理汇总了PHP中Magento\Framework\Config\Dom\UrnResolver::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP UrnResolver::expects方法的具体用法?PHP UrnResolver::expects怎么用?PHP UrnResolver::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Config\Dom\UrnResolver
的用法示例。
在下文中一共展示了UrnResolver::expects方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetSchemaFile
public function testGetSchemaFile()
{
$config = new \Magento\Framework\Config\Theme($this->urnResolverMock, null);
$this->urnResolverMock->expects($this->exactly(2))->method('getRealPath')->with('urn:magento:framework:Config/etc/theme.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd'));
$this->assertEquals($this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd'), $config->getSchemaFile());
$this->assertFileExists($config->getSchemaFile());
}
示例2: setUp
public function setUp()
{
$this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
$this->urnResolverMock = $this->getMock('Magento\\Framework\\Config\\Dom\\UrnResolver', [], [], '', false);
$this->urnResolverMock->expects($this->any())->method('getRealPath')->with('urn:magento:framework:App/Language/package.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd'));
$this->config = new Config(file_get_contents(__DIR__ . '/_files/language.xml'), $this->urnResolverMock);
}
示例3: setUp
protected function setUp()
{
$this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
$this->urnResolverMock = $this->getMock('Magento\\Framework\\Config\\Dom\\UrnResolver', [], [], '', false);
$this->urnResolverMock->expects($this->any())->method('getRealPath')->with('urn:magento:framework:App/Language/package.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd'));
$validationStateMock = $this->getMock('\\Magento\\Framework\\Config\\ValidationStateInterface', [], [], '', false);
$validationStateMock->method('isValidationRequired')->willReturn(true);
$domFactoryMock = $this->getMock('Magento\\Framework\\Config\\DomFactory', [], [], '', false);
$domFactoryMock->expects($this->once())->method('createDom')->willReturnCallback(function ($arguments) use($validationStateMock) {
return new \Magento\Framework\Config\Dom($arguments['xml'], $validationStateMock, [], null, $arguments['schemaFile']);
});
$this->config = new Config(file_get_contents(__DIR__ . '/_files/language.xml'), $this->urnResolverMock, $domFactoryMock);
}
示例4: testGetPerFileSchema
public function testGetPerFileSchema()
{
$this->urnResolverMock->expects($this->once())->method('getRealPath')->with('urn:magento:framework:Search/etc/search_request.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd'));
$this->assertEquals($this->urnResolver->getRealPath('urn:magento:framework:Search/etc/search_request.xsd'), $this->schemaLocator->getPerFileSchema());
}
示例5: testGetPerFileSchema
public function testGetPerFileSchema()
{
$this->urnResolverMock->expects($this->once())->method('getRealPath')->with('urn:magento:framework:Indexer/etc/indexer.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'));
$this->assertEquals($this->urnResolver->getRealPath('urn:magento:framework:Indexer/etc/indexer.xsd'), $this->model->getPerFileSchema());
}
示例6: testGetPerFileSchema
public function testGetPerFileSchema()
{
$this->urnResolverMock->expects($this->once())->method('getRealPath')->with('urn:magento:framework:App/etc/routes.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'));
$this->assertContains($this->urnResolver->getRealPath('urn:magento:framework:App/etc/routes.xsd'), $this->config->getPerFileSchema());
}
示例7: testGetSchema
public function testGetSchema()
{
$this->urnResolverMock->expects($this->once())->method('getRealPath')->with('urn:magento:framework:ObjectManager/etc/config.xsd')->willReturn($this->urnResolver->getRealPath('urn:magento:framework:ObjectManager/etc/config.xsd'));
$this->assertEquals($this->urnResolver->getRealPath('urn:magento:framework:ObjectManager/etc/config.xsd'), $this->model->getSchema());
}