當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UrnResolver::expects方法代碼示例

本文整理匯總了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());
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:7,代碼來源:ThemeTest.php

示例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);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:7,代碼來源:ConfigTest.php

示例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);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:13,代碼來源:ConfigTest.php

示例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());
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:5,代碼來源:SchemaLocatorTest.php

示例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());
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:5,代碼來源:SchemaLocatorTest.php

示例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());
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:5,代碼來源:SchemaLocatorTest.php

示例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());
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:5,代碼來源:SchemaLocatorTest.php


注:本文中的Magento\Framework\Config\Dom\UrnResolver::expects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。