1 | <?php |
||
12 | class BaseTest extends \PHPUnit\Framework\TestCase |
||
13 | { |
||
14 | private $context; |
||
15 | private $object; |
||
16 | private $stub; |
||
17 | |||
18 | |||
19 | protected function setUp() |
||
20 | { |
||
21 | $this->context = \TestHelperFrontend::getContext(); |
||
22 | |||
23 | $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
||
24 | ->disableOriginalConstructor() |
||
25 | ->getMock(); |
||
26 | |||
27 | $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Decorator\Base' ) |
||
28 | ->setConstructorArgs( [$this->stub, $this->context] ) |
||
29 | ->getMockForAbstractClass(); |
||
30 | } |
||
31 | |||
32 | |||
33 | protected function tearDown() |
||
34 | { |
||
35 | unset( $this->context, $this->object, $this->stub ); |
||
36 | } |
||
37 | |||
38 | |||
39 | public function testConstructException() |
||
49 | |||
50 | |||
51 | public function testCall() |
||
66 | |||
67 | |||
68 | public function testClear() |
||
69 | { |
||
70 | $this->stub->expects( $this->once() )->method( 'clear' ); |
||
71 | |||
72 | $this->object->clear(); |
||
73 | } |
||
74 | |||
75 | |||
76 | public function testGet() |
||
77 | { |
||
78 | $context = \TestHelperFrontend::getContext(); |
||
79 | $order = \Aimeos\MShop\Factory::createManager( $context, 'order/base' )->createItem(); |
||
80 | |||
81 | $this->stub->expects( $this->once() )->method( 'get' ) |
||
82 | ->will( $this->returnValue( $order ) ); |
||
83 | |||
84 | $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Base\Iface', $this->object->get() ); |
||
85 | } |
||
86 | |||
87 | |||
88 | public function testSave() |
||
89 | { |
||
90 | $this->stub->expects( $this->once() )->method( 'save' ); |
||
91 | |||
92 | $this->object->save(); |
||
93 | } |
||
94 | |||
95 | |||
96 | public function testSetType() |
||
102 | |||
103 | |||
104 | public function testStore() |
||
110 | |||
111 | |||
112 | public function testLoad() |
||
118 | |||
119 | |||
120 | public function testAddProduct() |
||
121 | { |
||
122 | $this->stub->expects( $this->once() )->method( 'addProduct' ); |
||
123 | |||
126 | |||
127 | |||
128 | public function testDeleteProduct() |
||
134 | |||
135 | |||
136 | public function testEditProduct() |
||
142 | |||
143 | |||
144 | public function testAddCoupon() |
||
150 | |||
151 | |||
152 | public function testDeleteCoupon() |
||
158 | |||
159 | |||
160 | public function testSetAddress() |
||
166 | |||
167 | |||
168 | public function testAddService() |
||
174 | |||
175 | |||
176 | public function testDeleteService() |
||
182 | |||
183 | |||
184 | public function testGetController() |
||
190 | |||
191 | |||
192 | protected function access( $name ) |
||
200 | } |
||
201 |