Completed
Push — master ( 0229de...f71bfb )
by Aimeos
04:41
created
admin/jqadm/tests/Admin/JQAdm/Subscription/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Subscription\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Subscription\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Subscription\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Subscription\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Subscription\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Subscription\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Subscription\Factory::create( $this->context, '%subscription' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Subscription\Factory::create($this->context, '%subscription');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Subscription\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Subscription\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Plugin/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Plugin\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Plugin\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Plugin\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Plugin\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Plugin\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Plugin\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Plugin\Factory::create( $this->context, '%plugin' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Plugin\Factory::create($this->context, '%plugin');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Plugin\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Plugin\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Group/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Group\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Group\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Group\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Group\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Group\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Group\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Group\Factory::create( $this->context, '%group' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Group\Factory::create($this->context, '%group');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Group\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Group\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Order/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, '%order' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, '%order');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, '%product' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, '%product');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/StandardTest.php 1 patch
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context );
29
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
30
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
31
-		$this->object->setView( $this->view );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context);
29
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
30
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
31
+		$this->object->setView($this->view);
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->view, $this->context );
37
+		unset($this->object, $this->view, $this->context);
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function testCreateException()
48 48
 	{
49
-		$object = $this->getClientMock( 'getSubClients' );
49
+		$object = $this->getClientMock('getSubClients');
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \RuntimeException() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \RuntimeException()));
53 53
 
54 54
 		$object->create();
55 55
 	}
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function testCreateMShopException()
59 59
 	{
60
-		$object = $this->getClientMock( 'getSubClients' );
60
+		$object = $this->getClientMock('getSubClients');
61 61
 
62
-		$object->expects( $this->once() )->method( 'getSubClients' )
63
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
62
+		$object->expects($this->once())->method('getSubClients')
63
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
64 64
 
65 65
 		$object->create();
66 66
 	}
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 
69 69
 	public function testCopy()
70 70
 	{
71
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop::create($this->context, 'product');
72 72
 
73
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
74
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
75
-		$this->view->addHelper( 'param', $helper );
73
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
74
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
75
+		$this->view->addHelper('param', $helper);
76 76
 
77 77
 		$result = $this->object->copy();
78 78
 
79
-		$this->assertContains( 'CNC_copy', $result );
79
+		$this->assertContains('CNC_copy', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testCopyException()
84 84
 	{
85
-		$object = $this->getClientMock( 'getSubClients' );
85
+		$object = $this->getClientMock('getSubClients');
86 86
 
87
-		$object->expects( $this->once() )->method( 'getSubClients' )
88
-			->will( $this->throwException( new \RuntimeException() ) );
87
+		$object->expects($this->once())->method('getSubClients')
88
+			->will($this->throwException(new \RuntimeException()));
89 89
 
90 90
 		$object->copy();
91 91
 	}
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 
94 94
 	public function testCopyMShopException()
95 95
 	{
96
-		$object = $this->getClientMock( 'getSubClients' );
96
+		$object = $this->getClientMock('getSubClients');
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testDelete()
106 106
 	{
107
-		$this->assertNotNull( $this->object->delete() );
107
+		$this->assertNotNull($this->object->delete());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testDeleteException()
112 112
 	{
113
-		$object = $this->getClientMock( 'getSubClients' );
113
+		$object = $this->getClientMock('getSubClients');
114 114
 
115
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
116
-			->will( $this->throwException( new \RuntimeException() ) );
115
+		$object->expects($this->exactly(2))->method('getSubClients')
116
+			->will($this->throwException(new \RuntimeException()));
117 117
 
118 118
 		$object->delete();
119 119
 	}
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDeleteMShopException()
123 123
 	{
124
-		$object = $this->getClientMock( 'getSubClients' );
124
+		$object = $this->getClientMock('getSubClients');
125 125
 
126
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
127
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
126
+		$object->expects($this->exactly(2))->method('getSubClients')
127
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
128 128
 
129 129
 		$object->delete();
130 130
 	}
@@ -132,24 +132,24 @@  discard block
 block discarded – undo
132 132
 
133 133
 	public function testGet()
134 134
 	{
135
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
135
+		$manager = \Aimeos\MShop::create($this->context, 'product');
136 136
 
137
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
138
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
139
-		$this->view->addHelper( 'param', $helper );
137
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
138
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
139
+		$this->view->addHelper('param', $helper);
140 140
 
141 141
 		$result = $this->object->get();
142 142
 
143
-		$this->assertContains( 'CNC', $result );
143
+		$this->assertContains('CNC', $result);
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetException()
148 148
 	{
149
-		$object = $this->getClientMock( 'getSubClients' );
149
+		$object = $this->getClientMock('getSubClients');
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \RuntimeException() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \RuntimeException()));
153 153
 
154 154
 		$object->get();
155 155
 	}
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function testGetMShopException()
159 159
 	{
160
-		$object = $this->getClientMock( 'getSubClients' );
160
+		$object = $this->getClientMock('getSubClients');
161 161
 
162
-		$object->expects( $this->once() )->method( 'getSubClients' )
163
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
162
+		$object->expects($this->once())->method('getSubClients')
163
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
164 164
 
165 165
 		$object->get();
166 166
 	}
@@ -168,16 +168,16 @@  discard block
 block discarded – undo
168 168
 
169 169
 	public function testGetViewException()
170 170
 	{
171
-		$object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, [] );
171
+		$object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, []);
172 172
 
173
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
180
+		$manager = \Aimeos\MShop::create($this->context, 'product');
181 181
 
182 182
 		$param = array(
183 183
 			'site' => 'unittest',
@@ -189,27 +189,27 @@  discard block
 block discarded – undo
189 189
 				'product.datestart' => null,
190 190
 				'product.dateend' => null,
191 191
 				'config' => array(
192
-					'key' => array( 0 => 'test key' ),
193
-					'val' => array( 0 => 'test value' ),
192
+					'key' => array(0 => 'test key'),
193
+					'val' => array(0 => 'test value'),
194 194
 				),
195 195
 			),
196 196
 		);
197 197
 
198
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
199
-		$this->view->addHelper( 'param', $helper );
198
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
199
+		$this->view->addHelper('param', $helper);
200 200
 
201 201
 		$this->object->save();
202 202
 
203
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
203
+		$manager->deleteItem($manager->findItem('test')->getId());
204 204
 	}
205 205
 
206 206
 
207 207
 	public function testSaveException()
208 208
 	{
209
-		$object = $this->getClientMock( 'fromArray' );
209
+		$object = $this->getClientMock('fromArray');
210 210
 
211
-		$object->expects( $this->once() )->method( 'fromArray' )
212
-			->will( $this->throwException( new \RuntimeException() ) );
211
+		$object->expects($this->once())->method('fromArray')
212
+			->will($this->throwException(new \RuntimeException()));
213 213
 
214 214
 		$object->save();
215 215
 	}
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 
218 218
 	public function testSaveMShopException()
219 219
 	{
220
-		$object = $this->getClientMock( 'fromArray' );
220
+		$object = $this->getClientMock('fromArray');
221 221
 
222
-		$object->expects( $this->once() )->method( 'fromArray' )
223
-			->will( $this->throwException( new \RuntimeException() ) );
222
+		$object->expects($this->once())->method('fromArray')
223
+			->will($this->throwException(new \RuntimeException()));
224 224
 
225 225
 		$object->save();
226 226
 	}
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
 
229 229
 	public function testSaveJQAdmException()
230 230
 	{
231
-		$object = $this->getClientMock( 'fromArray' );
231
+		$object = $this->getClientMock('fromArray');
232 232
 
233
-		$object->expects( $this->once() )->method( 'fromArray' )
234
-			->will( $this->throwException( new \RuntimeException() ) );
233
+		$object->expects($this->once())->method('fromArray')
234
+			->will($this->throwException(new \RuntimeException()));
235 235
 
236 236
 		$object->save();
237 237
 	}
@@ -242,27 +242,27 @@  discard block
 block discarded – undo
242 242
 		$param = array(
243 243
 			'site' => 'unittest', 'lang' => 'de',
244 244
 			'filter' => array(
245
-				'key' => array( 0 => 'product.code' ),
246
-				'op' => array( 0 => '==' ),
247
-				'val' => array( 0 => 'CNE' ),
245
+				'key' => array(0 => 'product.code'),
246
+				'op' => array(0 => '=='),
247
+				'val' => array(0 => 'CNE'),
248 248
 			),
249
-			'sort' => array( 'product.label', '-product.id' ),
249
+			'sort' => array('product.label', '-product.id'),
250 250
 		);
251
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
252
-		$this->view->addHelper( 'param', $helper );
251
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
252
+		$this->view->addHelper('param', $helper);
253 253
 
254 254
 		$result = $this->object->search();
255 255
 
256
-		$this->assertContains( '>CNE<', $result );
256
+		$this->assertContains('>CNE<', $result);
257 257
 	}
258 258
 
259 259
 
260 260
 	public function testSearchException()
261 261
 	{
262
-		$object = $this->getClientMock( 'initCriteria' );
262
+		$object = $this->getClientMock('initCriteria');
263 263
 
264
-		$object->expects( $this->once() )->method( 'initCriteria' )
265
-			->will( $this->throwException( new \RuntimeException() ) );
264
+		$object->expects($this->once())->method('initCriteria')
265
+			->will($this->throwException(new \RuntimeException()));
266 266
 
267 267
 		$object->search();
268 268
 	}
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 
271 271
 	public function testSearchMShopException()
272 272
 	{
273
-		$object = $this->getClientMock( 'initCriteria' );
273
+		$object = $this->getClientMock('initCriteria');
274 274
 
275
-		$object->expects( $this->once() )->method( 'initCriteria' )
276
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
275
+		$object->expects($this->once())->method('initCriteria')
276
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
277 277
 
278 278
 		$object->search();
279 279
 	}
@@ -281,52 +281,52 @@  discard block
 block discarded – undo
281 281
 
282 282
 	public function testGetSubClient()
283 283
 	{
284
-		$result = $this->object->getSubClient( 'media' );
285
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
284
+		$result = $this->object->getSubClient('media');
285
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
286 286
 	}
287 287
 
288 288
 
289 289
 	public function testGetSubClientInvalid()
290 290
 	{
291
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
292
-		$this->object->getSubClient( '$unknown$' );
291
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
292
+		$this->object->getSubClient('$unknown$');
293 293
 	}
294 294
 
295 295
 
296 296
 	public function testGetSubClientUnknown()
297 297
 	{
298
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
299
-		$this->object->getSubClient( 'unknown' );
298
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
299
+		$this->object->getSubClient('unknown');
300 300
 	}
301 301
 
302 302
 
303 303
 	public function testGetSubClientDecorators()
304 304
 	{
305
-		$this->context->getConfig()->set( 'admin/jqadm/product/media/decorators/global', array( 'Cache' ) );
305
+		$this->context->getConfig()->set('admin/jqadm/product/media/decorators/global', array('Cache'));
306 306
 
307
-		$result = $this->object->getSubClient( 'media' );
308
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
307
+		$result = $this->object->getSubClient('media');
308
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
309 309
 	}
310 310
 
311 311
 
312 312
 	public function testGetSubClientDecoratorInvalid()
313 313
 	{
314
-		$this->context->getConfig()->set( 'admin/jqadm/product/media/decorators/global', array( 'Invalid' ) );
314
+		$this->context->getConfig()->set('admin/jqadm/product/media/decorators/global', array('Invalid'));
315 315
 
316
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
317
-		$this->object->getSubClient( 'media' );
316
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
317
+		$this->object->getSubClient('media');
318 318
 	}
319 319
 
320 320
 
321
-	public function getClientMock( $method )
321
+	public function getClientMock($method)
322 322
 	{
323
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Standard::class )
324
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
325
-			->setMethods( [$method] )
323
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Standard::class)
324
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
325
+			->setMethods([$method])
326 326
 			->getMock();
327 327
 
328
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
329
-		$object->setView( $this->getViewNoRender() );
328
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
329
+		$object->setView($this->getViewNoRender());
330 330
 
331 331
 		return $object;
332 332
 	}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 
335 335
 	protected function getViewNoRender()
336 336
 	{
337
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
338
-			->setConstructorArgs( array( [] ) )
339
-			->setMethods( array( 'render', 'config' ) )
337
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
338
+			->setConstructorArgs(array([]))
339
+			->setMethods(array('render', 'config'))
340 340
 			->getMock();
341 341
 
342
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
342
+		$manager = \Aimeos\MShop::create($this->context, 'product');
343 343
 
344
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
345
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
346
-		$view->addHelper( 'param', $helper );
344
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
345
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
346
+		$view->addHelper('param', $helper);
347 347
 
348
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
349
-		$view->addHelper( 'access', $helper );
348
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
349
+		$view->addHelper('access', $helper);
350 350
 
351 351
 		return $view;
352 352
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Image/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Media\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Media\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-media', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-media', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC', ['media'] );
53
+		$this->view->item = $manager->findItem('CNC', ['media']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '&quot;media.preview&quot;:&quot;prod_114x95\/194_prod_114x95.jpg&quot;', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('&quot;media.preview&quot;:&quot;prod_114x95\/194_prod_114x95.jpg&quot;', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'product');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'product');
76 76
 
77
-		$this->view->item = $manager->findItem( 'CNC', ['media'] );
77
+		$this->view->item = $manager->findItem('CNC', ['media']);
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '&quot;media.preview&quot;:&quot;prod_114x95\/194_prod_114x95.jpg&quot;', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('&quot;media.preview&quot;:&quot;prod_114x95\/194_prod_114x95.jpg&quot;', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'product');
88 88
 		$this->view->item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -98,108 +98,108 @@  discard block
 block discarded – undo
98 98
 			]],
99 99
 		);
100 100
 
101
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
102
-		$this->view->addHelper( 'param', $helper );
101
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
102
+		$this->view->addHelper('param', $helper);
103 103
 
104
-		$file = $this->getMockBuilder( \Psr\Http\Message\UploadedFileInterface::class )->getMock();
105
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
106
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
107
-			->will( $this->returnValue( ['media' => [0 => ['file' => $file] ] ] ) );
104
+		$file = $this->getMockBuilder(\Psr\Http\Message\UploadedFileInterface::class)->getMock();
105
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
106
+		$request->expects($this->any())->method('getUploadedFiles')
107
+			->will($this->returnValue(['media' => [0 => ['file' => $file]]]));
108 108
 
109
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
110
-		$this->view ->addHelper( 'request', $helper );
109
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
110
+		$this->view ->addHelper('request', $helper);
111 111
 
112 112
 
113 113
 		$name = 'AdminJQAdmProductMediaSave';
114
-		$this->context->getConfig()->set( 'controller/common/media/name', $name );
114
+		$this->context->getConfig()->set('controller/common/media/name', $name);
115 115
 
116
-		$cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' )
117
-			->setConstructorArgs( array( $this->context ) )
118
-			->setMethods( array( 'add' ) )
116
+		$cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard')
117
+			->setConstructorArgs(array($this->context))
118
+			->setMethods(array('add'))
119 119
 			->getMock();
120 120
 
121
-		\Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub );
121
+		\Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub);
122 122
 
123
-		$cntlStub->expects( $this->once() )->method( 'add' );
123
+		$cntlStub->expects($this->once())->method('add');
124 124
 
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128 128
 
129
-		$this->assertNull( $this->view->get( 'errors' ) );
130
-		$this->assertNull( $result );
131
-		$this->assertEquals( 1, count( $this->view->item->getListItems() ) );
129
+		$this->assertNull($this->view->get('errors'));
130
+		$this->assertNull($result);
131
+		$this->assertEquals(1, count($this->view->item->getListItems()));
132 132
 
133
-		foreach( $this->view->item->getListItems( 'media' ) as $listItem )
133
+		foreach ($this->view->item->getListItems('media') as $listItem)
134 134
 		{
135
-			$this->assertEquals( 'media', $listItem->getDomain() );
135
+			$this->assertEquals('media', $listItem->getDomain());
136 136
 
137 137
 			$refItem = $listItem->getRefItem();
138
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
139
-			$this->assertEquals( 'test', $refItem->getLabel() );
138
+			$this->assertEquals('de', $refItem->getLanguageId());
139
+			$this->assertEquals('test', $refItem->getLabel());
140 140
 		}
141 141
 
142 142
 
143
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['site' => 'unittest', 'media' => []] );
144
-		$this->view->addHelper( 'param', $helper );
143
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['site' => 'unittest', 'media' => []]);
144
+		$this->view->addHelper('param', $helper);
145 145
 
146 146
 		$result = $this->object->save();
147 147
 
148
-		$this->assertNull( $this->view->get( 'errors' ) );
149
-		$this->assertNull( $result );
150
-		$this->assertEquals( 0, count( $this->view->item->getListItems() ) );
148
+		$this->assertNull($this->view->get('errors'));
149
+		$this->assertNull($result);
150
+		$this->assertEquals(0, count($this->view->item->getListItems()));
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSaveException()
155 155
 	{
156
-		$object = $this->getClientMock( 'fromArray' );
156
+		$object = $this->getClientMock('fromArray');
157 157
 
158
-		$object->expects( $this->once() )->method( 'fromArray' )
159
-			->will( $this->throwException( new \RuntimeException() ) );
158
+		$object->expects($this->once())->method('fromArray')
159
+			->will($this->throwException(new \RuntimeException()));
160 160
 
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162 162
 		$object->save();
163 163
 	}
164 164
 
165 165
 
166 166
 	public function testSaveMShopException()
167 167
 	{
168
-		$object = $this->getClientMock( 'fromArray' );
168
+		$object = $this->getClientMock('fromArray');
169 169
 
170
-		$object->expects( $this->once() )->method( 'fromArray' )
171
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
170
+		$object->expects($this->once())->method('fromArray')
171
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
172 172
 
173
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->save();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSearch()
179 179
 	{
180
-		$this->assertNull( $this->object->search() );
180
+		$this->assertNull($this->object->search());
181 181
 	}
182 182
 
183 183
 
184 184
 	public function testGetSubClient()
185 185
 	{
186
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
187
-		$this->object->getSubClient( 'unknown' );
186
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
187
+		$this->object->getSubClient('unknown');
188 188
 	}
189 189
 
190 190
 
191
-	public function getClientMock( $method )
191
+	public function getClientMock($method)
192 192
 	{
193
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Media\Standard::class )
194
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
195
-			->setMethods( [$method] )
193
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Media\Standard::class)
194
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
195
+			->setMethods([$method])
196 196
 			->getMock();
197 197
 
198 198
 		$view = \TestHelperJqadm::getView();
199
-		$view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
199
+		$view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
200 200
 
201
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
202
-		$object->setView( $view );
201
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
202
+		$object->setView($view);
203 203
 
204 204
 		return $object;
205 205
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Image/Property/StandardTest.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Media\Property\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Media\Property\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Media properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Media properties', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC', ['media'] );
53
+		$this->view->item = $manager->findItem('CNC', ['media']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'item-media-property', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('item-media-property', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,32 +62,32 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC', ['media'] );
74
+		$this->view->item = $manager->findItem('CNC', ['media']);
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'item-media-property', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('item-media-property', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 
86
-		$item = $manager->findItem( 'CNC', ['media'] );
87
-		$item->setCode( 'jqadm-test-media-property' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC', ['media']);
87
+		$item->setCode('jqadm-test-media-property');
88
+		$item->setId(null);
89 89
 
90
-		$this->view->item = $manager->saveItem( $item );
90
+		$this->view->item = $manager->saveItem($item);
91 91
 
92 92
 		$param = array(
93 93
 			'site' => 'unittest',
@@ -103,53 +103,53 @@  discard block
 block discarded – undo
103 103
 			),
104 104
 		);
105 105
 
106
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
107
-		$this->view->addHelper( 'param', $helper );
106
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
107
+		$this->view->addHelper('param', $helper);
108 108
 
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112 112
 
113
-		$manager->deleteItem( $this->view->item->getId() );
113
+		$manager->deleteItem($this->view->item->getId());
114 114
 
115
-		$this->assertNull( $this->view->get( 'errors' ) );
116
-		$this->assertNull( $result );
115
+		$this->assertNull($this->view->get('errors'));
116
+		$this->assertNull($result);
117 117
 
118
-		$mediaItems = $this->view->item->getRefItems( 'media' );
119
-		$this->assertEquals( 2, count( $mediaItems ) );
120
-		$this->assertEquals( 1, count( reset( $mediaItems )->getPropertyItems() ) );
118
+		$mediaItems = $this->view->item->getRefItems('media');
119
+		$this->assertEquals(2, count($mediaItems));
120
+		$this->assertEquals(1, count(reset($mediaItems)->getPropertyItems()));
121 121
 	}
122 122
 
123 123
 
124 124
 	public function testSaveException()
125 125
 	{
126
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Media\Property\Standard::class )
127
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
128
-			->setMethods( array( 'fromArray' ) )
126
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Media\Property\Standard::class)
127
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
128
+			->setMethods(array('fromArray'))
129 129
 			->getMock();
130 130
 
131
-		$object->expects( $this->once() )->method( 'fromArray' )
132
-			->will( $this->throwException( new \RuntimeException() ) );
131
+		$object->expects($this->once())->method('fromArray')
132
+			->will($this->throwException(new \RuntimeException()));
133 133
 
134 134
 		$this->view = \TestHelperJqadm::getView();
135
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
135
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
136 136
 
137
-		$object->setView( $this->view );
137
+		$object->setView($this->view);
138 138
 
139
-		$this->setExpectedException( \RuntimeException::class );
139
+		$this->setExpectedException(\RuntimeException::class);
140 140
 		$object->save();
141 141
 	}
142 142
 
143 143
 
144 144
 	public function testSearch()
145 145
 	{
146
-		$this->assertNull( $this->object->search() );
146
+		$this->assertNull($this->object->search());
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testGetSubClient()
151 151
 	{
152
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
153
-		$this->object->getSubClient( 'unknown' );
152
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
153
+		$this->object->getSubClient('unknown');
154 154
 	}
155 155
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, '%attribute' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, '%attribute');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.