Skip to content

Commit 4d5a567

Browse files
committed
fixed php unit test issue
1 parent 8acab0f commit 4d5a567

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Meta/BusinessExtension/Test/Unit/Helper/FBEHelperTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function setUp(): void
101101
$this->resourceConnection = $this->createMock(ResourceConnection::class);
102102
$this->moduleList = $this->createMock(ModuleListInterface::class);
103103
$this->systemConfig = $this->createMock(Config::class);
104+
$this->productMetadata = $this->createMock(ProductMetadataInterface::class);
104105
$this->fbeHelper = new FBEHelper(
105106
$this->context,
106107
$this->objectManagerInterface,
@@ -109,7 +110,8 @@ public function setUp(): void
109110
$this->curl,
110111
$this->resourceConnection,
111112
$this->moduleList,
112-
$this->systemConfig
113+
$this->systemConfig,
114+
$this->productMetadata
113115
);
114116
}
115117

@@ -132,8 +134,7 @@ public function testCorrectPartnerAgent()
132134
->disableOriginalConstructor()
133135
->setMethods(['getVersion', 'getEdition', 'getName'])
134136
->getMock();
135-
$productMetadata->method('getVersion')->willReturn($magentoVersion);
136-
$productMetadata->method('getVersion')->willReturn($magentoVersion);
137+
$this->productMetadata->expects($this->once())->method('getVersion')->willReturn($magentoVersion);
137138
$this->objectManagerInterface->method('get')->willReturn($productMetadata);
138139
$this->assertEquals(
139140
sprintf('%s-%s-%s', $source, $magentoVersion, $pluginVersion),

0 commit comments

Comments
 (0)