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

Public Member Functions

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

Protected Member Functions

 tearDown ()
 
- 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

 $integration
 
- 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 11 of file IntegrationTest.php.

Member Function Documentation

◆ tearDown()

tearDown ( )
protected

Definition at line 32 of file IntegrationTest.php.

33  {
34  $this->integration = null;
36  parent::tearDown();
37  }

◆ testConfigBasedIntegrationCreation()

testConfigBasedIntegrationCreation ( )

Definition at line 39 of file IntegrationTest.php.

40  {
41  $this->assertEquals('[email protected]', $this->integration->getEmail());
42  $this->assertEquals('http://example.com/endpoint1', $this->integration->getEndpoint());
43  $this->assertEquals('Test Integration1', $this->integration->getName());
44  $this->assertEquals(Integration::TYPE_CONFIG, $this->integration->getSetupType());
45  }

◆ testGetServiceCall()

testGetServiceCall ( )

Test simple request data

@depends testConfigBasedIntegrationCreation

Definition at line 52 of file IntegrationTest.php.

53  {
54  $this->_markTestAsRestOnly();
55  $itemId = 1;
56  $name = 'Test';
57  $serviceInfo = [
58  'rest' => [
59  'resourcePath' => '/V1/testmodule4/' . $itemId,
61  ],
62  ];
63  $item = $this->_webApiCall($serviceInfo, [], null, null, $this->integration);
64  $this->assertEquals($itemId, $item['entity_id'], 'id field returned incorrectly');
65  $this->assertEquals($name, $item['name'], 'name field returned incorrectly');
66  }
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
if(!isset($_GET['name'])) $name
Definition: log.php:14

Field Documentation

◆ $integration

$integration
protected

Definition at line 14 of file IntegrationTest.php.


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