@@ -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 | } |
@@ -20,79 +20,79 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Attribute\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Attribute\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Attribute\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Attribute\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 testAddFilterTypes() |
| 40 | 40 | { |
| 41 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' )->createSearch(); |
|
| 41 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'attribute')->createSearch(); |
|
| 42 | 42 | |
| 43 | - $this->stub->expects( $this->once() )->method( 'addFilterTypes' ) |
|
| 44 | - ->will( $this->returnArgument( 0 ) ); |
|
| 43 | + $this->stub->expects($this->once())->method('addFilterTypes') |
|
| 44 | + ->will($this->returnArgument(0)); |
|
| 45 | 45 | |
| 46 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes( $search, [] ) ); |
|
| 46 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes($search, [])); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testCreateFilter() |
| 51 | 51 | { |
| 52 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' )->createSearch(); |
|
| 52 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'attribute')->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 testGetItem() |
| 62 | 62 | { |
| 63 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' )->createItem(); |
|
| 63 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'attribute')->createItem(); |
|
| 64 | 64 | |
| 65 | - $this->stub->expects( $this->once() )->method( 'getItem' ) |
|
| 66 | - ->will( $this->returnValue( $item ) ); |
|
| 65 | + $this->stub->expects($this->once())->method('getItem') |
|
| 66 | + ->will($this->returnValue($item)); |
|
| 67 | 67 | |
| 68 | - $this->assertInstanceOf( '\Aimeos\MShop\Attribute\Item\Iface', $this->object->getItem( -1 ) ); |
|
| 68 | + $this->assertInstanceOf('\Aimeos\MShop\Attribute\Item\Iface', $this->object->getItem( -1 )); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | public function testSearchItems() |
| 73 | 73 | { |
| 74 | - $filter = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' )->createSearch(); |
|
| 74 | + $filter = \Aimeos\MShop\Factory::createManager($this->context, 'attribute')->createSearch(); |
|
| 75 | 75 | |
| 76 | - $this->stub->expects( $this->once() )->method( 'searchItems' ) |
|
| 77 | - ->will( $this->returnValue( [] ) ); |
|
| 76 | + $this->stub->expects($this->once())->method('searchItems') |
|
| 77 | + ->will($this->returnValue([])); |
|
| 78 | 78 | |
| 79 | - $this->assertEquals( [], $this->object->searchItems( $filter, ['media'] ) ); |
|
| 79 | + $this->assertEquals([], $this->object->searchItems($filter, ['media'])); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | public function testGetContext() |
| 84 | 84 | { |
| 85 | - $result = $this->access( 'getContext' )->invokeArgs( $this->object, [] ); |
|
| 85 | + $result = $this->access('getContext')->invokeArgs($this->object, []); |
|
| 86 | 86 | |
| 87 | - $this->assertInstanceOf( '\Aimeos\MShop\Context\Item\Iface', $result ); |
|
| 87 | + $this->assertInstanceOf('\Aimeos\MShop\Context\Item\Iface', $result); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | - protected function access( $name ) |
|
| 91 | + protected function access($name) |
|
| 92 | 92 | { |
| 93 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Attribute\Decorator\Base' ); |
|
| 94 | - $method = $class->getMethod( $name ); |
|
| 95 | - $method->setAccessible( true ); |
|
| 93 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Attribute\Decorator\Base'); |
|
| 94 | + $method = $class->getMethod($name); |
|
| 95 | + $method->setAccessible(true); |
|
| 96 | 96 | |
| 97 | 97 | return $method; |
| 98 | 98 | } |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | - $this->object = new \Aimeos\Controller\Frontend\Attribute\Standard( \TestHelperFrontend::getContext() ); |
|
| 19 | + $this->object = new \Aimeos\Controller\Frontend\Attribute\Standard(\TestHelperFrontend::getContext()); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | protected function tearDown() |
| 24 | 24 | { |
| 25 | - unset( $this->object ); |
|
| 25 | + unset($this->object); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,51 +30,51 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $filter = $this->object->createFilter(); |
| 32 | 32 | |
| 33 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $filter ); |
|
| 34 | - $this->assertEquals( 1, count( $filter->getSortations() ) ); |
|
| 35 | - $this->assertEquals( 0, $filter->getSliceStart() ); |
|
| 36 | - $this->assertEquals( 100, $filter->getSliceSize() ); |
|
| 33 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $filter); |
|
| 34 | + $this->assertEquals(1, count($filter->getSortations())); |
|
| 35 | + $this->assertEquals(0, $filter->getSliceStart()); |
|
| 36 | + $this->assertEquals(100, $filter->getSliceSize()); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testAddFilterTypes() |
| 41 | 41 | { |
| 42 | 42 | $filter = $this->object->createFilter(); |
| 43 | - $filter = $this->object->addFilterTypes( $filter, ['size'] ); |
|
| 43 | + $filter = $this->object->addFilterTypes($filter, ['size']); |
|
| 44 | 44 | |
| 45 | 45 | $list = $filter->getConditions()->getExpressions(); |
| 46 | 46 | |
| 47 | - if( !isset( $list[0] ) || !( $list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) ) { |
|
| 48 | - throw new \RuntimeException( 'Wrong expression' ); |
|
| 47 | + if (!isset($list[0]) || !($list[0] instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface)) { |
|
| 48 | + throw new \RuntimeException('Wrong expression'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $this->assertEquals( 'attribute.type.code', $list[0]->getName() ); |
|
| 52 | - $this->assertEquals( 1, count( $list[0]->getValue() ) ); |
|
| 51 | + $this->assertEquals('attribute.type.code', $list[0]->getName()); |
|
| 52 | + $this->assertEquals(1, count($list[0]->getValue())); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public function testGetItem() |
| 57 | 57 | { |
| 58 | 58 | $context = \TestHelperFrontend::getContext(); |
| 59 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'attribute' ); |
|
| 60 | - $id = $manager->findItem( 'xs', [], 'product', 'size' )->getId(); |
|
| 59 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'attribute'); |
|
| 60 | + $id = $manager->findItem('xs', [], 'product', 'size')->getId(); |
|
| 61 | 61 | |
| 62 | - $result = $this->object->getItem( $id, ['text'] ); |
|
| 62 | + $result = $this->object->getItem($id, ['text']); |
|
| 63 | 63 | |
| 64 | - $this->assertInstanceOf( '\Aimeos\MShop\Attribute\Item\Iface', $result ); |
|
| 65 | - $this->assertEquals( 3, count( $result->getRefItems( 'text' ) ) ); |
|
| 64 | + $this->assertInstanceOf('\Aimeos\MShop\Attribute\Item\Iface', $result); |
|
| 65 | + $this->assertEquals(3, count($result->getRefItems('text'))); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testSearchItems() |
| 70 | 70 | { |
| 71 | 71 | $filter = $this->object->createFilter(); |
| 72 | - $filter = $this->object->addFilterTypes( $filter, ['size'] ); |
|
| 72 | + $filter = $this->object->addFilterTypes($filter, ['size']); |
|
| 73 | 73 | |
| 74 | 74 | $total = 0; |
| 75 | - $results = $this->object->searchItems( $filter, ['text'], $total ); |
|
| 75 | + $results = $this->object->searchItems($filter, ['text'], $total); |
|
| 76 | 76 | |
| 77 | - $this->assertEquals( 6, $total ); |
|
| 78 | - $this->assertEquals( 6, count( $results ) ); |
|
| 77 | + $this->assertEquals(6, $total); |
|
| 78 | + $this->assertEquals(6, count($results)); |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
| 30 | 30 | * @since 2017.03 |
| 31 | 31 | */ |
| 32 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
| 32 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
| 33 | 33 | { |
| 34 | - if( !empty( $codes ) ) |
|
| 34 | + if (!empty($codes)) |
|
| 35 | 35 | { |
| 36 | 36 | $expr = [ |
| 37 | - $filter->compare( '==', 'attribute.type.code', $codes ), |
|
| 37 | + $filter->compare('==', 'attribute.type.code', $codes), |
|
| 38 | 38 | $filter->getConditions(), |
| 39 | 39 | ]; |
| 40 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
| 40 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return $filter; |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function createFilter() |
| 55 | 55 | { |
| 56 | - $filter = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->createSearch( true ); |
|
| 56 | + $filter = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->createSearch(true); |
|
| 57 | 57 | |
| 58 | 58 | $expr = array( |
| 59 | - $filter->compare( '==', 'attribute.domain', 'product' ), |
|
| 59 | + $filter->compare('==', 'attribute.domain', 'product'), |
|
| 60 | 60 | $filter->getConditions(), |
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
| 64 | - $filter->setSortations( array( $filter->sort( '+', 'attribute.position' ) ) ); |
|
| 63 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
| 64 | + $filter->setSortations(array($filter->sort('+', 'attribute.position'))); |
|
| 65 | 65 | |
| 66 | 66 | return $filter; |
| 67 | 67 | } |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
| 76 | 76 | * @since 2017.03 |
| 77 | 77 | */ |
| 78 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ) |
|
| 78 | + public function getItem($id, array $domains = array('media', 'price', 'text')) |
|
| 79 | 79 | { |
| 80 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->getItem( $id, $domains ); |
|
| 80 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->getItem($id, $domains); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
| 91 | 91 | * @since 2017.03 |
| 92 | 92 | */ |
| 93 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
| 93 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
| 94 | 94 | { |
| 95 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute' )->searchItems( $filter, $domains, $total ); |
|
| 95 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute')->searchItems($filter, $domains, $total); |
|
| 96 | 96 | } |
| 97 | 97 | } |