@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | * @param string $type Arbitrary order type (max. eight chars) |
| 30 | 30 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
| 31 | 31 | */ |
| 32 | - public function addItem( $baseId, $type ) |
|
| 32 | + public function addItem($baseId, $type) |
|
| 33 | 33 | { |
| 34 | 34 | $total = 0; |
| 35 | 35 | $context = $this->getContext(); |
| 36 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 36 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 37 | 37 | |
| 38 | 38 | /** controller/frontend/order/limit-seconds |
| 39 | 39 | * Order limitation time frame in seconds |
@@ -51,24 +51,24 @@ discard block |
||
| 51 | 51 | * @see controller/frontend/basket/limit-count |
| 52 | 52 | * @see controller/frontend/basket/limit-seconds |
| 53 | 53 | */ |
| 54 | - $seconds = $context->getConfig()->get( 'controller/frontend/order/limit-seconds', 300 ); |
|
| 54 | + $seconds = $context->getConfig()->get('controller/frontend/order/limit-seconds', 300); |
|
| 55 | 55 | |
| 56 | 56 | $search = $manager->createSearch(); |
| 57 | 57 | $expr = [ |
| 58 | - $search->compare( '==', 'order.baseid', $baseId ), |
|
| 59 | - $search->compare( '>=', 'order.ctime', date( 'Y-m-d H:i:s', time() - $seconds ) ), |
|
| 58 | + $search->compare('==', 'order.baseid', $baseId), |
|
| 59 | + $search->compare('>=', 'order.ctime', date('Y-m-d H:i:s', time() - $seconds)), |
|
| 60 | 60 | ]; |
| 61 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 62 | - $search->setSlice( 0, 0 ); |
|
| 61 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 62 | + $search->setSlice(0, 0); |
|
| 63 | 63 | |
| 64 | - $manager->searchItems( $search, [], $total ); |
|
| 64 | + $manager->searchItems($search, [], $total); |
|
| 65 | 65 | |
| 66 | - if( $total > 0 ) { |
|
| 67 | - throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'The order has already been created' ) ); |
|
| 66 | + if ($total > 0) { |
|
| 67 | + throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('The order has already been created')); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $item = $manager->createItem()->setBaseId( $baseId )->setType( $type ); |
|
| 71 | - return $manager->saveItem( $item ); |
|
| 70 | + $item = $manager->createItem()->setBaseId($baseId)->setType($type); |
|
| 71 | + return $manager->saveItem($item); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function createFilter() |
| 81 | 81 | { |
| 82 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch( true ); |
|
| 82 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(true); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
@@ -90,30 +90,30 @@ discard block |
||
| 90 | 90 | * @param boolean $default Use default criteria to limit orders |
| 91 | 91 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
| 92 | 92 | */ |
| 93 | - public function getItem( $id, $default = true ) |
|
| 93 | + public function getItem($id, $default = true) |
|
| 94 | 94 | { |
| 95 | 95 | $context = $this->getContext(); |
| 96 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 96 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 97 | 97 | |
| 98 | - $search = $manager->createSearch( true ); |
|
| 98 | + $search = $manager->createSearch(true); |
|
| 99 | 99 | $expr = [ |
| 100 | - $search->compare( '==', 'order.id', $id ), |
|
| 100 | + $search->compare('==', 'order.id', $id), |
|
| 101 | 101 | $search->getConditions(), |
| 102 | 102 | ]; |
| 103 | 103 | |
| 104 | - if( $default !== false ) { |
|
| 105 | - $expr[] = $search->compare( '==', 'order.editor', $context->getEditor() ); |
|
| 104 | + if ($default !== false) { |
|
| 105 | + $expr[] = $search->compare('==', 'order.editor', $context->getEditor()); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 108 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 109 | 109 | |
| 110 | - $items = $manager->searchItems( $search ); |
|
| 110 | + $items = $manager->searchItems($search); |
|
| 111 | 111 | |
| 112 | - if( ( $item = reset( $items ) ) !== false ) { |
|
| 112 | + if (($item = reset($items)) !== false) { |
|
| 113 | 113 | return $item; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'No order item for ID "%1$s" found', $id ) ); |
|
| 116 | + throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('No order item for ID "%1$s" found', $id)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | * @param \Aimeos\MShop\Order\Item\Iface $item Order object |
| 124 | 124 | * @return \Aimeos\MShop\Order\Item\Iface Saved order item |
| 125 | 125 | */ |
| 126 | - public function saveItem( \Aimeos\MShop\Order\Item\Iface $item ) |
|
| 126 | + public function saveItem(\Aimeos\MShop\Order\Item\Iface $item) |
|
| 127 | 127 | { |
| 128 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' ); |
|
| 129 | - return $manager->saveItem( $item ); |
|
| 128 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order'); |
|
| 129 | + return $manager->saveItem($item); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
@@ -137,18 +137,18 @@ discard block |
||
| 137 | 137 | * @param integer|null &$total Variable that will contain the total number of available items |
| 138 | 138 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
| 139 | 139 | */ |
| 140 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
|
| 140 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null) |
|
| 141 | 141 | { |
| 142 | 142 | $context = $this->getContext(); |
| 143 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 143 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 144 | 144 | |
| 145 | 145 | $expr = [ |
| 146 | 146 | $filter->getConditions(), |
| 147 | - $filter->compare( '==', 'order.base.customerid', $context->getUserId() ), |
|
| 147 | + $filter->compare('==', 'order.base.customerid', $context->getUserId()), |
|
| 148 | 148 | ]; |
| 149 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
| 149 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
| 150 | 150 | |
| 151 | - return $manager->searchItems( $filter, [], $total ); |
|
| 151 | + return $manager->searchItems($filter, [], $total); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | * |
| 171 | 171 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 172 | 172 | */ |
| 173 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 173 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 174 | 174 | { |
| 175 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem ); |
|
| 175 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | * |
| 195 | 195 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 196 | 196 | */ |
| 197 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 197 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 198 | 198 | { |
| 199 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem ); |
|
| 199 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | * |
| 215 | 215 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 216 | 216 | */ |
| 217 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 217 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 218 | 218 | { |
| 219 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem ); |
|
| 219 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
@@ -231,22 +231,22 @@ discard block |
||
| 231 | 231 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
| 232 | 232 | * @deprecated 2017.04 Use store() from basket controller instead |
| 233 | 233 | */ |
| 234 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
| 234 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
| 235 | 235 | { |
| 236 | 236 | $context = $this->getContext(); |
| 237 | 237 | |
| 238 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 239 | - $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
| 238 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 239 | + $orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | $orderBaseManager->begin(); |
| 243 | - $orderBaseManager->store( $basket ); |
|
| 243 | + $orderBaseManager->store($basket); |
|
| 244 | 244 | $orderBaseManager->commit(); |
| 245 | 245 | |
| 246 | 246 | $orderItem = $orderManager->createItem(); |
| 247 | - $orderItem->setBaseId( $basket->getId() ); |
|
| 248 | - $orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB ); |
|
| 247 | + $orderItem->setBaseId($basket->getId()); |
|
| 248 | + $orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB); |
|
| 249 | 249 | |
| 250 | - return $orderManager->saveItem( $orderItem ); |
|
| 250 | + return $orderManager->saveItem($orderItem); |
|
| 251 | 251 | } |
| 252 | 252 | } |
@@ -18,200 +18,200 @@ |
||
| 18 | 18 | |
| 19 | 19 | protected function setUp() |
| 20 | 20 | { |
| 21 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 21 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 22 | 22 | |
| 23 | 23 | $this->context = \TestHelperFrontend::getContext(); |
| 24 | - $this->object = new \Aimeos\Controller\Frontend\Order\Standard( $this->context ); |
|
| 24 | + $this->object = new \Aimeos\Controller\Frontend\Order\Standard($this->context); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset( $this->object, $this->context ); |
|
| 30 | + unset($this->object, $this->context); |
|
| 31 | 31 | |
| 32 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 32 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 33 | 33 | \Aimeos\MShop\Factory::clear(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | public function testAddItem() |
| 38 | 38 | { |
| 39 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 40 | - ->setConstructorArgs( [$this->context] ) |
|
| 41 | - ->setMethods( ['saveItem'] ) |
|
| 39 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 40 | + ->setConstructorArgs([$this->context]) |
|
| 41 | + ->setMethods(['saveItem']) |
|
| 42 | 42 | ->getMock(); |
| 43 | 43 | |
| 44 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager ); |
|
| 44 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager); |
|
| 45 | 45 | |
| 46 | - $manager->expects( $this->once() )->method( 'saveItem' ) |
|
| 47 | - ->will( $this->returnValue( $manager->createItem() ) ); |
|
| 46 | + $manager->expects($this->once())->method('saveItem') |
|
| 47 | + ->will($this->returnValue($manager->createItem())); |
|
| 48 | 48 | |
| 49 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) ); |
|
| 49 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' )); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | public function testAddItemLimit() |
| 54 | 54 | { |
| 55 | - $this->context->getConfig()->set( 'controller/frontend/order/limit-seconds', 86400 * 365 ); |
|
| 55 | + $this->context->getConfig()->set('controller/frontend/order/limit-seconds', 86400 * 365); |
|
| 56 | 56 | |
| 57 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' ); |
|
| 58 | - $result = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) ); |
|
| 57 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base'); |
|
| 58 | + $result = $manager->searchItems($manager->createSearch()->setSlice(0, 1)); |
|
| 59 | 59 | |
| 60 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 61 | - throw new \RuntimeException( 'No order item found' ); |
|
| 60 | + if (($item = reset($result)) === false) { |
|
| 61 | + throw new \RuntimeException('No order item found'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' ); |
|
| 65 | - $this->object->addItem( $item->getId(), 'test' ); |
|
| 64 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception'); |
|
| 65 | + $this->object->addItem($item->getId(), 'test'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testCreateFilter() |
| 70 | 70 | { |
| 71 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 71 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | public function testGetItem() |
| 76 | 76 | { |
| 77 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' ); |
|
| 78 | - $customerItem = $manager->findItem( 'UTC001' ); |
|
| 77 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer'); |
|
| 78 | + $customerItem = $manager->findItem('UTC001'); |
|
| 79 | 79 | |
| 80 | - $this->context->setEditor( 'core:unittest' ); |
|
| 80 | + $this->context->setEditor('core:unittest'); |
|
| 81 | 81 | |
| 82 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' ); |
|
| 83 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
| 84 | - $search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) ); |
|
| 85 | - $result = $manager->searchItems( $search ); |
|
| 82 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order'); |
|
| 83 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
| 84 | + $search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId())); |
|
| 85 | + $result = $manager->searchItems($search); |
|
| 86 | 86 | |
| 87 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 88 | - throw new \RuntimeException( 'No order item found' ); |
|
| 87 | + if (($item = reset($result)) === false) { |
|
| 88 | + throw new \RuntimeException('No order item found'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) ); |
|
| 91 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId())); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | public function testGetItemException() |
| 96 | 96 | { |
| 97 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' ); |
|
| 97 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception'); |
|
| 98 | 98 | $this->object->getItem( -1 ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | public function testSaveItem() |
| 103 | 103 | { |
| 104 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 105 | - ->setConstructorArgs( [$this->context] ) |
|
| 106 | - ->setMethods( ['saveItem'] ) |
|
| 104 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 105 | + ->setConstructorArgs([$this->context]) |
|
| 106 | + ->setMethods(['saveItem']) |
|
| 107 | 107 | ->getMock(); |
| 108 | 108 | |
| 109 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager ); |
|
| 109 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager); |
|
| 110 | 110 | |
| 111 | - $manager->expects( $this->once() )->method( 'saveItem' ) |
|
| 112 | - ->will( $this->returnValue( $manager->createItem() ) ); |
|
| 111 | + $manager->expects($this->once())->method('saveItem') |
|
| 112 | + ->will($this->returnValue($manager->createItem())); |
|
| 113 | 113 | |
| 114 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->saveItem( $manager->createItem() ) ); |
|
| 114 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->saveItem($manager->createItem())); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testSearchItems() |
| 119 | 119 | { |
| 120 | - $this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) ); |
|
| 120 | + $this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter())); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | public function testStore() |
| 125 | 125 | { |
| 126 | 126 | $name = 'ControllerFrontendOrderStore'; |
| 127 | - $this->context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 127 | + $this->context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 128 | 128 | |
| 129 | 129 | |
| 130 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 131 | - ->setMethods( array( 'saveItem', 'getSubManager' ) ) |
|
| 132 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 130 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 131 | + ->setMethods(array('saveItem', 'getSubManager')) |
|
| 132 | + ->setConstructorArgs(array($this->context)) |
|
| 133 | 133 | ->getMock(); |
| 134 | 134 | |
| 135 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 136 | - ->setMethods( array( 'store' ) ) |
|
| 137 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 135 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
| 136 | + ->setMethods(array('store')) |
|
| 137 | + ->setConstructorArgs(array($this->context)) |
|
| 138 | 138 | ->getMock(); |
| 139 | 139 | |
| 140 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 140 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | $orderBaseItem = $orderBaseManagerStub->createItem(); |
| 144 | - $orderBaseItem->setId( 1 ); |
|
| 144 | + $orderBaseItem->setId(1); |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | - $orderBaseManagerStub->expects( $this->once() )->method( 'store' ); |
|
| 147 | + $orderBaseManagerStub->expects($this->once())->method('store'); |
|
| 148 | 148 | |
| 149 | - $orderManagerStub->expects( $this->once() )->method( 'getSubManager' ) |
|
| 150 | - ->will( $this->returnValue( $orderBaseManagerStub ) ); |
|
| 149 | + $orderManagerStub->expects($this->once())->method('getSubManager') |
|
| 150 | + ->will($this->returnValue($orderBaseManagerStub)); |
|
| 151 | 151 | |
| 152 | - $orderManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 152 | + $orderManagerStub->expects($this->once())->method('saveItem'); |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | - $this->object->store( $orderBaseItem ); |
|
| 155 | + $this->object->store($orderBaseItem); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | public function testBlock() |
| 160 | 160 | { |
| 161 | 161 | $name = 'ControllerFrontendOrderBlock'; |
| 162 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 162 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 166 | - ->setMethods( array( 'block' ) ) |
|
| 167 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 165 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 166 | + ->setMethods(array('block')) |
|
| 167 | + ->setConstructorArgs(array($this->context)) |
|
| 168 | 168 | ->getMock(); |
| 169 | 169 | |
| 170 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 170 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 171 | 171 | |
| 172 | - $orderCntlStub->expects( $this->once() )->method( 'block' ); |
|
| 172 | + $orderCntlStub->expects($this->once())->method('block'); |
|
| 173 | 173 | |
| 174 | 174 | |
| 175 | - $this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 175 | + $this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | public function testUnblock() |
| 180 | 180 | { |
| 181 | 181 | $name = 'ControllerFrontendOrderUnblock'; |
| 182 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 182 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 183 | 183 | |
| 184 | 184 | |
| 185 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 186 | - ->setMethods( array( 'unblock' ) ) |
|
| 187 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 185 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 186 | + ->setMethods(array('unblock')) |
|
| 187 | + ->setConstructorArgs(array($this->context)) |
|
| 188 | 188 | ->getMock(); |
| 189 | 189 | |
| 190 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 190 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 191 | 191 | |
| 192 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
| 192 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
| 193 | 193 | |
| 194 | 194 | |
| 195 | - $this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 195 | + $this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
| 199 | 199 | public function testUpdate() |
| 200 | 200 | { |
| 201 | 201 | $name = 'ControllerFrontendOrderUpdate'; |
| 202 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 202 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 203 | 203 | |
| 204 | 204 | |
| 205 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 206 | - ->setMethods( array( 'update' ) ) |
|
| 207 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 205 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 206 | + ->setMethods(array('update')) |
|
| 207 | + ->setConstructorArgs(array($this->context)) |
|
| 208 | 208 | ->getMock(); |
| 209 | 209 | |
| 210 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 210 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 211 | 211 | |
| 212 | - $orderCntlStub->expects( $this->once() )->method( 'update' ); |
|
| 212 | + $orderCntlStub->expects($this->once())->method('update'); |
|
| 213 | 213 | |
| 214 | 214 | |
| 215 | - $this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 215 | + $this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 216 | 216 | } |
| 217 | 217 | } |