@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
| 30 | 30 | * @since 2015.08 |
| 31 | 31 | */ |
| 32 | - public function createManager( $name ) |
|
| 32 | + public function createManager($name) |
|
| 33 | 33 | { |
| 34 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), $name ); |
|
| 34 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), $name); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function createFilter() |
| 45 | 45 | { |
| 46 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->createSearch( true ); |
|
| 46 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->createSearch(true); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
| 56 | 56 | * @since 2017.03 |
| 57 | 57 | */ |
| 58 | - public function getPath( $id, array $domains = array( 'text', 'media' ) ) |
|
| 58 | + public function getPath($id, array $domains = array('text', 'media')) |
|
| 59 | 59 | { |
| 60 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->getPath( $id, $domains ); |
|
| 60 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->getPath($id, $domains); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
| 73 | 73 | * @since 2017.03 |
| 74 | 74 | */ |
| 75 | - public function getTree( $id = null, array $domains = array( 'text', 'media' ), |
|
| 76 | - $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null ) |
|
| 75 | + public function getTree($id = null, array $domains = array('text', 'media'), |
|
| 76 | + $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE, \Aimeos\MW\Criteria\Iface $search = null) |
|
| 77 | 77 | { |
| 78 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' )->getTree( $id, $domains, $level, $search ); |
|
| 78 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog')->getTree($id, $domains, $level, $search); |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -17,112 +17,112 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function setUp() |
| 19 | 19 | { |
| 20 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 20 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 21 | 21 | |
| 22 | 22 | $this->context = \TestHelperFrontend::getContext(); |
| 23 | - $this->object = new \Aimeos\Controller\Frontend\Service\Standard( $this->context ); |
|
| 23 | + $this->object = new \Aimeos\Controller\Frontend\Service\Standard($this->context); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | public static function setUpBeforeClass() |
| 28 | 28 | { |
| 29 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() ); |
|
| 30 | - $orderBaseMgr = $orderManager->getSubManager( 'base' ); |
|
| 29 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext()); |
|
| 30 | + $orderBaseMgr = $orderManager->getSubManager('base'); |
|
| 31 | 31 | self::$basket = $orderBaseMgr->createItem(); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | protected function tearDown() |
| 36 | 36 | { |
| 37 | - unset( $this->object, $this->context ); |
|
| 37 | + unset($this->object, $this->context); |
|
| 38 | 38 | |
| 39 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 39 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 40 | 40 | \Aimeos\MShop\Factory::clear(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | public function testCheckAttributes() |
| 45 | 45 | { |
| 46 | - $attributes = $this->object->checkAttributes( $this->getServiceItem()->getId(), [] ); |
|
| 47 | - $this->assertEquals( [], $attributes ); |
|
| 46 | + $attributes = $this->object->checkAttributes($this->getServiceItem()->getId(), []); |
|
| 47 | + $this->assertEquals([], $attributes); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testGetProviders() |
| 52 | 52 | { |
| 53 | - $providers = $this->object->getProviders( 'delivery' ); |
|
| 54 | - $this->assertGreaterThan( 0, count( $providers ) ); |
|
| 53 | + $providers = $this->object->getProviders('delivery'); |
|
| 54 | + $this->assertGreaterThan(0, count($providers)); |
|
| 55 | 55 | |
| 56 | - foreach( $providers as $provider ) { |
|
| 57 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider ); |
|
| 56 | + foreach ($providers as $provider) { |
|
| 57 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | public function testGetProvider() |
| 63 | 63 | { |
| 64 | - $provider = $this->object->getProvider( $this->getServiceItem()->getId() ); |
|
| 65 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider ); |
|
| 64 | + $provider = $this->object->getProvider($this->getServiceItem()->getId()); |
|
| 65 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testProcess() |
| 70 | 70 | { |
| 71 | 71 | $form = new \Aimeos\MShop\Common\Item\Helper\Form\Standard(); |
| 72 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 73 | - $serviceId = \Aimeos\MShop\Factory::createManager( $this->context, 'service' )->findItem( 'unitcode' )->getId(); |
|
| 72 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 73 | + $serviceId = \Aimeos\MShop\Factory::createManager($this->context, 'service')->findItem('unitcode')->getId(); |
|
| 74 | 74 | |
| 75 | - $provider = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' ) |
|
| 75 | + $provider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard') |
|
| 76 | 76 | ->disableOriginalConstructor() |
| 77 | - ->setMethods( ['process'] ) |
|
| 77 | + ->setMethods(['process']) |
|
| 78 | 78 | ->getMock(); |
| 79 | 79 | |
| 80 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
| 81 | - ->setConstructorArgs( [$this->context] ) |
|
| 82 | - ->setMethods( ['getProvider'] ) |
|
| 80 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
| 81 | + ->setConstructorArgs([$this->context]) |
|
| 82 | + ->setMethods(['getProvider']) |
|
| 83 | 83 | ->getMock(); |
| 84 | 84 | |
| 85 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'service', $manager ); |
|
| 85 | + \Aimeos\MShop\Factory::injectManager($this->context, 'service', $manager); |
|
| 86 | 86 | |
| 87 | - $provider->expects( $this->once() )->method( 'process' )->will( $this->returnValue( $form ) ); |
|
| 88 | - $manager->expects( $this->once() )->method( 'getProvider' )->will( $this->returnValue( $provider ) ); |
|
| 87 | + $provider->expects($this->once())->method('process')->will($this->returnValue($form)); |
|
| 88 | + $manager->expects($this->once())->method('getProvider')->will($this->returnValue($provider)); |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | - $result = $this->object->process( $item, $serviceId, [], [] ); |
|
| 92 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Helper\Form\Iface', $result ); |
|
| 91 | + $result = $this->object->process($item, $serviceId, [], []); |
|
| 92 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Helper\Form\Iface', $result); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | public function testUpdateSync() |
| 97 | 97 | { |
| 98 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 98 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 99 | 99 | |
| 100 | - $stream = $this->getMockBuilder( 'Psr\Http\Message\StreamInterface' )->getMock(); |
|
| 101 | - $request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock(); |
|
| 102 | - $response = $this->getMockBuilder( '\Aimeos\MW\View\Helper\Response\Iface' ) |
|
| 100 | + $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface')->getMock(); |
|
| 101 | + $request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock(); |
|
| 102 | + $response = $this->getMockBuilder('\Aimeos\MW\View\Helper\Response\Iface') |
|
| 103 | 103 | ->getMock(); |
| 104 | 104 | |
| 105 | - $provider = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' ) |
|
| 106 | - ->setMethods( ['updateSync', 'query', 'isImplemented'] ) |
|
| 105 | + $provider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard') |
|
| 106 | + ->setMethods(['updateSync', 'query', 'isImplemented']) |
|
| 107 | 107 | ->disableOriginalConstructor() |
| 108 | 108 | ->getMock(); |
| 109 | 109 | |
| 110 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' ) |
|
| 111 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 112 | - ->setMethods( ['getProvider'] ) |
|
| 110 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard') |
|
| 111 | + ->setConstructorArgs(array($this->context)) |
|
| 112 | + ->setMethods(['getProvider']) |
|
| 113 | 113 | ->getMock(); |
| 114 | 114 | |
| 115 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'service', $manager ); |
|
| 115 | + \Aimeos\MShop\Factory::injectManager($this->context, 'service', $manager); |
|
| 116 | 116 | |
| 117 | 117 | |
| 118 | - $request->expects( $this->once() )->method( 'getQueryParams' )->will( $this->returnValue( ['code' => 'unitcode'] ) ); |
|
| 119 | - $response->expects( $this->once() )->method( 'createStreamFromString' )->will( $this->returnValue( $stream ) ); |
|
| 120 | - $manager->expects( $this->once() )->method( 'getProvider' )->will( $this->returnValue( $provider ) ); |
|
| 121 | - $provider->expects( $this->once() )->method( 'updateSync' )->will( $this->returnValue( $item ) ); |
|
| 122 | - $provider->expects( $this->once() )->method( 'isImplemented' )->will( $this->returnValue( true ) ); |
|
| 123 | - $provider->expects( $this->once() )->method( 'query' ); |
|
| 118 | + $request->expects($this->once())->method('getQueryParams')->will($this->returnValue(['code' => 'unitcode'])); |
|
| 119 | + $response->expects($this->once())->method('createStreamFromString')->will($this->returnValue($stream)); |
|
| 120 | + $manager->expects($this->once())->method('getProvider')->will($this->returnValue($provider)); |
|
| 121 | + $provider->expects($this->once())->method('updateSync')->will($this->returnValue($item)); |
|
| 122 | + $provider->expects($this->once())->method('isImplemented')->will($this->returnValue(true)); |
|
| 123 | + $provider->expects($this->once())->method('query'); |
|
| 124 | 124 | |
| 125 | - $this->object->updateSync( $request, $response, [], 'paypalexpress', -1 ); |
|
| 125 | + $this->object->updateSync($request, $response, [], 'paypalexpress', -1); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | protected function getServiceItem() |
| 133 | 133 | { |
| 134 | - $manager = \Aimeos\MShop\Service\Manager\Factory::createManager( \TestHelperFrontend::getContext() ); |
|
| 135 | - return $manager->findItem( 'unitcode' ); |
|
| 134 | + $manager = \Aimeos\MShop\Service\Manager\Factory::createManager(\TestHelperFrontend::getContext()); |
|
| 135 | + return $manager->findItem('unitcode'); |
|
| 136 | 136 | } |
| 137 | 137 | } |
@@ -20,118 +20,118 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
| 29 | 29 | ->getMockForAbstractClass(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | protected function tearDown() |
| 34 | 34 | { |
| 35 | - unset( $this->context, $this->object, $this->stub ); |
|
| 35 | + unset($this->context, $this->object, $this->stub); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testConstructException() |
| 40 | 40 | { |
| 41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
| 41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
| 42 | 42 | |
| 43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
| 43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
| 44 | 44 | |
| 45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 46 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 47 | 47 | ->getMockForAbstractClass(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testCall() |
| 52 | 52 | { |
| 53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' ) |
|
| 53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
| 54 | 54 | ->disableOriginalConstructor() |
| 55 | - ->setMethods( ['invalid'] ) |
|
| 55 | + ->setMethods(['invalid']) |
|
| 56 | 56 | ->getMock(); |
| 57 | 57 | |
| 58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
| 59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Decorator\Base') |
|
| 59 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 60 | 60 | ->getMockForAbstractClass(); |
| 61 | 61 | |
| 62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
| 62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
| 63 | 63 | |
| 64 | - $this->assertTrue( $object->invalid() ); |
|
| 64 | + $this->assertTrue($object->invalid()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testCheckAttributes() |
| 69 | 69 | { |
| 70 | - $this->stub->expects( $this->once() )->method( 'checkAttributes' ) |
|
| 71 | - ->will( $this->returnValue( [] ) ); |
|
| 70 | + $this->stub->expects($this->once())->method('checkAttributes') |
|
| 71 | + ->will($this->returnValue([])); |
|
| 72 | 72 | |
| 73 | - $this->assertEquals( [], $this->object->checkAttributes( -1, [] ) ); |
|
| 73 | + $this->assertEquals([], $this->object->checkAttributes( -1, [] )); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | public function testGetProvider() |
| 78 | 78 | { |
| 79 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' ); |
|
| 80 | - $provider = $manager->getProvider( $manager->findItem( 'unitcode', [], 'service', 'delivery' ) ); |
|
| 79 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'service'); |
|
| 80 | + $provider = $manager->getProvider($manager->findItem('unitcode', [], 'service', 'delivery')); |
|
| 81 | 81 | |
| 82 | - $this->stub->expects( $this->once() )->method( 'getProvider' ) |
|
| 83 | - ->will( $this->returnValue( $provider ) ); |
|
| 82 | + $this->stub->expects($this->once())->method('getProvider') |
|
| 83 | + ->will($this->returnValue($provider)); |
|
| 84 | 84 | |
| 85 | - $this->assertSame( $provider, $this->object->getProvider( -1 ) ); |
|
| 85 | + $this->assertSame($provider, $this->object->getProvider( -1 )); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function testGetProviders() |
| 90 | 90 | { |
| 91 | - $this->stub->expects( $this->once() )->method( 'getProviders' ) |
|
| 92 | - ->will( $this->returnValue( [] ) ); |
|
| 91 | + $this->stub->expects($this->once())->method('getProviders') |
|
| 92 | + ->will($this->returnValue([])); |
|
| 93 | 93 | |
| 94 | - $this->assertEquals( [], $this->object->getProviders( 'payment' ) ); |
|
| 94 | + $this->assertEquals([], $this->object->getProviders('payment')); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | public function testProcess() |
| 99 | 99 | { |
| 100 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 100 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 101 | 101 | |
| 102 | - $this->stub->expects( $this->once() )->method( 'process' ) |
|
| 103 | - ->will( $this->returnValue( new \Aimeos\MShop\Common\Item\Helper\Form\Standard() ) ); |
|
| 102 | + $this->stub->expects($this->once())->method('process') |
|
| 103 | + ->will($this->returnValue(new \Aimeos\MShop\Common\Item\Helper\Form\Standard())); |
|
| 104 | 104 | |
| 105 | - $this->assertInstanceOf( 'Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process( $item, -1, [], [] ) ); |
|
| 105 | + $this->assertInstanceOf('Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process($item, -1, [], [])); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | public function testUpdateSync() |
| 110 | 110 | { |
| 111 | - $response = $this->getMockBuilder( '\Psr\Http\Message\ResponseInterface' )->getMock(); |
|
| 112 | - $request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock(); |
|
| 113 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 111 | + $response = $this->getMockBuilder('\Psr\Http\Message\ResponseInterface')->getMock(); |
|
| 112 | + $request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock(); |
|
| 113 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 114 | 114 | |
| 115 | - $this->stub->expects( $this->once() )->method( 'updateSync' ) |
|
| 116 | - ->will( $this->returnValue( $item ) ); |
|
| 115 | + $this->stub->expects($this->once())->method('updateSync') |
|
| 116 | + ->will($this->returnValue($item)); |
|
| 117 | 117 | |
| 118 | - $this->assertInstanceOf( 'Aimeos\MShop\Order\Item\Iface', $this->object->updateSync( $request, $response, [], 'test', -1 ) ); |
|
| 118 | + $this->assertInstanceOf('Aimeos\MShop\Order\Item\Iface', $this->object->updateSync($request, $response, [], 'test', -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 | - protected function access( $name ) |
|
| 130 | + protected function access($name) |
|
| 131 | 131 | { |
| 132 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ); |
|
| 133 | - $method = $class->getMethod( $name ); |
|
| 134 | - $method->setAccessible( true ); |
|
| 132 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Service\Decorator\Base'); |
|
| 133 | + $method = $class->getMethod($name); |
|
| 134 | + $method->setAccessible(true); |
|
| 135 | 135 | |
| 136 | 136 | return $method; |
| 137 | 137 | } |
@@ -18,165 +18,165 @@ |
||
| 18 | 18 | |
| 19 | 19 | protected function setUp() |
| 20 | 20 | { |
| 21 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 21 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 22 | 22 | |
| 23 | 23 | $this->context = \TestHelperFrontend::getContext(); |
| 24 | - $this->object = new \Aimeos\Controller\Frontend\Order\Standard( $this->context ); |
|
| 24 | + $this->object = new \Aimeos\Controller\Frontend\Order\Standard($this->context); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset( $this->object, $this->context ); |
|
| 30 | + unset($this->object, $this->context); |
|
| 31 | 31 | |
| 32 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 32 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 33 | 33 | \Aimeos\MShop\Factory::clear(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | public function testAddItem() |
| 38 | 38 | { |
| 39 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 40 | - ->setConstructorArgs( [$this->context] ) |
|
| 41 | - ->setMethods( ['saveItem'] ) |
|
| 39 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 40 | + ->setConstructorArgs([$this->context]) |
|
| 41 | + ->setMethods(['saveItem']) |
|
| 42 | 42 | ->getMock(); |
| 43 | 43 | |
| 44 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager ); |
|
| 44 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager); |
|
| 45 | 45 | |
| 46 | - $manager->expects( $this->once() )->method( 'saveItem' ) |
|
| 47 | - ->will( $this->returnValue( $manager->createItem() ) ); |
|
| 46 | + $manager->expects($this->once())->method('saveItem') |
|
| 47 | + ->will($this->returnValue($manager->createItem())); |
|
| 48 | 48 | |
| 49 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) ); |
|
| 49 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' )); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | public function testAddItemLimit() |
| 54 | 54 | { |
| 55 | - $this->context->getConfig()->set( 'controller/frontend/order/limit-seconds', 86400 * 365 ); |
|
| 55 | + $this->context->getConfig()->set('controller/frontend/order/limit-seconds', 86400 * 365); |
|
| 56 | 56 | |
| 57 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' ); |
|
| 58 | - $result = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) ); |
|
| 57 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base'); |
|
| 58 | + $result = $manager->searchItems($manager->createSearch()->setSlice(0, 1)); |
|
| 59 | 59 | |
| 60 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 61 | - throw new \RuntimeException( 'No order item found' ); |
|
| 60 | + if (($item = reset($result)) === false) { |
|
| 61 | + throw new \RuntimeException('No order item found'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' ); |
|
| 65 | - $this->object->addItem( $item->getId(), 'test' ); |
|
| 64 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception'); |
|
| 65 | + $this->object->addItem($item->getId(), 'test'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testCreateFilter() |
| 70 | 70 | { |
| 71 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 71 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | public function testGetItem() |
| 76 | 76 | { |
| 77 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' ); |
|
| 78 | - $customerItem = $manager->findItem( 'UTC001' ); |
|
| 77 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer'); |
|
| 78 | + $customerItem = $manager->findItem('UTC001'); |
|
| 79 | 79 | |
| 80 | - $this->context->setEditor( 'core:unittest' ); |
|
| 80 | + $this->context->setEditor('core:unittest'); |
|
| 81 | 81 | |
| 82 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' ); |
|
| 83 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
| 84 | - $search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) ); |
|
| 85 | - $result = $manager->searchItems( $search ); |
|
| 82 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order'); |
|
| 83 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
| 84 | + $search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId())); |
|
| 85 | + $result = $manager->searchItems($search); |
|
| 86 | 86 | |
| 87 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 88 | - throw new \RuntimeException( 'No order item found' ); |
|
| 87 | + if (($item = reset($result)) === false) { |
|
| 88 | + throw new \RuntimeException('No order item found'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) ); |
|
| 91 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId())); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | public function testGetItemException() |
| 96 | 96 | { |
| 97 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' ); |
|
| 97 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception'); |
|
| 98 | 98 | $this->object->getItem( -1 ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | public function testSaveItem() |
| 103 | 103 | { |
| 104 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 105 | - ->setConstructorArgs( [$this->context] ) |
|
| 106 | - ->setMethods( ['saveItem'] ) |
|
| 104 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 105 | + ->setConstructorArgs([$this->context]) |
|
| 106 | + ->setMethods(['saveItem']) |
|
| 107 | 107 | ->getMock(); |
| 108 | 108 | |
| 109 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager ); |
|
| 109 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager); |
|
| 110 | 110 | |
| 111 | - $manager->expects( $this->once() )->method( 'saveItem' ) |
|
| 112 | - ->will( $this->returnValue( $manager->createItem() ) ); |
|
| 111 | + $manager->expects($this->once())->method('saveItem') |
|
| 112 | + ->will($this->returnValue($manager->createItem())); |
|
| 113 | 113 | |
| 114 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->saveItem( $manager->createItem() ) ); |
|
| 114 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->saveItem($manager->createItem())); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testSearchItems() |
| 119 | 119 | { |
| 120 | - $this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) ); |
|
| 120 | + $this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter())); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | public function testBlock() |
| 125 | 125 | { |
| 126 | 126 | $name = 'ControllerFrontendOrderBlock'; |
| 127 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 127 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 128 | 128 | |
| 129 | 129 | |
| 130 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 131 | - ->setMethods( array( 'block' ) ) |
|
| 132 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 130 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 131 | + ->setMethods(array('block')) |
|
| 132 | + ->setConstructorArgs(array($this->context)) |
|
| 133 | 133 | ->getMock(); |
| 134 | 134 | |
| 135 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 135 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 136 | 136 | |
| 137 | - $orderCntlStub->expects( $this->once() )->method( 'block' ); |
|
| 137 | + $orderCntlStub->expects($this->once())->method('block'); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 140 | + $this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | public function testUnblock() |
| 145 | 145 | { |
| 146 | 146 | $name = 'ControllerFrontendOrderUnblock'; |
| 147 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 147 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 148 | 148 | |
| 149 | 149 | |
| 150 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 151 | - ->setMethods( array( 'unblock' ) ) |
|
| 152 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 150 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 151 | + ->setMethods(array('unblock')) |
|
| 152 | + ->setConstructorArgs(array($this->context)) |
|
| 153 | 153 | ->getMock(); |
| 154 | 154 | |
| 155 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 155 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 156 | 156 | |
| 157 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
| 157 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
| 158 | 158 | |
| 159 | 159 | |
| 160 | - $this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 160 | + $this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | public function testUpdate() |
| 165 | 165 | { |
| 166 | 166 | $name = 'ControllerFrontendOrderUpdate'; |
| 167 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
| 167 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
| 168 | 168 | |
| 169 | 169 | |
| 170 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
| 171 | - ->setMethods( array( 'update' ) ) |
|
| 172 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 170 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
| 171 | + ->setMethods(array('update')) |
|
| 172 | + ->setConstructorArgs(array($this->context)) |
|
| 173 | 173 | ->getMock(); |
| 174 | 174 | |
| 175 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
| 175 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
| 176 | 176 | |
| 177 | - $orderCntlStub->expects( $this->once() )->method( 'update' ); |
|
| 177 | + $orderCntlStub->expects($this->once())->method('update'); |
|
| 178 | 178 | |
| 179 | 179 | |
| 180 | - $this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
| 180 | + $this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
| 181 | 181 | } |
| 182 | 182 | } |
@@ -20,124 +20,124 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
| 22 | 22 | |
| 23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
| 23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
| 24 | 24 | ->disableOriginalConstructor() |
| 25 | 25 | ->getMock(); |
| 26 | 26 | |
| 27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
| 27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
| 29 | 29 | ->getMockForAbstractClass(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | protected function tearDown() |
| 34 | 34 | { |
| 35 | - unset( $this->context, $this->object, $this->stub ); |
|
| 35 | + unset($this->context, $this->object, $this->stub); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testConstructException() |
| 40 | 40 | { |
| 41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
| 41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
| 42 | 42 | |
| 43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
| 43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
| 44 | 44 | |
| 45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 46 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 47 | 47 | ->getMockForAbstractClass(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testCall() |
| 52 | 52 | { |
| 53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
| 53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
| 54 | 54 | ->disableOriginalConstructor() |
| 55 | - ->setMethods( ['invalid'] ) |
|
| 55 | + ->setMethods(['invalid']) |
|
| 56 | 56 | ->getMock(); |
| 57 | 57 | |
| 58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
| 59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
| 59 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 60 | 60 | ->getMockForAbstractClass(); |
| 61 | 61 | |
| 62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
| 62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
| 63 | 63 | |
| 64 | - $this->assertTrue( $object->invalid() ); |
|
| 64 | + $this->assertTrue($object->invalid()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testAddItem() |
| 69 | 69 | { |
| 70 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 70 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 71 | 71 | |
| 72 | - $this->stub->expects( $this->once() )->method( 'addItem' )->will( $this->returnValue( $item ) ); |
|
| 72 | + $this->stub->expects($this->once())->method('addItem')->will($this->returnValue($item)); |
|
| 73 | 73 | |
| 74 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' ) ); |
|
| 74 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' )); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testCreateFilter() |
| 79 | 79 | { |
| 80 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createSearch(); |
|
| 80 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createSearch(); |
|
| 81 | 81 | |
| 82 | - $this->stub->expects( $this->once() )->method( 'createFilter' )->will( $this->returnValue( $search ) ); |
|
| 82 | + $this->stub->expects($this->once())->method('createFilter')->will($this->returnValue($search)); |
|
| 83 | 83 | |
| 84 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 84 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | public function testGetItem() |
| 89 | 89 | { |
| 90 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 90 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 91 | 91 | |
| 92 | - $this->stub->expects( $this->once() )->method( 'getItem' )->will( $this->returnValue( $item ) ); |
|
| 92 | + $this->stub->expects($this->once())->method('getItem')->will($this->returnValue($item)); |
|
| 93 | 93 | |
| 94 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 ) ); |
|
| 94 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 )); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | public function testSearchItems() |
| 99 | 99 | { |
| 100 | - $search = $this->getMockBuilder( '\Aimeos\MW\Criteria\Iface' )->getMock(); |
|
| 100 | + $search = $this->getMockBuilder('\Aimeos\MW\Criteria\Iface')->getMock(); |
|
| 101 | 101 | |
| 102 | - $this->stub->expects( $this->once() )->method( 'searchItems' )->will( $this->returnValue( [] ) ); |
|
| 102 | + $this->stub->expects($this->once())->method('searchItems')->will($this->returnValue([])); |
|
| 103 | 103 | |
| 104 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
| 104 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | public function testUnblock() |
| 109 | 109 | { |
| 110 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 110 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 111 | 111 | |
| 112 | - $this->stub->expects( $this->once() )->method( 'unblock' ); |
|
| 112 | + $this->stub->expects($this->once())->method('unblock'); |
|
| 113 | 113 | |
| 114 | - $this->object->unblock( $orderItem ); |
|
| 114 | + $this->object->unblock($orderItem); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testUpdate() |
| 119 | 119 | { |
| 120 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
| 120 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
| 121 | 121 | |
| 122 | - $this->stub->expects( $this->once() )->method( 'update' ); |
|
| 122 | + $this->stub->expects($this->once())->method('update'); |
|
| 123 | 123 | |
| 124 | - $this->object->update( $orderItem ); |
|
| 124 | + $this->object->update($orderItem); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | public function testGetController() |
| 129 | 129 | { |
| 130 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 130 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 131 | 131 | |
| 132 | - $this->assertSame( $this->stub, $result ); |
|
| 132 | + $this->assertSame($this->stub, $result); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | - protected function access( $name ) |
|
| 136 | + protected function access($name) |
|
| 137 | 137 | { |
| 138 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ); |
|
| 139 | - $method = $class->getMethod( $name ); |
|
| 140 | - $method->setAccessible( true ); |
|
| 138 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Order\Decorator\Base'); |
|
| 139 | + $method = $class->getMethod($name); |
|
| 140 | + $method->setAccessible(true); |
|
| 141 | 141 | |
| 142 | 142 | return $method; |
| 143 | 143 | } |
@@ -17,18 +17,18 @@ |
||
| 17 | 17 | |
| 18 | 18 | protected function setUp() |
| 19 | 19 | { |
| 20 | - $this->object = new \Aimeos\Controller\Frontend\Catalog\Standard( \TestHelperFrontend::getContext() ); |
|
| 20 | + $this->object = new \Aimeos\Controller\Frontend\Catalog\Standard(\TestHelperFrontend::getContext()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() |
| 25 | 25 | { |
| 26 | - unset( $this->object ); |
|
| 26 | + unset($this->object); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | public function testCreateManager() |
| 31 | 31 | { |
| 32 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->createManager( 'product' ) ); |
|
| 32 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->createManager('product')); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -20,106 +20,106 @@ |
||
| 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 testConstructException() |
| 40 | 40 | { |
| 41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
| 41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
| 42 | 42 | |
| 43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
| 43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
| 44 | 44 | |
| 45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ) |
|
| 46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Decorator\Base') |
|
| 46 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 47 | 47 | ->getMockForAbstractClass(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testCall() |
| 52 | 52 | { |
| 53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Standard' ) |
|
| 53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Standard') |
|
| 54 | 54 | ->disableOriginalConstructor() |
| 55 | - ->setMethods( ['invalid'] ) |
|
| 55 | + ->setMethods(['invalid']) |
|
| 56 | 56 | ->getMock(); |
| 57 | 57 | |
| 58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ) |
|
| 59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
| 58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Decorator\Base') |
|
| 59 | + ->setConstructorArgs([$stub, $this->context]) |
|
| 60 | 60 | ->getMockForAbstractClass(); |
| 61 | 61 | |
| 62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
| 62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
| 63 | 63 | |
| 64 | - $this->assertTrue( $object->invalid() ); |
|
| 64 | + $this->assertTrue($object->invalid()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testCreateManager() |
| 69 | 69 | { |
| 70 | - $catalogManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' ); |
|
| 70 | + $catalogManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog'); |
|
| 71 | 71 | |
| 72 | - $this->stub->expects( $this->once() )->method( 'createManager' ) |
|
| 73 | - ->will( $this->returnValue( $catalogManager ) ); |
|
| 72 | + $this->stub->expects($this->once())->method('createManager') |
|
| 73 | + ->will($this->returnValue($catalogManager)); |
|
| 74 | 74 | |
| 75 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'catalog' ) ); |
|
| 75 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager('catalog')); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | public function testCreateFilter() |
| 80 | 80 | { |
| 81 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch(); |
|
| 81 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch(); |
|
| 82 | 82 | |
| 83 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
| 84 | - ->will( $this->returnValue( $search ) ); |
|
| 83 | + $this->stub->expects($this->once())->method('createFilter') |
|
| 84 | + ->will($this->returnValue($search)); |
|
| 85 | 85 | |
| 86 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
| 86 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | public function testGetPath() |
| 91 | 91 | { |
| 92 | - $this->stub->expects( $this->once() )->method( 'getPath' ) |
|
| 93 | - ->will( $this->returnValue( [] ) ); |
|
| 92 | + $this->stub->expects($this->once())->method('getPath') |
|
| 93 | + ->will($this->returnValue([])); |
|
| 94 | 94 | |
| 95 | - $this->assertEquals( [], $this->object->getPath( -1 ) ); |
|
| 95 | + $this->assertEquals([], $this->object->getPath( -1 )); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testGetTree() |
| 100 | 100 | { |
| 101 | - $catItem = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createItem(); |
|
| 101 | + $catItem = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createItem(); |
|
| 102 | 102 | |
| 103 | - $this->stub->expects( $this->once() )->method( 'getTree' ) |
|
| 104 | - ->will( $this->returnValue( $catItem ) ); |
|
| 103 | + $this->stub->expects($this->once())->method('getTree') |
|
| 104 | + ->will($this->returnValue($catItem)); |
|
| 105 | 105 | |
| 106 | - $this->assertInstanceOf( '\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree() ); |
|
| 106 | + $this->assertInstanceOf('\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree()); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | public function testGetController() |
| 111 | 111 | { |
| 112 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
| 112 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
| 113 | 113 | |
| 114 | - $this->assertSame( $this->stub, $result ); |
|
| 114 | + $this->assertSame($this->stub, $result); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | - protected function access( $name ) |
|
| 118 | + protected function access($name) |
|
| 119 | 119 | { |
| 120 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' ); |
|
| 121 | - $method = $class->getMethod( $name ); |
|
| 122 | - $method->setAccessible( true ); |
|
| 120 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Catalog\Decorator\Base'); |
|
| 121 | + $method = $class->getMethod($name); |
|
| 122 | + $method->setAccessible(true); |
|
| 123 | 123 | |
| 124 | 124 | return $method; |
| 125 | 125 | } |