Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SchemaLocatorTest.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
10 
11 class SchemaLocatorTest extends \PHPUnit\Framework\TestCase
12 {
16  private $moduleReaderMock;
17 
21  private $model;
22 
23  protected function setUp()
24  {
25  $this->moduleReaderMock = $this->createPartialMock(
26  \Magento\Framework\Module\Dir\Reader::class,
27  ['getModuleDir']
28  );
29  $this->moduleReaderMock->expects(
30  $this->any()
31  )->method(
32  'getModuleDir'
33  )->with(
34  'etc',
35  'Magento_WebapiAsync'
36  )->will(
37  $this->returnValue('schema_dir')
38  );
39 
40  $this->model = new \Magento\WebapiAsync\Model\ServiceConfig\SchemaLocator($this->moduleReaderMock);
41  }
42 
43  public function testGetSchema()
44  {
45  $this->assertEquals('schema_dir/webapi_async.xsd', $this->model->getSchema());
46  }
47 
48  public function testGetPerFileSchema()
49  {
50  $this->assertEquals(null, $this->model->getPerFileSchema());
51  }
52 }