File tree 3 files changed +69
-1
lines changed
3 files changed +69
-1
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 \Contact \Block ;
7
+
8
+ use Magento \Framework \View \Element \Template ;
9
+
10
+ /**
11
+ * Main contact form block
12
+ */
13
+ class ContactForm extends Template
14
+ {
15
+ /**
16
+ * @param Template\Context $context
17
+ * @param array $data
18
+ */
19
+ public function __construct (Template \Context $ context , array $ data = [])
20
+ {
21
+ parent ::__construct ($ context , $ data );
22
+ $ this ->_isScopePrivate = true ;
23
+ }
24
+ }
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
+
7
+ namespace Magento \Contact \Test \Unit \Block ;
8
+
9
+ use Magento \Contact \Block \ContactForm ;
10
+
11
+ class ContactFormTest extends \PHPUnit_Framework_TestCase
12
+ {
13
+ /**
14
+ * @var \Magento\Contact\Block\ContactForm
15
+ */
16
+ protected $ contactForm ;
17
+
18
+ /**
19
+ * @var \Magento\Framework\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject
20
+ */
21
+ protected $ contextMock ;
22
+
23
+ /**
24
+ * {@inheritDoc}
25
+ */
26
+ protected function setUp ()
27
+ {
28
+ $ this ->contextMock = $ this ->getMockBuilder ('Magento\Framework\View\Element\Template\Context ' )
29
+ ->disableOriginalConstructor ()
30
+ ->getMock ();
31
+
32
+ $ this ->contactForm = new ContactForm (
33
+ $ this ->contextMock
34
+ );
35
+ }
36
+
37
+ /**
38
+ *
39
+ */
40
+ public function testScope ()
41
+ {
42
+ $ this ->assertTrue ($ this ->contactForm ->isScopePrivate ());
43
+ }
44
+ }
Original file line number Diff line number Diff line change 11
11
</head >
12
12
<body >
13
13
<referenceContainer name =" content" >
14
- <block class =" Magento\Framework\View\Element\Template " name =" contactForm" template =" Magento_Contact::form.phtml" >
14
+ <block class =" Magento\Contact\Block\ContactForm " name =" contactForm" template =" Magento_Contact::form.phtml" >
15
15
<container name =" form.additional.info" label =" Form Additional Info" />
16
16
</block >
17
17
</referenceContainer >
You can’t perform that action at this time.
0 commit comments