Completed
Push — master ( 97a1e0...2507d2 )
by Aimeos
03:34
created
jqadm/tests/Admin/JQAdm/Product/Characteristic/Property/StandardTest.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Properties', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Properties', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC' );
52
+		$this->view->item = $manager->findItem('CNC');
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'Properties', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('Properties', $result);
57 57
 	}
58 58
 
59 59
 
@@ -61,111 +61,111 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		$result = $this->object->delete();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertNull( $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertNull($result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'CNC' );
73
+		$this->view->item = $manager->findItem('CNC');
74 74
 		$result = $this->object->get();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertContains( 'Properties', $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertContains('Properties', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSave()
82 82
 	{
83
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
84
-		$propManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property' );
85
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
83
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
84
+		$propManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property');
85
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
86 86
 
87
-		$item = $manager->findItem( 'CNC' );
88
-		$item->setCode( 'jqadm-test-property' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('CNC');
88
+		$item->setCode('jqadm-test-property');
89
+		$item->setId(null);
90 90
 
91
-		$manager->saveItem( $item );
91
+		$manager->saveItem($item);
92 92
 
93 93
 
94
-		$typeid = $typeManager->findItem( 'package-height', array(), 'product' )->getId();
94
+		$typeid = $typeManager->findItem('package-height', array(), 'product')->getId();
95 95
 
96 96
 		$param = array(
97 97
 			'characteristic' => array(
98 98
 				'property' => array(
99
-					'product.property.id' => array( '' ),
100
-					'product.property.typeid' => array( $typeid ),
101
-					'product.property.value' => array( '10.0' ),
99
+					'product.property.id' => array(''),
100
+					'product.property.typeid' => array($typeid),
101
+					'product.property.value' => array('10.0'),
102 102
 				),
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
 		$this->view->item = $item;
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112 112
 		$search = $propManager->createSearch();
113
-		$search->setConditions( $search->compare( '==', 'product.property.parentid', $item->getId() ) );
114
-		$items = $propManager->searchItems( $search );
113
+		$search->setConditions($search->compare('==', 'product.property.parentid', $item->getId()));
114
+		$items = $propManager->searchItems($search);
115 115
 
116
-		$manager->deleteItem( $item->getId() );
116
+		$manager->deleteItem($item->getId());
117 117
 
118
-		$this->assertNull( $this->view->get( 'errors' ) );
119
-		$this->assertNull( $result );
120
-		$this->assertEquals( 1, count( $items ) );
121
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
122
-		$this->assertEquals( '10.0', reset( $items )->getValue() );
118
+		$this->assertNull($this->view->get('errors'));
119
+		$this->assertNull($result);
120
+		$this->assertEquals(1, count($items));
121
+		$this->assertEquals(null, reset($items)->getLanguageId());
122
+		$this->assertEquals('10.0', reset($items)->getValue());
123 123
 	}
124 124
 
125 125
 
126 126
 	public function testSaveException()
127 127
 	{
128
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard' )
129
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
130
-			->setMethods( array( 'updateItems' ) )
128
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard')
129
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
130
+			->setMethods(array('updateItems'))
131 131
 			->getMock();
132 132
 
133
-		$object->expects( $this->once() )->method( 'updateItems' )
134
-			->will( $this->throwException( new \Exception() ) );
133
+		$object->expects($this->once())->method('updateItems')
134
+			->will($this->throwException(new \Exception()));
135 135
 
136
-		$object->setView( \TestHelperJqadm::getView() );
136
+		$object->setView(\TestHelperJqadm::getView());
137 137
 
138
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
138
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
139 139
 		$object->save();
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testSaveMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'updateItems' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('updateItems'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'updateItems' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('updateItems')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( \TestHelperJqadm::getView() );
153
+		$object->setView(\TestHelperJqadm::getView());
154 154
 
155
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
155
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
156 156
 		$object->save();
157 157
 	}
158 158
 
159 159
 
160 160
 	public function testSearch()
161 161
 	{
162
-		$this->assertNull( $this->object->search() );
162
+		$this->assertNull($this->object->search());
163 163
 	}
164 164
 
165 165
 
166 166
 	public function testGetSubClient()
167 167
 	{
168
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
169
-		$this->object->getSubClient( 'invalid' );
168
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
169
+		$this->object->getSubClient('invalid');
170 170
 	}
171 171
 }
Please login to merge, or discard this patch.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Attribute/StandardTest.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Attributes', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Attributes', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC', array( 'attribute' ) );
52
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'xs', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('xs', $result);
57 57
 	}
58 58
 
59 59
 
@@ -61,102 +61,102 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		$result = $this->object->delete();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertNull( $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertNull($result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'CNC', array( 'attribute' ) );
73
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
74 74
 		$result = $this->object->get();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertContains( 'xs', $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertContains('xs', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSave()
82 82
 	{
83
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
84
-		$attrManager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' );
83
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
84
+		$attrManager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute');
85 85
 
86
-		$item = $manager->findItem( 'CNC' );
87
-		$item->setCode( 'jqadm-test-attribute' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC');
87
+		$item->setCode('jqadm-test-attribute');
88
+		$item->setId(null);
89 89
 
90
-		$manager->saveItem( $item );
90
+		$manager->saveItem($item);
91 91
 
92 92
 
93 93
 		$param = array(
94 94
 			'characteristic' => array(
95 95
 				'attribute' => array(
96
-					'product.lists.id' => array( '' ),
97
-					'product.lists.refid' => array( $attrManager->findItem( 'xs', array(), 'product', 'size' )->getId() ),
96
+					'product.lists.id' => array(''),
97
+					'product.lists.refid' => array($attrManager->findItem('xs', array(), 'product', 'size')->getId()),
98 98
 				),
99 99
 			),
100 100
 		);
101 101
 
102
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
103
-		$this->view->addHelper( 'param', $helper );
102
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
103
+		$this->view->addHelper('param', $helper);
104 104
 		$this->view->item = $item;
105 105
 
106 106
 		$result = $this->object->save();
107 107
 
108
-		$item = $manager->getItem( $item->getId(), array( 'attribute' ) );
109
-		$manager->deleteItem( $item->getId() );
108
+		$item = $manager->getItem($item->getId(), array('attribute'));
109
+		$manager->deleteItem($item->getId());
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems( 'attribute' ) ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems('attribute')));
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testSaveException()
118 118
 	{
119
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard' )
120
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
121
-			->setMethods( array( 'updateItems' ) )
119
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard')
120
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
121
+			->setMethods(array('updateItems'))
122 122
 			->getMock();
123 123
 
124
-		$object->expects( $this->once() )->method( 'updateItems' )
125
-			->will( $this->throwException( new \Exception() ) );
124
+		$object->expects($this->once())->method('updateItems')
125
+			->will($this->throwException(new \Exception()));
126 126
 
127
-		$object->setView( \TestHelperJqadm::getView() );
127
+		$object->setView(\TestHelperJqadm::getView());
128 128
 
129
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
129
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
130 130
 		$object->save();
131 131
 	}
132 132
 
133 133
 
134 134
 	public function testSaveMShopException()
135 135
 	{
136
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard' )
137
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
138
-			->setMethods( array( 'updateItems' ) )
136
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard')
137
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
138
+			->setMethods(array('updateItems'))
139 139
 			->getMock();
140 140
 
141
-		$object->expects( $this->once() )->method( 'updateItems' )
142
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
141
+		$object->expects($this->once())->method('updateItems')
142
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
143 143
 
144
-		$object->setView( \TestHelperJqadm::getView() );
144
+		$object->setView(\TestHelperJqadm::getView());
145 145
 
146
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
146
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
147 147
 		$object->save();
148 148
 	}
149 149
 
150 150
 
151 151
 	public function testSearch()
152 152
 	{
153
-		$this->assertNull( $this->object->search() );
153
+		$this->assertNull($this->object->search());
154 154
 	}
155 155
 
156 156
 
157 157
 	public function testGetSubClient()
158 158
 	{
159
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
160
-		$this->object->getSubClient( 'invalid' );
159
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
160
+		$this->object->getSubClient('invalid');
161 161
 	}
162 162
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Bundle/StandardTest.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -22,39 +22,39 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Bundles', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Bundles', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) );
52
+		$this->view->item = $manager->findItem('U:BUNDLE', array('product'));
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'Cafe Noire Cappuccino', $result );
57
-		$this->assertContains( 'Cafe Noire Expresso', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('Cafe Noire Cappuccino', $result);
57
+		$this->assertContains('Cafe Noire Expresso', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,100 +62,100 @@  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\Factory::createManager( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) );
74
+		$this->view->item = $manager->findItem('U:BUNDLE', array('product'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Cafe Noire Cappuccino', $result );
79
-		$this->assertContains( 'Cafe Noire Expresso', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Cafe Noire Cappuccino', $result);
79
+		$this->assertContains('Cafe Noire Expresso', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testSave()
84 84
 	{
85
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
85
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
86 86
 
87
-		$item = $manager->findItem( 'U:BUNDLE' );
88
-		$item->setCode( 'jqadm-test-bundle' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('U:BUNDLE');
88
+		$item->setCode('jqadm-test-bundle');
89
+		$item->setId(null);
90 90
 
91
-		$manager->saveItem( $item );
91
+		$manager->saveItem($item);
92 92
 
93 93
 
94 94
 		$param = array(
95 95
 			'bundle' => array(
96
-				'product.lists.id' => array( '' ),
97
-				'product.lists.refid' => array( $manager->findItem( 'CNE' )->getId() ),
96
+				'product.lists.id' => array(''),
97
+				'product.lists.refid' => array($manager->findItem('CNE')->getId()),
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
 		$this->view->item = $item;
104 104
 
105 105
 		$result = $this->object->save();
106 106
 
107
-		$item = $manager->getItem( $item->getId(), array( 'product' ) );
108
-		$manager->deleteItem( $item->getId() );
107
+		$item = $manager->getItem($item->getId(), array('product'));
108
+		$manager->deleteItem($item->getId());
109 109
 
110
-		$this->assertNull( $this->view->get( 'errors' ) );
111
-		$this->assertNull( $result );
112
-		$this->assertEquals( 1, count( $item->getListItems( 'product' ) ) );
110
+		$this->assertNull($this->view->get('errors'));
111
+		$this->assertNull($result);
112
+		$this->assertEquals(1, count($item->getListItems('product')));
113 113
 	}
114 114
 
115 115
 
116 116
 	public function testSaveException()
117 117
 	{
118
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Bundle\Standard' )
119
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
120
-			->setMethods( array( 'updateItems' ) )
118
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Bundle\Standard')
119
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
120
+			->setMethods(array('updateItems'))
121 121
 			->getMock();
122 122
 
123
-		$object->expects( $this->once() )->method( 'updateItems' )
124
-			->will( $this->throwException( new \Exception() ) );
123
+		$object->expects($this->once())->method('updateItems')
124
+			->will($this->throwException(new \Exception()));
125 125
 
126
-		$object->setView( \TestHelperJqadm::getView() );
126
+		$object->setView(\TestHelperJqadm::getView());
127 127
 
128
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
128
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
129 129
 		$object->save();
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testSaveMShopException()
134 134
 	{
135
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Bundle\Standard' )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'updateItems' ) )
135
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Bundle\Standard')
136
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
137
+			->setMethods(array('updateItems'))
138 138
 			->getMock();
139 139
 
140
-		$object->expects( $this->once() )->method( 'updateItems' )
141
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
140
+		$object->expects($this->once())->method('updateItems')
141
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
142 142
 
143
-		$object->setView( \TestHelperJqadm::getView() );
143
+		$object->setView(\TestHelperJqadm::getView());
144 144
 
145
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
145
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
146 146
 		$object->save();
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testSearch()
151 151
 	{
152
-		$this->assertNull( $this->object->search() );
152
+		$this->assertNull($this->object->search());
153 153
 	}
154 154
 
155 155
 
156 156
 	public function testGetSubClient()
157 157
 	{
158
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
159
-		$this->object->getSubClient( 'invalid' );
158
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
159
+		$this->object->getSubClient('invalid');
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/BaseTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -17,83 +17,83 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		$this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' )
21
-			->setMethods( array( 'copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient' ) )
20
+		$this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard')
21
+			->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient'))
22 22
 			->disableOriginalConstructor()
23 23
 			->getMock();
24 24
 
25 25
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
26 26
 		$context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->mock, $context, $templatePaths );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->mock, $context, $templatePaths);
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object, $this->mock );
34
+		unset($this->object, $this->mock);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCallInvalid()
39 39
 	{
40
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
40
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
41 41
 		$this->object->invalidMethod();
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCopy()
46 46
 	{
47
-		$this->mock->expects( $this->once() )->method( 'copy' )->will( $this->returnValue( 'test' ) );
47
+		$this->mock->expects($this->once())->method('copy')->will($this->returnValue('test'));
48 48
 
49
-		$this->assertEquals( 'test', $this->object->copy() );
49
+		$this->assertEquals('test', $this->object->copy());
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testCreate()
54 54
 	{
55
-		$this->mock->expects( $this->once() )->method( 'create' )->will( $this->returnValue( 'test' ) );
55
+		$this->mock->expects($this->once())->method('create')->will($this->returnValue('test'));
56 56
 
57
-		$this->assertEquals( 'test', $this->object->create() );
57
+		$this->assertEquals('test', $this->object->create());
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) );
63
+		$this->mock->expects($this->once())->method('delete')->will($this->returnValue('test'));
64 64
 
65
-		$this->assertEquals( 'test', $this->object->delete() );
65
+		$this->assertEquals('test', $this->object->delete());
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$this->mock->expects( $this->once() )->method( 'get' )->will( $this->returnValue( 'test' ) );
71
+		$this->mock->expects($this->once())->method('get')->will($this->returnValue('test'));
72 72
 
73
-		$this->assertEquals( 'test', $this->object->get() );
73
+		$this->assertEquals('test', $this->object->get());
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testSave()
78 78
 	{
79
-		$this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) );
79
+		$this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
80 80
 
81
-		$this->assertEquals( 'test', $this->object->save() );
81
+		$this->assertEquals('test', $this->object->save());
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSearch()
86 86
 	{
87
-		$this->mock->expects( $this->once() )->method( 'search' )->will( $this->returnValue( 'test' ) );
87
+		$this->mock->expects($this->once())->method('search')->will($this->returnValue('test'));
88 88
 
89
-		$this->assertEquals( 'test', $this->object->search() );
89
+		$this->assertEquals('test', $this->object->search());
90 90
 	}
91 91
 
92 92
 
93 93
 	public function testGetSubClient()
94 94
 	{
95
-		$this->mock->expects( $this->once() )->method( 'getSubClient' )->will( $this->returnValue( 'test' ) );
95
+		$this->mock->expects($this->once())->method('getSubClient')->will($this->returnValue('test'));
96 96
 
97
-		$this->assertEquals( 'test', $this->object->getSubClient( 'invalid' ) );
97
+		$this->assertEquals('test', $this->object->getSubClient('invalid'));
98 98
 	}
99 99
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Factory/BaseTest.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -17,103 +17,103 @@  discard block
 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
 		$config = $this->context->getConfig();
23
-		$config->set( 'admin/jqadm/common/decorators/default', array() );
24
-		$config->set( 'admin/jqadm/decorators/global', array() );
25
-		$config->set( 'admin/jqadm/decorators/local', array() );
23
+		$config->set('admin/jqadm/common/decorators/default', array());
24
+		$config->set('admin/jqadm/decorators/global', array());
25
+		$config->set('admin/jqadm/decorators/local', array());
26 26
 
27 27
 	}
28 28
 
29 29
 
30 30
 	public function testInjectClient()
31 31
 	{
32
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
33
-		\Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client );
32
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
33
+		\Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client);
34 34
 
35
-		$iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
35
+		$iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
36 36
 
37
-		$this->assertSame( $client, $iClient );
37
+		$this->assertSame($client, $iClient);
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testInjectClientReset()
42 42
 	{
43
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
44
-		\Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client );
45
-		\Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null );
43
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
44
+		\Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client);
45
+		\Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null);
46 46
 
47
-		$new = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
47
+		$new = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
48 48
 
49
-		$this->assertNotSame( $client, $new );
49
+		$this->assertNotSame($client, $new);
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testAddDecorators()
54 54
 	{
55
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
55
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
56 56
 
57
-		$result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client,
58
-			array(), array( 'Cache' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' );
57
+		$result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client,
58
+			array(), array('Cache'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\');
59 59
 
60
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
60
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testAddDecoratorsInvalidName()
65 65
 	{
66
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
66
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
67 67
 
68
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
69
-		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(),
70
-			array( '$' ), 'Test' );
68
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
69
+		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(),
70
+			array('$'), 'Test');
71 71
 	}
72 72
 
73 73
 
74 74
 	public function testAddDecoratorsInvalidClass()
75 75
 	{
76
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
76
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
77 77
 
78
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
79
-		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(),
80
-			array( 'Test' ), 'TestDecorator' );
78
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
79
+		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(),
80
+			array('Test'), 'TestDecorator');
81 81
 	}
82 82
 
83 83
 
84 84
 	public function testAddDecoratorsInvalidInterface()
85 85
 	{
86
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
86
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
87 87
 
88
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
89
-		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(),
90
-			array( 'Test' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' );
88
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
89
+		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(),
90
+			array('Test'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\');
91 91
 	}
92 92
 
93 93
 
94 94
 	public function testAddClientDecoratorsExcludes()
95 95
 	{
96
-		$this->context->getConfig()->set( 'admin/jqadm/decorators/excludes', array( 'TestDecorator' ) );
97
-		$this->context->getConfig()->set( 'admin/jqadm/common/decorators/default', array( 'TestDecorator' ) );
96
+		$this->context->getConfig()->set('admin/jqadm/decorators/excludes', array('TestDecorator'));
97
+		$this->context->getConfig()->set('admin/jqadm/common/decorators/default', array('TestDecorator'));
98 98
 
99
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
100
-		\Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
99
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
100
+		\Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testAddClientDecoratorsEmptyPath()
105 105
 	{
106
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' );
106
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard');
107 107
 
108
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
109
-		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic( $this->context, $client, array(), '' );
108
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
109
+		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic($this->context, $client, array(), '');
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testCreateClientBase()
114 114
 	{
115
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
116
-		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic( $this->context, 'Test', 'Test', array() );
115
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
116
+		\Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic($this->context, 'Test', 'Test', array());
117 117
 	}
118 118
 }
119 119
 
@@ -125,22 +125,22 @@  discard block
 block discarded – undo
125 125
 	 * @param string $classprefix
126 126
 	 * @param string $path
127 127
 	 */
128
-	public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context,
129
-		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix )
128
+	public static function addDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context,
129
+		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix)
130 130
 	{
131
-		return self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix );
131
+		return self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix);
132 132
 	}
133 133
 
134
-	public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context,
135
-		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path )
134
+	public static function addClientDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context,
135
+		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path)
136 136
 	{
137
-		return self::addClientDecorators( $context, $client, $templatePaths, $path );
137
+		return self::addClientDecorators($context, $client, $templatePaths, $path);
138 138
 	}
139 139
 
140
-	public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context,
141
-		$classname, $interface, $templatePath )
140
+	public static function createClientBasePublic(\Aimeos\MShop\Context\Item\Iface $context,
141
+		$classname, $interface, $templatePath)
142 142
 	{
143
-		return self::createClientBase( $context, $classname, $interface, $templatePath );
143
+		return self::createClientBase($context, $classname, $interface, $templatePath);
144 144
 	}
145 145
 }
146 146
 
Please login to merge, or discard this patch.
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -121,18 +121,28 @@
 block discarded – undo
121 121
 class TestAbstract
122 122
 	extends \Aimeos\Admin\JQAdm\Common\Factory\Base
123 123
 {
124
+	/**
125
+	 * @param string $classprefix
126
+	 */
124 127
 	public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context,
125 128
 		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix )
126 129
 	{
127 130
 		return self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix );
128 131
 	}
129 132
 
133
+	/**
134
+	 * @param string $path
135
+	 */
130 136
 	public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context,
131 137
 		\Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path )
132 138
 	{
133 139
 		return self::addClientDecorators( $context, $client, $templatePaths, $path );
134 140
 	}
135 141
 
142
+	/**
143
+	 * @param string $classname
144
+	 * @param string $interface
145
+	 */
136 146
 	public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context,
137 147
 		$classname, $interface, $templatePath )
138 148
 	{
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
 	{
18 18
 		$this->templatePaths = \TestHelperJqadm::getTemplatePaths();
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::createClient( $this->context, $this->templatePaths );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths);
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::createClient( $this->context, $this->templatePaths, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, '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::createClient( $this->context, $this->templatePaths, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, '');
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::createClient( $this->context, $this->templatePaths, '%product' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, '%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::createClient( $this->context, $this->templatePaths, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, '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   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@  discard block
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->view = \TestHelperJqadm::getView();
20
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
21
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
22
-		$this->view ->addHelper( 'request', $helper );
20
+		$request = $this->getMock('\Psr\Http\Message\ServerRequestInterface');
21
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
22
+		$this->view ->addHelper('request', $helper);
23 23
 
24 24
 		$this->context = \TestHelperJqadm::getContext();
25 25
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
26 26
 
27
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths );
28
-		$this->object->setView( $this->view );
27
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths);
28
+		$this->object->setView($this->view);
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object );
34
+		unset($this->object);
35 35
 	}
36 36
 
37 37
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 
44 44
 	public function testCreateException()
45 45
 	{
46
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
47
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
48
-			->setMethods( array( 'getSubClients' ) )
46
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
47
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
48
+			->setMethods(array('getSubClients'))
49 49
 			->getMock();
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \Exception() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \Exception()));
53 53
 
54
-		$object->setView( $this->getViewNoRender() );
54
+		$object->setView($this->getViewNoRender());
55 55
 
56 56
 		$object->create();
57 57
 	}
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 
60 60
 	public function testCreateMShopException()
61 61
 	{
62
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
63
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
64
-			->setMethods( array( 'getSubClients' ) )
62
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
63
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
64
+			->setMethods(array('getSubClients'))
65 65
 			->getMock();
66 66
 
67
-		$object->expects( $this->once() )->method( 'getSubClients' )
68
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
67
+		$object->expects($this->once())->method('getSubClients')
68
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
69 69
 
70
-		$object->setView( $this->getViewNoRender() );
70
+		$object->setView($this->getViewNoRender());
71 71
 
72 72
 		$object->create();
73 73
 	}
@@ -75,29 +75,29 @@  discard block
 block discarded – undo
75 75
 
76 76
 	public function testCopy()
77 77
 	{
78
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
78
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
79 79
 
80
-		$param = array( 'id' => $manager->findItem( 'CNC' )->getId() );
81
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
82
-		$this->view->addHelper( 'param', $helper );
80
+		$param = array('id' => $manager->findItem('CNC')->getId());
81
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
82
+		$this->view->addHelper('param', $helper);
83 83
 
84 84
 		$result = $this->object->copy();
85 85
 
86
-		$this->assertContains( 'CNC_copy', $result );
86
+		$this->assertContains('CNC_copy', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testCopyException()
91 91
 	{
92
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
93
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
94
-			->setMethods( array( 'getSubClients' ) )
92
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
93
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
94
+			->setMethods(array('getSubClients'))
95 95
 			->getMock();
96 96
 
97
-		$object->expects( $this->once() )->method( 'getSubClients' )
98
-			->will( $this->throwException( new \Exception() ) );
97
+		$object->expects($this->once())->method('getSubClients')
98
+			->will($this->throwException(new \Exception()));
99 99
 
100
-		$object->setView( $this->getViewNoRender() );
100
+		$object->setView($this->getViewNoRender());
101 101
 
102 102
 		$object->copy();
103 103
 	}
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 
106 106
 	public function testCopyMShopException()
107 107
 	{
108
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
109
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
110
-			->setMethods( array( 'getSubClients' ) )
108
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
109
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
110
+			->setMethods(array('getSubClients'))
111 111
 			->getMock();
112 112
 
113
-		$object->expects( $this->once() )->method( 'getSubClients' )
114
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
113
+		$object->expects($this->once())->method('getSubClients')
114
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
115 115
 
116
-		$object->setView( $this->getViewNoRender() );
116
+		$object->setView($this->getViewNoRender());
117 117
 
118 118
 		$object->copy();
119 119
 	}
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDelete()
123 123
 	{
124
-		$this->assertNull( $this->object->delete() );
124
+		$this->assertNull($this->object->delete());
125 125
 	}
126 126
 
127 127
 
128 128
 	public function testDeleteException()
129 129
 	{
130
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
131
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
132
-			->setMethods( array( 'getSubClients' ) )
130
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
131
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
132
+			->setMethods(array('getSubClients'))
133 133
 			->getMock();
134 134
 
135
-		$object->expects( $this->once() )->method( 'getSubClients' )
136
-			->will( $this->throwException( new \Exception() ) );
135
+		$object->expects($this->once())->method('getSubClients')
136
+			->will($this->throwException(new \Exception()));
137 137
 
138
-		$object->setView( $this->getViewNoRender() );
138
+		$object->setView($this->getViewNoRender());
139 139
 
140 140
 		$object->delete();
141 141
 	}
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 
144 144
 	public function testDeleteMShopException()
145 145
 	{
146
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
147
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
148
-			->setMethods( array( 'getSubClients' ) )
146
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
147
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
148
+			->setMethods(array('getSubClients'))
149 149
 			->getMock();
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
153 153
 
154
-		$object->setView( $this->getViewNoRender() );
154
+		$object->setView($this->getViewNoRender());
155 155
 
156 156
 		$object->delete();
157 157
 	}
@@ -159,29 +159,29 @@  discard block
 block discarded – undo
159 159
 
160 160
 	public function testGet()
161 161
 	{
162
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
162
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
163 163
 
164
-		$param = array( 'id' => $manager->findItem( 'CNC' )->getId() );
165
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
166
-		$this->view->addHelper( 'param', $helper );
164
+		$param = array('id' => $manager->findItem('CNC')->getId());
165
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
166
+		$this->view->addHelper('param', $helper);
167 167
 
168 168
 		$result = $this->object->get();
169 169
 
170
-		$this->assertContains( 'CNC', $result );
170
+		$this->assertContains('CNC', $result);
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testGetException()
175 175
 	{
176
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
177
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
178
-			->setMethods( array( 'getSubClients' ) )
176
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
177
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
178
+			->setMethods(array('getSubClients'))
179 179
 			->getMock();
180 180
 
181
-		$object->expects( $this->once() )->method( 'getSubClients' )
182
-			->will( $this->throwException( new \Exception() ) );
181
+		$object->expects($this->once())->method('getSubClients')
182
+			->will($this->throwException(new \Exception()));
183 183
 
184
-		$object->setView( $this->getViewNoRender() );
184
+		$object->setView($this->getViewNoRender());
185 185
 
186 186
 		$object->get();
187 187
 	}
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
 
190 190
 	public function testGetMShopException()
191 191
 	{
192
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
193
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
194
-			->setMethods( array( 'getSubClients' ) )
192
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
193
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
194
+			->setMethods(array('getSubClients'))
195 195
 			->getMock();
196 196
 
197
-		$object->expects( $this->once() )->method( 'getSubClients' )
198
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
197
+		$object->expects($this->once())->method('getSubClients')
198
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
199 199
 
200
-		$object->setView( $this->getViewNoRender() );
200
+		$object->setView($this->getViewNoRender());
201 201
 
202 202
 		$object->get();
203 203
 	}
@@ -205,24 +205,24 @@  discard block
 block discarded – undo
205 205
 
206 206
 	public function testGetViewException()
207 207
 	{
208
-		$object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, array() );
208
+		$object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, array());
209 209
 
210
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
210
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
211 211
 		$object->getView();
212 212
 	}
213 213
 
214 214
 
215 215
 	public function testSave()
216 216
 	{
217
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
218
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
217
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
218
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/type');
219 219
 
220 220
 		$search = $typeManager->createSearch();
221
-		$search->setSlice( 0, 1 );
222
-		$typeItems = $typeManager->searchItems( $search );
221
+		$search->setSlice(0, 1);
222
+		$typeItems = $typeManager->searchItems($search);
223 223
 
224
-		if( ( $typeItem = reset( $typeItems ) ) === false ) {
225
-			throw new \Exception( 'No product type item found' );
224
+		if (($typeItem = reset($typeItems)) === false) {
225
+			throw new \Exception('No product type item found');
226 226
 		}
227 227
 
228 228
 
@@ -235,42 +235,42 @@  discard block
 block discarded – undo
235 235
 				'product.datestart' => null,
236 236
 				'product.dateend' => null,
237 237
 				'config' => array(
238
-					'key' => array( 0 => 'test key' ),
239
-					'val' => array( 0 => 'test value' ),
238
+					'key' => array(0 => 'test key'),
239
+					'val' => array(0 => 'test value'),
240 240
 				),
241 241
 			),
242 242
 		);
243 243
 
244
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
245
-		$this->view->addHelper( 'param', $helper );
244
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
245
+		$this->view->addHelper('param', $helper);
246 246
 
247 247
 		$this->object->save();
248 248
 
249
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
249
+		$manager->deleteItem($manager->findItem('test')->getId());
250 250
 	}
251 251
 
252 252
 
253 253
 	public function testSaveException()
254 254
 	{
255
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
256
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
257
-			->setMethods( array( 'getSubClients' ) )
255
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
256
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
257
+			->setMethods(array('getSubClients'))
258 258
 			->getMock();
259 259
 
260 260
 		$name = 'AdminJQAdmStandard';
261
-		$this->context->getConfig()->set( 'mshop/product/manager/name', $name );
261
+		$this->context->getConfig()->set('mshop/product/manager/name', $name);
262 262
 
263
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' )
264
-			->setConstructorArgs( array( $this->context ) )
265
-			->setMethods( array( 'createItem' ) )
263
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard')
264
+			->setConstructorArgs(array($this->context))
265
+			->setMethods(array('createItem'))
266 266
 			->getMock();
267 267
 
268
-		$mock->expects( $this->exactly( 2 ) )->method( 'createItem' )
269
-			->will( $this->throwException( new \Exception() ) );
268
+		$mock->expects($this->exactly(2))->method('createItem')
269
+			->will($this->throwException(new \Exception()));
270 270
 
271
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock );
271
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock);
272 272
 
273
-		$object->setView( $this->getViewNoRender() );
273
+		$object->setView($this->getViewNoRender());
274 274
 
275 275
 		$object->save();
276 276
 	}
@@ -278,25 +278,25 @@  discard block
 block discarded – undo
278 278
 
279 279
 	public function testSaveMShopException()
280 280
 	{
281
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
282
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
283
-			->setMethods( array( 'getSubClients' ) )
281
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
282
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
283
+			->setMethods(array('getSubClients'))
284 284
 			->getMock();
285 285
 
286 286
 		$name = 'AdminJQAdmStandard';
287
-		$this->context->getConfig()->set( 'mshop/product/manager/name', $name );
287
+		$this->context->getConfig()->set('mshop/product/manager/name', $name);
288 288
 
289
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' )
290
-			->setConstructorArgs( array( $this->context ) )
291
-			->setMethods( array( 'createItem' ) )
289
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard')
290
+			->setConstructorArgs(array($this->context))
291
+			->setMethods(array('createItem'))
292 292
 			->getMock();
293 293
 
294
-		$mock->expects( $this->exactly( 2 ) )->method( 'createItem' )
295
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
294
+		$mock->expects($this->exactly(2))->method('createItem')
295
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
296 296
 
297
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock );
297
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock);
298 298
 
299
-		$object->setView( $this->getViewNoRender() );
299
+		$object->setView($this->getViewNoRender());
300 300
 
301 301
 		$object->save();
302 302
 	}
@@ -304,25 +304,25 @@  discard block
 block discarded – undo
304 304
 
305 305
 	public function testSaveJQAdmException()
306 306
 	{
307
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
308
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
309
-			->setMethods( array( 'getSubClients' ) )
307
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
308
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
309
+			->setMethods(array('getSubClients'))
310 310
 			->getMock();
311 311
 
312 312
 		$name = 'AdminJQAdmStandard';
313
-		$this->context->getConfig()->set( 'mshop/product/manager/name', $name );
313
+		$this->context->getConfig()->set('mshop/product/manager/name', $name);
314 314
 
315
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' )
316
-			->setConstructorArgs( array( $this->context ) )
317
-			->setMethods( array( 'createItem' ) )
315
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard')
316
+			->setConstructorArgs(array($this->context))
317
+			->setMethods(array('createItem'))
318 318
 			->getMock();
319 319
 
320
-		$mock->expects( $this->exactly( 2 ) )->method( 'createItem' )
321
-			->will( $this->throwException( new \Aimeos\Admin\JQAdm\Exception() ) );
320
+		$mock->expects($this->exactly(2))->method('createItem')
321
+			->will($this->throwException(new \Aimeos\Admin\JQAdm\Exception()));
322 322
 
323
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock );
323
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock);
324 324
 
325
-		$object->setView( $this->getViewNoRender() );
325
+		$object->setView($this->getViewNoRender());
326 326
 
327 327
 		$object->save();
328 328
 	}
@@ -333,32 +333,32 @@  discard block
 block discarded – undo
333 333
 		$param = array(
334 334
 			'site' => 'unittest', 'lang' => 'de',
335 335
 			'filter' => array(
336
-				'key' => array( 0 => 'product.code' ),
337
-				'op' => array( 0 => '==' ),
338
-				'val' => array( 0 => 'CNE' ),
336
+				'key' => array(0 => 'product.code'),
337
+				'op' => array(0 => '=='),
338
+				'val' => array(0 => 'CNE'),
339 339
 			),
340
-			'sort' => array( 'product.label', '-product.id' ),
340
+			'sort' => array('product.label', '-product.id'),
341 341
 		);
342
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
343
-		$this->view->addHelper( 'param', $helper );
342
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
343
+		$this->view->addHelper('param', $helper);
344 344
 
345 345
 		$result = $this->object->search();
346 346
 
347
-		$this->assertContains( '>CNE<', $result );
347
+		$this->assertContains('>CNE<', $result);
348 348
 	}
349 349
 
350 350
 
351 351
 	public function testSearchException()
352 352
 	{
353
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
354
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
355
-			->setMethods( array( 'getSubClients' ) )
353
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
354
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
355
+			->setMethods(array('getSubClients'))
356 356
 			->getMock();
357 357
 
358
-		$object->expects( $this->once() )->method( 'getSubClients' )
359
-			->will( $this->throwException( new \Exception() ) );
358
+		$object->expects($this->once())->method('getSubClients')
359
+			->will($this->throwException(new \Exception()));
360 360
 
361
-		$object->setView( $this->getViewNoRender() );
361
+		$object->setView($this->getViewNoRender());
362 362
 
363 363
 		$object->search();
364 364
 	}
@@ -366,15 +366,15 @@  discard block
 block discarded – undo
366 366
 
367 367
 	public function testSearchMShopException()
368 368
 	{
369
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
370
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
371
-			->setMethods( array( 'getSubClients' ) )
369
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
370
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
371
+			->setMethods(array('getSubClients'))
372 372
 			->getMock();
373 373
 
374
-		$object->expects( $this->once() )->method( 'getSubClients' )
375
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
374
+		$object->expects($this->once())->method('getSubClients')
375
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
376 376
 
377
-		$object->setView( $this->getViewNoRender() );
377
+		$object->setView($this->getViewNoRender());
378 378
 
379 379
 		$object->search();
380 380
 	}
@@ -382,48 +382,48 @@  discard block
 block discarded – undo
382 382
 
383 383
 	public function testGetSubClient()
384 384
 	{
385
-		$result = $this->object->getSubClient( 'image' );
386
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
385
+		$result = $this->object->getSubClient('image');
386
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
387 387
 	}
388 388
 
389 389
 
390 390
 	public function testGetSubClientEmpty()
391 391
 	{
392
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
393
-		$this->object->getSubClient( '' );
392
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
393
+		$this->object->getSubClient('');
394 394
 	}
395 395
 
396 396
 
397 397
 	public function testGetSubClientInvalid()
398 398
 	{
399
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
400
-		$this->object->getSubClient( 'invalid' );
399
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
400
+		$this->object->getSubClient('invalid');
401 401
 	}
402 402
 
403 403
 
404 404
 	public function testGetSubClientDecorators()
405 405
 	{
406
-		$this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Cache' ) );
406
+		$this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Cache'));
407 407
 
408
-		$result = $this->object->getSubClient( 'image' );
409
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
408
+		$result = $this->object->getSubClient('image');
409
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
410 410
 	}
411 411
 
412 412
 
413 413
 	public function testGetSubClientDecoratorInvalid()
414 414
 	{
415
-		$this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Invalid' ) );
415
+		$this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Invalid'));
416 416
 
417
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
418
-		$this->object->getSubClient( 'image' );
417
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
418
+		$this->object->getSubClient('image');
419 419
 	}
420 420
 
421 421
 
422 422
 	protected function getViewNoRender()
423 423
 	{
424
-		return $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
425
-			->setConstructorArgs( array( array() ) )
426
-			->setMethods( array( 'render', 'config' ) )
424
+		return $this->getMockBuilder('\Aimeos\MW\View\Standard')
425
+			->setConstructorArgs(array(array()))
426
+			->setMethods(array('render', 'config'))
427 427
 			->getMock();
428 428
 	}
429 429
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/TestHelperJqadm.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -13,51 +13,51 @@  discard block
 block discarded – undo
13 13
 	public static function bootstrap()
14 14
 	{
15 15
 		self::getAimeos();
16
-		\Aimeos\MShop\Factory::setCache( false );
16
+		\Aimeos\MShop\Factory::setCache(false);
17 17
 	}
18 18
 
19 19
 
20
-	public static function getContext( $site = 'unittest' )
20
+	public static function getContext($site = 'unittest')
21 21
 	{
22
-		if( !isset( self::$context[$site] ) ) {
23
-			self::$context[$site] = self::createContext( $site );
22
+		if (!isset(self::$context[$site])) {
23
+			self::$context[$site] = self::createContext($site);
24 24
 		}
25 25
 
26 26
 		return clone self::$context[$site];
27 27
 	}
28 28
 
29 29
 
30
-	public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null )
30
+	public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null)
31 31
 	{
32
-		if( $config === null ) {
33
-			$config = self::getContext( $site )->getConfig();
32
+		if ($config === null) {
33
+			$config = self::getContext($site)->getConfig();
34 34
 		}
35 35
 
36
-		$view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() );
36
+		$view = new \Aimeos\MW\View\Standard(self::getTemplatePaths());
37 37
 
38
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
39
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
40
-		$view->addHelper( 'translate', $helper );
38
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
39
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
40
+		$view->addHelper('translate', $helper);
41 41
 
42
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
43
-		$view->addHelper( 'url', $helper );
42
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
43
+		$view->addHelper('url', $helper);
44 44
 
45
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
46
-		$view->addHelper( 'number', $helper );
45
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
46
+		$view->addHelper('number', $helper);
47 47
 
48
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
49
-		$view->addHelper( 'date', $helper );
48
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
49
+		$view->addHelper('date', $helper);
50 50
 
51
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) );
52
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
53
-		$view->addHelper( 'config', $helper );
51
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm'));
52
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
53
+		$view->addHelper('config', $helper);
54 54
 
55
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' );
56
-		$view->addHelper( 'csrf', $helper );
55
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value');
56
+		$view->addHelper('csrf', $helper);
57 57
 
58
-		$fcn = function() { return array( 'admin' ); };
59
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
60
-		$view->addHelper( 'access', $helper );
58
+		$fcn = function() { return array('admin'); };
59
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
60
+		$view->addHelper('access', $helper);
61 61
 
62 62
 		return $view;
63 63
 	}
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public static function getTemplatePaths()
67 67
 	{
68
-		return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' );
68
+		return self::getAimeos()->getCustomPaths('admin/jqadm/templates');
69 69
 	}
70 70
 
71 71
 
72 72
 	private static function getAimeos()
73 73
 	{
74
-		if( !isset( self::$aimeos ) )
74
+		if (!isset(self::$aimeos))
75 75
 		{
76 76
 			require_once 'Bootstrap.php';
77
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
77
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
78 78
 
79
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
80
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
79
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
80
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
81 81
 		}
82 82
 
83 83
 		return self::$aimeos;
@@ -87,53 +87,53 @@  discard block
 block discarded – undo
87 87
 	/**
88 88
 	 * @param string $site
89 89
 	 */
90
-	private static function createContext( $site )
90
+	private static function createContext($site)
91 91
 	{
92 92
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
93 93
 		$aimeos = self::getAimeos();
94 94
 
95 95
 
96
-		$paths = $aimeos->getConfigPaths( 'mysql' );
96
+		$paths = $aimeos->getConfigPaths('mysql');
97 97
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
98 98
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
99
-		$local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) );
99
+		$local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp')));
100 100
 
101
-		$conf = new \Aimeos\MW\Config\PHPArray( $local, $paths );
102
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
103
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
104
-		$ctx->setConfig( $conf );
101
+		$conf = new \Aimeos\MW\Config\PHPArray($local, $paths);
102
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
103
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
104
+		$ctx->setConfig($conf);
105 105
 
106 106
 
107
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
108
-		$ctx->setDatabaseManager( $dbm );
107
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
108
+		$ctx->setDatabaseManager($dbm);
109 109
 
110 110
 
111
-		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf );
112
-		$ctx->setFilesystemManager( $fs );
111
+		$fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf);
112
+		$ctx->setFilesystemManager($fs);
113 113
 
114 114
 
115
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
116
-		$ctx->setLogger( $logger );
115
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
116
+		$ctx->setLogger($logger);
117 117
 
118 118
 
119 119
 		$cache = new \Aimeos\MW\Cache\None();
120
-		$ctx->setCache( $cache );
120
+		$ctx->setCache($cache);
121 121
 
122 122
 
123
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
124
-		$ctx->setI18n( array( 'de' => $i18n ) );
123
+		$i18n = new \Aimeos\MW\Translation\None('de');
124
+		$ctx->setI18n(array('de' => $i18n));
125 125
 
126 126
 
127 127
 		$session = new \Aimeos\MW\Session\None();
128
-		$ctx->setSession( $session );
128
+		$ctx->setSession($session);
129 129
 
130 130
 
131
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
132
-		$locale = $localeManager->bootstrap( $site, '', '', false );
133
-		$ctx->setLocale( $locale );
131
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
132
+		$locale = $localeManager->bootstrap($site, '', '', false);
133
+		$ctx->setLocale($locale);
134 134
 
135 135
 
136
-		$ctx->setEditor( 'core:admin/jqadm' );
136
+		$ctx->setEditor('core:admin/jqadm');
137 137
 
138 138
 		return $ctx;
139 139
 	}
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Common/Decorator/Page.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 	 * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output
26 26
 	 * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls
27 27
 	 */
28
-	public function setView( \Aimeos\MW\View\Iface $view )
28
+	public function setView(\Aimeos\MW\View\Iface $view)
29 29
 	{
30
-		$extdir = dirname( dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) );
31
-		$aimeos = new \Aimeos\Bootstrap( array( $extdir ) );
30
+		$extdir = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__DIR__))))))));
31
+		$aimeos = new \Aimeos\Bootstrap(array($extdir));
32 32
 
33 33
 		$view->pageSites = $this->getSites();
34
-		$view->pageLanguages = $aimeos->getI18nList( 'admin' );
34
+		$view->pageLanguages = $aimeos->getI18nList('admin');
35 35
 
36
-		$this->getClient()->setView( $view );
36
+		$this->getClient()->setView($view);
37 37
 		return $this;
38 38
 	}
39 39
 
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	protected function getSites()
47 47
 	{
48 48
 		$list = array();
49
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/site' );
49
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site');
50 50
 
51 51
 		$search = $manager->createSearch();
52
-		$search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) );
52
+		$search->setSortations(array($search->sort('+', 'locale.site.label')));
53 53
 
54
-		foreach( $manager->searchItems( $search ) as $item ) {
54
+		foreach ($manager->searchItems($search) as $item) {
55 55
 			$list[$item->getCode()] = $item->getLabel();
56 56
 		}
57 57
 
Please login to merge, or discard this patch.