@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Locale\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Locale\Factory::create( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Locale\Factory::create(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Locale\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Locale\Factory::create(\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\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Locale\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Locale\Factory::create(\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\Locale\Factory::create( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Locale\Factory::create(\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\Locale\Factory::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Locale\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Basket\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::create( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::create(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Basket\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Basket\Factory::create(\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\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Basket\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Basket\Factory::create(\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::create( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Basket\Factory::create(\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::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Basket\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -14,31 +14,31 @@ |
||
14 | 14 | { |
15 | 15 | $target = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface'; |
16 | 16 | |
17 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::create( \TestHelperFrontend::getContext() ); |
|
18 | - $this->assertInstanceOf( $target, $controller ); |
|
17 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::create(\TestHelperFrontend::getContext()); |
|
18 | + $this->assertInstanceOf($target, $controller); |
|
19 | 19 | |
20 | - $controller = \Aimeos\Controller\Frontend\Catalog\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
21 | - $this->assertInstanceOf( $target, $controller ); |
|
20 | + $controller = \Aimeos\Controller\Frontend\Catalog\Factory::create(\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\\MW\\Common\\Exception' ); |
|
28 | - \Aimeos\Controller\Frontend\Catalog\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
27 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
28 | + \Aimeos\Controller\Frontend\Catalog\Factory::create(\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::create( \TestHelperFrontend::getContext(), '%^' ); |
|
34 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
35 | + \Aimeos\Controller\Frontend\Catalog\Factory::create(\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::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
41 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
42 | + \Aimeos\Controller\Frontend\Catalog\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
43 | 43 | } |
44 | 44 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Stock\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Stock\Factory::create( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Stock\Factory::create(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Stock\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Stock\Factory::create(\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\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Stock\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Stock\Factory::create(\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\Stock\Factory::create( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Stock\Factory::create(\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\Stock\Factory::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Stock\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Supplier\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::create( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::create(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Supplier\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Supplier\Factory::create(\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\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Supplier\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Supplier\Factory::create(\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\Supplier\Factory::create( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Supplier\Factory::create(\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\Supplier\Factory::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Supplier\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::create( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::create(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Attribute\Factory::create( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Attribute\Factory::create(\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\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Attribute\Factory::create( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Attribute\Factory::create(\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::create( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Attribute\Factory::create(\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::create( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Attribute\Factory::create(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -229,6 +229,9 @@ |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | |
232 | + /** |
|
233 | + * @param string $name |
|
234 | + */ |
|
232 | 235 | protected function access( $name ) |
233 | 236 | { |
234 | 237 | $class = new \ReflectionClass( \Aimeos\Controller\Frontend\Product\Decorator\Base::class ); |
@@ -20,57 +20,57 @@ discard block |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( \Aimeos\Controller\Frontend\Product\Standard::class ) |
|
23 | + $this->stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Product\Standard::class) |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( \Aimeos\Controller\Frontend\Product\Decorator\Base::class ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder(\Aimeos\Controller\Frontend\Product\Decorator\Base::class) |
|
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::class )->getMock(); |
|
41 | + $stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Iface::class)->getMock(); |
|
42 | 42 | |
43 | - $this->setExpectedException( \Aimeos\MW\Common\Exception::class ); |
|
43 | + $this->setExpectedException(\Aimeos\MW\Common\Exception::class); |
|
44 | 44 | |
45 | - $this->getMockBuilder( \Aimeos\Controller\Frontend\Product\Decorator\Base::class ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder(\Aimeos\Controller\Frontend\Product\Decorator\Base::class) |
|
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\Product\Standard::class ) |
|
53 | + $stub = $this->getMockBuilder(\Aimeos\Controller\Frontend\Product\Standard::class) |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( \Aimeos\Controller\Frontend\Product\Decorator\Base::class ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder(\Aimeos\Controller\Frontend\Product\Decorator\Base::class) |
|
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 testAggregate() |
69 | 69 | { |
70 | - $this->stub->expects( $this->once() )->method( 'aggregate' ) |
|
71 | - ->will( $this->returnValue( [] ) ); |
|
70 | + $this->stub->expects($this->once())->method('aggregate') |
|
71 | + ->will($this->returnValue([])); |
|
72 | 72 | |
73 | - $this->assertEquals( [], $this->object->aggregate( 'test' ) ); |
|
73 | + $this->assertEquals([], $this->object->aggregate('test')); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | { |
79 | 79 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
80 | 80 | |
81 | - $this->stub->expects( $this->once() )->method( 'allOf' ) |
|
82 | - ->will( $this->returnValue( $this->stub ) ); |
|
81 | + $this->stub->expects($this->once())->method('allOf') |
|
82 | + ->will($this->returnValue($this->stub)); |
|
83 | 83 | |
84 | - $this->assertInstanceOf( $expected, $this->object->allOf( [1, 2] ) ); |
|
84 | + $this->assertInstanceOf($expected, $this->object->allOf([1, 2])); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | { |
90 | 90 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
91 | 91 | |
92 | - $this->stub->expects( $this->once() )->method( 'category' ) |
|
93 | - ->will( $this->returnValue( $this->stub ) ); |
|
92 | + $this->stub->expects($this->once())->method('category') |
|
93 | + ->will($this->returnValue($this->stub)); |
|
94 | 94 | |
95 | - $this->assertInstanceOf( $expected, $this->object->category( 1, 'default', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ) ); |
|
95 | + $this->assertInstanceOf($expected, $this->object->category(1, 'default', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE)); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -100,34 +100,34 @@ discard block |
||
100 | 100 | { |
101 | 101 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
102 | 102 | |
103 | - $this->stub->expects( $this->once() )->method( 'compare' ) |
|
104 | - ->will( $this->returnValue( $this->stub ) ); |
|
103 | + $this->stub->expects($this->once())->method('compare') |
|
104 | + ->will($this->returnValue($this->stub)); |
|
105 | 105 | |
106 | - $this->assertInstanceOf( $expected, $this->object->compare( '==', 'product.code', 'test' ) ); |
|
106 | + $this->assertInstanceOf($expected, $this->object->compare('==', 'product.code', 'test')); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | 110 | public function testGet() |
111 | 111 | { |
112 | - $item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
112 | + $item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
113 | 113 | $expected = \Aimeos\MShop\Product\Item\Iface::class; |
114 | 114 | |
115 | - $this->stub->expects( $this->once() )->method( 'get' ) |
|
116 | - ->will( $this->returnValue( $item ) ); |
|
115 | + $this->stub->expects($this->once())->method('get') |
|
116 | + ->will($this->returnValue($item)); |
|
117 | 117 | |
118 | - $this->assertInstanceOf( $expected, $this->object->get( 1, ['text'] ) ); |
|
118 | + $this->assertInstanceOf($expected, $this->object->get(1, ['text'])); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | 122 | public function testFind() |
123 | 123 | { |
124 | - $item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
124 | + $item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
125 | 125 | $expected = \Aimeos\MShop\Product\Item\Iface::class; |
126 | 126 | |
127 | - $this->stub->expects( $this->once() )->method( 'find' ) |
|
128 | - ->will( $this->returnValue( $item ) ); |
|
127 | + $this->stub->expects($this->once())->method('find') |
|
128 | + ->will($this->returnValue($item)); |
|
129 | 129 | |
130 | - $this->assertInstanceOf( $expected, $this->object->find( 'test', ['text'] ) ); |
|
130 | + $this->assertInstanceOf($expected, $this->object->find('test', ['text'])); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | { |
136 | 136 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
137 | 137 | |
138 | - $this->stub->expects( $this->once() )->method( 'oneOf' ) |
|
139 | - ->will( $this->returnValue( $this->stub ) ); |
|
138 | + $this->stub->expects($this->once())->method('oneOf') |
|
139 | + ->will($this->returnValue($this->stub)); |
|
140 | 140 | |
141 | - $this->assertInstanceOf( $expected, $this->object->oneOf( [1, 2] ) ); |
|
141 | + $this->assertInstanceOf($expected, $this->object->oneOf([1, 2])); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | { |
147 | 147 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
148 | 148 | |
149 | - $this->stub->expects( $this->once() )->method( 'parse' ) |
|
150 | - ->will( $this->returnValue( $this->stub ) ); |
|
149 | + $this->stub->expects($this->once())->method('parse') |
|
150 | + ->will($this->returnValue($this->stub)); |
|
151 | 151 | |
152 | - $this->assertInstanceOf( $expected, $this->object->parse( [] ) ); |
|
152 | + $this->assertInstanceOf($expected, $this->object->parse([])); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -157,23 +157,23 @@ discard block |
||
157 | 157 | { |
158 | 158 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
159 | 159 | |
160 | - $this->stub->expects( $this->once() )->method( 'product' ) |
|
161 | - ->will( $this->returnValue( $this->stub ) ); |
|
160 | + $this->stub->expects($this->once())->method('product') |
|
161 | + ->will($this->returnValue($this->stub)); |
|
162 | 162 | |
163 | - $this->assertInstanceOf( $expected, $this->object->product( [1, 3] ) ); |
|
163 | + $this->assertInstanceOf($expected, $this->object->product([1, 3])); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
167 | 167 | public function testSearch() |
168 | 168 | { |
169 | - $item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
169 | + $item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
170 | 170 | $expected = \Aimeos\MShop\Product\Item\Iface::class; |
171 | 171 | $total = 0; |
172 | 172 | |
173 | - $this->stub->expects( $this->once() )->method( 'search' ) |
|
174 | - ->will( $this->returnValue( [$item] ) ); |
|
173 | + $this->stub->expects($this->once())->method('search') |
|
174 | + ->will($this->returnValue([$item])); |
|
175 | 175 | |
176 | - $this->assertEquals( [$item], $this->object->search( ['text'], $total ) ); |
|
176 | + $this->assertEquals([$item], $this->object->search(['text'], $total)); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | { |
182 | 182 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
183 | 183 | |
184 | - $this->stub->expects( $this->once() )->method( 'slice' ) |
|
185 | - ->will( $this->returnValue( $this->stub ) ); |
|
184 | + $this->stub->expects($this->once())->method('slice') |
|
185 | + ->will($this->returnValue($this->stub)); |
|
186 | 186 | |
187 | - $this->assertInstanceOf( $expected, $this->object->slice( 0, 100 ) ); |
|
187 | + $this->assertInstanceOf($expected, $this->object->slice(0, 100)); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | { |
193 | 193 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
194 | 194 | |
195 | - $this->stub->expects( $this->once() )->method( 'sort' ) |
|
196 | - ->will( $this->returnValue( $this->stub ) ); |
|
195 | + $this->stub->expects($this->once())->method('sort') |
|
196 | + ->will($this->returnValue($this->stub)); |
|
197 | 197 | |
198 | - $this->assertInstanceOf( $expected, $this->object->sort( 'code' ) ); |
|
198 | + $this->assertInstanceOf($expected, $this->object->sort('code')); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | { |
204 | 204 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
205 | 205 | |
206 | - $this->stub->expects( $this->once() )->method( 'supplier' ) |
|
207 | - ->will( $this->returnValue( $this->stub ) ); |
|
206 | + $this->stub->expects($this->once())->method('supplier') |
|
207 | + ->will($this->returnValue($this->stub)); |
|
208 | 208 | |
209 | - $this->assertInstanceOf( $expected, $this->object->supplier( [1], 'default' ) ); |
|
209 | + $this->assertInstanceOf($expected, $this->object->supplier([1], 'default')); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | |
@@ -214,26 +214,26 @@ discard block |
||
214 | 214 | { |
215 | 215 | $expected = \Aimeos\Controller\Frontend\Product\Iface::class; |
216 | 216 | |
217 | - $this->stub->expects( $this->once() )->method( 'text' ) |
|
218 | - ->will( $this->returnValue( $this->stub ) ); |
|
217 | + $this->stub->expects($this->once())->method('text') |
|
218 | + ->will($this->returnValue($this->stub)); |
|
219 | 219 | |
220 | - $this->assertInstanceOf( $expected, $this->object->text( 'test' ) ); |
|
220 | + $this->assertInstanceOf($expected, $this->object->text('test')); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | |
224 | 224 | public function testGetController() |
225 | 225 | { |
226 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
226 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
227 | 227 | |
228 | - $this->assertSame( $this->stub, $result ); |
|
228 | + $this->assertSame($this->stub, $result); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | |
232 | - protected function access( $name ) |
|
232 | + protected function access($name) |
|
233 | 233 | { |
234 | - $class = new \ReflectionClass( \Aimeos\Controller\Frontend\Product\Decorator\Base::class ); |
|
235 | - $method = $class->getMethod( $name ); |
|
236 | - $method->setAccessible( true ); |
|
234 | + $class = new \ReflectionClass(\Aimeos\Controller\Frontend\Product\Decorator\Base::class); |
|
235 | + $method = $class->getMethod($name); |
|
236 | + $method->setAccessible(true); |
|
237 | 237 | |
238 | 238 | return $method; |
239 | 239 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string|null $name Name of the controller implementaton (default: "Standard") |
29 | 29 | * @return \Aimeos\Controller\Frontend\Product\Iface Controller object |
30 | 30 | */ |
31 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
31 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
32 | 32 | { |
33 | 33 | /** controller/frontend/product/name |
34 | 34 | * Class name of the used product frontend controller implementation |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | * @since 2017.03 |
64 | 64 | * @category Developer |
65 | 65 | */ |
66 | - if( $name === null ) { |
|
67 | - $name = $context->getConfig()->get( 'controller/frontend/product/name', 'Standard' ); |
|
66 | + if ($name === null) { |
|
67 | + $name = $context->getConfig()->get('controller/frontend/product/name', 'Standard'); |
|
68 | 68 | } |
69 | 69 | |
70 | - if( ctype_alnum( $name ) === false ) |
|
70 | + if (ctype_alnum($name) === false) |
|
71 | 71 | { |
72 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Frontend\\Product\\' . $name : '<not a string>'; |
|
73 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
72 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Frontend\\Product\\' . $name : '<not a string>'; |
|
73 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $iface = '\\Aimeos\\Controller\\Frontend\\Product\\Iface'; |
77 | 77 | $classname = '\\Aimeos\\Controller\\Frontend\\Product\\' . $name; |
78 | 78 | |
79 | - $controller = self::createController( $context, $classname, $iface ); |
|
79 | + $controller = self::createController($context, $classname, $iface); |
|
80 | 80 | |
81 | 81 | /** controller/frontend/product/decorators/excludes |
82 | 82 | * Excludes decorators added by the "common" option from the product frontend controllers |
@@ -152,6 +152,6 @@ discard block |
||
152 | 152 | * @see controller/frontend/product/decorators/excludes |
153 | 153 | * @see controller/frontend/product/decorators/global |
154 | 154 | */ |
155 | - return self::addControllerDecorators( $context, $controller, 'product' ); |
|
155 | + return self::addControllerDecorators($context, $controller, 'product'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param boolean $value True to enable caching, false to disable it. |
28 | 28 | * @return boolean Previous cache setting |
29 | 29 | */ |
30 | - static public function cache( $value ) |
|
30 | + static public function cache($value) |
|
31 | 31 | { |
32 | 32 | self::$cache = (boolean) $value; |
33 | 33 | self::$objects = []; |
@@ -49,26 +49,26 @@ discard block |
||
49 | 49 | * @return \Aimeos\Controller\Frontend\Iface New frontend controller |
50 | 50 | * @throws \Aimeos\Controller\Frontend\Exception If the given path is invalid or the manager wasn't found |
51 | 51 | */ |
52 | - static public function create( \Aimeos\MShop\Context\Item\Iface $context, $path ) |
|
52 | + static public function create(\Aimeos\MShop\Context\Item\Iface $context, $path) |
|
53 | 53 | { |
54 | - if( empty( $path ) ) { |
|
55 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Controller path is empty' ) ); |
|
54 | + if (empty($path)) { |
|
55 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Controller path is empty')); |
|
56 | 56 | } |
57 | 57 | |
58 | - if( self::$cache === false || !isset( self::$objects[$path] ) ) |
|
58 | + if (self::$cache === false || !isset(self::$objects[$path])) |
|
59 | 59 | { |
60 | - if( ctype_alnum( $path ) === false ) { |
|
61 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid characters in controller name "%1$s"', $path ) ); |
|
60 | + if (ctype_alnum($path) === false) { |
|
61 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid characters in controller name "%1$s"', $path)); |
|
62 | 62 | } |
63 | 63 | |
64 | - $factory = '\\Aimeos\\Controller\\Frontend\\' . ucfirst( $path ) . '\\Factory'; |
|
64 | + $factory = '\\Aimeos\\Controller\\Frontend\\' . ucfirst($path) . '\\Factory'; |
|
65 | 65 | |
66 | - if( class_exists( $factory ) === false ) { |
|
67 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
66 | + if (class_exists($factory) === false) { |
|
67 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
68 | 68 | } |
69 | 69 | |
70 | - if( ( $controller = call_user_func_array( [$factory, 'create'], [$context] ) ) === false ) { |
|
71 | - throw new \Aimeos\Controller\Frontend\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
70 | + if (($controller = call_user_func_array([$factory, 'create'], [$context])) === false) { |
|
71 | + throw new \Aimeos\Controller\Frontend\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | self::$objects[$path] = $controller; |