@@ -20,161 +20,161 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
| 29 | 29 | ->getMockForAbstractClass(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | protected function tearDown() |
| 34 | 34 | { |
| 35 | - unset( $this->context, $this->object, $this->stub ); |
|
| 35 | + unset($this->context, $this->object, $this->stub); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testConstructException() |
| 40 | 40 | { |
| 41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
| 41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
| 42 | 42 | |
| 43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
| 43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
| 44 | 44 | |
| 45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 46 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 47 | 47 | ->getMockForAbstractClass(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testCall() |
| 52 | 52 | { |
| 53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' ) |
|
| 53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
| 54 | 54 | ->disableOriginalConstructor() |
| 55 | - ->setMethods( ['invalid'] ) |
|
| 55 | + ->setMethods(['invalid']) |
|
| 56 | 56 | ->getMock(); |
| 57 | 57 | |
| 58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 59 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 60 | 60 | ->getMockForAbstractClass(); |
| 61 | 61 | |
| 62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
| 62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
| 63 | 63 | |
| 64 | - $this->assertTrue( $object->invalid() ); |
|
| 64 | + $this->assertTrue($object->invalid()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testCheckAttributes() |
| 69 | 69 | { |
| 70 | - $this->stub->expects( $this->once() )->method( 'checkAttributes' ) |
|
| 71 | - ->will( $this->returnValue( [] ) ); |
|
| 70 | + $this->stub->expects($this->once())->method('checkAttributes') |
|
| 71 | + ->will($this->returnValue([])); |
|
| 72 | 72 | |
| 73 | - $this->assertEquals( [], $this->object->checkAttributes( -1, [] ) ); |
|
| 73 | + $this->assertEquals([], $this->object->checkAttributes( -1, [] )); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | public function testGetProvider() |
| 78 | 78 | { |
| 79 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' ); |
|
| 80 | - $provider = $manager->getProvider( $manager->findItem( 'unitcode', [], 'service', 'delivery' ) ); |
|
| 79 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'service'); |
|
| 80 | + $provider = $manager->getProvider($manager->findItem('unitcode', [], 'service', 'delivery')); |
|
| 81 | 81 | |
| 82 | - $this->stub->expects( $this->once() )->method( 'getProvider' ) |
|
| 83 | - ->will( $this->returnValue( $provider ) ); |
|
| 82 | + $this->stub->expects($this->once())->method('getProvider') |
|
| 83 | + ->will($this->returnValue($provider)); |
|
| 84 | 84 | |
| 85 | - $this->assertSame( $provider, $this->object->getProvider( -1 ) ); |
|
| 85 | + $this->assertSame($provider, $this->object->getProvider( -1 )); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function testGetProviders() |
| 90 | 90 | { |
| 91 | - $this->stub->expects( $this->once() )->method( 'getProviders' ) |
|
| 92 | - ->will( $this->returnValue( [] ) ); |
|
| 91 | + $this->stub->expects($this->once())->method('getProviders') |
|
| 92 | + ->will($this->returnValue([])); |
|
| 93 | 93 | |
| 94 | - $this->assertEquals( [], $this->object->getProviders( 'payment' ) ); |
|
| 94 | + $this->assertEquals([], $this->object->getProviders('payment')); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | public function testProcess() |
| 99 | 99 | { |
| 100 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 100 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 101 | 101 | |
| 102 | - $this->stub->expects( $this->once() )->method( 'process' ) |
|
| 103 | - ->will( $this->returnValue( new \Aimeos\MShop\Common\Item\Helper\Form\Standard() ) ); |
|
| 102 | + $this->stub->expects($this->once())->method('process') |
|
| 103 | + ->will($this->returnValue(new \Aimeos\MShop\Common\Item\Helper\Form\Standard())); |
|
| 104 | 104 | |
| 105 | - $this->assertInstanceOf( 'Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process( $item, -1, [], [] ) ); |
|
| 105 | + $this->assertInstanceOf('Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process($item, -1, [], [])); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | public function testUpdateSync() |
| 110 | 110 | { |
| 111 | - $response = $this->getMockBuilder( '\Psr\Http\Message\ResponseInterface' )->getMock(); |
|
| 112 | - $request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock(); |
|
| 113 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 111 | + $response = $this->getMockBuilder('\Psr\Http\Message\ResponseInterface')->getMock(); |
|
| 112 | + $request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock(); |
|
| 113 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 114 | 114 | |
| 115 | - $this->stub->expects( $this->once() )->method( 'updateSync' ) |
|
| 116 | - ->will( $this->returnValue( $item ) ); |
|
| 115 | + $this->stub->expects($this->once())->method('updateSync') |
|
| 116 | + ->will($this->returnValue($item)); |
|
| 117 | 117 | |
| 118 | - $this->assertInstanceOf( 'Aimeos\MShop\Order\Item\Iface', $this->object->updateSync( $request, $response, [] ) ); |
|
| 118 | + $this->assertInstanceOf('Aimeos\MShop\Order\Item\Iface', $this->object->updateSync($request, $response, [])); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | public function testGetServices() |
| 123 | 123 | { |
| 124 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 124 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 125 | 125 | |
| 126 | - $this->stub->expects( $this->once() )->method( 'getServices' ) |
|
| 127 | - ->will( $this->returnValue( [] ) ); |
|
| 126 | + $this->stub->expects($this->once())->method('getServices') |
|
| 127 | + ->will($this->returnValue([])); |
|
| 128 | 128 | |
| 129 | - $this->assertEquals( [], $this->object->getServices( 'payment', $basket ) ); |
|
| 129 | + $this->assertEquals([], $this->object->getServices('payment', $basket)); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | public function testGetServiceAttributes() |
| 134 | 134 | { |
| 135 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 135 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 136 | 136 | |
| 137 | - $this->stub->expects( $this->once() )->method( 'getServiceAttributes' ) |
|
| 138 | - ->will( $this->returnValue( [] ) ); |
|
| 137 | + $this->stub->expects($this->once())->method('getServiceAttributes') |
|
| 138 | + ->will($this->returnValue([])); |
|
| 139 | 139 | |
| 140 | - $this->assertEquals( [], $this->object->getServiceAttributes( 'payment', -1, $basket ) ); |
|
| 140 | + $this->assertEquals([], $this->object->getServiceAttributes('payment', -1, $basket)); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | public function testGetServicePrice() |
| 145 | 145 | { |
| 146 | - $priceItem = \Aimeos\MShop\Factory::createManager( $this->context, 'price' )->createItem(); |
|
| 147 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 146 | + $priceItem = \Aimeos\MShop\Factory::createManager($this->context, 'price')->createItem(); |
|
| 147 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 148 | 148 | |
| 149 | - $this->stub->expects( $this->once() )->method( 'getServicePrice' ) |
|
| 150 | - ->will( $this->returnValue( $priceItem ) ); |
|
| 149 | + $this->stub->expects($this->once())->method('getServicePrice') |
|
| 150 | + ->will($this->returnValue($priceItem)); |
|
| 151 | 151 | |
| 152 | - $this->assertInstanceOf( '\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice( 'payment', -1, $basket ) ); |
|
| 152 | + $this->assertInstanceOf('\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice('payment', -1, $basket)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | public function testCheckServiceAttributes() |
| 157 | 157 | { |
| 158 | - $this->stub->expects( $this->once() )->method( 'checkServiceAttributes' ) |
|
| 159 | - ->will( $this->returnValue( [] ) ); |
|
| 158 | + $this->stub->expects($this->once())->method('checkServiceAttributes') |
|
| 159 | + ->will($this->returnValue([])); |
|
| 160 | 160 | |
| 161 | - $this->assertEquals( [], $this->object->checkServiceAttributes( 'payment', -1, [] ) ); |
|
| 161 | + $this->assertEquals([], $this->object->checkServiceAttributes('payment', -1, [])); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | public function testGetController() |
| 166 | 166 | { |
| 167 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 167 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 168 | 168 | |
| 169 | - $this->assertSame( $this->stub, $result ); |
|
| 169 | + $this->assertSame($this->stub, $result); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | - protected function access( $name ) |
|
| 173 | + protected function access($name) |
|
| 174 | 174 | { |
| 175 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ); |
|
| 176 | - $method = $class->getMethod( $name ); |
|
| 177 | - $method->setAccessible( true ); |
|
| 175 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Service\Decorator\Base'); |
|
| 176 | + $method = $class->getMethod($name); |
|
| 177 | + $method->setAccessible(true); |
|
| 178 | 178 | |
| 179 | 179 | return $method; |
| 180 | 180 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param string $type Arbitrary order type (max. eight chars) |
| 28 | 28 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
| 29 | 29 | */ |
| 30 | - public function addItem( $baseId, $type ); |
|
| 30 | + public function addItem($baseId, $type); |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @param string $id Unique order ID |
| 45 | 45 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
| 46 | 46 | */ |
| 47 | - public function getItem( $id ); |
|
| 47 | + public function getItem($id); |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param integer &$total|null Variable that will contain the total number of available items |
| 55 | 55 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
| 56 | 56 | */ |
| 57 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ); |
|
| 57 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null); |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 77 | 77 | * @return void |
| 78 | 78 | */ |
| 79 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
| 79 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 99 | 99 | * @return void |
| 100 | 100 | */ |
| 101 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
| 101 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 117 | 117 | * @return void |
| 118 | 118 | */ |
| 119 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
| 119 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -130,5 +130,5 @@ discard block |
||
| 130 | 130 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
| 131 | 131 | * @deprecated 2017.04 Use store() from basket controller instead |
| 132 | 132 | */ |
| 133 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
| 133 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
| 134 | 134 | } |
@@ -20,136 +20,136 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
| 29 | 29 | ->getMockForAbstractClass(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | protected function tearDown() |
| 34 | 34 | { |
| 35 | - unset( $this->context, $this->object, $this->stub ); |
|
| 35 | + unset($this->context, $this->object, $this->stub); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testConstructException() |
| 40 | 40 | { |
| 41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
| 41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
| 42 | 42 | |
| 43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
| 43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
| 44 | 44 | |
| 45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 46 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 47 | 47 | ->getMockForAbstractClass(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testCall() |
| 52 | 52 | { |
| 53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
| 53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
| 54 | 54 | ->disableOriginalConstructor() |
| 55 | - ->setMethods( ['invalid'] ) |
|
| 55 | + ->setMethods(['invalid']) |
|
| 56 | 56 | ->getMock(); |
| 57 | 57 | |
| 58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 59 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 60 | 60 | ->getMockForAbstractClass(); |
| 61 | 61 | |
| 62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
| 62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
| 63 | 63 | |
| 64 | - $this->assertTrue( $object->invalid() ); |
|
| 64 | + $this->assertTrue($object->invalid()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testAddItem() |
| 69 | 69 | { |
| 70 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 70 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 71 | 71 | |
| 72 | - $this->stub->expects( $this->once() )->method( 'addItem' )->will( $this->returnValue( $item ) ); |
|
| 72 | + $this->stub->expects($this->once())->method('addItem')->will($this->returnValue($item)); |
|
| 73 | 73 | |
| 74 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' ) ); |
|
| 74 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' )); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testCreateFilter() |
| 79 | 79 | { |
| 80 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createSearch(); |
|
| 80 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createSearch(); |
|
| 81 | 81 | |
| 82 | - $this->stub->expects( $this->once() )->method( 'createFilter' )->will( $this->returnValue( $search ) ); |
|
| 82 | + $this->stub->expects($this->once())->method('createFilter')->will($this->returnValue($search)); |
|
| 83 | 83 | |
| 84 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 84 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | public function testGetItem() |
| 89 | 89 | { |
| 90 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 90 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 91 | 91 | |
| 92 | - $this->stub->expects( $this->once() )->method( 'getItem' )->will( $this->returnValue( $item ) ); |
|
| 92 | + $this->stub->expects($this->once())->method('getItem')->will($this->returnValue($item)); |
|
| 93 | 93 | |
| 94 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 ) ); |
|
| 94 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 )); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | public function testSearchItems() |
| 99 | 99 | { |
| 100 | - $search = $this->getMockBuilder( '\Aimeos\MW\Criteria\Iface' )->getMock(); |
|
| 100 | + $search = $this->getMockBuilder('\Aimeos\MW\Criteria\Iface')->getMock(); |
|
| 101 | 101 | |
| 102 | - $this->stub->expects( $this->once() )->method( 'searchItems' )->will( $this->returnValue( [] ) ); |
|
| 102 | + $this->stub->expects($this->once())->method('searchItems')->will($this->returnValue([])); |
|
| 103 | 103 | |
| 104 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
| 104 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | public function testUnblock() |
| 109 | 109 | { |
| 110 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 110 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 111 | 111 | |
| 112 | - $this->stub->expects( $this->once() )->method( 'unblock' ); |
|
| 112 | + $this->stub->expects($this->once())->method('unblock'); |
|
| 113 | 113 | |
| 114 | - $this->object->unblock( $orderItem ); |
|
| 114 | + $this->object->unblock($orderItem); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testUpdate() |
| 119 | 119 | { |
| 120 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 120 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 121 | 121 | |
| 122 | - $this->stub->expects( $this->once() )->method( 'update' ); |
|
| 122 | + $this->stub->expects($this->once())->method('update'); |
|
| 123 | 123 | |
| 124 | - $this->object->update( $orderItem ); |
|
| 124 | + $this->object->update($orderItem); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | public function testStore() |
| 129 | 129 | { |
| 130 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 131 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 130 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 131 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 132 | 132 | |
| 133 | - $this->stub->expects( $this->once() )->method( 'store' ) |
|
| 134 | - ->will( $this->returnValue( $orderItem ) ); |
|
| 133 | + $this->stub->expects($this->once())->method('store') |
|
| 134 | + ->will($this->returnValue($orderItem)); |
|
| 135 | 135 | |
| 136 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->store( $basket ) ); |
|
| 136 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->store($basket)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | public function testGetController() |
| 141 | 141 | { |
| 142 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 142 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 143 | 143 | |
| 144 | - $this->assertSame( $this->stub, $result ); |
|
| 144 | + $this->assertSame($this->stub, $result); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | - protected function access( $name ) |
|
| 148 | + protected function access($name) |
|
| 149 | 149 | { |
| 150 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ); |
|
| 151 | - $method = $class->getMethod( $name ); |
|
| 152 | - $method->setAccessible( true ); |
|
| 150 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Order\Decorator\Base'); |
|
| 151 | + $method = $class->getMethod($name); |
|
| 152 | + $method->setAccessible(true); |
|
| 153 | 153 | |
| 154 | 154 | return $method; |
| 155 | 155 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value |
| 31 | 31 | * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values |
| 32 | 32 | */ |
| 33 | - public function checkAttributes( $serviceId, array $attributes ); |
|
| 33 | + public function checkAttributes($serviceId, array $attributes); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Returns the service item for the given ID |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
| 40 | 40 | * @return \Aimeos\MShop\Service\Provider\Iface Service provider object |
| 41 | 41 | */ |
| 42 | - public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] ); |
|
| 42 | + public function getProvider($serviceId, $ref = ['media', 'price', 'text']); |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Returns the service providers for the given type |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
| 49 | 49 | * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values |
| 50 | 50 | */ |
| 51 | - public function getProviders( $type = null, $ref = ['media', 'price', 'text'] ); |
|
| 51 | + public function getProviders($type = null, $ref = ['media', 'price', 'text']); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Processes the service for the given order, e.g. payment and delivery services |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc. |
| 62 | 62 | * or null if no form data is required |
| 63 | 63 | */ |
| 64 | - public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params ); |
|
| 64 | + public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params); |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Updates the payment or delivery status for the given request |
@@ -72,5 +72,5 @@ discard block |
||
| 72 | 72 | * (keys are <type>.url-self, <type>.url-success, <type>.url-update where type can be "delivery" or "payment") |
| 73 | 73 | * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated |
| 74 | 74 | */ |
| 75 | - public function updateSync( ServerRequestInterface $request, ResponseInterface $response, array $urls ); |
|
| 75 | + public function updateSync(ServerRequestInterface $request, ResponseInterface $response, array $urls); |
|
| 76 | 76 | } |
@@ -29,12 +29,12 @@ 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 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' ); |
|
| 34 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order'); |
|
| 35 | 35 | |
| 36 | - $item = $manager->createItem()->setBaseId( $baseId )->setType( $type ); |
|
| 37 | - $manager->saveItem( $item ); |
|
| 36 | + $item = $manager->createItem()->setBaseId($baseId)->setType($type); |
|
| 37 | + $manager->saveItem($item); |
|
| 38 | 38 | |
| 39 | 39 | return $item; |
| 40 | 40 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function createFilter() |
| 49 | 49 | { |
| 50 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch( true ); |
|
| 50 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(true); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -57,26 +57,26 @@ discard block |
||
| 57 | 57 | * @param string $id Unique order ID |
| 58 | 58 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
| 59 | 59 | */ |
| 60 | - public function getItem( $id ) |
|
| 60 | + public function getItem($id) |
|
| 61 | 61 | { |
| 62 | 62 | $context = $this->getContext(); |
| 63 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 63 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 64 | 64 | |
| 65 | - $search = $manager->createSearch( true ); |
|
| 65 | + $search = $manager->createSearch(true); |
|
| 66 | 66 | $expr = [ |
| 67 | - $search->compare( '==', 'order.id', $id ), |
|
| 68 | - $search->compare( '==', 'order.base.customerid', $context->getUserId() ), |
|
| 67 | + $search->compare('==', 'order.id', $id), |
|
| 68 | + $search->compare('==', 'order.base.customerid', $context->getUserId()), |
|
| 69 | 69 | $search->getConditions(), |
| 70 | 70 | ]; |
| 71 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 71 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 72 | 72 | |
| 73 | - $items = $manager->searchItems( $search ); |
|
| 73 | + $items = $manager->searchItems($search); |
|
| 74 | 74 | |
| 75 | - if( ( $item = reset( $items ) ) !== false ) { |
|
| 75 | + if (($item = reset($items)) !== false) { |
|
| 76 | 76 | return $item; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'No order item for ID "%1$s" found', $id ) ); |
|
| 79 | + throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('No order item for ID "%1$s" found', $id)); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -87,18 +87,18 @@ discard block |
||
| 87 | 87 | * @param integer|null &$total Variable that will contain the total number of available items |
| 88 | 88 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
| 89 | 89 | */ |
| 90 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
|
| 90 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null) |
|
| 91 | 91 | { |
| 92 | 92 | $context = $this->getContext(); |
| 93 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 93 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 94 | 94 | |
| 95 | 95 | $expr = [ |
| 96 | 96 | $filter->getConditions(), |
| 97 | - $filter->compare( '==', 'order.base.customerid', $context->getUserId() ), |
|
| 97 | + $filter->compare('==', 'order.base.customerid', $context->getUserId()), |
|
| 98 | 98 | ]; |
| 99 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
| 99 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
| 100 | 100 | |
| 101 | - return $manager->searchItems( $filter, [], $total ); |
|
| 101 | + return $manager->searchItems($filter, [], $total); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 122 | 122 | */ |
| 123 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 123 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 124 | 124 | { |
| 125 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem ); |
|
| 125 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | * |
| 145 | 145 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 146 | 146 | */ |
| 147 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 147 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 148 | 148 | { |
| 149 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem ); |
|
| 149 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | * |
| 165 | 165 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
| 166 | 166 | */ |
| 167 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
| 167 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
| 168 | 168 | { |
| 169 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem ); |
|
| 169 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
@@ -181,22 +181,22 @@ discard block |
||
| 181 | 181 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
| 182 | 182 | * @deprecated 2017.04 Use store() from basket controller instead |
| 183 | 183 | */ |
| 184 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
| 184 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
| 185 | 185 | { |
| 186 | 186 | $context = $this->getContext(); |
| 187 | 187 | |
| 188 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
| 189 | - $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
| 188 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
| 189 | + $orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | $orderBaseManager->begin(); |
| 193 | - $orderBaseManager->store( $basket ); |
|
| 193 | + $orderBaseManager->store($basket); |
|
| 194 | 194 | $orderBaseManager->commit(); |
| 195 | 195 | |
| 196 | 196 | $orderItem = $orderManager->createItem(); |
| 197 | - $orderItem->setBaseId( $basket->getId() ); |
|
| 198 | - $orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB ); |
|
| 199 | - $orderManager->saveItem( $orderItem ); |
|
| 197 | + $orderItem->setBaseId($basket->getId()); |
|
| 198 | + $orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB); |
|
| 199 | + $orderManager->saveItem($orderItem); |
|
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | return $orderItem; |
@@ -18,175 +18,175 @@ |
||
| 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' ); |
|
| 46 | + $manager->expects($this->once())->method('saveItem'); |
|
| 47 | 47 | |
| 48 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) ); |
|
| 48 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' )); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateFilter() |
| 53 | 53 | { |
| 54 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 54 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | public function testGetItem() |
| 59 | 59 | { |
| 60 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' ); |
|
| 61 | - $customerItem = $manager->findItem( 'UTC001' ); |
|
| 60 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer'); |
|
| 61 | + $customerItem = $manager->findItem('UTC001'); |
|
| 62 | 62 | |
| 63 | - $this->context->setUserId( $customerItem->getId() ); |
|
| 63 | + $this->context->setUserId($customerItem->getId()); |
|
| 64 | 64 | |
| 65 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' ); |
|
| 66 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
| 67 | - $search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) ); |
|
| 68 | - $result = $manager->searchItems( $search ); |
|
| 65 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order'); |
|
| 66 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
| 67 | + $search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId())); |
|
| 68 | + $result = $manager->searchItems($search); |
|
| 69 | 69 | |
| 70 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 71 | - throw new \RuntimeException( 'No order item found' ); |
|
| 70 | + if (($item = reset($result)) === false) { |
|
| 71 | + throw new \RuntimeException('No order item found'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) ); |
|
| 74 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId())); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testGetItemException() |
| 79 | 79 | { |
| 80 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' ); |
|
| 81 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
| 82 | - $result = $manager->searchItems( $search ); |
|
| 80 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order'); |
|
| 81 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
| 82 | + $result = $manager->searchItems($search); |
|
| 83 | 83 | |
| 84 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 85 | - throw new \RuntimeException( 'No order item found' ); |
|
| 84 | + if (($item = reset($result)) === false) { |
|
| 85 | + throw new \RuntimeException('No order item found'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' ); |
|
| 89 | - $this->object->getItem( $item->getId() ); |
|
| 88 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception'); |
|
| 89 | + $this->object->getItem($item->getId()); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | public function testSearchItems() |
| 94 | 94 | { |
| 95 | - $this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) ); |
|
| 95 | + $this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter())); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testStore() |
| 100 | 100 | { |
| 101 | 101 | $name = 'ControllerFrontendOrderStore'; |
| 102 | - $this->context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 102 | + $this->context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 106 | - ->setMethods( array( 'saveItem', 'getSubManager' ) ) |
|
| 107 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 105 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 106 | + ->setMethods(array('saveItem', 'getSubManager')) |
|
| 107 | + ->setConstructorArgs(array($this->context)) |
|
| 108 | 108 | ->getMock(); |
| 109 | 109 | |
| 110 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 111 | - ->setMethods( array( 'store' ) ) |
|
| 112 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 110 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
| 111 | + ->setMethods(array('store')) |
|
| 112 | + ->setConstructorArgs(array($this->context)) |
|
| 113 | 113 | ->getMock(); |
| 114 | 114 | |
| 115 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 115 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | $orderBaseItem = $orderBaseManagerStub->createItem(); |
| 119 | - $orderBaseItem->setId( 1 ); |
|
| 119 | + $orderBaseItem->setId(1); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $orderBaseManagerStub->expects( $this->once() )->method( 'store' ); |
|
| 122 | + $orderBaseManagerStub->expects($this->once())->method('store'); |
|
| 123 | 123 | |
| 124 | - $orderManagerStub->expects( $this->once() )->method( 'getSubManager' ) |
|
| 125 | - ->will( $this->returnValue( $orderBaseManagerStub ) ); |
|
| 124 | + $orderManagerStub->expects($this->once())->method('getSubManager') |
|
| 125 | + ->will($this->returnValue($orderBaseManagerStub)); |
|
| 126 | 126 | |
| 127 | - $orderManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 127 | + $orderManagerStub->expects($this->once())->method('saveItem'); |
|
| 128 | 128 | |
| 129 | 129 | |
| 130 | - $this->object->store( $orderBaseItem ); |
|
| 130 | + $this->object->store($orderBaseItem); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function testBlock() |
| 135 | 135 | { |
| 136 | 136 | $name = 'ControllerFrontendOrderBlock'; |
| 137 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 137 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 141 | - ->setMethods( array( 'block' ) ) |
|
| 142 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 140 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 141 | + ->setMethods(array('block')) |
|
| 142 | + ->setConstructorArgs(array($this->context)) |
|
| 143 | 143 | ->getMock(); |
| 144 | 144 | |
| 145 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 145 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 146 | 146 | |
| 147 | - $orderCntlStub->expects( $this->once() )->method( 'block' ); |
|
| 147 | + $orderCntlStub->expects($this->once())->method('block'); |
|
| 148 | 148 | |
| 149 | 149 | |
| 150 | - $this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 150 | + $this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | public function testUnblock() |
| 155 | 155 | { |
| 156 | 156 | $name = 'ControllerFrontendOrderUnblock'; |
| 157 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 157 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 158 | 158 | |
| 159 | 159 | |
| 160 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 161 | - ->setMethods( array( 'unblock' ) ) |
|
| 162 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 160 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 161 | + ->setMethods(array('unblock')) |
|
| 162 | + ->setConstructorArgs(array($this->context)) |
|
| 163 | 163 | ->getMock(); |
| 164 | 164 | |
| 165 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 165 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 166 | 166 | |
| 167 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
| 167 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
| 168 | 168 | |
| 169 | 169 | |
| 170 | - $this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 170 | + $this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
| 174 | 174 | public function testUpdate() |
| 175 | 175 | { |
| 176 | 176 | $name = 'ControllerFrontendOrderUpdate'; |
| 177 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 177 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 178 | 178 | |
| 179 | 179 | |
| 180 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 181 | - ->setMethods( array( 'update' ) ) |
|
| 182 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 180 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 181 | + ->setMethods(array('update')) |
|
| 182 | + ->setConstructorArgs(array($this->context)) |
|
| 183 | 183 | ->getMock(); |
| 184 | 184 | |
| 185 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 185 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 186 | 186 | |
| 187 | - $orderCntlStub->expects( $this->once() )->method( 'update' ); |
|
| 187 | + $orderCntlStub->expects($this->once())->method('update'); |
|
| 188 | 188 | |
| 189 | 189 | |
| 190 | - $this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 190 | + $this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 191 | 191 | } |
| 192 | 192 | } |