Completed
Push — master ( 6fb08c...b77f3e )
by Aimeos
02:54
created
controller/frontend/tests/Controller/Frontend/Service/FactoryTest.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
12 12
 {
13 13
 	public function testCreateControllerInvalidImplementation()
14 14
 	{
15
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
16
-		\Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
15
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
16
+		\Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
17 17
 	}
18 18
 
19 19
 	public function testCreateControllerInvalidName()
20 20
 	{
21
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
22
-		\Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
21
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
22
+		\Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), '%^');
23 23
 	}
24 24
 
25 25
 	public function testCreateControllerNotExisting()
26 26
 	{
27
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
28
-		\Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
27
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
28
+		\Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
29 29
 	}
30 30
 
31 31
 	public function testAbstractAddControllerDecoratorsWithExclude()
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 		$context = \TestHelperFrontend::getContext();
34 34
 		$config = $context->getConfig();
35 35
 
36
-		$config->set( 'controller/frontend/common/decorators/default', array( 'Example' ) );
37
-		$config->set( 'controller/frontend/service/decorators/excludes', array( 'Example' ) );
36
+		$config->set('controller/frontend/common/decorators/default', array('Example'));
37
+		$config->set('controller/frontend/service/decorators/excludes', array('Example'));
38 38
 
39
-		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController( $context, 'Standard' );
39
+		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController($context, 'Standard');
40 40
 
41
-		$this->assertInstanceOf( '\\Aimeos\\Controller\\Frontend\\Common\\Iface', $controller );
41
+		$this->assertInstanceOf('\\Aimeos\\Controller\\Frontend\\Common\\Iface', $controller);
42 42
 	}
43 43
 
44 44
 	// using Factorylocal class
45 45
 	public function testAbstractAddControllerDecoratorsNoDomainException()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
48
-		\Aimeos\Controller\Frontend\Service\Factorylocal::createController( \TestHelperFrontend::getContext(), 'Standard', '' );
47
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
48
+		\Aimeos\Controller\Frontend\Service\Factorylocal::createController(\TestHelperFrontend::getContext(), 'Standard', '');
49 49
 	}
50 50
 
51 51
 	public function testAbstractAddDecorators()
@@ -53,47 +53,47 @@  discard block
 block discarded – undo
53 53
 		$context = \TestHelperFrontend::getContext();
54 54
 		$config = $context->getConfig();
55 55
 
56
-		$config->set( 'controller/frontend/common/decorators/default', array( 'Example', 'Example' ) );
57
-		$config->set( 'controller/frontend/service/decorators/excludes', array() );
56
+		$config->set('controller/frontend/common/decorators/default', array('Example', 'Example'));
57
+		$config->set('controller/frontend/service/decorators/excludes', array());
58 58
 
59
-		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController( $context, 'Standard' );
59
+		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController($context, 'Standard');
60 60
 
61
-		$this->assertInstanceOf( '\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface', $controller );
61
+		$this->assertInstanceOf('\\Aimeos\\Controller\\Frontend\\Common\\Decorator\\Iface', $controller);
62 62
 	}
63 63
 
64 64
 	public function testAbstractAddDecoratorsExceptionWrongName()
65 65
 	{
66 66
 		$context = \TestHelperFrontend::getContext();
67 67
 		$config = $context->getConfig();
68
-		$config->set( 'controller/frontend/common/decorators/default', array( '$$' ) );
68
+		$config->set('controller/frontend/common/decorators/default', array('$$'));
69 69
 
70
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
71
-		\Aimeos\Controller\Frontend\Service\Factory::createController( $context, 'Standard' );
70
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
71
+		\Aimeos\Controller\Frontend\Service\Factory::createController($context, 'Standard');
72 72
 	}
73 73
 
74 74
 	public function testAbstractAddDecoratorsExceptionWrongClass()
75 75
 	{
76 76
 		$context = \TestHelperFrontend::getContext();
77 77
 		$config = $context->getConfig();
78
-		$config->set( 'controller/frontend/common/decorators/default', array( 'WrongClass' ) );
78
+		$config->set('controller/frontend/common/decorators/default', array('WrongClass'));
79 79
 
80
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
81
-		\Aimeos\Controller\Frontend\Service\Factory::createController( $context, 'Standard' );
80
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
81
+		\Aimeos\Controller\Frontend\Service\Factory::createController($context, 'Standard');
82 82
 	}
83 83
 
84 84
 	public function testCreateController()
85 85
 	{
86 86
 		$context = \TestHelperFrontend::getContext();
87 87
 		$config = $context->getConfig();
88
-		$config->set( 'controller/frontend/common/decorators/default', array() );
88
+		$config->set('controller/frontend/common/decorators/default', array());
89 89
 
90 90
 		$target = '\\Aimeos\\Controller\\Frontend\\Service\\Iface';
91 91
 
92
-		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext() );
93
-		$this->assertInstanceOf( $target, $controller );
92
+		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext());
93
+		$this->assertInstanceOf($target, $controller);
94 94
 
95
-		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
96
-		$this->assertInstanceOf( $target, $controller );
95
+		$controller = \Aimeos\Controller\Frontend\Service\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
96
+		$this->assertInstanceOf($target, $controller);
97 97
 	}
98 98
 
99 99
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Service/Factorylocal.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@
 block discarded – undo
24 24
 	/**
25 25
 	 * @param string $name
26 26
 	 */
27
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, $name = null, $domainToTest = 'service' )
27
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, $name = null, $domainToTest = 'service')
28 28
 	{
29
-		if( $name === null ) {
30
-			$name = $context->getConfig()->get( 'controller/frontend/service/name', 'Standard' );
29
+		if ($name === null) {
30
+			$name = $context->getConfig()->get('controller/frontend/service/name', 'Standard');
31 31
 		}
32 32
 
33
-		if( ctype_alnum( $name ) === false ) {
34
-			throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $name ) );
33
+		if (ctype_alnum($name) === false) {
34
+			throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $name));
35 35
 		}
36 36
 
37 37
 		$iface = '\\Aimeos\\Controller\\Frontend\\Service\\Iface';
38 38
 		$classname = '\\Aimeos\\Controller\\Frontend\\Service\\' . $name;
39 39
 
40
-		$manager = self::createControllerBase( $context, $classname, $iface );
41
-		return self::addControllerDecorators( $context, $manager, $domainToTest );
40
+		$manager = self::createControllerBase($context, $classname, $iface);
41
+		return self::addControllerDecorators($context, $manager, $domainToTest);
42 42
 	}
43 43
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/ExceptionTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 	protected function setUp()
17 17
 	{
18
-		$this->object = new \Aimeos\Controller\Frontend\Exception( 'msg', 1, null, array( 'key' => 'value' ) );
18
+		$this->object = new \Aimeos\Controller\Frontend\Exception('msg', 1, null, array('key' => 'value'));
19 19
 	}
20 20
 
21 21
 
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
 
27 27
 	public function testGetMessage()
28 28
 	{
29
-		$this->assertEquals( 'msg', $this->object->getMessage() );
29
+		$this->assertEquals('msg', $this->object->getMessage());
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testGetCode()
34 34
 	{
35
-		$this->assertEquals( 1, $this->object->getCode() );
35
+		$this->assertEquals(1, $this->object->getCode());
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testGetErrorList()
40 40
 	{
41
-		$this->assertEquals( array( 'key' => 'value' ), $this->object->getErrorList() );
41
+		$this->assertEquals(array('key' => 'value'), $this->object->getErrorList());
42 42
 	}
43 43
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Basket/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 	{
15 15
 		$target = '\\Aimeos\\Controller\\Frontend\\Basket\\Iface';
16 16
 
17
-		$controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext() );
18
-		$this->assertInstanceOf( $target, $controller );
17
+		$controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext());
18
+		$this->assertInstanceOf($target, $controller);
19 19
 
20
-		$controller = \Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
21
-		$this->assertInstanceOf( $target, $controller );
20
+		$controller = \Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
21
+		$this->assertInstanceOf($target, $controller);
22 22
 	}
23 23
 
24 24
 
25 25
 	public function testCreateControllerInvalidImplementation()
26 26
 	{
27
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
28
-		\Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
27
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
28
+		\Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCreateControllerInvalidName()
33 33
 	{
34
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
35
-		\Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
34
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
35
+		\Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), '%^');
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testCreateControllerNotExisting()
40 40
 	{
41
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
42
-		\Aimeos\Controller\Frontend\Basket\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
41
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
42
+		\Aimeos\Controller\Frontend\Basket\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Catalog/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 	{
15 15
 		$target = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface';
16 16
 
17
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext() );
18
-		$this->assertInstanceOf( $target, $controller );
17
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext());
18
+		$this->assertInstanceOf($target, $controller);
19 19
 
20
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
21
-		$this->assertInstanceOf( $target, $controller );
20
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
21
+		$this->assertInstanceOf($target, $controller);
22 22
 	}
23 23
 
24 24
 
25 25
 	public function testCreateControllerInvalidImplementation()
26 26
 	{
27
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
28
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
27
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
28
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCreateControllerInvalidName()
33 33
 	{
34
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
35
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
34
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
35
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), '%^');
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testCreateControllerNotExisting()
40 40
 	{
41
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
42
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
41
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
42
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 	{
15 15
 		$target = '\\Aimeos\\Controller\\Frontend\\Order\\Iface';
16 16
 
17
-		$controller = \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext() );
18
-		$this->assertInstanceOf( $target, $controller );
17
+		$controller = \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext());
18
+		$this->assertInstanceOf($target, $controller);
19 19
 
20
-		$controller = \Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
21
-		$this->assertInstanceOf( $target, $controller );
20
+		$controller = \Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
21
+		$this->assertInstanceOf($target, $controller);
22 22
 	}
23 23
 
24 24
 
25 25
 	public function testCreateControllerInvalidImplementation()
26 26
 	{
27
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
28
-		\Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
27
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
28
+		\Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCreateControllerInvalidName()
33 33
 	{
34
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
35
-		\Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
34
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
35
+		\Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), '%^');
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testCreateControllerNotExisting()
40 40
 	{
41
-		$this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' );
42
-		\Aimeos\Controller\Frontend\Order\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
41
+		$this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception');
42
+		\Aimeos\Controller\Frontend\Order\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/StandardTest.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -14,36 +14,36 @@  discard block
 block discarded – undo
14 14
 	{
15 15
 		$context = \TestHelperFrontend::getContext();
16 16
 		$name = 'ControllerFrontendOrderStore';
17
-		$context->getConfig()->set( 'mshop/order/manager/name', $name );
17
+		$context->getConfig()->set('mshop/order/manager/name', $name);
18 18
 
19 19
 
20
-		$orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' )
21
-			->setMethods( array( 'saveItem', 'getSubManager' ) )
22
-			->setConstructorArgs( array( $context ) )
20
+		$orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard')
21
+			->setMethods(array('saveItem', 'getSubManager'))
22
+			->setConstructorArgs(array($context))
23 23
 			->getMock();
24 24
 
25
-		$orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' )
26
-			->setMethods( array( 'store' ) )
27
-			->setConstructorArgs( array( $context ) )
25
+		$orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')
26
+			->setMethods(array('store'))
27
+			->setConstructorArgs(array($context))
28 28
 			->getMock();
29 29
 
30
-		\Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub );
30
+		\Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub);
31 31
 
32 32
 
33 33
 		$orderBaseItem = $orderBaseManagerStub->createItem();
34
-		$orderBaseItem->setId( 1 );
34
+		$orderBaseItem->setId(1);
35 35
 
36 36
 
37
-		$orderBaseManagerStub->expects( $this->once() )->method( 'store' );
37
+		$orderBaseManagerStub->expects($this->once())->method('store');
38 38
 
39
-		$orderManagerStub->expects( $this->once() )->method( 'getSubManager' )
40
-			->will( $this->returnValue( $orderBaseManagerStub ) );
39
+		$orderManagerStub->expects($this->once())->method('getSubManager')
40
+			->will($this->returnValue($orderBaseManagerStub));
41 41
 
42
-		$orderManagerStub->expects( $this->once() )->method( 'saveItem' );
42
+		$orderManagerStub->expects($this->once())->method('saveItem');
43 43
 
44 44
 
45
-		$object = new \Aimeos\Controller\Frontend\Order\Standard( $context );
46
-		$object->store( $orderBaseItem );
45
+		$object = new \Aimeos\Controller\Frontend\Order\Standard($context);
46
+		$object->store($orderBaseItem);
47 47
 	}
48 48
 
49 49
 
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
51 51
 	{
52 52
 		$context = \TestHelperFrontend::getContext();
53 53
 		$name = 'ControllerFrontendOrderBlock';
54
-		$context->getConfig()->set( 'controller/common/order/name', $name );
54
+		$context->getConfig()->set('controller/common/order/name', $name);
55 55
 
56 56
 
57
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
58
-			->setMethods( array( 'block' ) )
59
-			->setConstructorArgs( array( $context ) )
57
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
58
+			->setMethods(array('block'))
59
+			->setConstructorArgs(array($context))
60 60
 			->getMock();
61 61
 
62
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
62
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
63 63
 
64
-		$orderCntlStub->expects( $this->once() )->method( 'block' );
64
+		$orderCntlStub->expects($this->once())->method('block');
65 65
 
66 66
 
67
-		$object = new \Aimeos\Controller\Frontend\Order\Standard( $context );
68
-		$object->block( \Aimeos\MShop\Factory::createManager( $context, 'order' )->createItem() );
67
+		$object = new \Aimeos\Controller\Frontend\Order\Standard($context);
68
+		$object->block(\Aimeos\MShop\Factory::createManager($context, 'order')->createItem());
69 69
 	}
70 70
 
71 71
 
@@ -73,21 +73,21 @@  discard block
 block discarded – undo
73 73
 	{
74 74
 		$context = \TestHelperFrontend::getContext();
75 75
 		$name = 'ControllerFrontendOrderUnblock';
76
-		$context->getConfig()->set( 'controller/common/order/name', $name );
76
+		$context->getConfig()->set('controller/common/order/name', $name);
77 77
 
78 78
 
79
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
80
-			->setMethods( array( 'unblock' ) )
81
-			->setConstructorArgs( array( $context ) )
79
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
80
+			->setMethods(array('unblock'))
81
+			->setConstructorArgs(array($context))
82 82
 			->getMock();
83 83
 
84
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
84
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
85 85
 
86
-		$orderCntlStub->expects( $this->once() )->method( 'unblock' );
86
+		$orderCntlStub->expects($this->once())->method('unblock');
87 87
 
88 88
 
89
-		$object = new \Aimeos\Controller\Frontend\Order\Standard( $context );
90
-		$object->unblock( \Aimeos\MShop\Factory::createManager( $context, 'order' )->createItem() );
89
+		$object = new \Aimeos\Controller\Frontend\Order\Standard($context);
90
+		$object->unblock(\Aimeos\MShop\Factory::createManager($context, 'order')->createItem());
91 91
 	}
92 92
 
93 93
 
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
 	{
96 96
 		$context = \TestHelperFrontend::getContext();
97 97
 		$name = 'ControllerFrontendOrderUpdate';
98
-		$context->getConfig()->set( 'controller/common/order/name', $name );
98
+		$context->getConfig()->set('controller/common/order/name', $name);
99 99
 
100 100
 
101
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
102
-			->setMethods( array( 'update' ) )
103
-			->setConstructorArgs( array( $context ) )
101
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
102
+			->setMethods(array('update'))
103
+			->setConstructorArgs(array($context))
104 104
 			->getMock();
105 105
 
106
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
106
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
107 107
 
108
-		$orderCntlStub->expects( $this->once() )->method( 'update' );
108
+		$orderCntlStub->expects($this->once())->method('update');
109 109
 
110 110
 
111
-		$object = new \Aimeos\Controller\Frontend\Order\Standard( $context );
112
-		$object->update( \Aimeos\MShop\Factory::createManager( $context, 'order' )->createItem() );
111
+		$object = new \Aimeos\Controller\Frontend\Order\Standard($context);
112
+		$object->update(\Aimeos\MShop\Factory::createManager($context, 'order')->createItem());
113 113
 	}
114 114
 }
Please login to merge, or discard this patch.
controller/frontend/tests/bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@
 block discarded – undo
11 11
  * Set error reporting to maximum
12 12
  */
13 13
 error_reporting( -1 );
14
-ini_set( 'display_errors', '1' );
14
+ini_set('display_errors', '1');
15 15
 
16
-date_default_timezone_set( 'UTC' );
16
+date_default_timezone_set('UTC');
17 17
 
18 18
 /**
19 19
  * Set locale settings to reasonable defaults
20 20
  */
21
-setlocale( LC_ALL, 'en_US.UTF-8' );
22
-setlocale( LC_NUMERIC, 'POSIX' );
23
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
24
-setlocale( LC_TIME, 'POSIX' );
21
+setlocale(LC_ALL, 'en_US.UTF-8');
22
+setlocale(LC_NUMERIC, 'POSIX');
23
+setlocale(LC_CTYPE, 'en_US.UTF-8');
24
+setlocale(LC_TIME, 'POSIX');
25 25
 
26 26
 /*
27 27
  * Set include path for tests
28 28
  */
29
-define( 'PATH_TESTS', __DIR__ );
29
+define('PATH_TESTS', __DIR__);
30 30
 
31 31
 require_once 'TestHelperFrontend.php';
32 32
 \TestHelperFrontend::bootstrap();
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Service/Standard.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -35,43 +35,43 @@  discard block
 block discarded – undo
35 35
 	 * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items
36 36
 	 * @throws \Exception If an error occurs
37 37
 	 */
38
-	public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket,
39
-		$ref = array( 'media', 'price', 'text' ) )
38
+	public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket,
39
+		$ref = array('media', 'price', 'text'))
40 40
 	{
41
-		if( isset( $this->items[$type] ) ) {
41
+		if (isset($this->items[$type])) {
42 42
 			return $this->items[$type];
43 43
 		}
44 44
 
45
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
45
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
46 46
 
47
-		$search = $serviceManager->createSearch( true );
47
+		$search = $serviceManager->createSearch(true);
48 48
 		$expr = array(
49 49
 			$search->getConditions(),
50
-			$search->compare( '==', 'service.type.domain', 'service' ),
51
-			$search->compare( '==', 'service.type.code', $type ),
50
+			$search->compare('==', 'service.type.domain', 'service'),
51
+			$search->compare('==', 'service.type.code', $type),
52 52
 		);
53
-		$search->setConditions( $search->combine( '&&', $expr ) );
54
-		$search->setSortations( array( $search->sort( '+', 'service.position' ) ) );
53
+		$search->setConditions($search->combine('&&', $expr));
54
+		$search->setSortations(array($search->sort('+', 'service.position')));
55 55
 
56
-		$this->items[$type] = $serviceManager->searchItems( $search, $ref );
56
+		$this->items[$type] = $serviceManager->searchItems($search, $ref);
57 57
 
58 58
 
59
-		foreach( $this->items[$type] as $id => $service )
59
+		foreach ($this->items[$type] as $id => $service)
60 60
 		{
61 61
 			try
62 62
 			{
63
-				$provider = $serviceManager->getProvider( $service );
63
+				$provider = $serviceManager->getProvider($service);
64 64
 
65
-				if( $provider->isAvailable( $basket ) ) {
65
+				if ($provider->isAvailable($basket)) {
66 66
 					$this->providers[$type][$id] = $provider;
67 67
 				} else {
68
-					unset( $this->items[$type][$id] );
68
+					unset($this->items[$type][$id]);
69 69
 				}
70 70
 			}
71
-			catch( \Aimeos\MShop\Service\Exception $e )
71
+			catch (\Aimeos\MShop\Service\Exception $e)
72 72
 			{
73
-				$msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id );
74
-				$this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN );
73
+				$msg = sprintf('Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id);
74
+				$this->getContext()->getLogger()->log($msg, \Aimeos\MW\Logger\Base::WARN);
75 75
 			}
76 76
 		}
77 77
 
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 	 * @throws \Aimeos\MShop\Exception If service provider isn't available
92 92
 	 * @throws \Exception If an error occurs
93 93
 	 */
94
-	public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
94
+	public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
95 95
 	{
96
-		if( isset( $this->providers[$type][$serviceId] ) ) {
97
-			return $this->providers[$type][$serviceId]->getConfigFE( $basket );
96
+		if (isset($this->providers[$type][$serviceId])) {
97
+			return $this->providers[$type][$serviceId]->getConfigFE($basket);
98 98
 		}
99 99
 
100
-		$item = $this->getServiceItem( $type, $serviceId );
101
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
100
+		$item = $this->getServiceItem($type, $serviceId);
101
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
102 102
 
103
-		return $serviceManager->getProvider( $item )->getConfigFE( $basket );
103
+		return $serviceManager->getProvider($item)->getConfigFE($basket);
104 104
 	}
105 105
 
106 106
 
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 	 * @throws \Aimeos\MShop\Exception If service provider isn't available
116 116
 	 * @throws \Exception If an error occurs
117 117
 	 */
118
-	public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket )
118
+	public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket)
119 119
 	{
120
-		if( isset( $this->providers[$type][$serviceId] ) ) {
121
-			return $this->providers[$type][$serviceId]->calcPrice( $basket );
120
+		if (isset($this->providers[$type][$serviceId])) {
121
+			return $this->providers[$type][$serviceId]->calcPrice($basket);
122 122
 		}
123 123
 
124
-		$item = $this->getServiceItem( $type, $serviceId );
125
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
124
+		$item = $this->getServiceItem($type, $serviceId);
125
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
126 126
 
127
-		return $serviceManager->getProvider( $item )->calcPrice( $basket );
127
+		return $serviceManager->getProvider($item)->calcPrice($basket);
128 128
 	}
129 129
 
130 130
 
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
 	 * 	known by the provider but aren't valid resp. null for attributes whose values are OK
140 140
 	 * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available
141 141
 	 */
142
-	public function checkServiceAttributes( $type, $serviceId, array $attributes )
142
+	public function checkServiceAttributes($type, $serviceId, array $attributes)
143 143
 	{
144
-		if( isset( $this->providers[$type][$serviceId] ) ) {
145
-			return $this->providers[$type][$serviceId]->checkConfigFE( $attributes );
144
+		if (isset($this->providers[$type][$serviceId])) {
145
+			return $this->providers[$type][$serviceId]->checkConfigFE($attributes);
146 146
 		}
147 147
 
148
-		$item = $this->getServiceItem( $type, $serviceId );
149
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
148
+		$item = $this->getServiceItem($type, $serviceId);
149
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
150 150
 
151
-		return $serviceManager->getProvider( $item )->checkConfigFE( $attributes );
151
+		return $serviceManager->getProvider($item)->checkConfigFE($attributes);
152 152
 	}
153 153
 
154 154
 
@@ -159,25 +159,25 @@  discard block
 block discarded – undo
159 159
 	 * @param string $serviceId Identifier of the service option chosen by the customer
160 160
 	 * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available
161 161
 	 */
162
-	protected function getServiceItem( $type, $serviceId )
162
+	protected function getServiceItem($type, $serviceId)
163 163
 	{
164
-		$serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' );
164
+		$serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service');
165 165
 
166
-		$search = $serviceManager->createSearch( true );
166
+		$search = $serviceManager->createSearch(true);
167 167
 		$expr = array(
168 168
 			$search->getConditions(),
169
-			$search->compare( '==', 'service.id', $serviceId ),
170
-			$search->compare( '==', 'service.type.domain', 'service' ),
171
-			$search->compare( '==', 'service.type.code', $type ),
169
+			$search->compare('==', 'service.id', $serviceId),
170
+			$search->compare('==', 'service.type.domain', 'service'),
171
+			$search->compare('==', 'service.type.code', $type),
172 172
 		);
173
-		$search->setConditions( $search->combine( '&&', $expr ) );
173
+		$search->setConditions($search->combine('&&', $expr));
174 174
 
175
-		$items = $serviceManager->searchItems( $search, array( 'price' ) );
175
+		$items = $serviceManager->searchItems($search, array('price'));
176 176
 
177
-		if( ( $item = reset( $items ) ) === false )
177
+		if (($item = reset($items)) === false)
178 178
 		{
179
-			$msg = sprintf( 'Service item for type "%1$s" and ID "%2$s" not found', $type, $serviceId );
180
-			throw new \Aimeos\Controller\Frontend\Service\Exception( $msg );
179
+			$msg = sprintf('Service item for type "%1$s" and ID "%2$s" not found', $type, $serviceId);
180
+			throw new \Aimeos\Controller\Frontend\Service\Exception($msg);
181 181
 		}
182 182
 
183 183
 		return $item;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
 				} else {
68 68
 					unset( $this->items[$type][$id] );
69 69
 				}
70
-			}
71
-			catch( \Aimeos\MShop\Service\Exception $e )
70
+			} catch( \Aimeos\MShop\Service\Exception $e )
72 71
 			{
73 72
 				$msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id );
74 73
 				$this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN );
Please login to merge, or discard this patch.