Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
SubsetTest Class Reference
Inheritance diagram for SubsetTest:
BaseService WebapiAbstract

Public Member Functions

 testItem ()
 
 testItems ()
 
- Public Member Functions inherited from WebapiAbstract
 addModelToDelete ($model, $secure=false)
 
 processRestExceptionResult (\Exception $e)
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from BaseService
 assertUnauthorizedException ($serviceInfo, $requestData=null)
 
 _assertRestUnauthorizedException ($serviceInfo, $requestData=null)
 
 _assertNoRouteOrOperationException ($serviceInfo, $requestData=null)
 
 _assertNoRestRouteException ($serviceInfo, $requestData=null)
 
 _assertSoapException ($serviceInfo, $requestData=null, $expectedMessage='')
 
- Protected Member Functions inherited from WebapiAbstract
 tearDown ()
 
 _webApiCall ( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
 
 _markTestAsSoapOnly ($message=null)
 
 _markTestAsRestOnly ($message=null)
 
 _getWebApiAdapter ($webApiAdapterCode)
 
 _assertMessagesEqual ($expectedMessages, $receivedMessages)
 
 _cleanAppConfigCache ()
 
 _restoreAppConfig ()
 
 checkSoapFault ( $soapFault, $expectedMessage, $expectedFaultCode, $expectedErrorParams=[], $expectedWrappedErrors=[], $traceString=null)
 
 _checkFaultParams ($expectedErrorParams, $errorDetails)
 
 _checkWrappedErrors ($expectedWrappedErrors, $errorDetails)
 

Protected Attributes

 $_version
 
 $_restResourcePath
 
 $_soapService
 
- Protected Attributes inherited from WebapiAbstract
 $_appCache
 
 $_modelsToDelete = []
 
 $_origConfigValues = []
 
 $_webApiAdapters
 
 $_webApiAdaptersMap
 

Additional Inherited Members

- Static Public Member Functions inherited from WebapiAbstract
static setUpBeforeClass ()
 
static tearDownAfterClass ()
 
static setFixture ($key, $fixture, $tearDown=self::AUTO_TEAR_DOWN_AFTER_METHOD)
 
static getFixture ($key)
 
static callModelDelete ($model, $secure=false)
 
static deleteFixture ($key, $secure=false)
 
- Data Fields inherited from WebapiAbstract
const AUTO_TEAR_DOWN_DISABLED = 0
 
const AUTO_TEAR_DOWN_AFTER_METHOD = 1
 
const AUTO_TEAR_DOWN_AFTER_CLASS = 2
 
const ADAPTER_SOAP = 'soap'
 
const ADAPTER_REST = 'rest'
 
- Static Protected Member Functions inherited from WebapiAbstract
static _setFixtureNamespace ()
 
static _unsetFixtureNamespace ()
 
static _getFixtureNamespace ()
 
static _deleteFixtures ($fixtures)
 
- Static Protected Attributes inherited from WebapiAbstract
static $_fixturesNamespace
 
static $_fixtures = []
 
static $_methodLevelFixtures = []
 
static $_classLevelFixtures = []
 

Detailed Description

Definition at line 12 of file SubsetTest.php.

Member Function Documentation

◆ setUp()

setUp ( )
protected

@Override

Definition at line 32 of file SubsetTest.php.

33  {
34  $this->_version = 'V1';
35  $this->_restResourcePath = "/{$this->_version}/testModule2SubsetRest/";
36  $this->_soapService = 'testModule2SubsetRestV1';
37  }

◆ testItem()

testItem ( )

@Override Test get item

Definition at line 43 of file SubsetTest.php.

44  {
45  $itemId = 1;
46  $serviceInfo = [
47  'rest' => [
48  'resourcePath' => $this->_restResourcePath . $itemId,
50  ],
51  'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Item'],
52  ];
53  $requestData = ['id' => $itemId];
54  $item = $this->_webApiCall($serviceInfo, $requestData);
55  $this->assertEquals($itemId, $item['id'], 'Item was retrieved unsuccessfully');
56  }
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)

◆ testItems()

testItems ( )

@Override Test fetching all items

Definition at line 62 of file SubsetTest.php.

63  {
64  $itemArr = [['id' => 1, 'name' => 'testItem1'], ['id' => 2, 'name' => 'testItem2']];
65  $serviceInfo = [
66  'rest' => [
67  'resourcePath' => $this->_restResourcePath,
69  ],
70  'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Items'],
71  ];
72 
73  $item = $this->_webApiCall($serviceInfo);
74  $this->assertEquals($itemArr, $item, 'Items were not retrieved');
75  }
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)

Field Documentation

◆ $_restResourcePath

$_restResourcePath
protected

Definition at line 22 of file SubsetTest.php.

◆ $_soapService

$_soapService
protected

Definition at line 27 of file SubsetTest.php.

◆ $_version

$_version
protected

Definition at line 17 of file SubsetTest.php.


The documentation for this class was generated from the following file: