@@ -20,48 +20,48 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperJqadm::getContext(); |
22 | 22 | |
23 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
24 | - ->setMethods( array( 'delete', 'save' ) ) |
|
23 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
24 | + ->setMethods(array('delete', 'save')) |
|
25 | 25 | ->disableOriginalConstructor() |
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index( $this->mock, $this->context ); |
|
29 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
30 | - $this->object->setView( \TestHelperJqadm::getView() ); |
|
28 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index($this->mock, $this->context); |
|
29 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
30 | + $this->object->setView(\TestHelperJqadm::getView()); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | protected function tearDown() |
35 | 35 | { |
36 | - unset( $this->object, $this->mock, $this->context ); |
|
36 | + unset($this->object, $this->mock, $this->context); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testDelete() |
41 | 41 | { |
42 | 42 | $view = \TestHelperJqadm::getView(); |
43 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => -1 ) ); |
|
44 | - $view->addHelper( 'param', $helper ); |
|
43 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => -1)); |
|
44 | + $view->addHelper('param', $helper); |
|
45 | 45 | |
46 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
47 | - $this->object->setView( $view ); |
|
46 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
47 | + $this->object->setView($view); |
|
48 | 48 | |
49 | 49 | $result = $this->object->delete(); |
50 | 50 | |
51 | - $this->assertEquals( 'test', $result ); |
|
51 | + $this->assertEquals('test', $result); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testSave() |
56 | 56 | { |
57 | 57 | $view = \TestHelperJqadm::getView(); |
58 | - $view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'CNC' ); |
|
58 | + $view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('CNC'); |
|
59 | 59 | |
60 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
61 | - $this->object->setView( $view ); |
|
60 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
61 | + $this->object->setView($view); |
|
62 | 62 | |
63 | 63 | $result = $this->object->save(); |
64 | 64 | |
65 | - $this->assertEquals( 'test', $result ); |
|
65 | + $this->assertEquals('test', $result); |
|
66 | 66 | } |
67 | 67 | } |
@@ -21,126 +21,126 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Dashboard\Job\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\Dashboard\Job\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 testDelete() |
38 | 38 | { |
39 | - $manager = \Aimeos\MAdmin::create( $this->context, 'job' ); |
|
39 | + $manager = \Aimeos\MAdmin::create($this->context, 'job'); |
|
40 | 40 | $item = $manager->createItem(); |
41 | - $item->setLabel( 'jobdeletetest.csv' ); |
|
42 | - $item->setResult( ['file' => 'jobdeletetest.csv'] ); |
|
43 | - $manager->saveItem( $item ); |
|
41 | + $item->setLabel('jobdeletetest.csv'); |
|
42 | + $item->setResult(['file' => 'jobdeletetest.csv']); |
|
43 | + $manager->saveItem($item); |
|
44 | 44 | |
45 | 45 | $param = ['site' => 'unittest', 'id' => $item->getId()]; |
46 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
47 | - $this->view->addHelper( 'param', $helper ); |
|
46 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
47 | + $this->view->addHelper('param', $helper); |
|
48 | 48 | |
49 | 49 | $result = $this->object->delete(); |
50 | 50 | |
51 | - $this->assertContains( 'dashboard-job', $result ); |
|
52 | - $this->assertNotContains( 'jobdeletetest.csv', $result ); |
|
51 | + $this->assertContains('dashboard-job', $result); |
|
52 | + $this->assertNotContains('jobdeletetest.csv', $result); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testDeleteException() |
57 | 57 | { |
58 | - $mock = $this->getMockBuilder( \Aimeos\MW\Filesystem\Manager\Standard::class ) |
|
58 | + $mock = $this->getMockBuilder(\Aimeos\MW\Filesystem\Manager\Standard::class) |
|
59 | 59 | ->disableOriginalConstructor() |
60 | - ->setMethods( ['get'] ) |
|
60 | + ->setMethods(['get']) |
|
61 | 61 | ->getMock(); |
62 | 62 | |
63 | - $mock->expects( $this->once() )->method( 'get' ) |
|
64 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
63 | + $mock->expects($this->once())->method('get') |
|
64 | + ->will($this->throwException(new \RuntimeException())); |
|
65 | 65 | |
66 | - $this->context->setFileSystemManager( $mock ); |
|
67 | - $this->object->setView( $this->getViewNoRender() ); |
|
66 | + $this->context->setFileSystemManager($mock); |
|
67 | + $this->object->setView($this->getViewNoRender()); |
|
68 | 68 | $this->object->delete(); |
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | 72 | public function testDeleteMAdminException() |
73 | 73 | { |
74 | - $mock = $this->getMockBuilder( \Aimeos\MW\Filesystem\Manager\Standard::class ) |
|
74 | + $mock = $this->getMockBuilder(\Aimeos\MW\Filesystem\Manager\Standard::class) |
|
75 | 75 | ->disableOriginalConstructor() |
76 | - ->setMethods( ['get'] ) |
|
76 | + ->setMethods(['get']) |
|
77 | 77 | ->getMock(); |
78 | 78 | |
79 | - $mock->expects( $this->once() )->method( 'get' ) |
|
80 | - ->will( $this->throwException( new \Aimeos\MAdmin\Exception() ) ); |
|
79 | + $mock->expects($this->once())->method('get') |
|
80 | + ->will($this->throwException(new \Aimeos\MAdmin\Exception())); |
|
81 | 81 | |
82 | - $this->context->setFileSystemManager( $mock ); |
|
83 | - $this->object->setView( $this->getViewNoRender() ); |
|
82 | + $this->context->setFileSystemManager($mock); |
|
83 | + $this->object->setView($this->getViewNoRender()); |
|
84 | 84 | $this->object->delete(); |
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | 88 | public function testGet() |
89 | 89 | { |
90 | - $dir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . '/tmp'; |
|
90 | + $dir = dirname(dirname(dirname(dirname(__DIR__)))) . '/tmp'; |
|
91 | 91 | $path = $dir . '/jobtest.csv'; |
92 | 92 | |
93 | - if( file_exists( $dir ) === false && mkdir( $dir, 0755, true ) === false ) { |
|
94 | - throw new \Exception( 'Cannot create temp directory' ); |
|
93 | + if (file_exists($dir) === false && mkdir($dir, 0755, true) === false) { |
|
94 | + throw new \Exception('Cannot create temp directory'); |
|
95 | 95 | } |
96 | 96 | |
97 | - if( touch( $path ) === false ) { |
|
98 | - throw new \Exception( 'Cannot create test file' ); |
|
97 | + if (touch($path) === false) { |
|
98 | + throw new \Exception('Cannot create test file'); |
|
99 | 99 | } |
100 | 100 | |
101 | - $manager = \Aimeos\MAdmin::create( $this->context, 'job' ); |
|
101 | + $manager = \Aimeos\MAdmin::create($this->context, 'job'); |
|
102 | 102 | $item = $manager->createItem(); |
103 | - $item->setLabel( 'jobtest.csv' ); |
|
104 | - $item->setResult( ['file' => 'jobtest.csv'] ); |
|
105 | - $manager->saveItem( $item ); |
|
103 | + $item->setLabel('jobtest.csv'); |
|
104 | + $item->setResult(['file' => 'jobtest.csv']); |
|
105 | + $manager->saveItem($item); |
|
106 | 106 | |
107 | 107 | $result = $this->object->get(); |
108 | 108 | |
109 | - $this->assertNull( $result ); |
|
109 | + $this->assertNull($result); |
|
110 | 110 | |
111 | - $manager->deleteItem( $item->getId() ); |
|
112 | - unlink( $path ); |
|
111 | + $manager->deleteItem($item->getId()); |
|
112 | + unlink($path); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | 116 | public function testGetException() |
117 | 117 | { |
118 | - $mock = $this->getMockBuilder( \Aimeos\MW\Filesystem\Manager\Standard::class ) |
|
118 | + $mock = $this->getMockBuilder(\Aimeos\MW\Filesystem\Manager\Standard::class) |
|
119 | 119 | ->disableOriginalConstructor() |
120 | - ->setMethods( ['get'] ) |
|
120 | + ->setMethods(['get']) |
|
121 | 121 | ->getMock(); |
122 | 122 | |
123 | - $mock->expects( $this->once() )->method( 'get' ) |
|
124 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
123 | + $mock->expects($this->once())->method('get') |
|
124 | + ->will($this->throwException(new \RuntimeException())); |
|
125 | 125 | |
126 | - $this->context->setFileSystemManager( $mock ); |
|
127 | - $this->object->setView( $this->getViewNoRender() ); |
|
126 | + $this->context->setFileSystemManager($mock); |
|
127 | + $this->object->setView($this->getViewNoRender()); |
|
128 | 128 | $this->object->get(); |
129 | 129 | } |
130 | 130 | |
131 | 131 | |
132 | 132 | public function testGetMAdminException() |
133 | 133 | { |
134 | - $mock = $this->getMockBuilder( \Aimeos\MW\Filesystem\Manager\Standard::class ) |
|
134 | + $mock = $this->getMockBuilder(\Aimeos\MW\Filesystem\Manager\Standard::class) |
|
135 | 135 | ->disableOriginalConstructor() |
136 | - ->setMethods( ['get'] ) |
|
136 | + ->setMethods(['get']) |
|
137 | 137 | ->getMock(); |
138 | 138 | |
139 | - $mock->expects( $this->once() )->method( 'get' ) |
|
140 | - ->will( $this->throwException( new \Aimeos\MAdmin\Exception() ) ); |
|
139 | + $mock->expects($this->once())->method('get') |
|
140 | + ->will($this->throwException(new \Aimeos\MAdmin\Exception())); |
|
141 | 141 | |
142 | - $this->context->setFileSystemManager( $mock ); |
|
143 | - $this->object->setView( $this->getViewNoRender() ); |
|
142 | + $this->context->setFileSystemManager($mock); |
|
143 | + $this->object->setView($this->getViewNoRender()); |
|
144 | 144 | $this->object->get(); |
145 | 145 | } |
146 | 146 | |
@@ -149,22 +149,22 @@ discard block |
||
149 | 149 | { |
150 | 150 | $result = $this->object->search(); |
151 | 151 | |
152 | - $this->assertContains( 'dashboard-job', $result ); |
|
153 | - $this->assertContains( 'unittest job', $result ); |
|
152 | + $this->assertContains('dashboard-job', $result); |
|
153 | + $this->assertContains('unittest job', $result); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
157 | 157 | public function testSearchException() |
158 | 158 | { |
159 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Dashboard\Job\Standard::class ) |
|
160 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
161 | - ->setMethods( array( 'getSubClients' ) ) |
|
159 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Dashboard\Job\Standard::class) |
|
160 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
161 | + ->setMethods(array('getSubClients')) |
|
162 | 162 | ->getMock(); |
163 | 163 | |
164 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
165 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
164 | + $object->expects($this->once())->method('getSubClients') |
|
165 | + ->will($this->throwException(new \RuntimeException())); |
|
166 | 166 | |
167 | - $object->setView( $this->getViewNoRender() ); |
|
167 | + $object->setView($this->getViewNoRender()); |
|
168 | 168 | |
169 | 169 | $object->search(); |
170 | 170 | } |
@@ -172,15 +172,15 @@ discard block |
||
172 | 172 | |
173 | 173 | public function testSearchMAdminException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Dashboard\Job\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Dashboard\Job\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 \Aimeos\MAdmin\Exception() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \Aimeos\MAdmin\Exception())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->search(); |
186 | 186 | } |
@@ -188,17 +188,17 @@ discard block |
||
188 | 188 | |
189 | 189 | protected function getViewNoRender() |
190 | 190 | { |
191 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
192 | - ->setConstructorArgs( array( [] ) ) |
|
193 | - ->setMethods( array( 'render', 'config' ) ) |
|
191 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
192 | + ->setConstructorArgs(array([])) |
|
193 | + ->setMethods(array('render', 'config')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | 196 | $param = ['site' => 'unittest', 'id' => -1]; |
197 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
198 | - $view->addHelper( 'param', $helper ); |
|
197 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
198 | + $view->addHelper('param', $helper); |
|
199 | 199 | |
200 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
201 | - $view->addHelper( 'access', $helper ); |
|
200 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
201 | + $view->addHelper('access', $helper); |
|
202 | 202 | |
203 | 203 | return $view; |
204 | 204 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Coupon\Code\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\Coupon\Code\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 |
||
40 | 40 | |
41 | 41 | $result = $this->object->copy(); |
42 | 42 | |
43 | - $this->assertContains( 'item-code', $result ); |
|
43 | + $this->assertContains('item-code', $result); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $result = $this->object->create(); |
50 | 50 | |
51 | - $this->assertContains( 'item-code', $result ); |
|
51 | + $this->assertContains('item-code', $result); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | |
59 | 59 | $result = $this->object->get(); |
60 | 60 | |
61 | - $this->assertContains( 'item-code', $result ); |
|
62 | - $this->assertContains( 'OPQR', $result ); |
|
61 | + $this->assertContains('item-code', $result); |
|
62 | + $this->assertContains('OPQR', $result); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | 66 | public function testGetException() |
67 | 67 | { |
68 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Code\Standard::class ) |
|
69 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
70 | - ->setMethods( array( 'toArray' ) ) |
|
68 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Code\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 |
||
81 | 81 | |
82 | 82 | public function testGetMShopException() |
83 | 83 | { |
84 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Code\Standard::class ) |
|
85 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
86 | - ->setMethods( array( 'toArray' ) ) |
|
84 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Code\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 |
||
97 | 97 | |
98 | 98 | public function testSave() |
99 | 99 | { |
100 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon/code' ); |
|
100 | + $manager = \Aimeos\MShop::create($this->context, 'coupon/code'); |
|
101 | 101 | |
102 | 102 | $param = array( |
103 | 103 | 'site' => 'unittest', |
@@ -110,28 +110,28 @@ discard block |
||
110 | 110 | ), |
111 | 111 | ); |
112 | 112 | |
113 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
114 | - $this->view->addHelper( 'param', $helper ); |
|
113 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
114 | + $this->view->addHelper('param', $helper); |
|
115 | 115 | |
116 | 116 | $this->view->item = $this->getCouponItem(); |
117 | 117 | |
118 | 118 | $this->object->save(); |
119 | 119 | |
120 | - $manager->deleteItem( $manager->findItem( 'jqadm test code' )->getId() ); |
|
120 | + $manager->deleteItem($manager->findItem('jqadm test code')->getId()); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
124 | 124 | public function testSaveException() |
125 | 125 | { |
126 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Standard::class ) |
|
127 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
128 | - ->setMethods( array( 'fromArray' ) ) |
|
126 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Standard::class) |
|
127 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
128 | + ->setMethods(array('fromArray')) |
|
129 | 129 | ->getMock(); |
130 | 130 | |
131 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
132 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
131 | + $object->expects($this->once())->method('fromArray') |
|
132 | + ->will($this->throwException(new \RuntimeException())); |
|
133 | 133 | |
134 | - $object->setView( $this->getViewNoRender() ); |
|
134 | + $object->setView($this->getViewNoRender()); |
|
135 | 135 | |
136 | 136 | $object->save(); |
137 | 137 | } |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | |
140 | 140 | public function testSaveMShopException() |
141 | 141 | { |
142 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Standard::class ) |
|
143 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
144 | - ->setMethods( array( 'fromArray' ) ) |
|
142 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Standard::class) |
|
143 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
144 | + ->setMethods(array('fromArray')) |
|
145 | 145 | ->getMock(); |
146 | 146 | |
147 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
148 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
147 | + $object->expects($this->once())->method('fromArray') |
|
148 | + ->will($this->throwException(new \RuntimeException())); |
|
149 | 149 | |
150 | - $object->setView( $this->getViewNoRender() ); |
|
150 | + $object->setView($this->getViewNoRender()); |
|
151 | 151 | |
152 | 152 | $object->save(); |
153 | 153 | } |
@@ -155,16 +155,16 @@ discard block |
||
155 | 155 | |
156 | 156 | public function testGetSubClient() |
157 | 157 | { |
158 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
159 | - $this->object->getSubClient( 'unknown' ); |
|
158 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
159 | + $this->object->getSubClient('unknown'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
163 | 163 | protected function getViewNoRender() |
164 | 164 | { |
165 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
166 | - ->setConstructorArgs( array( [] ) ) |
|
167 | - ->setMethods( array( 'render', 'config' ) ) |
|
165 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
166 | + ->setConstructorArgs(array([])) |
|
167 | + ->setMethods(array('render', 'config')) |
|
168 | 168 | ->getMock(); |
169 | 169 | |
170 | 170 | $view->item = $this->getCouponItem(); |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | - protected function getCouponItem( $provider = 'Example,BasketValues' ) |
|
176 | + protected function getCouponItem($provider = 'Example,BasketValues') |
|
177 | 177 | { |
178 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon' ); |
|
178 | + $manager = \Aimeos\MShop::create($this->context, 'coupon'); |
|
179 | 179 | |
180 | 180 | $search = $manager->createSearch(); |
181 | - $search->setConditions( $search->compare( '==', 'coupon.provider', $provider ) ); |
|
181 | + $search->setConditions($search->compare('==', 'coupon.provider', $provider)); |
|
182 | 182 | |
183 | - $items = $manager->searchItems( $search ); |
|
183 | + $items = $manager->searchItems($search); |
|
184 | 184 | |
185 | - if( ( $item = reset( $items ) ) === false ) { |
|
186 | - throw new \RuntimeException( 'No coupon item found' ); |
|
185 | + if (($item = reset($items)) === false) { |
|
186 | + throw new \RuntimeException('No coupon item found'); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $item; |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Tag\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\Type\Tag\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 |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->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('sort', [], 'product')->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( 'sort', $result ); |
|
85 | + $this->assertContains('sort', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
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\Type\Tag\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->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('sort', [], 'product')->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( 'sort', $result ); |
|
169 | + $this->assertContains('sort', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Tag\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Tag\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, 'tag/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'tag.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'sort' ), |
|
291 | + 'key' => array(0 => 'tag.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'sort'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-tag.type.id' ), |
|
295 | + 'sort' => array('-tag.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>sort<', $result ); |
|
302 | + $this->assertContains('>sort<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('sort', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
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\Type\Media\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\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, 'media/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'media.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.type.id' ), |
|
295 | + 'sort' => array('-media.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\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\Type\Media\Lists\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 |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
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\Type\Media\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\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, 'media/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'media.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.lists.type.id' ), |
|
295 | + 'sort' => array('-media.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->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('size', [], 'media')->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( 'size', $result ); |
|
85 | + $this->assertContains('size', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
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\Type\Media\Property\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->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('size', [], 'media')->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( 'size', $result ); |
|
169 | + $this->assertContains('size', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\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, 'media/property/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.property.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'size' ), |
|
291 | + 'key' => array(0 => 'media.property.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'size'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.property.type.id' ), |
|
295 | + 'sort' => array('-media.property.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>size<', $result ); |
|
302 | + $this->assertContains('>size<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\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\Type\Catalog\Lists\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 |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
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\Type\Catalog\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->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('default', [], 'product')->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( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\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, 'catalog/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'catalog.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'catalog.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-catalog.lists.type.id' ), |
|
295 | + 'sort' => array('-catalog.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Service\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\Type\Service\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 |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->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('payment', [], 'service')->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( 'payment', $result ); |
|
85 | + $this->assertContains('payment', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
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\Type\Service\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->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('payment', [], 'service')->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( 'payment', $result ); |
|
169 | + $this->assertContains('payment', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\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 |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Service\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Service\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, 'service/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'service' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'service')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'service.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'payment' ), |
|
291 | + 'key' => array(0 => 'service.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'payment'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-service.type.id' ), |
|
295 | + 'sort' => array('-service.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>payment<', $result ); |
|
302 | + $this->assertContains('>payment<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('payment', [], 'service')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |