File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments