Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RequestTest.php
Go to the documentation of this file.
1 <?php
7 
8 class RequestTest extends \PHPUnit\Framework\TestCase
9 {
11  protected $request;
12 
13  protected function setUp()
14  {
16  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
17  $this->request = $objectManager->getObject(\Magento\Framework\Webapi\Request::class);
18  }
19 
20  protected function tearDown()
21  {
22  unset($this->request);
23  parent::tearDown();
24  }
25 
31  public function testGetRequestedServicesSuccess($requestParamServices, $expectedResult)
32  {
33  $requestParams = [
36  ];
37  $this->request->setParams($requestParams);
38  $this->assertEquals($expectedResult, $this->request->getRequestedServices());
39  }
40 
45  {
46  $testModuleA = 'testModule1AllSoapAndRestV1';
47  $testModuleB = 'testModule1AllSoapAndRestV2';
48  $testModuleC = 'testModule2AllSoapNoRestV1';
49  return [
50  ["{$testModuleA},{$testModuleB}", [$testModuleA, $testModuleB]],
51  ["{$testModuleA},{$testModuleC}", [$testModuleA, $testModuleC]],
52  ["{$testModuleA}", [$testModuleA]]
53  ];
54  }
55 }
testGetRequestedServicesSuccess($requestParamServices, $expectedResult)
Definition: RequestTest.php:31
$objectManager
Definition: bootstrap.php:17