Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AsynchronousSchemaRequestProcessorTest.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
20  public function testSchemaRequest($path)
21  {
22  ob_start();
23  $this->dispatch($path);
24  ob_end_clean();
25  $schema = $this->getResponse()->getBody();
26 
27  // Check that an HTTP 202 response is visible for what is normally an HTTP 200.
28  $this->assertRegExp('/202 Accepted/', $schema);
29 
30  // Make sure that the async interface definition is included in the response.
31  $this->assertRegExp('/asynchronous-operations-data-async-response-interface/', $schema);
32  }
33 
39  public function getResponse()
40  {
41  if (!$this->_response) {
42  $this->_response = $this->_objectManager->get(\Magento\Framework\Webapi\Rest\Response::class);
43  }
44  return $this->_response;
45  }
46 
50  public function schemaRequestProvider()
51  {
52  return [
53  ['rest/async/schema'],
54  ['rest/async/schema?services=all'],
55  ['rest/all/async/schema?services=all'],
56  ['rest/default/async/schema?services=all'],
57  ['rest/async/schema?services=all'],
58  ];
59  }
60 }