Skip to content

Commit 5afac73

Browse files
committed
Merge remote-tracking branch 'origin/MC-33069-CE-1' into MC-33069
2 parents 81e3240 + c7a3b3f commit 5afac73

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/Grouped/LinksTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,25 @@ public function testSaveLinksDataWithProductsAttrs($linksData)
108108
$linksData['attr_product_ids'] = [12 => true, 16 => true];
109109
$linksData['position'] = [4 => 6];
110110
$linksData['qty'] = [9 => 3];
111+
$attributes = [
112+
['id' => 1, 'code' => 'position', 'type' => 'int'],
113+
['id' => 2, 'code' => 'qty', 'type' => 'decimal'],
114+
];
111115
$this->processBehaviorGetter('append');
112116
$select = $this->createMock(Select::class);
113-
$this->connection->expects($this->any())->method('select')->will($this->returnValue($select));
114-
$select->expects($this->any())->method('from')->willReturnSelf();
115-
$select->expects($this->any())->method('where')->willReturnSelf();
116-
$this->connection->expects($this->once())->method('fetchAll')->with($select)->will($this->returnValue([]));
117+
$this->connection->expects($this->exactly(2))->method('select')->will($this->returnValue($select));
118+
$select->expects($this->exactly(2))->method('from')->willReturnSelf();
119+
$select->expects($this->exactly(2))->method('where')->willReturnSelf();
120+
$this->connection->expects($this->once())->method('fetchAll')
121+
->with($select)->will($this->returnValue($attributes));
117122
$this->connection->expects($this->once())->method('fetchPairs')->with($select)->will(
118123
$this->returnValue([])
119124
);
120125
$this->connection->expects($this->exactly(4))->method('insertOnDuplicate');
126+
$this->link->expects($this->exactly(2))->method('getAttributeTypeTable')->willReturn(
127+
'table_name'
128+
);
129+
121130
$this->links->saveLinksData($linksData);
122131
}
123132

app/code/Magento/Integration/Test/Unit/Controller/Token/AccessTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ public function testAccessAction()
167167
$this->helperMock->expects($this->once())
168168
->method('getRequestUrl');
169169
$this->helperMock->expects($this->once())
170-
->method('prepareRequest');
170+
->method('prepareRequest')
171+
->willReturn(['oauth_consumer_key' => 'oauth_key']);
171172
$this->frameworkOauthSvcMock->expects($this->once())
172173
->method('getAccessToken')
173174
->willReturn(['response']);

lib/internal/Magento/Framework/MessageQueue/Code/Generator/RemoteServiceGenerator.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function _getClassMethods()
136136
$parameterName = $methodParameter->getName();
137137
$parameter = [
138138
'name' => $parameterName,
139-
'type' => $methodParameter->getType(),
139+
'type' => $this->convertMethodType($methodParameter->getType()),
140140
];
141141
if ($methodParameter->isDefaultValueAvailable()) {
142142
$parameter['defaultValue'] = $methodParameter->getDefaultValue() !== null
@@ -155,7 +155,7 @@ protected function _getClassMethods()
155155
$annotations = [['name' => 'inheritdoc']];
156156
$method = [
157157
'name' => $methodName,
158-
'returnType' => $methodReflection->getReturnType(),
158+
'returnType' => $this->convertMethodType($methodReflection->getReturnType()),
159159
'parameters' => $methodParameters,
160160
'body' => $methodBody,
161161
'docblock' => ['tags' => $annotations],
@@ -165,6 +165,17 @@ protected function _getClassMethods()
165165
return $methods;
166166
}
167167

168+
/**
169+
* Converts method type if needed.
170+
*
171+
* @param mixed $type
172+
* @return string|null
173+
*/
174+
private function convertMethodType($type)
175+
{
176+
return $type instanceof \ReflectionNamedType ? $type->getName() : $type;
177+
}
178+
168179
/**
169180
* @inheritDoc
170181
*/

0 commit comments

Comments
 (0)