Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
admin/jqadm/tests/Admin/JQAdm/Customer/Property/StandardTest.php 1 patch
Spacing   +46 added lines, -46 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\Customer\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\Customer\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, 'customer' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('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, 'customer' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
52 52
 
53
-		$this->view->item = $manager->findItem( 'UTC001', ['customer/property'] );
53
+		$this->view->item = $manager->findItem('UTC001', ['customer/property']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Properties', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Properties', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,26 +62,26 @@  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, 'customer' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
73 73
 
74
-		$this->view->item = $manager->findItem( 'UTC001', ['customer/property'] );
74
+		$this->view->item = $manager->findItem('UTC001', ['customer/property']);
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Properties', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Properties', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -95,70 +95,70 @@  discard block
 block discarded – undo
95 95
 			),
96 96
 		);
97 97
 
98
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
99
-		$this->view->addHelper( 'param', $helper );
98
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
99
+		$this->view->addHelper('param', $helper);
100 100
 
101 101
 		$result = $this->object->save();
102 102
 
103
-		$items = $this->view->item->getPropertyItems( null, false );
103
+		$items = $this->view->item->getPropertyItems(null, false);
104 104
 
105
-		$this->assertNull( $this->view->get( 'errors' ) );
106
-		$this->assertNull( $result );
107
-		$this->assertEquals( 1, count( $items ) );
108
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
109
-		$this->assertEquals( '#100000', reset( $items )->getValue() );
105
+		$this->assertNull($this->view->get('errors'));
106
+		$this->assertNull($result);
107
+		$this->assertEquals(1, count($items));
108
+		$this->assertEquals(null, reset($items)->getLanguageId());
109
+		$this->assertEquals('#100000', reset($items)->getValue());
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testSaveException()
114 114
 	{
115
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Property\Standard::class )
116
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
117
-			->setMethods( array( 'fromArray' ) )
115
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Property\Standard::class)
116
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
117
+			->setMethods(array('fromArray'))
118 118
 			->getMock();
119 119
 
120
-		$object->expects( $this->once() )->method( 'fromArray' )
121
-			->will( $this->throwException( new \RuntimeException() ) );
120
+		$object->expects($this->once())->method('fromArray')
121
+			->will($this->throwException(new \RuntimeException()));
122 122
 
123 123
 		$this->view = \TestHelperJqadm::getView();
124
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
124
+		$this->view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
125 125
 
126
-		$object->setView( $this->view );
126
+		$object->setView($this->view);
127 127
 
128
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
128
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
129 129
 		$object->save();
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testSaveMShopException()
134 134
 	{
135
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Property\Standard::class )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'fromArray' ) )
135
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Property\Standard::class)
136
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
137
+			->setMethods(array('fromArray'))
138 138
 			->getMock();
139 139
 
140
-		$object->expects( $this->once() )->method( 'fromArray' )
141
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
140
+		$object->expects($this->once())->method('fromArray')
141
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
142 142
 
143 143
 		$this->view = \TestHelperJqadm::getView();
144
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
144
+		$this->view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
145 145
 
146
-		$object->setView( $this->view );
146
+		$object->setView($this->view);
147 147
 
148
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
148
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
149 149
 		$object->save();
150 150
 	}
151 151
 
152 152
 
153 153
 	public function testSearch()
154 154
 	{
155
-		$this->assertNull( $this->object->search() );
155
+		$this->assertNull($this->object->search());
156 156
 	}
157 157
 
158 158
 
159 159
 	public function testGetSubClient()
160 160
 	{
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
162
-		$this->object->getSubClient( 'unknown' );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162
+		$this->object->getSubClient('unknown');
163 163
 	}
164 164
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Supplier/Address/StandardTest.php 1 patch
Spacing   +47 added lines, -47 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\Supplier\Address\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\Supplier\Address\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, 'supplier' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-address', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-address', $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, 'supplier' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
52 52
 
53
-		$this->view->item = $manager->findItem( 'unitCode001', array( 'supplier/address' ) );
53
+		$this->view->item = $manager->findItem('unitCode001', array('supplier/address'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Example company', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Example company', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,26 +62,26 @@  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, 'supplier' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
73 73
 
74
-		$this->view->item = $manager->findItem( 'unitCode001', array( 'supplier/address' ) );
74
+		$this->view->item = $manager->findItem('unitCode001', array('supplier/address'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Example company', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Example company', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -96,73 +96,73 @@  discard block
 block discarded – undo
96 96
 			),
97 97
 		);
98 98
 
99
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
100
-		$this->view->addHelper( 'param', $helper );
99
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
100
+		$this->view->addHelper('param', $helper);
101 101
 
102 102
 		$result = $this->object->save();
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $this->view->item->getAddressItems() ) );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($this->view->item->getAddressItems()));
107 107
 
108
-		foreach( $this->view->item->getAddressItems() as $addrItem )
108
+		foreach ($this->view->item->getAddressItems() as $addrItem)
109 109
 		{
110
-			$this->assertEquals( '[email protected]', $addrItem->getEmail() );
111
-			$this->assertEquals( 'test', $addrItem->getFirstname() );
112
-			$this->assertEquals( 'user', $addrItem->getLastname() );
110
+			$this->assertEquals('[email protected]', $addrItem->getEmail());
111
+			$this->assertEquals('test', $addrItem->getFirstname());
112
+			$this->assertEquals('user', $addrItem->getLastname());
113 113
 		}
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testSaveException()
118 118
 	{
119
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Address\Standard::class )
120
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
121
-			->setMethods( array( 'fromArray' ) )
119
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Address\Standard::class)
120
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
121
+			->setMethods(array('fromArray'))
122 122
 			->getMock();
123 123
 
124
-		$object->expects( $this->once() )->method( 'fromArray' )
125
-			->will( $this->throwException( new \RuntimeException() ) );
124
+		$object->expects($this->once())->method('fromArray')
125
+			->will($this->throwException(new \RuntimeException()));
126 126
 
127 127
 		$view = \TestHelperJqadm::getView();
128
-		$view->item = \Aimeos\MShop::create( $this->context, 'supplier' )->createItem();
128
+		$view->item = \Aimeos\MShop::create($this->context, 'supplier')->createItem();
129 129
 
130
-		$object->setView( $view );
130
+		$object->setView($view);
131 131
 
132
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
132
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
133 133
 		$object->save();
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testSaveMShopException()
138 138
 	{
139
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Address\Standard::class )
140
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
141
-			->setMethods( array( 'fromArray' ) )
139
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Address\Standard::class)
140
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
141
+			->setMethods(array('fromArray'))
142 142
 			->getMock();
143 143
 
144
-		$object->expects( $this->once() )->method( 'fromArray' )
145
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
144
+		$object->expects($this->once())->method('fromArray')
145
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
146 146
 
147 147
 		$this->view = \TestHelperJqadm::getView();
148
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'supplier' )->createItem();
148
+		$this->view->item = \Aimeos\MShop::create($this->context, 'supplier')->createItem();
149 149
 
150
-		$object->setView( $this->view );
150
+		$object->setView($this->view);
151 151
 
152
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
152
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
153 153
 		$object->save();
154 154
 	}
155 155
 
156 156
 
157 157
 	public function testSearch()
158 158
 	{
159
-		$this->assertNull( $this->object->search() );
159
+		$this->assertNull($this->object->search());
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testGetSubClient()
164 164
 	{
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
166
-		$this->object->getSubClient( 'unknown' );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166
+		$this->object->getSubClient('unknown');
167 167
 	}
168 168
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Supplier/Product/StandardTest.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  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\Supplier\Product\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\Supplier\Product\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 testCopy()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
40
-		$this->view->item = $manager->findItem( 'unitCode001' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
40
+		$this->view->item = $manager->findItem('unitCode001');
41 41
 
42 42
 		$result = $this->object->copy();
43 43
 
44
-		$this->assertContains( 'item-product', $result );
44
+		$this->assertContains('item-product', $result);
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopyException()
49 49
 	{
50
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
51
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
52
-			->setMethods( array( 'getSubClients' ) )
50
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
51
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
52
+			->setMethods(array('getSubClients'))
53 53
 			->getMock();
54 54
 
55
-		$object->expects( $this->once() )->method( 'getSubClients' )
56
-			->will( $this->throwException( new \RuntimeException() ) );
55
+		$object->expects($this->once())->method('getSubClients')
56
+			->will($this->throwException(new \RuntimeException()));
57 57
 
58
-		$object->setView( $this->getViewNoRender() );
58
+		$object->setView($this->getViewNoRender());
59 59
 
60 60
 		$object->copy();
61 61
 	}
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
 
64 64
 	public function testCopyMShopException()
65 65
 	{
66
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
67
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
68
-			->setMethods( array( 'getSubClients' ) )
66
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
67
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
68
+			->setMethods(array('getSubClients'))
69 69
 			->getMock();
70 70
 
71
-		$object->expects( $this->once() )->method( 'getSubClients' )
72
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
71
+		$object->expects($this->once())->method('getSubClients')
72
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
73 73
 
74
-		$object->setView( $this->getViewNoRender() );
74
+		$object->setView($this->getViewNoRender());
75 75
 
76 76
 		$object->copy();
77 77
 	}
@@ -79,26 +79,26 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public function testCreate()
81 81
 	{
82
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
83
-		$this->view->item = $manager->findItem( 'unitCode001' );
82
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
83
+		$this->view->item = $manager->findItem('unitCode001');
84 84
 
85 85
 		$result = $this->object->create();
86 86
 
87
-		$this->assertContains( 'item-product', $result );
87
+		$this->assertContains('item-product', $result);
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testCreateException()
92 92
 	{
93
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
94
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
95
-			->setMethods( array( 'getSubClients' ) )
93
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
94
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
95
+			->setMethods(array('getSubClients'))
96 96
 			->getMock();
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \RuntimeException() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \RuntimeException()));
100 100
 
101
-		$object->setView( $this->getViewNoRender() );
101
+		$object->setView($this->getViewNoRender());
102 102
 
103 103
 		$object->create();
104 104
 	}
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 
107 107
 	public function testCreateMShopException()
108 108
 	{
109
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
110
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
111
-			->setMethods( array( 'getSubClients' ) )
109
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
110
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
111
+			->setMethods(array('getSubClients'))
112 112
 			->getMock();
113 113
 
114
-		$object->expects( $this->once() )->method( 'getSubClients' )
115
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
114
+		$object->expects($this->once())->method('getSubClients')
115
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
116 116
 
117
-		$object->setView( $this->getViewNoRender() );
117
+		$object->setView($this->getViewNoRender());
118 118
 
119 119
 		$object->create();
120 120
 	}
@@ -122,27 +122,27 @@  discard block
 block discarded – undo
122 122
 
123 123
 	public function testGet()
124 124
 	{
125
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
126
-		$this->view->item = $manager->findItem( 'unitCode001' );
125
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
126
+		$this->view->item = $manager->findItem('unitCode001');
127 127
 
128 128
 		$result = $this->object->get();
129 129
 
130
-		$this->assertContains( 'item-product', $result );
131
-		$this->assertContains( 'default', $result );
130
+		$this->assertContains('item-product', $result);
131
+		$this->assertContains('default', $result);
132 132
 	}
133 133
 
134 134
 
135 135
 	public function testGetException()
136 136
 	{
137
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
138
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
139
-			->setMethods( array( 'getSubClients' ) )
137
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
138
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
139
+			->setMethods(array('getSubClients'))
140 140
 			->getMock();
141 141
 
142
-		$object->expects( $this->once() )->method( 'getSubClients' )
143
-			->will( $this->throwException( new \RuntimeException() ) );
142
+		$object->expects($this->once())->method('getSubClients')
143
+			->will($this->throwException(new \RuntimeException()));
144 144
 
145
-		$object->setView( $this->getViewNoRender() );
145
+		$object->setView($this->getViewNoRender());
146 146
 
147 147
 		$object->get();
148 148
 	}
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
 
151 151
 	public function testGetMShopException()
152 152
 	{
153
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
154
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
155
-			->setMethods( array( 'getSubClients' ) )
153
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
154
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
155
+			->setMethods(array('getSubClients'))
156 156
 			->getMock();
157 157
 
158
-		$object->expects( $this->once() )->method( 'getSubClients' )
159
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
158
+		$object->expects($this->once())->method('getSubClients')
159
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
160 160
 
161
-		$object->setView( $this->getViewNoRender() );
161
+		$object->setView($this->getViewNoRender());
162 162
 
163 163
 		$object->get();
164 164
 	}
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 
167 167
 	public function testSave()
168 168
 	{
169
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
169
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
170 170
 
171
-		$item = $manager->findItem( 'unitCode001' );
172
-		$item->setCode( 'jqadm-test-save' );
173
-		$item->setId( null );
171
+		$item = $manager->findItem('unitCode001');
172
+		$item->setCode('jqadm-test-save');
173
+		$item->setId(null);
174 174
 
175
-		$item = $manager->saveItem( $item );
175
+		$item = $manager->saveItem($item);
176 176
 
177 177
 
178 178
 		$param = array(
@@ -188,83 +188,83 @@  discard block
 block discarded – undo
188 188
 			),
189 189
 		);
190 190
 
191
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
192
-		$this->view->addHelper( 'param', $helper );
191
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
192
+		$this->view->addHelper('param', $helper);
193 193
 		$this->view->item = $item;
194 194
 
195 195
 		$result = $this->object->save();
196 196
 
197
-		$item = $manager->getItem( $item->getId(), ['product'] );
198
-		$manager->deleteItem( $item->getId() );
197
+		$item = $manager->getItem($item->getId(), ['product']);
198
+		$manager->deleteItem($item->getId());
199 199
 
200
-		$this->assertNull( $this->view->get( 'errors' ) );
201
-		$this->assertNull( $result );
202
-		$this->assertEquals( 1, count( $item->getListItems() ) );
200
+		$this->assertNull($this->view->get('errors'));
201
+		$this->assertNull($result);
202
+		$this->assertEquals(1, count($item->getListItems()));
203 203
 
204
-		foreach( $item->getListItems( 'product' ) as $listItem )
204
+		foreach ($item->getListItems('product') as $listItem)
205 205
 		{
206
-			$this->assertEquals( $item->getId(), $listItem->getParentId() );
207
-			$this->assertEquals( 'default', $listItem->getType() );
208
-			$this->assertEquals( 'product', $listItem->getDomain() );
209
-			$this->assertEquals( '2000-01-01 00:00:00', $listItem->getDateStart() );
210
-			$this->assertEquals( '2100-01-01 00:00:00', $listItem->getDateEnd() );
211
-			$this->assertEquals( ['test' => 'value'], $listItem->getConfig() );
212
-			$this->assertEquals( 'test', $listItem->getRefId() );
213
-			$this->assertEquals( 1, $listItem->getStatus() );
206
+			$this->assertEquals($item->getId(), $listItem->getParentId());
207
+			$this->assertEquals('default', $listItem->getType());
208
+			$this->assertEquals('product', $listItem->getDomain());
209
+			$this->assertEquals('2000-01-01 00:00:00', $listItem->getDateStart());
210
+			$this->assertEquals('2100-01-01 00:00:00', $listItem->getDateEnd());
211
+			$this->assertEquals(['test' => 'value'], $listItem->getConfig());
212
+			$this->assertEquals('test', $listItem->getRefId());
213
+			$this->assertEquals(1, $listItem->getStatus());
214 214
 		}
215 215
 	}
216 216
 
217 217
 
218 218
 	public function testSaveException()
219 219
 	{
220
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
221
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
222
-			->setMethods( array( 'fromArray' ) )
220
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
221
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
222
+			->setMethods(array('fromArray'))
223 223
 			->getMock();
224 224
 
225
-		$object->expects( $this->once() )->method( 'fromArray' )
226
-			->will( $this->throwException( new \RuntimeException() ) );
225
+		$object->expects($this->once())->method('fromArray')
226
+			->will($this->throwException(new \RuntimeException()));
227 227
 
228
-		$object->setView( $this->getViewNoRender() );
228
+		$object->setView($this->getViewNoRender());
229 229
 
230
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
230
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
231 231
 		$object->save();
232 232
 	}
233 233
 
234 234
 
235 235
 	public function testSaveMShopException()
236 236
 	{
237
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Product\Standard::class )
238
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
239
-			->setMethods( array( 'fromArray' ) )
237
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Product\Standard::class)
238
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
239
+			->setMethods(array('fromArray'))
240 240
 			->getMock();
241 241
 
242
-		$object->expects( $this->once() )->method( 'fromArray' )
243
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
242
+		$object->expects($this->once())->method('fromArray')
243
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
244 244
 
245
-		$object->setView( $this->getViewNoRender() );
245
+		$object->setView($this->getViewNoRender());
246 246
 
247
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
247
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
248 248
 		$object->save();
249 249
 	}
250 250
 
251 251
 
252 252
 	public function testGetSubClient()
253 253
 	{
254
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
255
-		$this->object->getSubClient( 'unknown' );
254
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
255
+		$this->object->getSubClient('unknown');
256 256
 	}
257 257
 
258 258
 
259 259
 	protected function getViewNoRender()
260 260
 	{
261
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
262
-			->setConstructorArgs( array( [] ) )
263
-			->setMethods( array( 'render', 'config' ) )
261
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
262
+			->setConstructorArgs(array([]))
263
+			->setMethods(array('render', 'config'))
264 264
 			->getMock();
265 265
 
266
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
267
-		$view->item = $manager->findItem( 'unitCode001' );
266
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
267
+		$view->item = $manager->findItem('unitCode001');
268 268
 
269 269
 		return $view;
270 270
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Supplier/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'supplier' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'supplier')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Supplier\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Supplier\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertContains( 'item-text', $result );
50
-		$this->assertNull( $this->view->get( 'errors' ) );
49
+		$this->assertContains('item-text', $result);
50
+		$this->assertNull($this->view->get('errors'));
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
57 57
 
58
-		$this->view->item = $manager->findItem( 'unitCode001', ['text'] );
58
+		$this->view->item = $manager->findItem('unitCode001', ['text']);
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( 'Supplier description', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('Supplier description', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
81 81
 
82
-		$this->view->item = $manager->findItem( 'unitCode001', ['text'] );
82
+		$this->view->item = $manager->findItem('unitCode001', ['text']);
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( 'Supplier description', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('Supplier description', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'supplier');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($item->getListItems()));
131 131
 
132
-		foreach( $item->getListItems( 'text' ) as $listItem )
132
+		foreach ($item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Text\Standard::class )
145
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
146
-			->setMethods( array( 'fromArray' ) )
144
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Text\Standard::class)
145
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
146
+			->setMethods(array('fromArray'))
147 147
 			->getMock();
148 148
 
149
-		$object->expects( $this->once() )->method( 'fromArray' )
150
-			->will( $this->throwException( new \RuntimeException() ) );
149
+		$object->expects($this->once())->method('fromArray')
150
+			->will($this->throwException(new \RuntimeException()));
151 151
 
152 152
 		$this->view = \TestHelperJqadm::getView();
153
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'supplier' )->createItem();
153
+		$this->view->item = \Aimeos\MShop::create($this->context, 'supplier')->createItem();
154 154
 
155
-		$object->setView( $this->view );
155
+		$object->setView($this->view);
156 156
 
157
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
157
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
158 158
 		$object->save();
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveMShopException()
163 163
 	{
164
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Text\Standard::class )
165
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
166
-			->setMethods( array( 'fromArray' ) )
164
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Text\Standard::class)
165
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
166
+			->setMethods(array('fromArray'))
167 167
 			->getMock();
168 168
 
169
-		$object->expects( $this->once() )->method( 'fromArray' )
170
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
169
+		$object->expects($this->once())->method('fromArray')
170
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
171 171
 
172 172
 		$this->view = \TestHelperJqadm::getView();
173
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'supplier' )->createItem();
173
+		$this->view->item = \Aimeos\MShop::create($this->context, 'supplier')->createItem();
174 174
 
175
-		$object->setView( $this->view );
175
+		$object->setView($this->view);
176 176
 
177
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
177
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
178 178
 		$object->save();
179 179
 	}
180 180
 
181 181
 
182 182
 	public function testSearch()
183 183
 	{
184
-		$this->assertNull( $this->object->search() );
184
+		$this->assertNull($this->object->search());
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testGetSubClient()
189 189
 	{
190
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
191
-		$this->object->getSubClient( 'unknown' );
190
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
191
+		$this->object->getSubClient('unknown');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Group/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  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\Group\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\Group\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
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
46
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
47
+			->setMethods(array('getSubClients'))
48 48
 			->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53
-		$object->setView( $this->getViewNoRender() );
53
+		$object->setView($this->getViewNoRender());
54 54
 
55 55
 		$object->create();
56 56
 	}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
62
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
63
+			->setMethods(array('getSubClients'))
64 64
 			->getMock();
65 65
 
66
-		$object->expects( $this->once() )->method( 'getSubClients' )
67
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
66
+		$object->expects($this->once())->method('getSubClients')
67
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
68 68
 
69
-		$object->setView( $this->getViewNoRender() );
69
+		$object->setView($this->getViewNoRender());
70 70
 
71 71
 		$object->create();
72 72
 	}
@@ -74,29 +74,29 @@  discard block
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop::create( $this->context, 'customer/group' );
77
+		$manager = \Aimeos\MShop::create($this->context, 'customer/group');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()];
80
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
81
-		$this->view->addHelper( 'param', $helper );
79
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()];
80
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
81
+		$this->view->addHelper('param', $helper);
82 82
 
83 83
 		$result = $this->object->copy();
84 84
 
85
-		$this->assertContains( 'unitgroup', $result );
85
+		$this->assertContains('unitgroup', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('getSubClients'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \RuntimeException() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \RuntimeException()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
108
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
109
+			->setMethods(array('getSubClients'))
110 110
 			->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'getSubClients' )
113
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
112
+		$object->expects($this->once())->method('getSubClients')
113
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
114 114
 
115
-		$object->setView( $this->getViewNoRender() );
115
+		$object->setView($this->getViewNoRender());
116 116
 
117 117
 		$object->copy();
118 118
 	}
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDelete()
122 122
 	{
123
-		$this->assertNotNull( $this->object->delete() );
123
+		$this->assertNotNull($this->object->delete());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testDeleteException()
128 128
 	{
129
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
130
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
131
+			->setMethods(array('getSubClients', 'search'))
132 132
 			->getMock();
133 133
 
134
-		$object->expects( $this->once() )->method( 'getSubClients' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('getSubClients')
135
+			->will($this->throwException(new \RuntimeException()));
136 136
 
137
-		$object->setView( $this->getViewNoRender() );
137
+		$object->setView($this->getViewNoRender());
138 138
 
139 139
 		$object->delete();
140 140
 	}
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('getSubClients', 'search'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( $this->getViewNoRender() );
153
+		$object->setView($this->getViewNoRender());
154 154
 
155 155
 		$object->delete();
156 156
 	}
@@ -158,29 +158,29 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop::create( $this->context, 'customer/group' );
161
+		$manager = \Aimeos\MShop::create($this->context, 'customer/group');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()];
164
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
165
-		$this->view->addHelper( 'param', $helper );
163
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()];
164
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
165
+		$this->view->addHelper('param', $helper);
166 166
 
167 167
 		$result = $this->object->get();
168 168
 
169
-		$this->assertContains( 'unitgroup', $result );
169
+		$this->assertContains('unitgroup', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
176
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
177
+			->setMethods(array('getSubClients'))
178 178
 			->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'getSubClients' )
181
-			->will( $this->throwException( new \RuntimeException() ) );
180
+		$object->expects($this->once())->method('getSubClients')
181
+			->will($this->throwException(new \RuntimeException()));
182 182
 
183
-		$object->setView( $this->getViewNoRender() );
183
+		$object->setView($this->getViewNoRender());
184 184
 
185 185
 		$object->get();
186 186
 	}
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
192
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
193
+			->setMethods(array('getSubClients'))
194 194
 			->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'getSubClients' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
196
+		$object->expects($this->once())->method('getSubClients')
197
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
198 198
 
199
-		$object->setView( $this->getViewNoRender() );
199
+		$object->setView($this->getViewNoRender());
200 200
 
201 201
 		$object->get();
202 202
 	}
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Group\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Group\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
209
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop::create( $this->context, 'customer/group' );
216
+		$manager = \Aimeos\MShop::create($this->context, 'customer/group');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -224,26 +224,26 @@  discard block
 block discarded – undo
224 224
 			),
225 225
 		);
226 226
 
227
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
228
-		$this->view->addHelper( 'param', $helper );
227
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
228
+		$this->view->addHelper('param', $helper);
229 229
 
230 230
 		$this->object->save();
231 231
 
232
-		$manager->deleteItem( $manager->findItem( 'jqadm@test' )->getId() );
232
+		$manager->deleteItem($manager->findItem('jqadm@test')->getId());
233 233
 	}
234 234
 
235 235
 
236 236
 	public function testSaveException()
237 237
 	{
238
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
239
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
240
-			->setMethods( array( 'fromArray' ) )
238
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
239
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
240
+			->setMethods(array('fromArray'))
241 241
 			->getMock();
242 242
 
243
-		$object->expects( $this->once() )->method( 'fromArray' )
244
-			->will( $this->throwException( new \RuntimeException() ) );
243
+		$object->expects($this->once())->method('fromArray')
244
+			->will($this->throwException(new \RuntimeException()));
245 245
 
246
-		$object->setView( $this->getViewNoRender() );
246
+		$object->setView($this->getViewNoRender());
247 247
 
248 248
 		$object->save();
249 249
 	}
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 
252 252
 	public function testSaveMShopException()
253 253
 	{
254
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
255
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
256
-			->setMethods( array( 'fromArray' ) )
254
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
255
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
256
+			->setMethods(array('fromArray'))
257 257
 			->getMock();
258 258
 
259
-		$object->expects( $this->once() )->method( 'fromArray' )
260
-			->will( $this->throwException( new \RuntimeException() ) );
259
+		$object->expects($this->once())->method('fromArray')
260
+			->will($this->throwException(new \RuntimeException()));
261 261
 
262
-		$object->setView( $this->getViewNoRender() );
262
+		$object->setView($this->getViewNoRender());
263 263
 
264 264
 		$object->save();
265 265
 	}
@@ -267,15 +267,15 @@  discard block
 block discarded – undo
267 267
 
268 268
 	public function testSaveJQAdmException()
269 269
 	{
270
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
271
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
272
-			->setMethods( array( 'fromArray' ) )
270
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
271
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
272
+			->setMethods(array('fromArray'))
273 273
 			->getMock();
274 274
 
275
-		$object->expects( $this->once() )->method( 'fromArray' )
276
-			->will( $this->throwException( new \RuntimeException() ) );
275
+		$object->expects($this->once())->method('fromArray')
276
+			->will($this->throwException(new \RuntimeException()));
277 277
 
278
-		$object->setView( $this->getViewNoRender() );
278
+		$object->setView($this->getViewNoRender());
279 279
 
280 280
 		$object->save();
281 281
 	}
@@ -286,32 +286,32 @@  discard block
 block discarded – undo
286 286
 		$param = array(
287 287
 			'type' => 'unittest', 'lang' => 'de',
288 288
 			'filter' => array(
289
-				'key' => array( 0 => 'customer.group.code' ),
290
-				'op' => array( 0 => '==' ),
291
-				'val' => array( 0 => 'unitgroup' ),
289
+				'key' => array(0 => 'customer.group.code'),
290
+				'op' => array(0 => '=='),
291
+				'val' => array(0 => 'unitgroup'),
292 292
 			),
293
-			'sort' => array( '-customer.group.id' ),
293
+			'sort' => array('-customer.group.id'),
294 294
 		);
295
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
296
-		$this->view->addHelper( 'param', $helper );
295
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
296
+		$this->view->addHelper('param', $helper);
297 297
 
298 298
 		$result = $this->object->search();
299 299
 
300
-		$this->assertContains( '>unitgroup<', $result );
300
+		$this->assertContains('>unitgroup<', $result);
301 301
 	}
302 302
 
303 303
 
304 304
 	public function testSearchException()
305 305
 	{
306
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
307
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
308
-			->setMethods( array( 'initCriteria' ) )
306
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
307
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
308
+			->setMethods(array('initCriteria'))
309 309
 			->getMock();
310 310
 
311
-		$object->expects( $this->once() )->method( 'initCriteria' )
312
-			->will( $this->throwException( new \RuntimeException() ) );
311
+		$object->expects($this->once())->method('initCriteria')
312
+			->will($this->throwException(new \RuntimeException()));
313 313
 
314
-		$object->setView( $this->getViewNoRender() );
314
+		$object->setView($this->getViewNoRender());
315 315
 
316 316
 		$object->search();
317 317
 	}
@@ -319,15 +319,15 @@  discard block
 block discarded – undo
319 319
 
320 320
 	public function testSearchMShopException()
321 321
 	{
322
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Group\Standard::class )
323
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
324
-			->setMethods( array( 'initCriteria' ) )
322
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Group\Standard::class)
323
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
324
+			->setMethods(array('initCriteria'))
325 325
 			->getMock();
326 326
 
327
-		$object->expects( $this->once() )->method( 'initCriteria' )
328
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
327
+		$object->expects($this->once())->method('initCriteria')
328
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
329 329
 
330
-		$object->setView( $this->getViewNoRender() );
330
+		$object->setView($this->getViewNoRender());
331 331
 
332 332
 		$object->search();
333 333
 	}
@@ -335,33 +335,33 @@  discard block
 block discarded – undo
335 335
 
336 336
 	public function testGetSubClientInvalid()
337 337
 	{
338
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
339
-		$this->object->getSubClient( '$unknown$' );
338
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
339
+		$this->object->getSubClient('$unknown$');
340 340
 	}
341 341
 
342 342
 
343 343
 	public function testGetSubClientUnknown()
344 344
 	{
345
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
346
-		$this->object->getSubClient( 'unknown' );
345
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
346
+		$this->object->getSubClient('unknown');
347 347
 	}
348 348
 
349 349
 
350 350
 	protected function getViewNoRender()
351 351
 	{
352
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
353
-			->setConstructorArgs( array( [] ) )
354
-			->setMethods( array( 'render', 'config' ) )
352
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
353
+			->setConstructorArgs(array([]))
354
+			->setMethods(array('render', 'config'))
355 355
 			->getMock();
356 356
 
357
-		$manager = \Aimeos\MShop::create( $this->context, 'customer/group' );
357
+		$manager = \Aimeos\MShop::create($this->context, 'customer/group');
358 358
 
359
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'unitgroup' )->getId()];
360
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
361
-		$view->addHelper( 'param', $helper );
359
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('unitgroup')->getId()];
360
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
361
+		$view->addHelper('param', $helper);
362 362
 
363
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
364
-		$view->addHelper( 'access', $helper );
363
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
364
+		$view->addHelper('access', $helper);
365 365
 
366 366
 		return $view;
367 367
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Order/Invoice/StandardTest.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  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\Order\Invoice\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\Order\Invoice\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
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 		$result = $this->object->copy();
42 42
 
43
-		$this->assertContains( 'item-invoice', $result );
43
+		$this->assertContains('item-invoice', $result);
44 44
 	}
45 45
 
46 46
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	{
49 49
 		$result = $this->object->create();
50 50
 
51
-		$this->assertContains( 'item-invoice', $result );
51
+		$this->assertContains('item-invoice', $result);
52 52
 	}
53 53
 
54 54
 
@@ -58,22 +58,22 @@  discard block
 block discarded – undo
58 58
 
59 59
 		$result = $this->object->get();
60 60
 
61
-		$this->assertContains( 'item-invoice', $result );
62
-		$this->assertContains( 'phone', $result );
61
+		$this->assertContains('item-invoice', $result);
62
+		$this->assertContains('phone', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testGetException()
67 67
 	{
68
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Order\Invoice\Standard::class )
69
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
70
-			->setMethods( array( 'toArray' ) )
68
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Order\Invoice\Standard::class)
69
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
70
+			->setMethods(array('toArray'))
71 71
 			->getMock();
72 72
 
73
-		$object->expects( $this->once() )->method( 'toArray' )
74
-			->will( $this->throwException( new \RuntimeException() ) );
73
+		$object->expects($this->once())->method('toArray')
74
+			->will($this->throwException(new \RuntimeException()));
75 75
 
76
-		$object->setView( $this->getViewNoRender() );
76
+		$object->setView($this->getViewNoRender());
77 77
 
78 78
 		$object->get();
79 79
 	}
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
 
82 82
 	public function testGetMShopException()
83 83
 	{
84
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Order\Invoice\Standard::class )
85
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
86
-			->setMethods( array( 'toArray' ) )
84
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Order\Invoice\Standard::class)
85
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
86
+			->setMethods(array('toArray'))
87 87
 			->getMock();
88 88
 
89
-		$object->expects( $this->once() )->method( 'toArray' )
90
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
89
+		$object->expects($this->once())->method('toArray')
90
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
91 91
 
92
-		$object->setView( $this->getViewNoRender() );
92
+		$object->setView($this->getViewNoRender());
93 93
 
94 94
 		$object->get();
95 95
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 	public function testSave()
99 99
 	{
100
-		$manager = \Aimeos\MShop::create( $this->context, 'order' );
100
+		$manager = \Aimeos\MShop::create($this->context, 'order');
101 101
 
102 102
 		$param = array(
103 103
 			'site' => 'unittest',
@@ -107,39 +107,39 @@  discard block
 block discarded – undo
107 107
 			),
108 108
 		);
109 109
 
110
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
111
-		$this->view->addHelper( 'param', $helper );
110
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
111
+		$this->view->addHelper('param', $helper);
112 112
 
113 113
 		$this->view->item = $this->getOrderBaseItem();
114 114
 
115 115
 		$result = $this->object->save();
116 116
 
117 117
 		$search = $manager->createSearch();
118
-		$search->setConditions( $search->compare( '==', 'order.type', 'jqadmtst' ) );
119
-		$items = $manager->searchItems( $search );
118
+		$search->setConditions($search->compare('==', 'order.type', 'jqadmtst'));
119
+		$items = $manager->searchItems($search);
120 120
 
121
-		if( ( $item = reset( $items ) ) === false ) {
122
-			$this->fail( 'No saved order item found' );
121
+		if (($item = reset($items)) === false) {
122
+			$this->fail('No saved order item found');
123 123
 		}
124 124
 
125
-		$manager->deleteItem( $item->getId() );
125
+		$manager->deleteItem($item->getId());
126 126
 
127
-		$this->assertNull( $result );
127
+		$this->assertNull($result);
128 128
 	}
129 129
 
130 130
 
131 131
 	public function testGetSubClient()
132 132
 	{
133
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
134
-		$this->object->getSubClient( 'unknown' );
133
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
134
+		$this->object->getSubClient('unknown');
135 135
 	}
136 136
 
137 137
 
138 138
 	protected function getViewNoRender()
139 139
 	{
140
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
141
-			->setConstructorArgs( array( [] ) )
142
-			->setMethods( array( 'render', 'config' ) )
140
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
141
+			->setConstructorArgs(array([]))
142
+			->setMethods(array('render', 'config'))
143 143
 			->getMock();
144 144
 
145 145
 		$view->item = $this->getOrderBaseItem();
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
 	}
149 149
 
150 150
 
151
-	protected function getOrderBaseItem( $comment = 'This is another comment.' )
151
+	protected function getOrderBaseItem($comment = 'This is another comment.')
152 152
 	{
153
-		$manager = \Aimeos\MShop::create( $this->context, 'order/base' );
153
+		$manager = \Aimeos\MShop::create($this->context, 'order/base');
154 154
 
155 155
 		$search = $manager->createSearch();
156
-		$search->setConditions( $search->compare( '==', 'order.base.comment', $comment ) );
156
+		$search->setConditions($search->compare('==', 'order.base.comment', $comment));
157 157
 
158
-		$items = $manager->searchItems( $search );
158
+		$items = $manager->searchItems($search);
159 159
 
160
-		if( ( $item = reset( $items ) ) === false ) {
161
-			throw new \RuntimeException( 'No order base item found' );
160
+		if (($item = reset($items)) === false) {
161
+			throw new \RuntimeException('No order base item found');
162 162
 		}
163 163
 
164 164
 		return $item;
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Related/StandardTest.php 1 patch
Spacing   +45 added lines, -45 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\Related\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\Related\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->assertNull( $this->view->get( 'errors' ) );
45
-		$this->assertContains( 'item-related', $result );
44
+		$this->assertNull($this->view->get('errors'));
45
+		$this->assertContains('item-related', $result);
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' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'item-related', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('item-related', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,91 +62,91 @@  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' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'item-related', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('item-related', $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' );
87
-		$item->setCode( 'jqadm-test-related' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC');
87
+		$item->setCode('jqadm-test-related');
88
+		$item->setId(null);
89 89
 
90
-		$item = $manager->saveItem( $item );
90
+		$item = $manager->saveItem($item);
91 91
 		$this->view->item = $item;
92 92
 
93 93
 		$result = $this->object->save();
94
-		$manager->deleteItem( $item->getId() );
94
+		$manager->deleteItem($item->getId());
95 95
 
96
-		$this->assertNull( $this->view->get( 'errors' ) );
97
-		$this->assertNull( $result );
96
+		$this->assertNull($this->view->get('errors'));
97
+		$this->assertNull($result);
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testSaveException()
102 102
 	{
103
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Related\Standard::class )
104
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
105
-			->setMethods( array( 'getSubClients' ) )
103
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Related\Standard::class)
104
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
105
+			->setMethods(array('getSubClients'))
106 106
 			->getMock();
107 107
 
108
-		$object->expects( $this->once() )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->once())->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$this->view = \TestHelperJqadm::getView();
112
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
112
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
113 113
 
114
-		$object->setView( $this->view );
114
+		$object->setView($this->view);
115 115
 
116
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
116
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
117 117
 		$object->save();
118 118
 	}
119 119
 
120 120
 
121 121
 	public function testSaveMShopException()
122 122
 	{
123
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Related\Standard::class )
124
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
125
-			->setMethods( array( 'getSubClients' ) )
123
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Related\Standard::class)
124
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
125
+			->setMethods(array('getSubClients'))
126 126
 			->getMock();
127 127
 
128
-		$object->expects( $this->once() )->method( 'getSubClients' )
129
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
128
+		$object->expects($this->once())->method('getSubClients')
129
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
130 130
 
131 131
 		$this->view = \TestHelperJqadm::getView();
132
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
132
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
133 133
 
134
-		$object->setView( $this->view );
134
+		$object->setView($this->view);
135 135
 
136
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
136
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
137 137
 		$object->save();
138 138
 	}
139 139
 
140 140
 
141 141
 	public function testSearch()
142 142
 	{
143
-		$this->assertNull( $this->object->search() );
143
+		$this->assertNull($this->object->search());
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetSubClient()
148 148
 	{
149
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
150
-		$this->object->getSubClient( 'unknown' );
149
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
150
+		$this->object->getSubClient('unknown');
151 151
 	}
152 152
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Related/Suggest/StandardTest.php 1 patch
Spacing   +31 added lines, -31 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\Related\Suggest\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\Related\Suggest\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( 'Suggested', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Suggested', $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' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Suggested', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Suggested', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  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' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Suggested', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Suggested', $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
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'related' => array(
90 90
 				'suggest' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$products = $this->view->item->getListItems( 'product' );
102
+		$products = $this->view->item->getListItems('product');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $products ) );
107
-		$this->assertEquals( '123', reset( $products )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($products));
107
+		$this->assertEquals('123', reset($products)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Related/Bought/StandardTest.php 1 patch
Spacing   +31 added lines, -31 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\Related\Bought\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\Related\Bought\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( 'Products bought together', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Products bought together', $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' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Products bought together', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Products bought together', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  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' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Products bought together', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Products bought together', $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
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'related' => array(
90 90
 				'bought' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$products = $this->view->item->getListItems( 'product' );
102
+		$products = $this->view->item->getListItems('product');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $products ) );
107
-		$this->assertEquals( '123', reset( $products )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($products));
107
+		$this->assertEquals('123', reset($products)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.