Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TokensDialogTest.php
Go to the documentation of this file.
1 <?php
8 
10 {
11  public function testTokensDialog()
12  {
13  $controller = $this->_createIntegrationController('TokensDialog');
14  $this->_registryMock->expects($this->any())->method('register');
15 
16  $this->_requestMock->expects(
17  $this->any()
18  )->method(
19  'getParam'
20  )->will(
21  $this->returnValueMap(
22  [
23  [
24  \Magento\Integration\Controller\Adminhtml\Integration::PARAM_INTEGRATION_ID,
25  null,
26  self::INTEGRATION_ID
27  ],[\Magento\Integration\Controller\Adminhtml\Integration::PARAM_REAUTHORIZE, 0, 0],
28  ]
29  )
30  );
31 
32  $this->_integrationSvcMock->expects(
33  $this->any()
34  )->method(
35  'get'
36  )->with(
37  $this->equalTo(self::INTEGRATION_ID)
38  )->will(
39  $this->returnValue($this->_getIntegrationModelMock())
40  );
41 
42  $this->_escaper->expects($this->once())
43  ->method('escapeHtml')
44  ->willReturnArgument(0);
45 
46  $this->_oauthSvcMock->expects($this->once())->method('createAccessToken')->will($this->returnValue(true));
47 
48  $this->_viewMock->expects($this->any())->method('loadLayout');
49  $this->_viewMock->expects($this->any())->method('renderLayout');
50 
51  $controller->execute();
52  }
53 }
$controller
Definition: info.phtml:14