Skip to content

Commit 814c791

Browse files
authored
Merge pull request #2043 from magento-plankton/webapi-fixes-2.1
Fixed issues: - MAGETWO-87346 Uncaught 'undefined property' notices in REST tests - backport for 2.1-develop - MAGETWO-87348 WebAPI-Tests on 2.1 fails with the exception when running the fixture - MAGETWO-87343 Uncaught fatal error in SOAP tests
2 parents 689f414 + 7062d96 commit 814c791

File tree

8 files changed

+10
-20
lines changed

8 files changed

+10
-20
lines changed

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
@@ -412,6 +411,7 @@ public function validOptionDataProvider()
412411
*/
413412
public function testUpdateNegative($optionData, $message, $exceptionCode)
414413
{
414+
$this->_markTestAsRestOnly();
415415
$productSku = 'simple';
416416
/** @var ProductRepository $productRepository */
417417
$productRepository = $this->objectManager->create(ProductRepository::class);
@@ -424,18 +424,9 @@ public function testUpdateNegative($optionData, $message, $exceptionCode)
424424
'resourcePath' => '/V1/products/options/' . $optionId,
425425
'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT,
426426
],
427-
'soap' => [
428-
'service' => self::SERVICE_NAME,
429-
'serviceVersion' => 'V1',
430-
'operation' => self::SERVICE_NAME . 'Save',
431-
],
432427
];
433428

434-
if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
435-
$this->setExpectedException('SoapFault');
436-
} else {
437-
$this->setExpectedException('Exception', $message, $exceptionCode);
438-
}
429+
$this->setExpectedException('Exception', $message, $exceptionCode);
439430
$this->_webApiCall($serviceInfo, ['option' => $optionData]);
440431
}
441432

dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function tearDown()
103103
$this->assertTrue($response);
104104
}
105105
}
106-
unset($this->accountManagement);
106+
$this->accountManagement = null;
107107
$mediaDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
108108
$mediaDirectory->delete(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
109109
}

dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setUp()
9494
*/
9595
public function tearDown()
9696
{
97-
unset($this->customerRepository);
97+
$this->customerRepository = null;
9898

9999
/** @var \Magento\Framework\Registry $registry */
100100
$registry = Bootstrap::getObjectManager()->get('Magento\Framework\Registry');

dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ public function tearDown()
150150
$this->configValue
151151
);
152152
$this->config->save();
153-
unset($this->accountManagement);
154-
unset($this->subscriber);
153+
$this->accountManagement = null;
154+
$this->subscriber = null;
155155
}
156156

157157
private function initSubscriber()

dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function tearDown()
139139
$this->assertTrue($response);
140140
}
141141
}
142-
unset($this->customerRepository);
142+
$this->customerRepository = null;
143143
}
144144

145145
/**

dev/tests/api-functional/testsuite/Magento/Integration/Model/IntegrationTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class IntegrationTest extends \Magento\TestFramework\TestCase\WebapiAbstract
1313
/** @var \Magento\Integration\Model\Integration */
1414
protected $integration;
1515

16-
1716
protected function setUp()
1817
{
1918
$objectManager = Bootstrap::getObjectManager();
@@ -32,7 +31,7 @@ protected function setUp()
3231

3332
protected function tearDown()
3433
{
35-
unset($this->integration);
34+
$this->integration = null;
3635
OauthHelper::clearApiAccessCredentials();
3736
parent::tearDown();
3837
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/delete_association.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
/** @var $product \Magento\Catalog\Model\Product */
88
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product');
9-
$product->load(1);
9+
$product->load(1001);
1010
$product->setAssociatedProductIds([20]);
1111
$product->save();

dev/tests/static/testsuite/Magento/Test/Legacy/CopyrightTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testCopyright()
1717
$invoker(
1818
function ($filename) {
1919
$fileText = file_get_contents($filename);
20-
if (strpos($fileText, 'Copyright © 2013-' . date('Y')) === false) {
20+
if (strpos($fileText, 'Copyright © Magento, Inc. All rights reserved.') === false) {
2121
$this->fail('Copyright is missing or has wrong year in ' . $filename);
2222
}
2323
},

0 commit comments

Comments
 (0)