-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-37044: [GITHUB] I'm not getting default values (name & email)…
… in contact form when i logged in #1200
- Loading branch information
1 parent
25391d3
commit d582414
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Contact\Block; | ||
|
||
use Magento\Framework\View\Element\Template; | ||
|
||
/** | ||
* Main contact form block | ||
*/ | ||
class ContactForm extends Template | ||
{ | ||
/** | ||
* @param Template\Context $context | ||
* @param array $data | ||
*/ | ||
public function __construct(Template\Context $context, array $data = []) | ||
{ | ||
parent::__construct($context, $data); | ||
$this->_isScopePrivate = true; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/code/Magento/Contact/Test/Unit/Block/ContactFormTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Contact\Test\Unit\Block; | ||
|
||
use Magento\Contact\Block\ContactForm; | ||
|
||
class ContactFormTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var \Magento\Contact\Block\ContactForm | ||
*/ | ||
protected $contactForm; | ||
|
||
/** | ||
* @var \Magento\Framework\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $contextMock; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->contextMock = $this->getMockBuilder('Magento\Framework\View\Element\Template\Context') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$this->contactForm = new ContactForm( | ||
$this->contextMock | ||
); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testScope() | ||
{ | ||
$this->assertTrue($this->contactForm->isScopePrivate()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters