StartTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Paypal\Test\Unit\Controller\Express;
  8. class StartTest extends \Magento\Paypal\Test\Unit\Controller\ExpressTest
  9. {
  10. protected $name = 'Start';
  11. /**
  12. * @param null|bool $buttonParam
  13. * @dataProvider startActionDataProvider
  14. */
  15. public function testStartAction($buttonParam)
  16. {
  17. $this->request->expects($this->at(1))
  18. ->method('getParam')
  19. ->with('bml')
  20. ->will($this->returnValue($buttonParam));
  21. $this->checkout->expects($this->once())
  22. ->method('setIsBml')
  23. ->with((bool)$buttonParam);
  24. $this->request->expects($this->at(2))
  25. ->method('getParam')
  26. ->with(\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_BUTTON)
  27. ->will($this->returnValue($buttonParam));
  28. $this->customerData->expects($this->any())
  29. ->method('getId')
  30. ->will($this->returnValue(1));
  31. $this->checkout->expects($this->once())
  32. ->method('start')
  33. ->with($this->anything(), $this->anything(), (bool)$buttonParam);
  34. $this->model->execute();
  35. }
  36. /**
  37. * @return array
  38. */
  39. public function startActionDataProvider()
  40. {
  41. return [['1'], [null]];
  42. }
  43. }