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