Skip to content

Commit d31ae7b

Browse files
committed
MC-33071: Stabilize Web-API tests
1 parent 039a827 commit d31ae7b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

dev/tests/api-functional/testsuite/Magento/Swatches/Api/ProductAttributeOptionManagementInterfaceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
3535
* @magentoApiDataFixture Magento/Catalog/Model/Product/Attribute/_files/select_attribute.php
3636
* @param array $data
3737
* @param array $payload
38-
* @param string $expectedSwatchType
38+
* @param int $expectedSwatchType
3939
* @param string $expectedLabel
4040
* @param string $expectedValue
4141
*
@@ -44,7 +44,7 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
4444
public function testAdd(
4545
array $data,
4646
array $payload,
47-
string $expectedSwatchType,
47+
int $expectedSwatchType,
4848
string $expectedLabel,
4949
string $expectedValue
5050
) {

dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function testCreateTaxRateExistingCode()
126126
$this->_webApiCall($serviceInfo, $data);
127127
$this->fail('Expected exception was not raised');
128128
} catch (\SoapFault $e) {
129-
$this->assertContains(
129+
$this->assertStringContainsString(
130130
$expectedMessage,
131131
$e->getMessage(),
132132
'SoapFault does not contain expected message.'
@@ -164,7 +164,7 @@ public function testCreateTaxRateWithoutValue()
164164
$this->_webApiCall($serviceInfo, $data);
165165
$this->fail('Expected exception was not raised');
166166
} catch (\SoapFault $e) {
167-
$this->assertContains(
167+
$this->assertStringContainsString(
168168
'SOAP-ERROR: Encoding: object has no \'rate\' property',
169169
$e->getMessage(),
170170
'SoapFault does not contain expected message.'
@@ -369,7 +369,7 @@ public function testUpdateTaxRateNotExisting()
369369
} catch (\Exception $e) {
370370
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
371371

372-
$this->assertContains(
372+
$this->assertStringContainsString(
373373
$expectedMessage,
374374
$e->getMessage(),
375375
"Exception does not contain expected message."
@@ -426,7 +426,7 @@ public function testGetTaxRateNotExist()
426426
} catch (\Exception $e) {
427427
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
428428

429-
$this->assertContains(
429+
$this->assertStringContainsString(
430430
$expectedMessage,
431431
$e->getMessage(),
432432
"Exception does not contain expected message."
@@ -493,7 +493,7 @@ public function testCannotDeleteTaxRate()
493493
} catch (\Exception $e) {
494494
$expectedMessage = "The tax rate can't be removed because it exists in a tax rule.";
495495

496-
$this->assertContains(
496+
$this->assertStringContainsString(
497497
$expectedMessage,
498498
$e->getMessage(),
499499
"Exception does not contain expected message."

dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ public function testCreateTaxRuleInvalidTaxClassIds()
195195
$this->_webApiCall($serviceInfo, $requestData);
196196
$this->fail('Did not throw expected InputException');
197197
} catch (\SoapFault $e) {
198-
$this->assertContains('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
198+
$this->assertStringContainsString('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
199199
} catch (\Exception $e) {
200-
$this->assertContains('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
200+
$this->assertStringContainsString('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
201201
}
202202
}
203203

@@ -232,7 +232,7 @@ public function testCreateTaxRuleExistingCode()
232232
$this->_webApiCall($serviceInfo, $requestData);
233233
$this->fail('Expected exception was not raised');
234234
} catch (\SoapFault $e) {
235-
$this->assertContains(
235+
$this->assertStringContainsString(
236236
$expectedMessage,
237237
$e->getMessage(),
238238
'SoapFault does not contain expected message.'
@@ -430,7 +430,7 @@ public function testGetTaxRuleNotExist()
430430
} catch (\Exception $e) {
431431
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
432432

433-
$this->assertContains(
433+
$this->assertStringContainsString(
434434
$expectedMessage,
435435
$e->getMessage(),
436436
"Exception does not contain expected message."
@@ -542,7 +542,7 @@ public function testUpdateTaxRuleNotExisting()
542542
} catch (\Exception $e) {
543543
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
544544

545-
$this->assertContains(
545+
$this->assertStringContainsString(
546546
$expectedMessage,
547547
$e->getMessage(),
548548
"Exception does not contain expected message."

0 commit comments

Comments
 (0)