| @@ 102-120 (lines=19) @@ | ||
| 99 | * |
|
| 100 | * @return \eBayEnterprise\RetailOrderManagement\Api\IBidirectionalApi (mock) |
|
| 101 | */ |
|
| 102 | protected function _mockSdkApi() |
|
| 103 | { |
|
| 104 | $sdk = $this->getMockBuilder('\eBayEnterprise\RetailOrderManagement\Api\IBidirectionalApi') |
|
| 105 | // Constructor disabled to prevent needing to create and inject |
|
| 106 | // API configuration. |
|
| 107 | ->disableOriginalConstructor() |
|
| 108 | // Payload getters mocked but not set to return anything. The validator |
|
| 109 | // shouln't need to worry about manipulating the payloads so shouldn't |
|
| 110 | // be necessary to create valid or mocked payloads. |
|
| 111 | ->setMethods(['getRequestBody', 'setRequestBody', 'send', 'getResponseBody']) |
|
| 112 | ->getMock(); |
|
| 113 | $sdk->expects($this->any()) |
|
| 114 | ->method('setRequestBody') |
|
| 115 | ->will($this->returnSelf()); |
|
| 116 | $sdk->expects($this->any()) |
|
| 117 | ->method('send') |
|
| 118 | ->will($this->returnSelf()); |
|
| 119 | return $sdk; |
|
| 120 | } |
|
| 121 | ||
| 122 | /** |
|
| 123 | * Replace the customer session object with a mock. |
|
| @@ 29-43 (lines=15) @@ | ||
| 26 | ->getMock(); |
|
| 27 | $this->replaceByMock('singleton', 'core/session', $session); |
|
| 28 | } |
|
| 29 | protected function _getProductCollectionStub() |
|
| 30 | { |
|
| 31 | $col = $this->getResourceModelMockBuilder('catalog/product_collection') |
|
| 32 | ->setMethods(array('load', 'save')) |
|
| 33 | ->disableOriginalConstructor() |
|
| 34 | ->getMock(); |
|
| 35 | $col->setItemObjectClass('catalog/product'); |
|
| 36 | $col->expects($this->any()) |
|
| 37 | ->method('load') |
|
| 38 | ->will($this->returnSelf()); |
|
| 39 | $col->expects($this->any()) |
|
| 40 | ->method('save') |
|
| 41 | ->will($this->returnSelf()); |
|
| 42 | return $col; |
|
| 43 | } |
|
| 44 | /** |
|
| 45 | * Test getProductsToClean method, making sure our assumption are correct and |
|
| 46 | * the right parameters are being pass to the collect to filter where is_clean is false |
|