StoreConfigManagerTest.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Store\Api;
  7. use Magento\TestFramework\TestCase\WebapiAbstract;
  8. /**
  9. * Tests for website repository interface.
  10. */
  11. class StoreConfigManagerTest extends WebapiAbstract
  12. {
  13. const SERVICE_NAME = 'storeStoreConfigManagerV1';
  14. const SERVICE_VERSION = 'V1';
  15. const RESOURCE_PATH = '/V1/store/storeConfigs';
  16. /**
  17. * Test getStoreConfigs
  18. */
  19. public function testGetStoreConfigs()
  20. {
  21. $serviceInfo = [
  22. 'rest' => [
  23. 'resourcePath' => self::RESOURCE_PATH,
  24. 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
  25. ],
  26. 'soap' => [
  27. 'service' => self::SERVICE_NAME,
  28. 'serviceVersion' => self::SERVICE_VERSION,
  29. 'operation' => self::SERVICE_NAME . 'getStoreConfigs',
  30. ],
  31. ];
  32. $requestData = [
  33. 'storeCodes' => ['default'],
  34. ];
  35. $storeConfigs = $this->_webApiCall($serviceInfo, $requestData);
  36. $this->assertNotNull($storeConfigs);
  37. $this->assertEquals(1, count($storeConfigs));
  38. $expectedKeys = [
  39. 'id',
  40. 'code',
  41. 'website_id',
  42. 'locale',
  43. 'base_currency_code',
  44. 'default_display_currency_code',
  45. 'timezone',
  46. 'weight_unit',
  47. 'base_url',
  48. 'base_link_url',
  49. 'base_static_url',
  50. 'base_media_url',
  51. 'secure_base_url',
  52. 'secure_base_link_url',
  53. 'secure_base_static_url',
  54. 'secure_base_media_url'
  55. ];
  56. $this->assertEquals($expectedKeys, array_keys($storeConfigs[0]));
  57. }
  58. }