Skip to content
Snippets Groups Projects
Commit e4472e29 authored by Oleksii Korshenko's avatar Oleksii Korshenko
Browse files

MAGETWO-66875: Remove the copyright year from file headers #8648

 - fixed merge conflict
parent 89f57c81
No related merge requests found
...@@ -52,48 +52,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -52,48 +52,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
protected function setUp() 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) $this->_flyweightFactory = $this->getMockBuilder(FlyweightFactory::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
...@@ -117,7 +75,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -117,7 +75,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
->willReturn($this->_structureData['config']['system']); ->willReturn($this->_structureData['config']['system']);
$this->_model = new Structure( $this->_model = new Structure(
>>>>>>> mainline/develop
$this->_structureDataMock, $this->_structureDataMock,
$this->_tabIteratorMock, $this->_tabIteratorMock,
$this->_flyweightFactory, $this->_flyweightFactory,
...@@ -127,25 +84,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -127,25 +84,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
public function testGetTabsBuildsSectionTree() 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']]]]; $expected = ['tab1' => ['children' => ['section1' => ['tab' => 'tab1']]]];
$this->_structureDataMock = $this->getMockBuilder(Data::class) $this->_structureDataMock = $this->getMockBuilder(Data::class)
...@@ -172,21 +110,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -172,21 +110,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
public function testGetSectionList() 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 = [ $expected = [
'section1_child_id_1' => true, 'section1_child_id_1' => true,
'section1_child_id_2' => true, 'section1_child_id_2' => true,
...@@ -200,7 +123,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -200,7 +123,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
$this->_structureDataMock->expects($this->any()) $this->_structureDataMock->expects($this->any())
->method('get') ->method('get')
->willReturn( ->willReturn(
>>>>>>> mainline/develop
[ [
'sections' => [ 'sections' => [
'section1' => [ 'section1' => [
...@@ -269,16 +191,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -269,16 +191,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
public function testGetElementReturnsProperElementByPath() 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']; $section = $this->_structureData['config']['system']['sections']['section_1'];
$fieldData = $section['children']['group_level_1']['children']['field_3']; $fieldData = $section['children']['group_level_1']['children']['field_3'];
...@@ -299,16 +211,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -299,16 +211,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
public function testGetElementByPathPartsIfSectionDataIsEmpty() public function testGetElementByPathPartsIfSectionDataIsEmpty()
{ {
<<<<<<< HEAD
$elementMock = $this->getMock(
\Magento\Config\Model\Config\Structure\Element\Field::class,
[],
[],
'',
false
);
=======
>>>>>>> mainline/develop
$fieldData = [ $fieldData = [
'id' => 'field_3', 'id' => 'field_3',
'path' => 'section_1/group_level_1', 'path' => 'section_1/group_level_1',
...@@ -316,22 +218,12 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -316,22 +218,12 @@ class StructureTest extends \PHPUnit_Framework_TestCase
]; ];
$pathParts = explode('/', 'section_1/group_level_1/field_3'); $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) $elementMock = $this->getMockBuilder(Structure\Element\Field::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$structureDataMock = $this->getMockBuilder(Data::class) $structureDataMock = $this->getMockBuilder(Data::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
>>>>>>> mainline/develop
$elementMock->expects($this->once()) $elementMock->expects($this->once())
->method('setData') ->method('setData')
...@@ -356,20 +248,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -356,20 +248,6 @@ class StructureTest extends \PHPUnit_Framework_TestCase
public function testGetFirstSectionReturnsFirstAllowedSection() 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) $tabMock = $this->getMockBuilder(Structure\Element\Tab::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
->setMethods(['current', 'getChildren', 'rewind']) ->setMethods(['current', 'getChildren', 'rewind'])
...@@ -389,22 +267,11 @@ class StructureTest extends \PHPUnit_Framework_TestCase ...@@ -389,22 +267,11 @@ class StructureTest extends \PHPUnit_Framework_TestCase
->method('current') ->method('current')
->willReturn($tabMock); ->willReturn($tabMock);
>>>>>>> mainline/develop
$this->assertEquals('currentSection', $this->_model->getFirstSection()); $this->assertEquals('currentSection', $this->_model->getFirstSection());
} }
public function testGetElementReturnsProperElementByPathCachesObject() 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']; $section = $this->_structureData['config']['system']['sections']['section_1'];
$fieldData = $section['children']['group_level_1']['children']['field_3']; $fieldData = $section['children']['group_level_1']['children']['field_3'];
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment