@@ -21,75 +21,75 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $langManager = \Aimeos\MShop::create( $this->context, 'locale/language' ); |
|
24 | + $langManager = \Aimeos\MShop::create($this->context, 'locale/language'); |
|
25 | 25 | |
26 | - $this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() ); |
|
27 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem(); |
|
26 | + $this->view->pageLanguages = $langManager->searchItems($langManager->createSearch()); |
|
27 | + $this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem(); |
|
28 | 28 | |
29 | - $this->object = new \Aimeos\Admin\JQAdm\Attribute\Text\Standard( $this->context ); |
|
30 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
31 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
32 | - $this->object->setView( $this->view ); |
|
29 | + $this->object = new \Aimeos\Admin\JQAdm\Attribute\Text\Standard($this->context); |
|
30 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
31 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
32 | + $this->object->setView($this->view); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | protected function tearDown() |
37 | 37 | { |
38 | - unset( $this->object, $this->view, $this->context ); |
|
38 | + unset($this->object, $this->view, $this->context); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testCreate() |
43 | 43 | { |
44 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
44 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
45 | 45 | |
46 | 46 | $this->view->item = $manager->createItem(); |
47 | 47 | $result = $this->object->create(); |
48 | 48 | |
49 | - $this->assertContains( 'item-text', $result ); |
|
50 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
49 | + $this->assertContains('item-text', $result); |
|
50 | + $this->assertNull($this->view->get('errors')); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testCopy() |
55 | 55 | { |
56 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
56 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
57 | 57 | |
58 | - $this->view->item = $manager->findItem( 'white', ['text'], 'product', 'color' ); |
|
58 | + $this->view->item = $manager->findItem('white', ['text'], 'product', 'color'); |
|
59 | 59 | $result = $this->object->copy(); |
60 | 60 | |
61 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
62 | - $this->assertContains( '"text.type":"name"', $result ); |
|
61 | + $this->assertNull($this->view->get('errors')); |
|
62 | + $this->assertContains('"text.type":"name"', $result); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | 66 | public function testDelete() |
67 | 67 | { |
68 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
68 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
69 | 69 | |
70 | 70 | $this->view->item = $manager->createItem(); |
71 | 71 | $result = $this->object->delete(); |
72 | 72 | |
73 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
74 | - $this->assertNull( $result ); |
|
73 | + $this->assertNull($this->view->get('errors')); |
|
74 | + $this->assertNull($result); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testGet() |
79 | 79 | { |
80 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
80 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
81 | 81 | |
82 | - $this->view->item = $manager->findItem( 'white', ['text'], 'product', 'color' ); |
|
82 | + $this->view->item = $manager->findItem('white', ['text'], 'product', 'color'); |
|
83 | 83 | $result = $this->object->get(); |
84 | 84 | |
85 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
86 | - $this->assertContains( '"text.type":"name"', $result ); |
|
85 | + $this->assertNull($this->view->get('errors')); |
|
86 | + $this->assertContains('"text.type":"name"', $result); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | 90 | public function testSave() |
91 | 91 | { |
92 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
92 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
93 | 93 | $item = $manager->createItem(); |
94 | 94 | |
95 | 95 | $param = array( |
@@ -119,75 +119,75 @@ discard block |
||
119 | 119 | ), |
120 | 120 | ); |
121 | 121 | |
122 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
123 | - $this->view->addHelper( 'param', $helper ); |
|
122 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
123 | + $this->view->addHelper('param', $helper); |
|
124 | 124 | $this->view->item = $item; |
125 | 125 | |
126 | 126 | $result = $this->object->save(); |
127 | 127 | |
128 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
129 | - $this->assertNull( $result ); |
|
130 | - $this->assertEquals( 3, count( $this->view->item->getListItems() ) ); |
|
128 | + $this->assertNull($this->view->get('errors')); |
|
129 | + $this->assertNull($result); |
|
130 | + $this->assertEquals(3, count($this->view->item->getListItems())); |
|
131 | 131 | |
132 | - foreach( $this->view->item->getListItems( 'text' ) as $listItem ) |
|
132 | + foreach ($this->view->item->getListItems('text') as $listItem) |
|
133 | 133 | { |
134 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
134 | + $this->assertEquals('text', $listItem->getDomain()); |
|
135 | 135 | |
136 | 136 | $refItem = $listItem->getRefItem(); |
137 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
137 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | public function testSaveException() |
143 | 143 | { |
144 | - $object = $this->getClientMock( 'fromArray' ); |
|
144 | + $object = $this->getClientMock('fromArray'); |
|
145 | 145 | |
146 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
147 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
146 | + $object->expects($this->once())->method('fromArray') |
|
147 | + ->will($this->throwException(new \RuntimeException())); |
|
148 | 148 | |
149 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
149 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
150 | 150 | $object->save(); |
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testSaveMShopException() |
155 | 155 | { |
156 | - $object = $this->getClientMock( 'fromArray' ); |
|
156 | + $object = $this->getClientMock('fromArray'); |
|
157 | 157 | |
158 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
159 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
158 | + $object->expects($this->once())->method('fromArray') |
|
159 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
160 | 160 | |
161 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
161 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
162 | 162 | $object->save(); |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | 166 | public function testSearch() |
167 | 167 | { |
168 | - $this->assertNull( $this->object->search() ); |
|
168 | + $this->assertNull($this->object->search()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
172 | 172 | public function testGetSubClient() |
173 | 173 | { |
174 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
175 | - $this->object->getSubClient( 'unknown' ); |
|
174 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
175 | + $this->object->getSubClient('unknown'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
179 | - public function getClientMock( $method ) |
|
179 | + public function getClientMock($method) |
|
180 | 180 | { |
181 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class ) |
|
182 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
183 | - ->setMethods( [$method] ) |
|
181 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class) |
|
182 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
183 | + ->setMethods([$method]) |
|
184 | 184 | ->getMock(); |
185 | 185 | |
186 | 186 | $view = \TestHelperJqadm::getView(); |
187 | - $view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem(); |
|
187 | + $view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem(); |
|
188 | 188 | |
189 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
190 | - $object->setView( $view ); |
|
189 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
190 | + $object->setView($view); |
|
191 | 191 | |
192 | 192 | return $object; |
193 | 193 | } |
@@ -21,70 +21,70 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Attribute\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\Attribute\Media\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'item-media', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('item-media', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' ); |
|
53 | + $this->view->item = $manager->findItem('xs', ['media'], 'product', 'size'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( '"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testDelete() |
62 | 62 | { |
63 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
63 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
64 | 64 | |
65 | 65 | $this->view->item = $manager->createItem(); |
66 | 66 | $result = $this->object->delete(); |
67 | 67 | |
68 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
69 | - $this->assertNull( $result ); |
|
68 | + $this->assertNull($this->view->get('errors')); |
|
69 | + $this->assertNull($result); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
73 | 73 | public function testGet() |
74 | 74 | { |
75 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
75 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
76 | 76 | |
77 | - $this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' ); |
|
77 | + $this->view->item = $manager->findItem('xs', ['media'], 'product', 'size'); |
|
78 | 78 | $result = $this->object->get(); |
79 | 79 | |
80 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
81 | - $this->assertContains( '"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result ); |
|
80 | + $this->assertNull($this->view->get('errors')); |
|
81 | + $this->assertContains('"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testSave() |
86 | 86 | { |
87 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
87 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
88 | 88 | $this->view->item = $manager->createItem(); |
89 | 89 | |
90 | 90 | |
@@ -99,108 +99,108 @@ discard block |
||
99 | 99 | ]], |
100 | 100 | ); |
101 | 101 | |
102 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
103 | - $this->view->addHelper( 'param', $helper ); |
|
102 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
103 | + $this->view->addHelper('param', $helper); |
|
104 | 104 | |
105 | - $file = $this->getMockBuilder( \Psr\Http\Message\UploadedFileInterface::class )->getMock(); |
|
106 | - $request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock(); |
|
107 | - $request->expects( $this->any() )->method( 'getUploadedFiles' ) |
|
108 | - ->will( $this->returnValue( ['media' => [0 => ['file' => $file] ] ] ) ); |
|
105 | + $file = $this->getMockBuilder(\Psr\Http\Message\UploadedFileInterface::class)->getMock(); |
|
106 | + $request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock(); |
|
107 | + $request->expects($this->any())->method('getUploadedFiles') |
|
108 | + ->will($this->returnValue(['media' => [0 => ['file' => $file]]])); |
|
109 | 109 | |
110 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' ); |
|
111 | - $this->view ->addHelper( 'request', $helper ); |
|
110 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test'); |
|
111 | + $this->view ->addHelper('request', $helper); |
|
112 | 112 | |
113 | 113 | |
114 | 114 | $name = 'AdminJQAdmAttributeMediaSave'; |
115 | - $this->context->getConfig()->set( 'controller/common/media/name', $name ); |
|
115 | + $this->context->getConfig()->set('controller/common/media/name', $name); |
|
116 | 116 | |
117 | - $cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' ) |
|
118 | - ->setConstructorArgs( array( $this->context ) ) |
|
119 | - ->setMethods( array( 'add' ) ) |
|
117 | + $cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard') |
|
118 | + ->setConstructorArgs(array($this->context)) |
|
119 | + ->setMethods(array('add')) |
|
120 | 120 | ->getMock(); |
121 | 121 | |
122 | - \Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub ); |
|
122 | + \Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub); |
|
123 | 123 | |
124 | - $cntlStub->expects( $this->once() )->method( 'add' ); |
|
124 | + $cntlStub->expects($this->once())->method('add'); |
|
125 | 125 | |
126 | 126 | |
127 | 127 | $result = $this->object->save(); |
128 | 128 | |
129 | 129 | |
130 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
131 | - $this->assertNull( $result ); |
|
132 | - $this->assertEquals( 1, count( $this->view->item->getListItems() ) ); |
|
130 | + $this->assertNull($this->view->get('errors')); |
|
131 | + $this->assertNull($result); |
|
132 | + $this->assertEquals(1, count($this->view->item->getListItems())); |
|
133 | 133 | |
134 | - foreach( $this->view->item->getListItems( 'media' ) as $listItem ) |
|
134 | + foreach ($this->view->item->getListItems('media') as $listItem) |
|
135 | 135 | { |
136 | - $this->assertEquals( 'media', $listItem->getDomain() ); |
|
136 | + $this->assertEquals('media', $listItem->getDomain()); |
|
137 | 137 | |
138 | 138 | $refItem = $listItem->getRefItem(); |
139 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
140 | - $this->assertEquals( 'test', $refItem->getLabel() ); |
|
139 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
140 | + $this->assertEquals('test', $refItem->getLabel()); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
144 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['site' => 'unittest', 'media' => []] ); |
|
145 | - $this->view->addHelper( 'param', $helper ); |
|
144 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['site' => 'unittest', 'media' => []]); |
|
145 | + $this->view->addHelper('param', $helper); |
|
146 | 146 | |
147 | 147 | $result = $this->object->save(); |
148 | 148 | |
149 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
150 | - $this->assertNull( $result ); |
|
151 | - $this->assertEquals( 0, count( $this->view->item->getListItems() ) ); |
|
149 | + $this->assertNull($this->view->get('errors')); |
|
150 | + $this->assertNull($result); |
|
151 | + $this->assertEquals(0, count($this->view->item->getListItems())); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
155 | 155 | public function testSaveException() |
156 | 156 | { |
157 | - $object = $this->getClientMock( 'fromArray' ); |
|
157 | + $object = $this->getClientMock('fromArray'); |
|
158 | 158 | |
159 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
160 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
159 | + $object->expects($this->once())->method('fromArray') |
|
160 | + ->will($this->throwException(new \RuntimeException())); |
|
161 | 161 | |
162 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
162 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
163 | 163 | $object->save(); |
164 | 164 | } |
165 | 165 | |
166 | 166 | |
167 | 167 | public function testSaveMShopException() |
168 | 168 | { |
169 | - $object = $this->getClientMock( 'fromArray' ); |
|
169 | + $object = $this->getClientMock('fromArray'); |
|
170 | 170 | |
171 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
172 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
171 | + $object->expects($this->once())->method('fromArray') |
|
172 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
173 | 173 | |
174 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
174 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
175 | 175 | $object->save(); |
176 | 176 | } |
177 | 177 | |
178 | 178 | |
179 | 179 | public function testSearch() |
180 | 180 | { |
181 | - $this->assertNull( $this->object->search() ); |
|
181 | + $this->assertNull($this->object->search()); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
185 | 185 | public function testGetSubClient() |
186 | 186 | { |
187 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
188 | - $this->object->getSubClient( 'unknown' ); |
|
187 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
188 | + $this->object->getSubClient('unknown'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | |
192 | - public function getClientMock( $method ) |
|
192 | + public function getClientMock($method) |
|
193 | 193 | { |
194 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class ) |
|
195 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
196 | - ->setMethods( [$method] ) |
|
194 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class) |
|
195 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
196 | + ->setMethods([$method]) |
|
197 | 197 | ->getMock(); |
198 | 198 | |
199 | 199 | $view = \TestHelperJqadm::getView(); |
200 | - $view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem(); |
|
200 | + $view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem(); |
|
201 | 201 | |
202 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
203 | - $object->setView( $view ); |
|
202 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
203 | + $object->setView($view); |
|
204 | 204 | |
205 | 205 | return $object; |
206 | 206 | } |
@@ -21,40 +21,40 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Attribute\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\Attribute\Media\Property\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'Media properties', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('Media properties', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' ); |
|
53 | + $this->view->item = $manager->findItem('xs', ['media'], 'product', 'size'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( 'item-media-property', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('item-media-property', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,33 +62,33 @@ discard block |
||
62 | 62 | { |
63 | 63 | $result = $this->object->delete(); |
64 | 64 | |
65 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
66 | - $this->assertNull( $result ); |
|
65 | + $this->assertNull($this->view->get('errors')); |
|
66 | + $this->assertNull($result); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | 70 | public function testGet() |
71 | 71 | { |
72 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
72 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' ); |
|
74 | + $this->view->item = $manager->findItem('xs', ['media'], 'product', 'size'); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( 'item-media-property', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('item-media-property', $result); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | public function testSave() |
83 | 83 | { |
84 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
85 | - $typeManager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
84 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
85 | + $typeManager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
86 | 86 | |
87 | - $item = $manager->findItem( 'xs', ['media'], 'product', 'size' ); |
|
88 | - $item->setCode( 'jqadm-test-media-property' ); |
|
89 | - $item->setId( null ); |
|
87 | + $item = $manager->findItem('xs', ['media'], 'product', 'size'); |
|
88 | + $item->setCode('jqadm-test-media-property'); |
|
89 | + $item->setId(null); |
|
90 | 90 | |
91 | - $this->view->item = $manager->saveItem( $item ); |
|
91 | + $this->view->item = $manager->saveItem($item); |
|
92 | 92 | |
93 | 93 | $param = array( |
94 | 94 | 'site' => 'unittest', |
@@ -104,53 +104,53 @@ discard block |
||
104 | 104 | ), |
105 | 105 | ); |
106 | 106 | |
107 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
108 | - $this->view->addHelper( 'param', $helper ); |
|
107 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
108 | + $this->view->addHelper('param', $helper); |
|
109 | 109 | |
110 | 110 | |
111 | 111 | $result = $this->object->save(); |
112 | 112 | |
113 | 113 | |
114 | - $manager->deleteItem( $this->view->item->getId() ); |
|
114 | + $manager->deleteItem($this->view->item->getId()); |
|
115 | 115 | |
116 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
117 | - $this->assertNull( $result ); |
|
116 | + $this->assertNull($this->view->get('errors')); |
|
117 | + $this->assertNull($result); |
|
118 | 118 | |
119 | - $mediaItems = $this->view->item->getRefItems( 'media' ); |
|
120 | - $this->assertEquals( 1, count( $mediaItems ) ); |
|
121 | - $this->assertEquals( 1, count( reset( $mediaItems )->getPropertyItems() ) ); |
|
119 | + $mediaItems = $this->view->item->getRefItems('media'); |
|
120 | + $this->assertEquals(1, count($mediaItems)); |
|
121 | + $this->assertEquals(1, count(reset($mediaItems)->getPropertyItems())); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
125 | 125 | public function testSaveException() |
126 | 126 | { |
127 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Property\Standard::class ) |
|
128 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
129 | - ->setMethods( array( 'fromArray' ) ) |
|
127 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Property\Standard::class) |
|
128 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
129 | + ->setMethods(array('fromArray')) |
|
130 | 130 | ->getMock(); |
131 | 131 | |
132 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
133 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
132 | + $object->expects($this->once())->method('fromArray') |
|
133 | + ->will($this->throwException(new \RuntimeException())); |
|
134 | 134 | |
135 | 135 | $this->view = \TestHelperJqadm::getView(); |
136 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem(); |
|
136 | + $this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem(); |
|
137 | 137 | |
138 | - $object->setView( $this->view ); |
|
138 | + $object->setView($this->view); |
|
139 | 139 | |
140 | - $this->setExpectedException( \RuntimeException::class ); |
|
140 | + $this->setExpectedException(\RuntimeException::class); |
|
141 | 141 | $object->save(); |
142 | 142 | } |
143 | 143 | |
144 | 144 | |
145 | 145 | public function testSearch() |
146 | 146 | { |
147 | - $this->assertNull( $this->object->search() ); |
|
147 | + $this->assertNull($this->object->search()); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
151 | 151 | public function testGetSubClient() |
152 | 152 | { |
153 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
154 | - $this->object->getSubClient( 'unknown' ); |
|
153 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
154 | + $this->object->getSubClient('unknown'); |
|
155 | 155 | } |
156 | 156 | } |
@@ -21,70 +21,70 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Attribute\Price\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\Attribute\Price\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'item-price', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('item-price', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'xs', ['price'], 'product', 'size' ); |
|
53 | + $this->view->item = $manager->findItem('xs', ['price'], 'product', 'size'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( '"price.type":"default"', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('"price.type":"default"', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testDelete() |
62 | 62 | { |
63 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
63 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
64 | 64 | |
65 | 65 | $this->view->item = $manager->createItem(); |
66 | 66 | $result = $this->object->delete(); |
67 | 67 | |
68 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
69 | - $this->assertNull( $result ); |
|
68 | + $this->assertNull($this->view->get('errors')); |
|
69 | + $this->assertNull($result); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
73 | 73 | public function testGet() |
74 | 74 | { |
75 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
75 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
76 | 76 | |
77 | - $this->view->item = $manager->findItem( 'xs', ['price'], 'product', 'size' ); |
|
77 | + $this->view->item = $manager->findItem('xs', ['price'], 'product', 'size'); |
|
78 | 78 | $result = $this->object->get(); |
79 | 79 | |
80 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
81 | - $this->assertContains( '"price.type":"default"', $result ); |
|
80 | + $this->assertNull($this->view->get('errors')); |
|
81 | + $this->assertContains('"price.type":"default"', $result); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testSave() |
86 | 86 | { |
87 | - $manager = \Aimeos\MShop::create( $this->context, 'attribute' ); |
|
87 | + $manager = \Aimeos\MShop::create($this->context, 'attribute'); |
|
88 | 88 | $item = $manager->createItem(); |
89 | 89 | |
90 | 90 | $param = array( |
@@ -102,80 +102,80 @@ discard block |
||
102 | 102 | ]], |
103 | 103 | ); |
104 | 104 | |
105 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
106 | - $this->view->addHelper( 'param', $helper ); |
|
105 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
106 | + $this->view->addHelper('param', $helper); |
|
107 | 107 | $this->view->item = $item; |
108 | 108 | |
109 | 109 | $result = $this->object->save(); |
110 | 110 | |
111 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
112 | - $this->assertNull( $result ); |
|
113 | - $this->assertEquals( 1, count( $item->getListItems() ) ); |
|
111 | + $this->assertNull($this->view->get('errors')); |
|
112 | + $this->assertNull($result); |
|
113 | + $this->assertEquals(1, count($item->getListItems())); |
|
114 | 114 | |
115 | - foreach( $item->getListItems( 'price' ) as $listItem ) |
|
115 | + foreach ($item->getListItems('price') as $listItem) |
|
116 | 116 | { |
117 | - $this->assertEquals( 'price', $listItem->getDomain() ); |
|
117 | + $this->assertEquals('price', $listItem->getDomain()); |
|
118 | 118 | |
119 | 119 | $refItem = $listItem->getRefItem(); |
120 | - $this->assertEquals( 'EUR', $refItem->getCurrencyId() ); |
|
121 | - $this->assertEquals( '2', $refItem->getQuantity() ); |
|
122 | - $this->assertEquals( '10.00', $refItem->getValue() ); |
|
123 | - $this->assertEquals( '1.00', $refItem->getCosts() ); |
|
124 | - $this->assertEquals( '5.00', $refItem->getRebate() ); |
|
125 | - $this->assertEquals( '20.00', $refItem->getTaxRate() ); |
|
120 | + $this->assertEquals('EUR', $refItem->getCurrencyId()); |
|
121 | + $this->assertEquals('2', $refItem->getQuantity()); |
|
122 | + $this->assertEquals('10.00', $refItem->getValue()); |
|
123 | + $this->assertEquals('1.00', $refItem->getCosts()); |
|
124 | + $this->assertEquals('5.00', $refItem->getRebate()); |
|
125 | + $this->assertEquals('20.00', $refItem->getTaxRate()); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | 129 | |
130 | 130 | public function testSaveException() |
131 | 131 | { |
132 | - $object = $this->getClientMock( 'fromArray' ); |
|
132 | + $object = $this->getClientMock('fromArray'); |
|
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('fromArray') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
137 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
138 | 138 | $object->save(); |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | public function testSaveMShopException() |
143 | 143 | { |
144 | - $object = $this->getClientMock( 'fromArray' ); |
|
144 | + $object = $this->getClientMock('fromArray'); |
|
145 | 145 | |
146 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
147 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
146 | + $object->expects($this->once())->method('fromArray') |
|
147 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
148 | 148 | |
149 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
149 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
150 | 150 | $object->save(); |
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testSearch() |
155 | 155 | { |
156 | - $this->assertNull( $this->object->search() ); |
|
156 | + $this->assertNull($this->object->search()); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | |
160 | 160 | public function testGetSubClient() |
161 | 161 | { |
162 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
163 | - $this->object->getSubClient( 'unknown' ); |
|
162 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
163 | + $this->object->getSubClient('unknown'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
167 | - public function getClientMock( $method ) |
|
167 | + public function getClientMock($method) |
|
168 | 168 | { |
169 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class ) |
|
170 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
171 | - ->setMethods( [$method] ) |
|
169 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class) |
|
170 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
171 | + ->setMethods([$method]) |
|
172 | 172 | ->getMock(); |
173 | 173 | |
174 | 174 | $view = \TestHelperJqadm::getView(); |
175 | - $view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem(); |
|
175 | + $view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem(); |
|
176 | 176 | |
177 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
178 | - $object->setView( $view ); |
|
177 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
178 | + $object->setView($view); |
|
179 | 179 | |
180 | 180 | return $object; |
181 | 181 | } |
@@ -17,102 +17,102 @@ discard block |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | |
22 | 22 | $config = $this->context->getConfig(); |
23 | - $config->set( 'admin/jqadm/common/decorators/default', [] ); |
|
24 | - $config->set( 'admin/jqadm/product/decorators/global', [] ); |
|
25 | - $config->set( 'admin/jqadm/product/decorators/local', [] ); |
|
23 | + $config->set('admin/jqadm/common/decorators/default', []); |
|
24 | + $config->set('admin/jqadm/product/decorators/global', []); |
|
25 | + $config->set('admin/jqadm/product/decorators/local', []); |
|
26 | 26 | |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testInjectClient() |
31 | 31 | { |
32 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
33 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
32 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
33 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
34 | 34 | |
35 | - $iClient = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
35 | + $iClient = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
36 | 36 | |
37 | - $this->assertSame( $client, $iClient ); |
|
37 | + $this->assertSame($client, $iClient); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testInjectClientReset() |
42 | 42 | { |
43 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
44 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
45 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null ); |
|
43 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
44 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
45 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null); |
|
46 | 46 | |
47 | - $new = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
47 | + $new = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
48 | 48 | |
49 | - $this->assertNotSame( $client, $new ); |
|
49 | + $this->assertNotSame($client, $new); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testAddDecorators() |
54 | 54 | { |
55 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
55 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
56 | 56 | |
57 | - $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
58 | - [], array( 'Cache' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
57 | + $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
58 | + [], array('Cache'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
59 | 59 | |
60 | - $this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result ); |
|
60 | + $this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testAddDecoratorsInvalidName() |
65 | 65 | { |
66 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
66 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
67 | 67 | |
68 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
69 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, ['$'], 'Test' ); |
|
68 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
69 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, ['$'], 'Test'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
73 | 73 | public function testAddDecoratorsInvalidClass() |
74 | 74 | { |
75 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
75 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
76 | 76 | |
77 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
78 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
79 | - array( 'Test' ), 'TestDecorator' ); |
|
77 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
78 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
79 | + array('Test'), 'TestDecorator'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | 83 | public function testAddDecoratorsInvalidInterface() |
84 | 84 | { |
85 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
85 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
86 | 86 | |
87 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
88 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
89 | - array( 'Test' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
87 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
88 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
89 | + array('Test'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | 93 | public function testAddClientDecoratorsExcludes() |
94 | 94 | { |
95 | - $this->context->getConfig()->set( 'admin/jqadm/decorators/excludes', array( 'TestDecorator' ) ); |
|
96 | - $this->context->getConfig()->set( 'admin/jqadm/common/decorators/default', array( 'TestDecorator' ) ); |
|
95 | + $this->context->getConfig()->set('admin/jqadm/decorators/excludes', array('TestDecorator')); |
|
96 | + $this->context->getConfig()->set('admin/jqadm/common/decorators/default', array('TestDecorator')); |
|
97 | 97 | |
98 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
99 | - \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
98 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
99 | + \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | 103 | public function testAddClientDecoratorsEmptyPath() |
104 | 104 | { |
105 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' ); |
|
105 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard'); |
|
106 | 106 | |
107 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
108 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic( $this->context, $client, '' ); |
|
107 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
108 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic($this->context, $client, ''); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
112 | 112 | public function testCreateClientBase() |
113 | 113 | { |
114 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
115 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createAdminPublic( $this->context, 'Test', 'Test' ); |
|
114 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
115 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createAdminPublic($this->context, 'Test', 'Test'); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -120,22 +120,22 @@ discard block |
||
120 | 120 | class TestAbstract |
121 | 121 | extends \Aimeos\Admin\JQAdm\Common\Factory\Base |
122 | 122 | { |
123 | - public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
124 | - \Aimeos\Admin\JQAdm\Iface $client, array $decorators, $classprefix ) |
|
123 | + public static function addDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
124 | + \Aimeos\Admin\JQAdm\Iface $client, array $decorators, $classprefix) |
|
125 | 125 | { |
126 | - return self::addDecorators( $context, $client, $decorators, $classprefix ); |
|
126 | + return self::addDecorators($context, $client, $decorators, $classprefix); |
|
127 | 127 | } |
128 | 128 | |
129 | - public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
130 | - \Aimeos\Admin\JQAdm\Iface $client, $path ) |
|
129 | + public static function addClientDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
130 | + \Aimeos\Admin\JQAdm\Iface $client, $path) |
|
131 | 131 | { |
132 | - return self::addClientDecorators( $context, $client, $path ); |
|
132 | + return self::addClientDecorators($context, $client, $path); |
|
133 | 133 | } |
134 | 134 | |
135 | - public static function createAdminPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
136 | - $classname, $interface ) |
|
135 | + public static function createAdminPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
136 | + $classname, $interface) |
|
137 | 137 | { |
138 | - return self::createAdmin( $context, $classname, $interface ); |
|
138 | + return self::createAdmin($context, $classname, $interface); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Log\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Log\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Log\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Log\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Log\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Log\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Log\Factory::create( $this->context, '%log' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Log\Factory::create($this->context, '%log'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Log\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Log\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Locale\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Locale\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Locale\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Locale\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Locale\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Locale\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Locale\Factory::create( $this->context, '%locale' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Locale\Factory::create($this->context, '%locale'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Locale\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Locale\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Locale\Site\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Locale\Site\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Locale\Site\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Locale\Site\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Locale\Site\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Locale\Site\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Locale\Site\Factory::create( $this->context, '%locale/site' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Locale\Site\Factory::create($this->context, '%locale/site'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Locale\Site\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Locale\Site\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create( $this->context, '%locale/currency' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create($this->context, '%locale/currency'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Locale\Currency\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |