Skip to content

Commit f066e2c

Browse files
author
Joan He
committed
MAGETWO-38380: Add "all" store code to APIs to allow APIs to work with all stores
1 parent 91531ba commit f066e2c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Soap.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ public function generateWsdlUrl($services, $storeCode = null)
123123
//TODO: This may change since same resource of multiple versions may be allowed after namespace changes
124124
ksort($services);
125125
/** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
126-
$storeCode = $storeCode !== null
127-
? (string)$storeCode
128-
: Bootstrap::getObjectManager()
126+
if ($storeCode !== null) {
127+
$storeCode = Bootstrap::getObjectManager()
129128
->get('Magento\Store\Model\StoreManagerInterface')
130129
->getStore()
131130
->getCode();
131+
} elseif ($storeCode === \Magento\Webapi\Controller\PathProcessor::ALL_STORE_CODE) {
132+
$storeCode = \Magento\Store\Model\Store::ADMIN_CODE;
133+
}
132134

133135
/** TESTS_BASE_URL is initialized in PHPUnit configuration */
134136
$wsdlUrl = rtrim(TESTS_BASE_URL, '/') . self::WSDL_BASE_PATH . '/' . $storeCode . '?wsdl=1&services=';

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

-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public function testCreate($product)
144144
*/
145145
public function testCreateAllStoreCode($fixtureProduct)
146146
{
147-
$this->_markTestAsRestOnly();
148147
$response = $this->saveProduct($fixtureProduct, 'all');
149148
$this->assertArrayHasKey(ProductInterface::SKU, $response);
150149

@@ -174,7 +173,6 @@ public function testCreateAllStoreCode($fixtureProduct)
174173
*/
175174
public function testDeleteAllStoreCode($fixtureProduct)
176175
{
177-
$this->_markTestAsRestOnly();
178176
$sku = $fixtureProduct[ProductInterface::SKU];
179177
$this->saveProduct($fixtureProduct);
180178
$this->setExpectedException('Exception', 'Requested product doesn\'t exist');

0 commit comments

Comments
 (0)