Skip to content

Commit 023b240

Browse files
committed
static test fix
1 parent 6ed0d87 commit 023b240

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -735,16 +735,16 @@ public function testGetSwatchesByOptionsIdIf2()
735735
'id' => 488,
736736
]
737737
];
738-
739-
$swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn(0);
740-
$swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn(1);
741-
$swatchMock->expects($this->at(2))->method('offsetGet')->with('value')->willReturn('test');
742-
$swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn(35);
743-
$swatchMock->expects($this->at(4))->method('offsetGet')->with('type')->willReturn(0);
744-
$swatchMock->expects($this->at(5))->method('offsetGet')->with('store_id')->willReturn(1);
745-
$swatchMock->expects($this->at(6))->method('offsetGet')->with('value')->willReturn('test2');
746-
$swatchMock->expects($this->at(7))->method('offsetGet')->with('option_id')->willReturn(36);
747-
738+
// @codingStandardsIgnoreStart
739+
$swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn($optionsData[0]['type']);
740+
$swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn($optionsData[0]['store_id']);
741+
$swatchMock->expects($this->at(2))->method('offsetGet')->with('value')->willReturn($optionsData[0]['value']);
742+
$swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn($optionsData[0]['option_id']);
743+
$swatchMock->expects($this->at(4))->method('offsetGet')->with('type')->willReturn($optionsData[1]['type']);
744+
$swatchMock->expects($this->at(5))->method('offsetGet')->with('store_id')->willReturn($optionsData[1]['store_id']);
745+
$swatchMock->expects($this->at(6))->method('offsetGet')->with('value')->willReturn($optionsData[1]['value']);
746+
$swatchMock->expects($this->at(7))->method('offsetGet')->with('option_id')->willReturn($optionsData[1]['option_id']);
747+
// @codingStandardsIgnoreEnd
748748
$swatchCollectionMock = $this->createMock(Collection::class);
749749
$this->swatchCollectionFactoryMock->method('create')->willReturn($swatchCollectionMock);
750750

@@ -770,12 +770,12 @@ public function testGetSwatchesByOptionsIdIf3()
770770
'option_id' => 35,
771771
'id' => 423,
772772
];
773-
774-
$swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn(0);
775-
$swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn(0);
776-
$swatchMock->expects($this->at(2))->method('offsetGet')->with('store_id')->willReturn(0);
777-
$swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn(35);
778-
773+
// @codingStandardsIgnoreStart
774+
$swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn($optionsData['type']);
775+
$swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn($optionsData['store_id']);
776+
$swatchMock->expects($this->at(2))->method('offsetGet')->with('store_id')->willReturn($optionsData['store_id']);
777+
$swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn($optionsData['option_id']);
778+
// @codingStandardsIgnoreEnd
779779
$swatchCollectionMock = $this->createMock(Collection::class);
780780
$this->swatchCollectionFactoryMock->method('create')->willReturn($swatchCollectionMock);
781781

0 commit comments

Comments
 (0)