@@ -128,7 +128,7 @@ |
||
| 128 | 128 | /** |
| 129 | 129 | * Returns the frontend controller |
| 130 | 130 | * |
| 131 | - * @return \Aimeos\Controller\Frontend\Attribute\Iface Frontend controller object |
|
| 131 | + * @return \Aimeos\Controller\Frontend\Iface Frontend controller object |
|
| 132 | 132 | */ |
| 133 | 133 | protected function getController() |
| 134 | 134 | { |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
| 31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
| 32 | 32 | */ |
| 33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
| 34 | 34 | { |
| 35 | 35 | $iface = '\Aimeos\Controller\Frontend\Attribute\Iface'; |
| 36 | - if( !( $controller instanceof $iface ) ) |
|
| 36 | + if (!($controller instanceof $iface)) |
|
| 37 | 37 | { |
| 38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
| 39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
| 38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
| 39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $this->context = $context; |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * @return mixed Returns the value of the called method |
| 53 | 53 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
| 54 | 54 | */ |
| 55 | - public function __call( $name, array $param ) |
|
| 55 | + public function __call($name, array $param) |
|
| 56 | 56 | { |
| 57 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
| 57 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 67 | 67 | * @since 2017.03 |
| 68 | 68 | */ |
| 69 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
| 69 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
| 70 | 70 | { |
| 71 | - return $this->controller->addFilterTypes( $filter, $codes ); |
|
| 71 | + return $this->controller->addFilterTypes($filter, $codes); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
| 94 | 94 | * @since 2017.03 |
| 95 | 95 | */ |
| 96 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ) |
|
| 96 | + public function getItem($id, array $domains = array('media', 'price', 'text')) |
|
| 97 | 97 | { |
| 98 | - return $this->controller->getItem( $id, $domains ); |
|
| 98 | + return $this->controller->getItem($id, $domains); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
| 109 | 109 | * @since 2017.03 |
| 110 | 110 | */ |
| 111 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
| 111 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
| 112 | 112 | { |
| 113 | - return $this->controller->searchItems( $filter, $domains, $total ); |
|
| 113 | + return $this->controller->searchItems($filter, $domains, $total); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | /** |
| 141 | 141 | * Returns the frontend controller |
| 142 | 142 | * |
| 143 | - * @return \Aimeos\Controller\Frontend\Stock\Iface Frontend controller object |
|
| 143 | + * @return \Aimeos\Controller\Frontend\Iface Frontend controller object |
|
| 144 | 144 | */ |
| 145 | 145 | protected function getController() |
| 146 | 146 | { |
@@ -237,6 +237,9 @@ |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| 240 | + /** |
|
| 241 | + * @param string $name |
|
| 242 | + */ |
|
| 240 | 243 | protected function access( $name ) |
| 241 | 244 | { |
| 242 | 245 | $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ); |
@@ -20,228 +20,228 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\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 testCreateManager() |
| 40 | 40 | { |
| 41 | - $catalogManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' ); |
|
| 41 | + $catalogManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog'); |
|
| 42 | 42 | |
| 43 | - $this->stub->expects( $this->once() )->method( 'createManager' ) |
|
| 44 | - ->will( $this->returnValue( $catalogManager ) ); |
|
| 43 | + $this->stub->expects($this->once())->method('createManager') |
|
| 44 | + ->will($this->returnValue($catalogManager)); |
|
| 45 | 45 | |
| 46 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'catalog' ) ); |
|
| 46 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager('catalog')); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testCreateFilter() |
| 51 | 51 | { |
| 52 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch(); |
|
| 52 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch(); |
|
| 53 | 53 | |
| 54 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
| 55 | - ->will( $this->returnValue( $search ) ); |
|
| 54 | + $this->stub->expects($this->once())->method('createFilter') |
|
| 55 | + ->will($this->returnValue($search)); |
|
| 56 | 56 | |
| 57 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 57 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testGetPath() |
| 62 | 62 | { |
| 63 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch(); |
|
| 63 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch(); |
|
| 64 | 64 | |
| 65 | - $this->stub->expects( $this->once() )->method( 'getPath' ) |
|
| 66 | - ->will( $this->returnValue( [] ) ); |
|
| 65 | + $this->stub->expects($this->once())->method('getPath') |
|
| 66 | + ->will($this->returnValue([])); |
|
| 67 | 67 | |
| 68 | - $this->assertEquals( [], $this->object->getPath( -1 ) ); |
|
| 68 | + $this->assertEquals([], $this->object->getPath( -1 )); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | public function testGetTree() |
| 73 | 73 | { |
| 74 | - $catItem = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createItem(); |
|
| 74 | + $catItem = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createItem(); |
|
| 75 | 75 | |
| 76 | - $this->stub->expects( $this->once() )->method( 'getTree' ) |
|
| 77 | - ->will( $this->returnValue( $catItem ) ); |
|
| 76 | + $this->stub->expects($this->once())->method('getTree') |
|
| 77 | + ->will($this->returnValue($catItem)); |
|
| 78 | 78 | |
| 79 | - $this->assertInstanceOf( '\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree() ); |
|
| 79 | + $this->assertInstanceOf('\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree()); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | public function testCreateCatalogFilter() |
| 84 | 84 | { |
| 85 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch(); |
|
| 85 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch(); |
|
| 86 | 86 | |
| 87 | - $this->stub->expects( $this->once() )->method( 'createCatalogFilter' ) |
|
| 88 | - ->will( $this->returnValue( $search ) ); |
|
| 87 | + $this->stub->expects($this->once())->method('createCatalogFilter') |
|
| 88 | + ->will($this->returnValue($search)); |
|
| 89 | 89 | |
| 90 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createCatalogFilter() ); |
|
| 90 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createCatalogFilter()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | public function testGetCatalogPath() |
| 95 | 95 | { |
| 96 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch(); |
|
| 96 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch(); |
|
| 97 | 97 | |
| 98 | - $this->stub->expects( $this->once() )->method( 'getCatalogPath' ) |
|
| 99 | - ->will( $this->returnValue( [] ) ); |
|
| 98 | + $this->stub->expects($this->once())->method('getCatalogPath') |
|
| 99 | + ->will($this->returnValue([])); |
|
| 100 | 100 | |
| 101 | - $this->assertEquals( [], $this->object->getCatalogPath( -1 ) ); |
|
| 101 | + $this->assertEquals([], $this->object->getCatalogPath( -1 )); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | public function testGetCatalogTree() |
| 106 | 106 | { |
| 107 | - $catItem = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createItem(); |
|
| 107 | + $catItem = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createItem(); |
|
| 108 | 108 | |
| 109 | - $this->stub->expects( $this->once() )->method( 'getCatalogTree' ) |
|
| 110 | - ->will( $this->returnValue( $catItem ) ); |
|
| 109 | + $this->stub->expects($this->once())->method('getCatalogTree') |
|
| 110 | + ->will($this->returnValue($catItem)); |
|
| 111 | 111 | |
| 112 | - $this->assertInstanceOf( '\Aimeos\MShop\Catalog\Item\Iface', $this->object->getCatalogTree() ); |
|
| 112 | + $this->assertInstanceOf('\Aimeos\MShop\Catalog\Item\Iface', $this->object->getCatalogTree()); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | public function testAggregateIndex() |
| 117 | 117 | { |
| 118 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 118 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 119 | 119 | |
| 120 | - $this->stub->expects( $this->once() )->method( 'aggregateIndex' ) |
|
| 121 | - ->will( $this->returnValue( [] ) ); |
|
| 120 | + $this->stub->expects($this->once())->method('aggregateIndex') |
|
| 121 | + ->will($this->returnValue([])); |
|
| 122 | 122 | |
| 123 | - $this->assertEquals( [], $this->object->aggregateIndex( $search, 'test' ) ); |
|
| 123 | + $this->assertEquals([], $this->object->aggregateIndex($search, 'test')); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testAddIndexFilterCategory() |
| 128 | 128 | { |
| 129 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 129 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 130 | 130 | |
| 131 | - $this->stub->expects( $this->once() )->method( 'addIndexFilterCategory' ) |
|
| 132 | - ->will( $this->returnArgument( 0 ) ); |
|
| 131 | + $this->stub->expects($this->once())->method('addIndexFilterCategory') |
|
| 132 | + ->will($this->returnArgument(0)); |
|
| 133 | 133 | |
| 134 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterCategory( $search, -1 ) ); |
|
| 134 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterCategory($search, -1)); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| 138 | 138 | public function testAddIndexFilterText() |
| 139 | 139 | { |
| 140 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 140 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 141 | 141 | |
| 142 | - $this->stub->expects( $this->once() )->method( 'addIndexFilterText' ) |
|
| 143 | - ->will( $this->returnArgument( 0 ) ); |
|
| 142 | + $this->stub->expects($this->once())->method('addIndexFilterText') |
|
| 143 | + ->will($this->returnArgument(0)); |
|
| 144 | 144 | |
| 145 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterText( $search, 'test' ) ); |
|
| 145 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterText($search, 'test')); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | public function testCreateIndexFilter() |
| 150 | 150 | { |
| 151 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 151 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 152 | 152 | |
| 153 | - $this->stub->expects( $this->once() )->method( 'createIndexFilter' ) |
|
| 154 | - ->will( $this->returnValue( $search ) ); |
|
| 153 | + $this->stub->expects($this->once())->method('createIndexFilter') |
|
| 154 | + ->will($this->returnValue($search)); |
|
| 155 | 155 | |
| 156 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilter() ); |
|
| 156 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilter()); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | public function testCreateIndexFilterCategory() |
| 161 | 161 | { |
| 162 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 162 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 163 | 163 | |
| 164 | - $this->stub->expects( $this->once() )->method( 'createIndexFilterCategory' ) |
|
| 165 | - ->will( $this->returnValue( $search ) ); |
|
| 164 | + $this->stub->expects($this->once())->method('createIndexFilterCategory') |
|
| 165 | + ->will($this->returnValue($search)); |
|
| 166 | 166 | |
| 167 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterCategory( -1 ) ); |
|
| 167 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterCategory( -1 )); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | public function testCreateIndexFilterText() |
| 172 | 172 | { |
| 173 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 173 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 174 | 174 | |
| 175 | - $this->stub->expects( $this->once() )->method( 'createIndexFilterText' ) |
|
| 176 | - ->will( $this->returnValue( $search ) ); |
|
| 175 | + $this->stub->expects($this->once())->method('createIndexFilterText') |
|
| 176 | + ->will($this->returnValue($search)); |
|
| 177 | 177 | |
| 178 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterText( 'test' ) ); |
|
| 178 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterText('test')); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | 182 | public function testGetIndexItems() |
| 183 | 183 | { |
| 184 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 184 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 185 | 185 | |
| 186 | - $this->stub->expects( $this->once() )->method( 'getIndexItems' ) |
|
| 187 | - ->will( $this->returnValue( [] ) ); |
|
| 186 | + $this->stub->expects($this->once())->method('getIndexItems') |
|
| 187 | + ->will($this->returnValue([])); |
|
| 188 | 188 | |
| 189 | - $this->assertEquals( [], $this->object->getIndexItems( $search ) ); |
|
| 189 | + $this->assertEquals([], $this->object->getIndexItems($search)); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| 193 | 193 | public function testGetProductItems() |
| 194 | 194 | { |
| 195 | - $this->stub->expects( $this->once() )->method( 'getProductItems' ) |
|
| 196 | - ->will( $this->returnValue( [] ) ); |
|
| 195 | + $this->stub->expects($this->once())->method('getProductItems') |
|
| 196 | + ->will($this->returnValue([])); |
|
| 197 | 197 | |
| 198 | - $this->assertEquals( [], $this->object->getProductItems( [-1] ) ); |
|
| 198 | + $this->assertEquals([], $this->object->getProductItems([-1])); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | public function testCreateTextFilter() |
| 203 | 203 | { |
| 204 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 204 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 205 | 205 | |
| 206 | - $this->stub->expects( $this->once() )->method( 'createTextFilter' ) |
|
| 207 | - ->will( $this->returnValue( $search ) ); |
|
| 206 | + $this->stub->expects($this->once())->method('createTextFilter') |
|
| 207 | + ->will($this->returnValue($search)); |
|
| 208 | 208 | |
| 209 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createTextFilter( 'test' ) ); |
|
| 209 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createTextFilter('test')); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | public function testGetTextList() |
| 214 | 214 | { |
| 215 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 215 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 216 | 216 | |
| 217 | - $this->stub->expects( $this->once() )->method( 'getTextList' ) |
|
| 218 | - ->will( $this->returnValue( [] ) ); |
|
| 217 | + $this->stub->expects($this->once())->method('getTextList') |
|
| 218 | + ->will($this->returnValue([])); |
|
| 219 | 219 | |
| 220 | - $this->assertEquals( [], $this->object->getTextList( $search ) ); |
|
| 220 | + $this->assertEquals([], $this->object->getTextList($search)); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | public function testGetController() |
| 225 | 225 | { |
| 226 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 226 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 227 | 227 | |
| 228 | - $this->assertSame( $this->stub, $result ); |
|
| 228 | + $this->assertSame($this->stub, $result); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| 232 | 232 | public function testGetContext() |
| 233 | 233 | { |
| 234 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 234 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 235 | 235 | |
| 236 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 236 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| 240 | - protected function access( $name ) |
|
| 240 | + protected function access($name) |
|
| 241 | 241 | { |
| 242 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ); |
|
| 243 | - $method = $class->getMethod( $name ); |
|
| 244 | - $method->setAccessible( true ); |
|
| 242 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Catalog\Decorator\Base'); |
|
| 243 | + $method = $class->getMethod($name); |
|
| 244 | + $method->setAccessible(true); |
|
| 245 | 245 | |
| 246 | 246 | return $method; |
| 247 | 247 | } |
@@ -20,85 +20,85 @@ |
||
| 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 testStore() |
| 40 | 40 | { |
| 41 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 42 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 41 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 42 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 43 | 43 | |
| 44 | - $this->stub->expects( $this->once() )->method( 'store' ) |
|
| 45 | - ->will( $this->returnValue( $orderItem ) ); |
|
| 44 | + $this->stub->expects($this->once())->method('store') |
|
| 45 | + ->will($this->returnValue($orderItem)); |
|
| 46 | 46 | |
| 47 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->store( $basket ) ); |
|
| 47 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->store($basket)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testBlock() |
| 52 | 52 | { |
| 53 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 53 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 54 | 54 | |
| 55 | - $this->stub->expects( $this->once() )->method( 'block' ); |
|
| 55 | + $this->stub->expects($this->once())->method('block'); |
|
| 56 | 56 | |
| 57 | - $this->object->block( $orderItem ); |
|
| 57 | + $this->object->block($orderItem); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testUnblock() |
| 62 | 62 | { |
| 63 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 63 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 64 | 64 | |
| 65 | - $this->stub->expects( $this->once() )->method( 'unblock' ); |
|
| 65 | + $this->stub->expects($this->once())->method('unblock'); |
|
| 66 | 66 | |
| 67 | - $this->object->unblock( $orderItem ); |
|
| 67 | + $this->object->unblock($orderItem); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | public function testUpdate() |
| 72 | 72 | { |
| 73 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 73 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 74 | 74 | |
| 75 | - $this->stub->expects( $this->once() )->method( 'update' ); |
|
| 75 | + $this->stub->expects($this->once())->method('update'); |
|
| 76 | 76 | |
| 77 | - $this->object->update( $orderItem ); |
|
| 77 | + $this->object->update($orderItem); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | public function testGetController() |
| 82 | 82 | { |
| 83 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 83 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 84 | 84 | |
| 85 | - $this->assertSame( $this->stub, $result ); |
|
| 85 | + $this->assertSame($this->stub, $result); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function testGetContext() |
| 90 | 90 | { |
| 91 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 91 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 92 | 92 | |
| 93 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 93 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | - protected function access( $name ) |
|
| 97 | + protected function access($name) |
|
| 98 | 98 | { |
| 99 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ); |
|
| 100 | - $method = $class->getMethod( $name ); |
|
| 101 | - $method->setAccessible( true ); |
|
| 99 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Order\Decorator\Base'); |
|
| 100 | + $method = $class->getMethod($name); |
|
| 101 | + $method->setAccessible(true); |
|
| 102 | 102 | |
| 103 | 103 | return $method; |
| 104 | 104 | } |
@@ -20,78 +20,78 @@ |
||
| 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 testGetServices() |
| 40 | 40 | { |
| 41 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 41 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 42 | 42 | |
| 43 | - $this->stub->expects( $this->once() )->method( 'getServices' ) |
|
| 44 | - ->will( $this->returnValue( [] ) ); |
|
| 43 | + $this->stub->expects($this->once())->method('getServices') |
|
| 44 | + ->will($this->returnValue([])); |
|
| 45 | 45 | |
| 46 | - $this->assertEquals( [], $this->object->getServices( 'payment', $basket ) ); |
|
| 46 | + $this->assertEquals([], $this->object->getServices('payment', $basket)); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testGetServiceAttributes() |
| 51 | 51 | { |
| 52 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 52 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 53 | 53 | |
| 54 | - $this->stub->expects( $this->once() )->method( 'getServiceAttributes' ) |
|
| 55 | - ->will( $this->returnValue( [] ) ); |
|
| 54 | + $this->stub->expects($this->once())->method('getServiceAttributes') |
|
| 55 | + ->will($this->returnValue([])); |
|
| 56 | 56 | |
| 57 | - $this->assertEquals( [], $this->object->getServiceAttributes( 'payment', -1, $basket ) ); |
|
| 57 | + $this->assertEquals([], $this->object->getServiceAttributes('payment', -1, $basket)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testGetServicePrice() |
| 62 | 62 | { |
| 63 | - $priceItem = \Aimeos\MShop\Factory::createManager( $this->context, 'price' )->createItem(); |
|
| 64 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
| 63 | + $priceItem = \Aimeos\MShop\Factory::createManager($this->context, 'price')->createItem(); |
|
| 64 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
| 65 | 65 | |
| 66 | - $this->stub->expects( $this->once() )->method( 'getServicePrice' ) |
|
| 67 | - ->will( $this->returnValue( $priceItem ) ); |
|
| 66 | + $this->stub->expects($this->once())->method('getServicePrice') |
|
| 67 | + ->will($this->returnValue($priceItem)); |
|
| 68 | 68 | |
| 69 | - $this->assertInstanceOf( '\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice( 'payment', -1, $basket ) ); |
|
| 69 | + $this->assertInstanceOf('\Aimeos\MShop\Price\Item\Iface', $this->object->getServicePrice('payment', -1, $basket)); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | public function testCheckServiceAttributes() |
| 74 | 74 | { |
| 75 | - $this->stub->expects( $this->once() )->method( 'checkServiceAttributes' ) |
|
| 76 | - ->will( $this->returnValue( [] ) ); |
|
| 75 | + $this->stub->expects($this->once())->method('checkServiceAttributes') |
|
| 76 | + ->will($this->returnValue([])); |
|
| 77 | 77 | |
| 78 | - $this->assertEquals( [], $this->object->checkServiceAttributes( 'payment', -1, [] ) ); |
|
| 78 | + $this->assertEquals([], $this->object->checkServiceAttributes('payment', -1, [])); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | public function testGetContext() |
| 83 | 83 | { |
| 84 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 84 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 85 | 85 | |
| 86 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 86 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | - protected function access( $name ) |
|
| 90 | + protected function access($name) |
|
| 91 | 91 | { |
| 92 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ); |
|
| 93 | - $method = $class->getMethod( $name ); |
|
| 94 | - $method->setAccessible( true ); |
|
| 92 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Service\Decorator\Base'); |
|
| 93 | + $method = $class->getMethod($name); |
|
| 94 | + $method->setAccessible(true); |
|
| 95 | 95 | |
| 96 | 96 | return $method; |
| 97 | 97 | } |
@@ -20,90 +20,90 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\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 testAddFilterCodes() |
| 40 | 40 | { |
| 41 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch(); |
|
| 41 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch(); |
|
| 42 | 42 | |
| 43 | - $this->stub->expects( $this->once() )->method( 'addFilterCodes' ) |
|
| 44 | - ->will( $this->returnArgument( 0 ) ); |
|
| 43 | + $this->stub->expects($this->once())->method('addFilterCodes') |
|
| 44 | + ->will($this->returnArgument(0)); |
|
| 45 | 45 | |
| 46 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterCodes( $search, [] ) ); |
|
| 46 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterCodes($search, [])); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testAddFilterTypes() |
| 51 | 51 | { |
| 52 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch(); |
|
| 52 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch(); |
|
| 53 | 53 | |
| 54 | - $this->stub->expects( $this->once() )->method( 'addFilterTypes' ) |
|
| 55 | - ->will( $this->returnArgument( 0 ) ); |
|
| 54 | + $this->stub->expects($this->once())->method('addFilterTypes') |
|
| 55 | + ->will($this->returnArgument(0)); |
|
| 56 | 56 | |
| 57 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes( $search, [] ) ); |
|
| 57 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes($search, [])); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testCreateFilter() |
| 62 | 62 | { |
| 63 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch(); |
|
| 63 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch(); |
|
| 64 | 64 | |
| 65 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
| 66 | - ->will( $this->returnValue( $search ) ); |
|
| 65 | + $this->stub->expects($this->once())->method('createFilter') |
|
| 66 | + ->will($this->returnValue($search)); |
|
| 67 | 67 | |
| 68 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 68 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | public function testGetItem() |
| 73 | 73 | { |
| 74 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createItem(); |
|
| 74 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createItem(); |
|
| 75 | 75 | |
| 76 | - $this->stub->expects( $this->once() )->method( 'getItem' ) |
|
| 77 | - ->will( $this->returnValue( $item ) ); |
|
| 76 | + $this->stub->expects($this->once())->method('getItem') |
|
| 77 | + ->will($this->returnValue($item)); |
|
| 78 | 78 | |
| 79 | - $this->assertInstanceOf( '\Aimeos\MShop\Stock\Item\Iface', $this->object->getItem( -1 ) ); |
|
| 79 | + $this->assertInstanceOf('\Aimeos\MShop\Stock\Item\Iface', $this->object->getItem( -1 )); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | public function testSearchItems() |
| 84 | 84 | { |
| 85 | - $filter = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch(); |
|
| 85 | + $filter = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch(); |
|
| 86 | 86 | |
| 87 | - $this->stub->expects( $this->once() )->method( 'searchItems' ) |
|
| 88 | - ->will( $this->returnValue( [] ) ); |
|
| 87 | + $this->stub->expects($this->once())->method('searchItems') |
|
| 88 | + ->will($this->returnValue([])); |
|
| 89 | 89 | |
| 90 | - $this->assertEquals( [], $this->object->searchItems( $filter ) ); |
|
| 90 | + $this->assertEquals([], $this->object->searchItems($filter)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | public function testGetContext() |
| 95 | 95 | { |
| 96 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 96 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 97 | 97 | |
| 98 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 98 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | - protected function access( $name ) |
|
| 102 | + protected function access($name) |
|
| 103 | 103 | { |
| 104 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' ); |
|
| 105 | - $method = $class->getMethod( $name ); |
|
| 106 | - $method->setAccessible( true ); |
|
| 104 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Stock\Decorator\Base'); |
|
| 105 | + $method = $class->getMethod($name); |
|
| 106 | + $method->setAccessible(true); |
|
| 107 | 107 | |
| 108 | 108 | return $method; |
| 109 | 109 | } |
@@ -20,121 +20,121 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\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 testAddFilterAttribute() |
| 40 | 40 | { |
| 41 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 41 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 42 | 42 | |
| 43 | - $this->stub->expects( $this->once() )->method( 'addFilterAttribute' ) |
|
| 44 | - ->will( $this->returnArgument( 0 ) ); |
|
| 43 | + $this->stub->expects($this->once())->method('addFilterAttribute') |
|
| 44 | + ->will($this->returnArgument(0)); |
|
| 45 | 45 | |
| 46 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute( $search, [], [], [] ) ); |
|
| 46 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute($search, [], [], [])); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testAddFilterCategory() |
| 51 | 51 | { |
| 52 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 52 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 53 | 53 | |
| 54 | - $this->stub->expects( $this->once() )->method( 'addFilterCategory' ) |
|
| 55 | - ->will( $this->returnArgument( 0 ) ); |
|
| 54 | + $this->stub->expects($this->once())->method('addFilterCategory') |
|
| 55 | + ->will($this->returnArgument(0)); |
|
| 56 | 56 | |
| 57 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory( $search, -1 ) ); |
|
| 57 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory($search, -1)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testAddFilterText() |
| 62 | 62 | { |
| 63 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 63 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 64 | 64 | |
| 65 | - $this->stub->expects( $this->once() )->method( 'addFilterText' ) |
|
| 66 | - ->will( $this->returnArgument( 0 ) ); |
|
| 65 | + $this->stub->expects($this->once())->method('addFilterText') |
|
| 66 | + ->will($this->returnArgument(0)); |
|
| 67 | 67 | |
| 68 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterText( $search, 'test' ) ); |
|
| 68 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterText($search, 'test')); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | public function testAggregate() |
| 73 | 73 | { |
| 74 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 74 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 75 | 75 | |
| 76 | - $this->stub->expects( $this->once() )->method( 'aggregate' ) |
|
| 77 | - ->will( $this->returnValue( [] ) ); |
|
| 76 | + $this->stub->expects($this->once())->method('aggregate') |
|
| 77 | + ->will($this->returnValue([])); |
|
| 78 | 78 | |
| 79 | - $this->assertEquals( [], $this->object->aggregate( $search, 'test' ) ); |
|
| 79 | + $this->assertEquals([], $this->object->aggregate($search, 'test')); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | public function testCreateFilter() |
| 84 | 84 | { |
| 85 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 85 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 86 | 86 | |
| 87 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
| 88 | - ->will( $this->returnValue( $search ) ); |
|
| 87 | + $this->stub->expects($this->once())->method('createFilter') |
|
| 88 | + ->will($this->returnValue($search)); |
|
| 89 | 89 | |
| 90 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 90 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | public function testGetItem() |
| 95 | 95 | { |
| 96 | - $prodItem = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createItem(); |
|
| 96 | + $prodItem = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createItem(); |
|
| 97 | 97 | |
| 98 | - $this->stub->expects( $this->once() )->method( 'getItem' ) |
|
| 99 | - ->will( $this->returnValue( $prodItem ) ); |
|
| 98 | + $this->stub->expects($this->once())->method('getItem') |
|
| 99 | + ->will($this->returnValue($prodItem)); |
|
| 100 | 100 | |
| 101 | - $this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 ) ); |
|
| 101 | + $this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 )); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | public function testGetItems() |
| 106 | 106 | { |
| 107 | - $this->stub->expects( $this->once() )->method( 'getItems' ) |
|
| 108 | - ->will( $this->returnValue( [] ) ); |
|
| 107 | + $this->stub->expects($this->once())->method('getItems') |
|
| 108 | + ->will($this->returnValue([])); |
|
| 109 | 109 | |
| 110 | - $this->assertEquals( [], $this->object->getItems( [-1] ) ); |
|
| 110 | + $this->assertEquals([], $this->object->getItems([-1])); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | public function testSearchItems() |
| 115 | 115 | { |
| 116 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
| 116 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
| 117 | 117 | |
| 118 | - $this->stub->expects( $this->once() )->method( 'searchItems' ) |
|
| 119 | - ->will( $this->returnValue( [] ) ); |
|
| 118 | + $this->stub->expects($this->once())->method('searchItems') |
|
| 119 | + ->will($this->returnValue([])); |
|
| 120 | 120 | |
| 121 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
| 121 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | public function testGetContext() |
| 126 | 126 | { |
| 127 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 127 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 128 | 128 | |
| 129 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 129 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | - protected function access( $name ) |
|
| 133 | + protected function access($name) |
|
| 134 | 134 | { |
| 135 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ); |
|
| 136 | - $method = $class->getMethod( $name ); |
|
| 137 | - $method->setAccessible( true ); |
|
| 135 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Product\Decorator\Base'); |
|
| 136 | + $method = $class->getMethod($name); |
|
| 137 | + $method->setAccessible(true); |
|
| 138 | 138 | |
| 139 | 139 | return $method; |
| 140 | 140 | } |
@@ -19,25 +19,25 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $context = \TestHelperFrontend::getContext(); |
| 21 | 21 | |
| 22 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
|
| 22 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
| 23 | 23 | ->disableOriginalConstructor() |
| 24 | 24 | ->getMock(); |
| 25 | 25 | |
| 26 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Decorator\Base' ) |
|
| 27 | - ->setConstructorArgs( [$this->stub, $context] ) |
|
| 26 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Decorator\Base') |
|
| 27 | + ->setConstructorArgs([$this->stub, $context]) |
|
| 28 | 28 | ->getMockForAbstractClass(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | protected function tearDown() |
| 33 | 33 | { |
| 34 | - unset( $this->object, $this->stub ); |
|
| 34 | + unset($this->object, $this->stub); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testClear() |
| 39 | 39 | { |
| 40 | - $this->stub->expects( $this->once() )->method( 'clear' ); |
|
| 40 | + $this->stub->expects($this->once())->method('clear'); |
|
| 41 | 41 | |
| 42 | 42 | $this->object->clear(); |
| 43 | 43 | } |
@@ -46,18 +46,18 @@ discard block |
||
| 46 | 46 | public function testGet() |
| 47 | 47 | { |
| 48 | 48 | $context = \TestHelperFrontend::getContext(); |
| 49 | - $order = \Aimeos\MShop\Factory::createManager( $context, 'order/base' )->createItem(); |
|
| 49 | + $order = \Aimeos\MShop\Factory::createManager($context, 'order/base')->createItem(); |
|
| 50 | 50 | |
| 51 | - $this->stub->expects( $this->once() )->method( 'get' ) |
|
| 52 | - ->will( $this->returnValue( $order ) ); |
|
| 51 | + $this->stub->expects($this->once())->method('get') |
|
| 52 | + ->will($this->returnValue($order)); |
|
| 53 | 53 | |
| 54 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Base\Iface', $this->object->get() ); |
|
| 54 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Base\Iface', $this->object->get()); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | public function testSave() |
| 59 | 59 | { |
| 60 | - $this->stub->expects( $this->once() )->method( 'save' ); |
|
| 60 | + $this->stub->expects($this->once())->method('save'); |
|
| 61 | 61 | |
| 62 | 62 | $this->object->save(); |
| 63 | 63 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function testAddProduct() |
| 67 | 67 | { |
| 68 | - $this->stub->expects( $this->once() )->method( 'addProduct' ); |
|
| 68 | + $this->stub->expects($this->once())->method('addProduct'); |
|
| 69 | 69 | |
| 70 | 70 | $this->object->addProduct( -1 ); |
| 71 | 71 | } |
@@ -73,73 +73,73 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function testDeleteProduct() |
| 75 | 75 | { |
| 76 | - $this->stub->expects( $this->once() )->method( 'deleteProduct' ); |
|
| 76 | + $this->stub->expects($this->once())->method('deleteProduct'); |
|
| 77 | 77 | |
| 78 | - $this->object->deleteProduct( 0 ); |
|
| 78 | + $this->object->deleteProduct(0); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | public function testEditProduct() |
| 83 | 83 | { |
| 84 | - $this->stub->expects( $this->once() )->method( 'editProduct' ); |
|
| 84 | + $this->stub->expects($this->once())->method('editProduct'); |
|
| 85 | 85 | |
| 86 | - $this->object->editProduct( 0, 1 ); |
|
| 86 | + $this->object->editProduct(0, 1); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | public function testAddCoupon() |
| 91 | 91 | { |
| 92 | - $this->stub->expects( $this->once() )->method( 'addCoupon' ); |
|
| 92 | + $this->stub->expects($this->once())->method('addCoupon'); |
|
| 93 | 93 | |
| 94 | - $this->object->addCoupon( 'test' ); |
|
| 94 | + $this->object->addCoupon('test'); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | public function testDeleteCoupon() |
| 99 | 99 | { |
| 100 | - $this->stub->expects( $this->once() )->method( 'deleteCoupon' ); |
|
| 100 | + $this->stub->expects($this->once())->method('deleteCoupon'); |
|
| 101 | 101 | |
| 102 | - $this->object->deleteCoupon( 'test' ); |
|
| 102 | + $this->object->deleteCoupon('test'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | public function testSetAddress() |
| 107 | 107 | { |
| 108 | - $this->stub->expects( $this->once() )->method( 'setAddress' ); |
|
| 108 | + $this->stub->expects($this->once())->method('setAddress'); |
|
| 109 | 109 | |
| 110 | - $this->object->setAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT, null ); |
|
| 110 | + $this->object->setAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT, null); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | public function testSetService() |
| 115 | 115 | { |
| 116 | - $this->stub->expects( $this->once() )->method( 'setService' ); |
|
| 116 | + $this->stub->expects($this->once())->method('setService'); |
|
| 117 | 117 | |
| 118 | - $this->object->setService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT, -1 ); |
|
| 118 | + $this->object->setService(\Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT, -1); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | public function testGetController() |
| 123 | 123 | { |
| 124 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 124 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 125 | 125 | |
| 126 | - $this->assertSame( $this->stub, $result ); |
|
| 126 | + $this->assertSame($this->stub, $result); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
| 130 | 130 | public function testGetContext() |
| 131 | 131 | { |
| 132 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 132 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 133 | 133 | |
| 134 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 134 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| 138 | - protected function access( $name ) |
|
| 138 | + protected function access($name) |
|
| 139 | 139 | { |
| 140 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Basket\Decorator\Base' ); |
|
| 141 | - $method = $class->getMethod( $name ); |
|
| 142 | - $method->setAccessible( true ); |
|
| 140 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Basket\Decorator\Base'); |
|
| 141 | + $method = $class->getMethod($name); |
|
| 142 | + $method->setAccessible(true); |
|
| 143 | 143 | |
| 144 | 144 | return $method; |
| 145 | 145 | } |
@@ -15,31 +15,31 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface'; |
| 17 | 17 | |
| 18 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext() ); |
|
| 19 | - $this->assertInstanceOf( $target, $controller ); |
|
| 18 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext()); |
|
| 19 | + $this->assertInstanceOf($target, $controller); |
|
| 20 | 20 | |
| 21 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
| 22 | - $this->assertInstanceOf( $target, $controller ); |
|
| 21 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
| 22 | + $this->assertInstanceOf($target, $controller); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | public function testCreateControllerInvalidImplementation() |
| 27 | 27 | { |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
| 28 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
| 29 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testCreateControllerInvalidName() |
| 34 | 34 | { |
| 35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
| 36 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
| 35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
| 36 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testCreateControllerNotExisting() |
| 41 | 41 | { |
| 42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
| 43 | - \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
| 42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
| 43 | + \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
| 44 | 44 | } |
| 45 | 45 | } |