Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from magento-engcom/default-source-install-data
Add default Source in Data Install.
- Loading branch information
Showing
2 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/code/Magento/InventoryCatalog/Test/Api/GetDefaultSourceTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\InventoryCatalog\Test\Api; | ||
|
||
use Magento\InventoryApi\Api\Data\SourceInterface; | ||
use Magento\TestFramework\TestCase\WebapiAbstract; | ||
use Magento\Framework\Webapi\Rest\Request; | ||
|
||
/** | ||
* Class GetDefaultSourceTest | ||
*/ | ||
class GetDefaultSourceTest extends WebapiAbstract | ||
{ | ||
/** | ||
* Test that default Source is present after installation | ||
*/ | ||
public function testGetDefaultSource() | ||
{ | ||
$defaultSourceId = 1; | ||
$serviceInfo = [ | ||
'rest' => [ | ||
'resourcePath' => '/V1/inventory/source/' . $defaultSourceId, | ||
'httpMethod' => Request::HTTP_METHOD_GET, | ||
], | ||
'soap' => [ | ||
'service' => 'inventoryApiSourceRepositoryV1', | ||
'operation' => 'inventoryApiSourceRepositoryV1Get', | ||
], | ||
]; | ||
if (self::ADAPTER_REST == TESTS_WEB_API_ADAPTER) { | ||
$source = $this->_webApiCall($serviceInfo); | ||
} else { | ||
$source = $this->_webApiCall($serviceInfo, ['sourceId' => $defaultSourceId]); | ||
} | ||
$this->assertEquals($defaultSourceId, $source[SourceInterface::SOURCE_ID]); | ||
} | ||
} |