Skip to content

Commit b2f5a66

Browse files
committed
Merge remote-tracking branch 'origin/MC-33071-CE-8' into MC-33071
# Conflicts: # dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php
2 parents 4be2cec + 9ceb94e commit b2f5a66

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,11 @@ protected function checkSoapFault(
592592
$expectedWrappedErrors = [],
593593
$traceString = null
594594
) {
595-
$this->assertStringContainsString($expectedMessage, $soapFault->getMessage(), "Fault message is invalid.");
595+
$this->assertStringContainsString(
596+
$expectedMessage,
597+
$soapFault->getMessage(),
598+
"Fault message is invalid."
599+
);
596600

597601
$errorDetailsNode = 'GenericFault';
598602
$errorDetails = isset($soapFault->detail->$errorDetailsNode) ? $soapFault->detail->$errorDetailsNode : null;

dev/tests/api-functional/testsuite/Magento/Webapi/DeserializationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testPostRequestWithEmptyBody()
4444
$this->_webApiCall($serviceInfo, RestClient::EMPTY_REQUEST_BODY);
4545
} catch (\Exception $e) {
4646
$this->assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
47-
$this->assertContains(
47+
$this->assertStringContainsString(
4848
$expectedMessage,
4949
$e->getMessage(),
5050
"Response does not contain expected message."
@@ -71,7 +71,7 @@ public function testPutRequestWithEmptyBody()
7171
$this->_webApiCall($serviceInfo, RestClient::EMPTY_REQUEST_BODY);
7272
} catch (\Exception $e) {
7373
$this->assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
74-
$this->assertContains(
74+
$this->assertStringContainsString(
7575
$expectedMessage,
7676
$e->getMessage(),
7777
"Response does not contain expected message."

dev/tests/api-functional/testsuite/Magento/Webapi/Routing/BaseService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function _assertRestUnauthorizedException($serviceInfo, $requestData =
4343
try {
4444
$this->_webApiCall($serviceInfo, $requestData);
4545
} catch (\Exception $e) {
46-
$this->assertContains(
46+
$this->assertStringContainsString(
4747
'{"message":"The consumer isn\'t authorized to access %resources.',
4848
$e->getMessage(),
4949
sprintf(
@@ -111,7 +111,7 @@ protected function _assertSoapException($serviceInfo, $requestData = null, $expe
111111
}
112112

113113
if ($expectedMessage) {
114-
$this->assertContains($expectedMessage, $e->getMessage());
114+
$this->assertStringContainsString($expectedMessage, $e->getMessage());
115115
}
116116
}
117117
}

dev/tests/api-functional/testsuite/Magento/Webapi/WsdlGenerationFromDataObjectTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ public function testNoAuthorizedServices()
7171
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
7272
$responseContent = curl_exec($connection);
7373
$this->assertEquals(curl_getinfo($connection, CURLINFO_HTTP_CODE), 401);
74-
$this->assertContains("The consumer isn't authorized to access %resources.", $responseContent);
74+
$this->assertStringContainsString("The consumer isn't authorized to access %resources.", $responseContent);
7575
}
7676

7777
public function testInvalidWsdlUrlNoServices()
7878
{
7979
$responseContent = $this->_getWsdlContent($this->_getBaseWsdlUrl());
80-
$this->assertContains("Requested services are missing.", $responseContent);
80+
$this->assertStringContainsString("Requested services are missing.", $responseContent);
8181
}
8282

8383
public function testInvalidWsdlUrlInvalidParameter()
8484
{
8585
$wsdlUrl = $this->_getBaseWsdlUrl() . '&invalid';
8686
$responseContent = $this->_getWsdlContent($wsdlUrl);
87-
$this->assertContains("Not allowed parameters", $responseContent);
87+
$this->assertStringContainsString("Not allowed parameters", $responseContent);
8888
}
8989

9090
/**
@@ -145,7 +145,7 @@ protected function _checkTypesDeclaration($wsdlContent)
145145
<xsd:schema targetNamespace="{$this->_soapUrl}">
146146
TYPES_SECTION_DECLARATION;
147147
// @codingStandardsIgnoreEnd
148-
$this->assertContains(
148+
$this->assertStringContainsString(
149149
$this->_convertXmlToString($typesSectionDeclaration),
150150
$wsdlContent,
151151
'Types section declaration is invalid'
@@ -168,7 +168,7 @@ protected function _checkElementsDeclaration($wsdlContent)
168168
<xsd:element name="testModule5AllSoapAndRestV1ItemRequest" type="tns:TestModule5AllSoapAndRestV1ItemRequest"/>
169169
REQUEST_ELEMENT;
170170
}
171-
$this->assertContains(
171+
$this->assertStringContainsString(
172172
$this->_convertXmlToString($requestElement),
173173
$wsdlContent,
174174
'Request element declaration in types section is invalid'
@@ -183,7 +183,7 @@ protected function _checkElementsDeclaration($wsdlContent)
183183
<xsd:element name="testModule5AllSoapAndRestV1ItemResponse" type="tns:TestModule5AllSoapAndRestV1ItemResponse"/>
184184
RESPONSE_ELEMENT;
185185
}
186-
$this->assertContains(
186+
$this->assertStringContainsString(
187187
$this->_convertXmlToString($responseElement),
188188
$wsdlContent,
189189
'Response element declaration in types section is invalid'
@@ -247,7 +247,7 @@ protected function _checkComplexTypesDeclaration($wsdlContent)
247247
REQUEST_TYPE;
248248
}
249249
// @codingStandardsIgnoreEnd
250-
$this->assertContains(
250+
$this->assertStringContainsString(
251251
$this->_convertXmlToString($requestType),
252252
$wsdlContent,
253253
'Request type declaration in types section is invalid'
@@ -304,7 +304,7 @@ protected function _checkComplexTypesDeclaration($wsdlContent)
304304
RESPONSE_TYPE;
305305
}
306306
// @codingStandardsIgnoreEnd
307-
$this->assertContains(
307+
$this->assertStringContainsString(
308308
$this->_convertXmlToString($responseType),
309309
$wsdlContent,
310310
'Response type declaration in types section is invalid'
@@ -472,7 +472,7 @@ protected function _checkReferencedTypeDeclaration($wsdlContent)
472472
RESPONSE_TYPE;
473473
}
474474
// @codingStandardsIgnoreEnd
475-
$this->assertContains(
475+
$this->assertStringContainsString(
476476
$this->_convertXmlToString($referencedType),
477477
$wsdlContent,
478478
'Declaration of complex type generated from Data Object, which is referenced in response, is invalid'
@@ -495,7 +495,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
495495
<portType name="testModule5AllSoapAndRestV1PortType">
496496
FIRST_PORT_TYPE;
497497
}
498-
$this->assertContains(
498+
$this->assertStringContainsString(
499499
$this->_convertXmlToString($firstPortType),
500500
$wsdlContent,
501501
'Port type declaration is missing or invalid'
@@ -505,7 +505,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
505505
$secondPortType = <<< SECOND_PORT_TYPE
506506
<portType name="testModule5AllSoapAndRestV2PortType">
507507
SECOND_PORT_TYPE;
508-
$this->assertContains(
508+
$this->assertStringContainsString(
509509
$this->_convertXmlToString($secondPortType),
510510
$wsdlContent,
511511
'Port type declaration is missing or invalid'
@@ -539,7 +539,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
539539
</operation>
540540
OPERATION_DECLARATION;
541541
}
542-
$this->assertContains(
542+
$this->assertStringContainsString(
543543
$this->_convertXmlToString($operationDeclaration),
544544
$wsdlContent,
545545
'Operation in port type is invalid'
@@ -564,7 +564,7 @@ protected function _checkBindingDeclaration($wsdlContent)
564564
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
565565
FIRST_BINDING;
566566
}
567-
$this->assertContains(
567+
$this->assertStringContainsString(
568568
$this->_convertXmlToString($firstBinding),
569569
$wsdlContent,
570570
'Binding declaration is missing or invalid'
@@ -575,7 +575,7 @@ protected function _checkBindingDeclaration($wsdlContent)
575575
<binding name="testModule5AllSoapAndRestV2Binding" type="tns:testModule5AllSoapAndRestV2PortType">
576576
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
577577
SECOND_BINDING;
578-
$this->assertContains(
578+
$this->assertStringContainsString(
579579
$this->_convertXmlToString($secondBinding),
580580
$wsdlContent,
581581
'Binding declaration is missing or invalid'
@@ -629,7 +629,7 @@ protected function _checkBindingDeclaration($wsdlContent)
629629
</operation>
630630
OPERATION_DECLARATION;
631631
}
632-
$this->assertContains(
632+
$this->assertStringContainsString(
633633
$this->_convertXmlToString($operationDeclaration),
634634
$wsdlContent,
635635
'Operation in binding is invalid'
@@ -662,7 +662,7 @@ protected function _checkServiceDeclaration($wsdlContent)
662662
FIRST_SERVICE_DECLARATION;
663663
}
664664
// @codingStandardsIgnoreEnd
665-
$this->assertContains(
665+
$this->assertStringContainsString(
666666
$this->_convertXmlToString($firstServiceDeclaration),
667667
$wsdlContent,
668668
'First service section is invalid'
@@ -678,7 +678,7 @@ protected function _checkServiceDeclaration($wsdlContent)
678678
</service>
679679
SECOND_SERVICE_DECLARATION;
680680
// @codingStandardsIgnoreEnd
681-
$this->assertContains(
681+
$this->assertStringContainsString(
682682
$this->_convertXmlToString($secondServiceDeclaration),
683683
$wsdlContent,
684684
'Second service section is invalid'
@@ -701,7 +701,7 @@ protected function _checkMessagesDeclaration($wsdlContent)
701701
<part name="messageParameters" element="tns:testModule5AllSoapAndRestV2ItemResponse"/>
702702
</message>
703703
MESSAGES_DECLARATION;
704-
$this->assertContains(
704+
$this->assertStringContainsString(
705705
$this->_convertXmlToString($itemMessagesDeclaration),
706706
$wsdlContent,
707707
'Messages section for "item" operation is invalid'
@@ -714,7 +714,7 @@ protected function _checkMessagesDeclaration($wsdlContent)
714714
<part name="messageParameters" element="tns:testModule5AllSoapAndRestV2ItemsResponse"/>
715715
</message>
716716
MESSAGES_DECLARATION;
717-
$this->assertContains(
717+
$this->assertStringContainsString(
718718
$this->_convertXmlToString($itemsMessagesDeclaration),
719719
$wsdlContent,
720720
'Messages section for "items" operation is invalid'
@@ -742,7 +742,7 @@ protected function _checkFaultsPortTypeSection($wsdlContent)
742742
$faultsInPortType = <<< FAULT_IN_PORT_TYPE
743743
<fault name="GenericFault" message="tns:GenericFault"/>
744744
FAULT_IN_PORT_TYPE;
745-
$this->assertContains(
745+
$this->assertStringContainsString(
746746
$this->_convertXmlToString($faultsInPortType),
747747
$wsdlContent,
748748
'SOAP Fault section in port type section is invalid'
@@ -757,7 +757,7 @@ protected function _checkFaultsBindingSection($wsdlContent)
757757
$faultsInBinding = <<< FAULT_IN_BINDING
758758
<fault name="GenericFault"/>
759759
FAULT_IN_BINDING;
760-
$this->assertContains(
760+
$this->assertStringContainsString(
761761
$this->_convertXmlToString($faultsInBinding),
762762
$wsdlContent,
763763
'SOAP Fault section in binding section is invalid'
@@ -774,7 +774,7 @@ protected function _checkFaultsMessagesSection($wsdlContent)
774774
<part name="messageParameters" element="tns:GenericFault"/>
775775
</message>
776776
GENERIC_FAULT_IN_MESSAGES;
777-
$this->assertContains(
777+
$this->assertStringContainsString(
778778
$this->_convertXmlToString($genericFaultMessage),
779779
$wsdlContent,
780780
'Generic SOAP Fault declaration in messages section is invalid'
@@ -787,7 +787,7 @@ protected function _checkFaultsMessagesSection($wsdlContent)
787787
*/
788788
protected function _checkFaultsComplexTypeSection($wsdlContent)
789789
{
790-
$this->assertContains(
790+
$this->assertStringContainsString(
791791
$this->_convertXmlToString('<xsd:element name="GenericFault" type="tns:GenericFault"/>'),
792792
$wsdlContent,
793793
'Default SOAP Fault complex type element declaration is invalid'
@@ -824,7 +824,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
824824
</xsd:sequence>
825825
</xsd:complexType>
826826
GENERIC_FAULT_COMPLEX_TYPE;
827-
$this->assertContains(
827+
$this->assertStringContainsString(
828828
$this->_convertXmlToString($genericFaultType),
829829
$wsdlContent,
830830
'Default SOAP Fault complex types declaration is invalid'
@@ -852,7 +852,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
852852
</xsd:sequence>
853853
</xsd:complexType>
854854
PARAM_COMPLEX_TYPE;
855-
$this->assertContains(
855+
$this->assertStringContainsString(
856856
$this->_convertXmlToString($detailsParameterType),
857857
$wsdlContent,
858858
'Details parameter complex types declaration is invalid.'
@@ -907,7 +907,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
907907
WRAPPED_ERROR_COMPLEX_TYPE;
908908
}
909909
// @codingStandardsIgnoreEnd
910-
$this->assertContains(
910+
$this->assertStringContainsString(
911911
$this->_convertXmlToString($detailsWrappedErrorType),
912912
$wsdlContent,
913913
'Details wrapped error complex types declaration is invalid.'
@@ -930,7 +930,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
930930
</xsd:complexType>
931931
PARAMETERS_COMPLEX_TYPE;
932932
// @codingStandardsIgnoreEnd
933-
$this->assertContains(
933+
$this->assertStringContainsString(
934934
$this->_convertXmlToString($detailsParametersType),
935935
$wsdlContent,
936936
'Details parameters (array of parameters) complex types declaration is invalid.'
@@ -974,7 +974,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
974974

975975
}
976976
// @codingStandardsIgnoreEnd
977-
$this->assertContains(
977+
$this->assertStringContainsString(
978978
$this->_convertXmlToString($detailsWrappedErrorsType),
979979
$wsdlContent,
980980
'Details wrapped errors (array of wrapped errors) complex types declaration is invalid.'

0 commit comments

Comments
 (0)