Skip to content

Commit

Permalink
MAGETWO-66875: Remove the copyright year from file headers #8648
Browse files Browse the repository at this point in the history
 - fixed merge conflict
  • Loading branch information
Oleksii Korshenko committed Mar 29, 2017
1 parent 89f57c8 commit e4472e2
Showing 1 changed file with 0 additions and 133 deletions.
133 changes: 0 additions & 133 deletions app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,48 +52,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
<<<<<<< HEAD
$this->_flyweightFactory = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\FlyweightFactory::class,
[],
[],
'',
false
);
$this->_tabIteratorMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Iterator\Tab::class,
[],
[],
'',
false
);
$this->_structureDataMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Data::class,
[],
[],
'',
false
);
$this->_scopeDefinerMock = $this->getMock(
\Magento\Config\Model\Config\ScopeDefiner::class,
[],
[],
'',
false
);
$this->_scopeDefinerMock->expects($this->any())->method('getScope')->will($this->returnValue('scope'));

$filePath = dirname(__DIR__) . '/_files';
$this->_structureData = require $filePath . '/converted_config.php';
$this->_structureDataMock->expects(
$this->once()
)->method(
'get'
)->will(
$this->returnValue($this->_structureData['config']['system'])
);
$this->_model = new \Magento\Config\Model\Config\Structure(
=======
$this->_flyweightFactory = $this->getMockBuilder(FlyweightFactory::class)
->disableOriginalConstructor()
->getMock();
Expand All @@ -117,7 +75,6 @@ protected function setUp()
->willReturn($this->_structureData['config']['system']);

$this->_model = new Structure(
>>>>>>> mainline/develop
$this->_structureDataMock,
$this->_tabIteratorMock,
$this->_flyweightFactory,
Expand All @@ -127,25 +84,6 @@ protected function setUp()

public function testGetTabsBuildsSectionTree()
{
<<<<<<< HEAD
$this->_structureDataMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Data::class,
[],
[],
'',
false
);
$this->_structureDataMock->expects(
$this->any()
)->method(
'get'
)->will(
$this->returnValue(
['sections' => ['section1' => ['tab' => 'tab1']], 'tabs' => ['tab1' => []]]
)
);
=======
>>>>>>> mainline/develop
$expected = ['tab1' => ['children' => ['section1' => ['tab' => 'tab1']]]];

$this->_structureDataMock = $this->getMockBuilder(Data::class)
Expand All @@ -172,21 +110,6 @@ public function testGetTabsBuildsSectionTree()

public function testGetSectionList()
{
<<<<<<< HEAD
$this->_structureDataMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Data::class,
[],
[],
'',
false
);
$this->_structureDataMock->expects(
$this->any()
)->method(
'get'
)->will(
$this->returnValue(
=======
$expected = [
'section1_child_id_1' => true,
'section1_child_id_2' => true,
Expand All @@ -200,7 +123,6 @@ public function testGetSectionList()
$this->_structureDataMock->expects($this->any())
->method('get')
->willReturn(
>>>>>>> mainline/develop
[
'sections' => [
'section1' => [
Expand Down Expand Up @@ -269,16 +191,6 @@ public function emptyElementDataProvider()

public function testGetElementReturnsProperElementByPath()
{
<<<<<<< HEAD
$elementMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Field::class,
[],
[],
'',
false
);
=======
>>>>>>> mainline/develop
$section = $this->_structureData['config']['system']['sections']['section_1'];
$fieldData = $section['children']['group_level_1']['children']['field_3'];

Expand All @@ -299,39 +211,19 @@ public function testGetElementReturnsProperElementByPath()

public function testGetElementByPathPartsIfSectionDataIsEmpty()
{
<<<<<<< HEAD
$elementMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Field::class,
[],
[],
'',
false
);
=======
>>>>>>> mainline/develop
$fieldData = [
'id' => 'field_3',
'path' => 'section_1/group_level_1',
'_elementType' => 'field',
];
$pathParts = explode('/', 'section_1/group_level_1/field_3');

<<<<<<< HEAD
$structureDataMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Data::class,
[],
[],
'',
false
);
=======
$elementMock = $this->getMockBuilder(Structure\Element\Field::class)
->disableOriginalConstructor()
->getMock();
$structureDataMock = $this->getMockBuilder(Data::class)
->disableOriginalConstructor()
->getMock();
>>>>>>> mainline/develop

$elementMock->expects($this->once())
->method('setData')
Expand All @@ -356,20 +248,6 @@ public function testGetElementByPathPartsIfSectionDataIsEmpty()

public function testGetFirstSectionReturnsFirstAllowedSection()
{
<<<<<<< HEAD
$tabMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Tab::class,
['current', 'getChildren', 'rewind'],
[],
'',
false
);
$tabMock->expects($this->any())->method('getChildren')->will($this->returnSelf());
$tabMock->expects($this->once())->method('rewind');
$tabMock->expects($this->once())->method('current')->will($this->returnValue('currentSection'));
$this->_tabIteratorMock->expects($this->once())->method('rewind');
$this->_tabIteratorMock->expects($this->once())->method('current')->will($this->returnValue($tabMock));
=======
$tabMock = $this->getMockBuilder(Structure\Element\Tab::class)
->disableOriginalConstructor()
->setMethods(['current', 'getChildren', 'rewind'])
Expand All @@ -389,22 +267,11 @@ public function testGetFirstSectionReturnsFirstAllowedSection()
->method('current')
->willReturn($tabMock);

>>>>>>> mainline/develop
$this->assertEquals('currentSection', $this->_model->getFirstSection());
}

public function testGetElementReturnsProperElementByPathCachesObject()
{
<<<<<<< HEAD
$elementMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Field::class,
[],
[],
'',
false
);
=======
>>>>>>> mainline/develop
$section = $this->_structureData['config']['system']['sections']['section_1'];
$fieldData = $section['children']['group_level_1']['children']['field_3'];

Expand Down

0 comments on commit e4472e2

Please sign in to comment.