TokensDialogTest.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Test\Unit\Controller\Adminhtml\Integration;
  7. class TokensDialogTest extends \Magento\Integration\Test\Unit\Controller\Adminhtml\IntegrationTest
  8. {
  9. public function testTokensDialog()
  10. {
  11. $controller = $this->_createIntegrationController('TokensDialog');
  12. $this->_registryMock->expects($this->any())->method('register');
  13. $this->_requestMock->expects(
  14. $this->any()
  15. )->method(
  16. 'getParam'
  17. )->will(
  18. $this->returnValueMap(
  19. [
  20. [
  21. \Magento\Integration\Controller\Adminhtml\Integration::PARAM_INTEGRATION_ID,
  22. null,
  23. self::INTEGRATION_ID
  24. ],[\Magento\Integration\Controller\Adminhtml\Integration::PARAM_REAUTHORIZE, 0, 0],
  25. ]
  26. )
  27. );
  28. $this->_integrationSvcMock->expects(
  29. $this->any()
  30. )->method(
  31. 'get'
  32. )->with(
  33. $this->equalTo(self::INTEGRATION_ID)
  34. )->will(
  35. $this->returnValue($this->_getIntegrationModelMock())
  36. );
  37. $this->_escaper->expects($this->once())
  38. ->method('escapeHtml')
  39. ->willReturnArgument(0);
  40. $this->_oauthSvcMock->expects($this->once())->method('createAccessToken')->will($this->returnValue(true));
  41. $this->_viewMock->expects($this->any())->method('loadLayout');
  42. $this->_viewMock->expects($this->any())->method('renderLayout');
  43. $controller->execute();
  44. }
  45. }