Skip to content

Commit e4fcb81

Browse files
MAGETWO-31369: [South] Unit and Integration tests coverage
1 parent 7ce8a32 commit e4fcb81

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Theme\Model\Layout\Config;
7+
8+
use Magento\Framework\App\Filesystem\DirectoryList;
9+
10+
class SchemaLocatorTest extends \PHPUnit_Framework_TestCase
11+
{
12+
/**
13+
* @var SchemaLocator
14+
*/
15+
protected $object;
16+
17+
/**
18+
* @var string
19+
*/
20+
protected $scheme;
21+
22+
/**
23+
* Initialize testable object
24+
*/
25+
public function setUp()
26+
{
27+
$path = '/root/path/lib';
28+
$filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')->disableOriginalConstructor()->getMock();
29+
$read = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface')->getMock();
30+
31+
$filesystem->expects($this->once())
32+
->method('getDirectoryRead')
33+
->with(DirectoryList::LIB_INTERNAL)
34+
->willReturn($read);
35+
$read->expects($this->once())
36+
->method('getAbsolutePath')
37+
->willReturn($path);
38+
39+
$this->scheme = $path . '/Magento/Framework/View/PageLayout/etc/layouts.xsd';
40+
41+
/** @var $filesystem \Magento\Framework\Filesystem */
42+
$this->object = new SchemaLocator($filesystem);
43+
}
44+
45+
/**
46+
* cover getPerFileSchema and getSchema
47+
*/
48+
public function testGetScheme()
49+
{
50+
$this->assertEquals($this->scheme, $this->object->getPerFileSchema());
51+
$this->assertEquals($this->scheme, $this->object->getSchema());
52+
}
53+
}

0 commit comments

Comments
 (0)