| @@ 58-79 (lines=22) @@ | ||
| 55 | * verify the order and shipment are setup correctly. |
|
| 56 | * verify the request is handled properly. |
|
| 57 | */ |
|
| 58 | public function testPrintOrderShipmentAction() |
|
| 59 | { |
|
| 60 | $this->_request->expects($this->any()) |
|
| 61 | ->method('getParam') |
|
| 62 | ->will($this->returnValue('theid')); |
|
| 63 | $this->_controller->expects($this->any()) |
|
| 64 | ->method('_loadValidOrder') |
|
| 65 | ->will($this->returnValue(true)); |
|
| 66 | $this->_controller->expects($this->any()) |
|
| 67 | ->method('_canViewOrder') |
|
| 68 | ->will($this->returnValue(true)); |
|
| 69 | $this->_controller->expects($this->once()) |
|
| 70 | ->method('loadLayout') |
|
| 71 | ->with($this->isType('string')) |
|
| 72 | ->will($this->returnValue($this->getModelMock('core/layout'))); |
|
| 73 | // if all went well, a call to renderLayout should |
|
| 74 | // be observed. |
|
| 75 | $this->_controller->expects($this->once()) |
|
| 76 | ->method('renderLayout') |
|
| 77 | ->will($this->returnSelf()); |
|
| 78 | $this->_controller->printOrderShipmentAction(); |
|
| 79 | } |
|
| 80 | /** |
|
| 81 | * provide shipment ids and return values for the mocked methods _loadValidOrder and _canViewOrder |
|
| 82 | * so the printOrderShipmentAction method should not attempt to render any content. |
|
| @@ 68-89 (lines=22) @@ | ||
| 65 | * verify the order and shipment are setup correctly. |
|
| 66 | * verify the request is handled properly. |
|
| 67 | */ |
|
| 68 | public function testPrintOrderShipmentAction() |
|
| 69 | { |
|
| 70 | $this->_request->expects($this->any()) |
|
| 71 | ->method('getParam') |
|
| 72 | ->will($this->returnValue('theid')); |
|
| 73 | $this->_controller->expects($this->any()) |
|
| 74 | ->method('_loadValidOrder') |
|
| 75 | ->will($this->returnValue(true)); |
|
| 76 | $this->_controller->expects($this->any()) |
|
| 77 | ->method('_canViewOrder') |
|
| 78 | ->will($this->returnValue(true)); |
|
| 79 | $this->_controller->expects($this->once()) |
|
| 80 | ->method('loadLayout') |
|
| 81 | ->with($this->isType('string')) |
|
| 82 | ->will($this->returnValue($this->getModelMock('core/layout'))); |
|
| 83 | // if all went well, a call to renderLayout should |
|
| 84 | // be observed. |
|
| 85 | $this->_controller->expects($this->once()) |
|
| 86 | ->method('renderLayout') |
|
| 87 | ->will($this->returnSelf()); |
|
| 88 | $this->_controller->printOrderShipmentAction(); |
|
| 89 | } |
|
| 90 | /** |
|
| 91 | * provide datasets so the printOrderShipmentAction method does not attempt |
|
| 92 | * to render any content. |
|