SchemaLocatorTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Test\Unit\Model\Config;
  7. use Magento\Integration\Model\Config\SchemaLocator;
  8. class SchemaLocatorTest extends \PHPUnit\Framework\TestCase
  9. {
  10. /** @var \Magento\Framework\Module\Dir\Reader|\PHPUnit_Framework_MockObject_MockObject */
  11. protected $moduleReader;
  12. /** @var string */
  13. protected $moduleDir;
  14. /** @var SchemaLocator */
  15. protected $schemaLocator;
  16. protected function setUp()
  17. {
  18. $this->moduleDir = 'moduleDirectory';
  19. $this->moduleReader = $this->createMock(\Magento\Framework\Module\Dir\Reader::class);
  20. $this->moduleReader->expects($this->any())
  21. ->method('getModuleDir')
  22. ->willReturn($this->moduleDir);
  23. $this->schemaLocator = new SchemaLocator($this->moduleReader);
  24. }
  25. public function testGetSchema()
  26. {
  27. $this->assertEquals($this->moduleDir . '/integration/config.xsd', $this->schemaLocator->getSchema());
  28. }
  29. public function testGetPerFileSchema()
  30. {
  31. $this->assertNull($this->schemaLocator->getPerFileSchema());
  32. }
  33. }