@@ -145,7 +145,7 @@ |
||
145 | 145 | * Creates a list of all available translations. |
146 | 146 | * |
147 | 147 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
148 | - * @return array List of language IDs with labels |
|
148 | + * @return string List of language IDs with labels |
|
149 | 149 | */ |
150 | 150 | protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
151 | 151 | { |
@@ -30,54 +30,54 @@ discard block |
||
30 | 30 | * @param integer $tab Number of the currently active tab |
31 | 31 | * @return \Symfony\Component\HttpFoundation\Response HTML page for the admin interface |
32 | 32 | */ |
33 | - public function indexAction( $site, $lang, $tab ) |
|
33 | + public function indexAction($site, $lang, $tab) |
|
34 | 34 | { |
35 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
36 | - $context = $this->setLocale( $context, $site, $lang ); |
|
35 | + $context = $this->get('aimeos_context')->get(false); |
|
36 | + $context = $this->setLocale($context, $site, $lang); |
|
37 | 37 | |
38 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
39 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
40 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
38 | + $aimeos = $this->get('aimeos')->get(); |
|
39 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
40 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
41 | 41 | $cssFiles = array(); |
42 | 42 | |
43 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
43 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
44 | 44 | { |
45 | - foreach( $paths as $path ) |
|
45 | + foreach ($paths as $path) |
|
46 | 46 | { |
47 | 47 | $jsbAbsPath = $base . '/' . $path; |
48 | 48 | |
49 | - if( !is_file( $jsbAbsPath ) ) { |
|
50 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
49 | + if (!is_file($jsbAbsPath)) { |
|
50 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
51 | 51 | } |
52 | 52 | |
53 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
54 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
53 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
54 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | - $params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' ); |
|
59 | - $adminUrl = $this->generateUrl( 'aimeos_shop_admin', $params ); |
|
58 | + $params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}'); |
|
59 | + $adminUrl = $this->generateUrl('aimeos_shop_admin', $params); |
|
60 | 60 | |
61 | - $token = $this->get( 'security.csrf.token_manager' )->getToken( 'aimeos_admin_token' )->getValue(); |
|
62 | - $jsonUrl = $this->generateUrl( 'aimeos_shop_admin_json', array( '_token' => $token ) ); |
|
61 | + $token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue(); |
|
62 | + $jsonUrl = $this->generateUrl('aimeos_shop_admin_json', array('_token' => $token)); |
|
63 | 63 | |
64 | 64 | $vars = array( |
65 | 65 | 'lang' => $lang, |
66 | 66 | 'cssFiles' => $cssFiles, |
67 | - 'languages' => $this->getJsonLanguages( $context), |
|
68 | - 'config' => $this->getJsonClientConfig( $context ), |
|
69 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
70 | - 'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ), |
|
67 | + 'languages' => $this->getJsonLanguages($context), |
|
68 | + 'config' => $this->getJsonClientConfig($context), |
|
69 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
70 | + 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), |
|
71 | 71 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
72 | 72 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
73 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
74 | - 'urlTemplate' => urldecode( $adminUrl ), |
|
75 | - 'uploaddir' => $this->container->getParameter( 'aimeos_shop.uploaddir' ), |
|
73 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
74 | + 'urlTemplate' => urldecode($adminUrl), |
|
75 | + 'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'), |
|
76 | 76 | 'version' => $this->getVersion(), |
77 | 77 | 'activeTab' => $tab, |
78 | 78 | ); |
79 | 79 | |
80 | - return $this->render( 'AimeosShopBundle:Admin:index.html.twig', $vars ); |
|
80 | + return $this->render('AimeosShopBundle:Admin:index.html.twig', $vars); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -87,22 +87,22 @@ discard block |
||
87 | 87 | * @param Request $request Symfony request object |
88 | 88 | * @return \Symfony\Component\HttpFoundation\Response 2.0 RPC message response |
89 | 89 | */ |
90 | - public function doAction( Request $request ) |
|
90 | + public function doAction(Request $request) |
|
91 | 91 | { |
92 | 92 | $csrfProvider = $this->get('security.csrf.token_manager'); |
93 | 93 | |
94 | - if( $csrfProvider->isTokenValid( new CsrfToken( 'aimeos_admin_token', $request->query->get( '_token' ) ) ) !== true ) { |
|
95 | - throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException( 'CSRF token is invalid' ); |
|
94 | + if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) { |
|
95 | + throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid'); |
|
96 | 96 | } |
97 | 97 | |
98 | - $cntlPaths = $this->get( 'aimeos' )->get()->getCustomPaths( 'controller/extjs' ); |
|
99 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
100 | - $context = $this->setLocale( $context ); |
|
98 | + $cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs'); |
|
99 | + $context = $this->get('aimeos_context')->get(false); |
|
100 | + $context = $this->setLocale($context); |
|
101 | 101 | |
102 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
102 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
103 | 103 | |
104 | - $response = $controller->process( $request->request->all(), 'php://input' ); |
|
105 | - return $this->render( 'AimeosShopBundle:Admin:do.html.twig', array( 'output' => $response ) ); |
|
104 | + $response = $controller->process($request->request->all(), 'php://input'); |
|
105 | + return $this->render('AimeosShopBundle:Admin:do.html.twig', array('output' => $response)); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -115,27 +115,27 @@ discard block |
||
115 | 115 | { |
116 | 116 | $contents = ''; |
117 | 117 | $jsFiles = array(); |
118 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
118 | + $aimeos = $this->get('aimeos')->get(); |
|
119 | 119 | |
120 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
120 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
121 | 121 | { |
122 | - foreach( $paths as $path ) |
|
122 | + foreach ($paths as $path) |
|
123 | 123 | { |
124 | 124 | $jsbAbsPath = $base . '/' . $path; |
125 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
126 | - $jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) ); |
|
125 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
126 | + $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', '')); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | - foreach( $jsFiles as $file ) |
|
130 | + foreach ($jsFiles as $file) |
|
131 | 131 | { |
132 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
132 | + if (($content = file_get_contents($file)) !== false) { |
|
133 | 133 | $contents .= $content; |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | - $response = new Response( $contents ); |
|
138 | - $response->headers->set( 'Content-Type', 'application/javascript' ); |
|
137 | + $response = new Response($contents); |
|
138 | + $response->headers->set('Content-Type', 'application/javascript'); |
|
139 | 139 | |
140 | 140 | return $response; |
141 | 141 | } |
@@ -147,30 +147,30 @@ discard block |
||
147 | 147 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
148 | 148 | * @return array List of language IDs with labels |
149 | 149 | */ |
150 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
150 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
151 | 151 | { |
152 | - $paths = $this->get( 'aimeos' )->get()->getI18nPaths(); |
|
152 | + $paths = $this->get('aimeos')->get()->getI18nPaths(); |
|
153 | 153 | $langs = array(); |
154 | 154 | |
155 | - if( !isset( $paths['admin'] ) ) { |
|
156 | - return json_encode( array() ); |
|
155 | + if (!isset($paths['admin'])) { |
|
156 | + return json_encode(array()); |
|
157 | 157 | } |
158 | 158 | |
159 | - foreach( $paths['admin'] as $path ) |
|
159 | + foreach ($paths['admin'] as $path) |
|
160 | 160 | { |
161 | - $iter = new \DirectoryIterator( $path ); |
|
161 | + $iter = new \DirectoryIterator($path); |
|
162 | 162 | |
163 | - foreach( $iter as $file ) |
|
163 | + foreach ($iter as $file) |
|
164 | 164 | { |
165 | 165 | $name = $file->getFilename(); |
166 | 166 | |
167 | - if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) { |
|
167 | + if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) { |
|
168 | 168 | $langs[$name] = null; |
169 | 169 | } |
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) ); |
|
173 | + return json_encode($this->getLanguages($context, array_keys($langs))); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
181 | 181 | * @return string JSON encoded configuration object |
182 | 182 | */ |
183 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
183 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
184 | 184 | { |
185 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
186 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
185 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
186 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -194,16 +194,16 @@ discard block |
||
194 | 194 | * @param string $lang ISO language code like "en" or "en_GB" |
195 | 195 | * @return string JSON encoded translation object |
196 | 196 | */ |
197 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
197 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
198 | 198 | { |
199 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) ); |
|
199 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true)); |
|
200 | 200 | |
201 | 201 | $content = array( |
202 | - 'admin' => $i18n->getAll( 'admin' ), |
|
203 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
202 | + 'admin' => $i18n->getAll('admin'), |
|
203 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
204 | 204 | ); |
205 | 205 | |
206 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
206 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | |
@@ -215,19 +215,19 @@ discard block |
||
215 | 215 | * @return string JSON encoded site item object |
216 | 216 | * @throws Exception If no site item was found for the code |
217 | 217 | */ |
218 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
218 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
219 | 219 | { |
220 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
220 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
221 | 221 | |
222 | 222 | $criteria = $manager->createSearch(); |
223 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
224 | - $items = $manager->searchItems( $criteria ); |
|
223 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
224 | + $items = $manager->searchItems($criteria); |
|
225 | 225 | |
226 | - if( ( $item = reset( $items ) ) === false ) { |
|
227 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
226 | + if (($item = reset($items)) === false) { |
|
227 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
228 | 228 | } |
229 | 229 | |
230 | - return json_encode( $item->toArray() ); |
|
230 | + return json_encode($item->toArray()); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | |
@@ -238,18 +238,18 @@ discard block |
||
238 | 238 | * @param array $langIds List of language IDs |
239 | 239 | * @return array List of associative lists with "id" and "label" as keys |
240 | 240 | */ |
241 | - protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds ) |
|
241 | + protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds) |
|
242 | 242 | { |
243 | - $languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
243 | + $languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
244 | 244 | $result = array(); |
245 | 245 | |
246 | 246 | $search = $languageManager->createSearch(); |
247 | - $search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) ); |
|
248 | - $search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) ); |
|
249 | - $langItems = $languageManager->searchItems( $search ); |
|
247 | + $search->setConditions($search->compare('==', 'locale.language.id', $langIds)); |
|
248 | + $search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label'))); |
|
249 | + $langItems = $languageManager->searchItems($search); |
|
250 | 250 | |
251 | - foreach( $langItems as $id => $item ) { |
|
252 | - $result[] = array( 'id' => $id, 'label' => $item->getLabel() ); |
|
251 | + foreach ($langItems as $id => $item) { |
|
252 | + $result[] = array('id' => $id, 'label' => $item->getLabel()); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | return $result; |
@@ -263,14 +263,14 @@ discard block |
||
263 | 263 | */ |
264 | 264 | protected function getVersion() |
265 | 265 | { |
266 | - $filename = dirname( $this->get( 'kernel' )->getRootDir() ) . DIRECTORY_SEPARATOR . 'composer.lock'; |
|
266 | + $filename = dirname($this->get('kernel')->getRootDir()) . DIRECTORY_SEPARATOR . 'composer.lock'; |
|
267 | 267 | |
268 | - if( file_exists( $filename ) === true && ( $content = file_get_contents( $filename ) ) !== false |
|
269 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
268 | + if (file_exists($filename) === true && ($content = file_get_contents($filename)) !== false |
|
269 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
270 | 270 | ) { |
271 | - foreach( (array) $content['packages'] as $item ) |
|
271 | + foreach ((array) $content['packages'] as $item) |
|
272 | 272 | { |
273 | - if( $item['name'] === 'aimeos/aimeos-symfony2' ) { |
|
273 | + if ($item['name'] === 'aimeos/aimeos-symfony2') { |
|
274 | 274 | return $item['version']; |
275 | 275 | } |
276 | 276 | } |
@@ -288,17 +288,17 @@ discard block |
||
288 | 288 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
289 | 289 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
290 | 290 | */ |
291 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
291 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
292 | 292 | { |
293 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
293 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
294 | 294 | |
295 | 295 | try { |
296 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
297 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
296 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
297 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
298 | 298 | $localeItem = $localeManager->createItem(); |
299 | 299 | } |
300 | 300 | |
301 | - $context->setLocale( $localeItem ); |
|
301 | + $context->setLocale($localeItem); |
|
302 | 302 | |
303 | 303 | return $context; |
304 | 304 | } |
@@ -28,7 +28,6 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
30 | 30 | * @param string Resource location, e.g. "product/stock/wareshouse" |
31 | - * @param string $sitecode Unique site code |
|
32 | 31 | * @param integer|null $id Unique resource ID |
33 | 32 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
34 | 33 | */ |
@@ -49,7 +48,6 @@ discard block |
||
49 | 48 | * |
50 | 49 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
51 | 50 | * @param string Resource location, e.g. "product/stock/wareshouse" |
52 | - * @param string $sitecode Unique site code |
|
53 | 51 | * @param integer|null $id Unique resource ID |
54 | 52 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
55 | 53 | */ |
@@ -70,7 +68,6 @@ discard block |
||
70 | 68 | * |
71 | 69 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
72 | 70 | * @param string Resource location, e.g. "product/stock/wareshouse" |
73 | - * @param string $sitecode Unique site code |
|
74 | 71 | * @param integer|null $id Unique resource ID |
75 | 72 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
76 | 73 | */ |
@@ -91,7 +88,6 @@ discard block |
||
91 | 88 | * |
92 | 89 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
93 | 90 | * @param string Resource location, e.g. "product/stock/wareshouse" |
94 | - * @param string $sitecode Unique site code |
|
95 | 91 | * @param integer $id Unique ID of the resource |
96 | 92 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
97 | 93 | */ |
@@ -112,7 +108,6 @@ discard block |
||
112 | 108 | * |
113 | 109 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
114 | 110 | * @param string Resource location, e.g. "product/stock/wareshouse" |
115 | - * @param string $sitecode Unique site code |
|
116 | 111 | * @param integer|null $id Unique resource ID |
117 | 112 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
118 | 113 | */ |
@@ -133,7 +128,6 @@ discard block |
||
133 | 128 | * |
134 | 129 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
135 | 130 | * @param string Resource location, e.g. "product/stock/wareshouse" |
136 | - * @param string $sitecode Unique site code |
|
137 | 131 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
138 | 132 | */ |
139 | 133 | public function optionsAction( Request $request, $resource = '', $site = 'default' ) |
@@ -177,7 +171,7 @@ discard block |
||
177 | 171 | * @param string $content Body of the HTTP response |
178 | 172 | * @param integer $status HTTP status |
179 | 173 | * @param array $header List of HTTP headers |
180 | - * @return \Illuminate\Http\Response HTTP response object |
|
174 | + * @return Response HTTP response object |
|
181 | 175 | */ |
182 | 176 | protected function createResponse( $content, $status, array $header ) |
183 | 177 | { |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | * @param integer|null $id Unique resource ID |
33 | 33 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
34 | 34 | */ |
35 | - public function deleteAction( Request $request, $resource, $site = 'default', $id = null ) |
|
35 | + public function deleteAction(Request $request, $resource, $site = 'default', $id = null) |
|
36 | 36 | { |
37 | 37 | $status = 500; |
38 | 38 | $header = $request->headers->all(); |
39 | 39 | |
40 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
41 | - $result = $cntl->delete( $request->getContent(), $header, $status ); |
|
40 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
41 | + $result = $cntl->delete($request->getContent(), $header, $status); |
|
42 | 42 | |
43 | - return $this->createResponse( $result, $status, $header ); |
|
43 | + return $this->createResponse($result, $status, $header); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | * @param integer|null $id Unique resource ID |
54 | 54 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
55 | 55 | */ |
56 | - public function getAction( Request $request, $resource, $site = 'default', $id = null ) |
|
56 | + public function getAction(Request $request, $resource, $site = 'default', $id = null) |
|
57 | 57 | { |
58 | 58 | $status = 500; |
59 | 59 | $header = $request->headers->all(); |
60 | 60 | |
61 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
62 | - $result = $cntl->get( $request->getContent(), $header, $status ); |
|
61 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
62 | + $result = $cntl->get($request->getContent(), $header, $status); |
|
63 | 63 | |
64 | - return $this->createResponse( $result, $status, $header ); |
|
64 | + return $this->createResponse($result, $status, $header); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | * @param integer|null $id Unique resource ID |
75 | 75 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
76 | 76 | */ |
77 | - public function patchAction( Request $request, $resource, $site = 'default', $id = null ) |
|
77 | + public function patchAction(Request $request, $resource, $site = 'default', $id = null) |
|
78 | 78 | { |
79 | 79 | $status = 500; |
80 | 80 | $header = $request->headers->all(); |
81 | 81 | |
82 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
83 | - $result = $cntl->patch( $request->getContent(), $header, $status ); |
|
82 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
83 | + $result = $cntl->patch($request->getContent(), $header, $status); |
|
84 | 84 | |
85 | - return $this->createResponse( $result, $status, $header ); |
|
85 | + return $this->createResponse($result, $status, $header); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | * @param integer $id Unique ID of the resource |
96 | 96 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
97 | 97 | */ |
98 | - public function postAction( Request $request, $resource, $site = 'default', $id = null ) |
|
98 | + public function postAction(Request $request, $resource, $site = 'default', $id = null) |
|
99 | 99 | { |
100 | 100 | $status = 500; |
101 | 101 | $header = $request->headers->all(); |
102 | 102 | |
103 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
104 | - $result = $cntl->post( $request->getContent(), $header, $status ); |
|
103 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
104 | + $result = $cntl->post($request->getContent(), $header, $status); |
|
105 | 105 | |
106 | - return $this->createResponse( $result, $status, $header ); |
|
106 | + return $this->createResponse($result, $status, $header); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | * @param integer|null $id Unique resource ID |
117 | 117 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
118 | 118 | */ |
119 | - public function putAction( Request $request, $resource, $site = 'default', $id = null ) |
|
119 | + public function putAction(Request $request, $resource, $site = 'default', $id = null) |
|
120 | 120 | { |
121 | 121 | $status = 500; |
122 | 122 | $header = $request->headers->all(); |
123 | 123 | |
124 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
125 | - $result = $cntl->put( $request->getContent(), $header, $status ); |
|
124 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
125 | + $result = $cntl->put($request->getContent(), $header, $status); |
|
126 | 126 | |
127 | - return $this->createResponse( $result, $status, $header ); |
|
127 | + return $this->createResponse($result, $status, $header); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | * @param string $sitecode Unique site code |
137 | 137 | * @return \Symfony\Component\HttpFoundation\Response Response object containing the generated output |
138 | 138 | */ |
139 | - public function optionsAction( Request $request, $resource = '', $site = 'default' ) |
|
139 | + public function optionsAction(Request $request, $resource = '', $site = 'default') |
|
140 | 140 | { |
141 | 141 | $status = 500; |
142 | 142 | $header = $request->headers->all(); |
143 | 143 | |
144 | - $cntl = $this->createController( $site, $resource, $request->get( 'lang', 'en' ) ); |
|
145 | - $result = $cntl->options( $request->getContent(), $header, $status ); |
|
144 | + $cntl = $this->createController($site, $resource, $request->get('lang', 'en')); |
|
145 | + $result = $cntl->options($request->getContent(), $header, $status); |
|
146 | 146 | |
147 | - return $this->createResponse( $result, $status, $header ); |
|
147 | + return $this->createResponse($result, $status, $header); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -156,18 +156,18 @@ discard block |
||
156 | 156 | * @param string $lang Language code |
157 | 157 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
158 | 158 | */ |
159 | - protected function createController( $sitecode, $resource, $lang ) |
|
159 | + protected function createController($sitecode, $resource, $lang) |
|
160 | 160 | { |
161 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
162 | - $templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' ); |
|
161 | + $aimeos = $this->get('aimeos')->get(); |
|
162 | + $templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates'); |
|
163 | 163 | |
164 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
165 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
164 | + $context = $this->get('aimeos_context')->get(false); |
|
165 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
166 | 166 | |
167 | - $view = $this->get('aimeos_view')->create( $context->getConfig(), $templatePaths, $lang ); |
|
168 | - $context->setView( $view ); |
|
167 | + $view = $this->get('aimeos_view')->create($context->getConfig(), $templatePaths, $lang); |
|
168 | + $context->setView($view); |
|
169 | 169 | |
170 | - return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource ); |
|
170 | + return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -179,14 +179,14 @@ discard block |
||
179 | 179 | * @param array $header List of HTTP headers |
180 | 180 | * @return \Illuminate\Http\Response HTTP response object |
181 | 181 | */ |
182 | - protected function createResponse( $content, $status, array $header ) |
|
182 | + protected function createResponse($content, $status, array $header) |
|
183 | 183 | { |
184 | 184 | $response = new Response(); |
185 | - $response->setContent( $content ); |
|
186 | - $response->setStatusCode( $status ); |
|
185 | + $response->setContent($content); |
|
186 | + $response->setStatusCode($status); |
|
187 | 187 | |
188 | - foreach( $header as $key => $value ) { |
|
189 | - $response->headers->set( $key, $value ); |
|
188 | + foreach ($header as $key => $value) { |
|
189 | + $response->headers->set($key, $value); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | return $response; |
@@ -201,23 +201,23 @@ discard block |
||
201 | 201 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
202 | 202 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
203 | 203 | */ |
204 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang ) |
|
204 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang) |
|
205 | 205 | { |
206 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
206 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
207 | 207 | |
208 | 208 | try |
209 | 209 | { |
210 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
211 | - $localeItem->setLanguageId( null ); |
|
212 | - $localeItem->setCurrencyId( null ); |
|
210 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
211 | + $localeItem->setLanguageId(null); |
|
212 | + $localeItem->setCurrencyId(null); |
|
213 | 213 | } |
214 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
214 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
215 | 215 | { |
216 | 216 | $localeItem = $localeManager->createItem(); |
217 | 217 | } |
218 | 218 | |
219 | - $context->setLocale( $localeItem ); |
|
220 | - $context->setI18n( $this->get('aimeos_i18n')->get( array( $lang ) ) ); |
|
219 | + $context->setLocale($localeItem); |
|
220 | + $context->setI18n($this->get('aimeos_i18n')->get(array($lang))); |
|
221 | 221 | |
222 | 222 | return $context; |
223 | 223 | } |
@@ -210,8 +210,7 @@ |
||
210 | 210 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
211 | 211 | $localeItem->setLanguageId( null ); |
212 | 212 | $localeItem->setCurrencyId( null ); |
213 | - } |
|
214 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
213 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
215 | 214 | { |
216 | 215 | $localeItem = $localeManager->createItem(); |
217 | 216 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Doctrine\Common\Annotations\AnnotationRegistry; |
4 | 4 | |
5 | 5 | |
6 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
6 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
7 | 7 | |
8 | 8 | // if the bundle is within a symfony project, try to reuse the project's autoload |
9 | 9 | $files = array( |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | ); |
13 | 13 | |
14 | 14 | $autoload = false; |
15 | -foreach( $files as $file ) |
|
15 | +foreach ($files as $file) |
|
16 | 16 | { |
17 | - if( is_file( $file ) ) { |
|
17 | + if (is_file($file)) { |
|
18 | 18 | $autoload = include_once $file; |
19 | 19 | break; |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | -if( !$autoload ) |
|
23 | +if (!$autoload) |
|
24 | 24 | { |
25 | 25 | exit( |
26 | 26 | "Unable to find autoload.php file, please use composer to load dependencies: |
@@ -30,4 +30,4 @@ discard block |
||
30 | 30 | ); |
31 | 31 | } |
32 | 32 | |
33 | -AnnotationRegistry::registerLoader( array( $autoload, 'loadClass' ) ); |
|
33 | +AnnotationRegistry::registerLoader(array($autoload, 'loadClass')); |
@@ -17,144 +17,144 @@ |
||
17 | 17 | |
18 | 18 | public function testGetId() |
19 | 19 | { |
20 | - $this->assertEquals( null, $this->object->getId() ); |
|
20 | + $this->assertEquals(null, $this->object->getId()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testGetSetCompany() |
25 | 25 | { |
26 | - $this->object->setCompany( 'ABC' ); |
|
27 | - $this->assertEquals( 'ABC', $this->object->getCompany() ); |
|
26 | + $this->object->setCompany('ABC'); |
|
27 | + $this->assertEquals('ABC', $this->object->getCompany()); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testGetSetVatID() |
32 | 32 | { |
33 | - $this->object->setVatID( 'AT0000' ); |
|
34 | - $this->assertEquals( 'AT0000', $this->object->getVatID() ); |
|
33 | + $this->object->setVatID('AT0000'); |
|
34 | + $this->assertEquals('AT0000', $this->object->getVatID()); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetSetSalutation() |
39 | 39 | { |
40 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN ); |
|
41 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation() ); |
|
40 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN); |
|
41 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation()); |
|
42 | 42 | |
43 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY ); |
|
44 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation() ); |
|
43 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY); |
|
44 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation()); |
|
45 | 45 | |
46 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS ); |
|
47 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation() ); |
|
46 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS); |
|
47 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation()); |
|
48 | 48 | |
49 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS ); |
|
50 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation() ); |
|
49 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS); |
|
50 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation()); |
|
51 | 51 | |
52 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR ); |
|
53 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation() ); |
|
52 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR); |
|
53 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testGetSetTitle() |
58 | 58 | { |
59 | - $this->object->setTitle( 'Prof. Dr.' ); |
|
60 | - $this->assertEquals( 'Prof. Dr.', $this->object->getTitle() ); |
|
59 | + $this->object->setTitle('Prof. Dr.'); |
|
60 | + $this->assertEquals('Prof. Dr.', $this->object->getTitle()); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testGetSetFirstname() |
65 | 65 | { |
66 | - $this->object->setFirstname( 'first' ); |
|
67 | - $this->assertEquals( 'first', $this->object->getFirstname() ); |
|
66 | + $this->object->setFirstname('first'); |
|
67 | + $this->assertEquals('first', $this->object->getFirstname()); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testGetSetLastname() |
72 | 72 | { |
73 | - $this->object->setLastname( 'last' ); |
|
74 | - $this->assertEquals( 'last', $this->object->getLastname() ); |
|
73 | + $this->object->setLastname('last'); |
|
74 | + $this->assertEquals('last', $this->object->getLastname()); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testGetSetAddress1() |
79 | 79 | { |
80 | - $this->object->setAddress1( 'test street' ); |
|
81 | - $this->assertEquals( 'test street', $this->object->getAddress1() ); |
|
80 | + $this->object->setAddress1('test street'); |
|
81 | + $this->assertEquals('test street', $this->object->getAddress1()); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testGetSetAddress2() |
86 | 86 | { |
87 | - $this->object->setAddress2( '1' ); |
|
88 | - $this->assertEquals( '1', $this->object->getAddress2() ); |
|
87 | + $this->object->setAddress2('1'); |
|
88 | + $this->assertEquals('1', $this->object->getAddress2()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
92 | 92 | public function testGetSetAddress3() |
93 | 93 | { |
94 | - $this->object->setAddress3( 'EG' ); |
|
95 | - $this->assertEquals( 'EG', $this->object->getAddress3() ); |
|
94 | + $this->object->setAddress3('EG'); |
|
95 | + $this->assertEquals('EG', $this->object->getAddress3()); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | 99 | public function testGetSetPostal() |
100 | 100 | { |
101 | - $this->object->setPostal( '12345' ); |
|
102 | - $this->assertEquals( '12345', $this->object->getPostal() ); |
|
101 | + $this->object->setPostal('12345'); |
|
102 | + $this->assertEquals('12345', $this->object->getPostal()); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
106 | 106 | public function testGetSetCity() |
107 | 107 | { |
108 | - $this->object->setCity( 'Munich' ); |
|
109 | - $this->assertEquals( 'Munich', $this->object->getCity() ); |
|
108 | + $this->object->setCity('Munich'); |
|
109 | + $this->assertEquals('Munich', $this->object->getCity()); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testGetSetState() |
114 | 114 | { |
115 | - $this->object->setState( 'Bayern' ); |
|
116 | - $this->assertEquals( 'Bayern', $this->object->getState() ); |
|
115 | + $this->object->setState('Bayern'); |
|
116 | + $this->assertEquals('Bayern', $this->object->getState()); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | 120 | public function testGetSetCountryId() |
121 | 121 | { |
122 | - $this->object->setCountryId( 'DE' ); |
|
123 | - $this->assertEquals( 'DE', $this->object->getCountryId() ); |
|
122 | + $this->object->setCountryId('DE'); |
|
123 | + $this->assertEquals('DE', $this->object->getCountryId()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testGetSetLanguageId() |
128 | 128 | { |
129 | - $this->object->setLanguageId( 'de' ); |
|
130 | - $this->assertEquals( 'de', $this->object->getLanguageId() ); |
|
129 | + $this->object->setLanguageId('de'); |
|
130 | + $this->assertEquals('de', $this->object->getLanguageId()); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | 134 | public function testGetSetTelephone() |
135 | 135 | { |
136 | - $this->object->setTelephone( '089123456789' ); |
|
137 | - $this->assertEquals( '089123456789', $this->object->getTelephone() ); |
|
136 | + $this->object->setTelephone('089123456789'); |
|
137 | + $this->assertEquals('089123456789', $this->object->getTelephone()); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | 141 | public function testGetSetTelefax() |
142 | 142 | { |
143 | - $this->object->setTelefax( '089987654321' ); |
|
144 | - $this->assertEquals( '089987654321', $this->object->getTelefax() ); |
|
143 | + $this->object->setTelefax('089987654321'); |
|
144 | + $this->assertEquals('089987654321', $this->object->getTelefax()); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
148 | 148 | public function testGetSetWebsite() |
149 | 149 | { |
150 | - $this->object->setWebsite( 'http://aimeos.org' ); |
|
151 | - $this->assertEquals( 'http://aimeos.org', $this->object->getWebsite() ); |
|
150 | + $this->object->setWebsite('http://aimeos.org'); |
|
151 | + $this->assertEquals('http://aimeos.org', $this->object->getWebsite()); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
155 | 155 | public function testSetWebsiteInvalid() |
156 | 156 | { |
157 | - $this->setExpectedException( 'Exception' ); |
|
158 | - $this->object->setWebsite( 'aimeos+org' ); |
|
157 | + $this->setExpectedException('Exception'); |
|
158 | + $this->object->setWebsite('aimeos+org'); |
|
159 | 159 | } |
160 | 160 | } |
@@ -28,9 +28,9 @@ |
||
28 | 28 | /** |
29 | 29 | * {@inheritdoc} |
30 | 30 | */ |
31 | - public function registerContainerConfiguration( LoaderInterface $loader ) |
|
31 | + public function registerContainerConfiguration(LoaderInterface $loader) |
|
32 | 32 | { |
33 | - $loader->load( __DIR__ . '/config/config.yml' ); |
|
33 | + $loader->load(__DIR__ . '/config/config.yml'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'/../../../vendor/autoload.php'; |
|
3 | +require_once __DIR__ . '/../../../vendor/autoload.php'; |
@@ -10,8 +10,8 @@ |
||
10 | 10 | public function testAccount() |
11 | 11 | { |
12 | 12 | $client = static::createClient(); |
13 | - $client->request( 'GET', '/unittest/de/EUR/myaccount' ); |
|
13 | + $client->request('GET', '/unittest/de/EUR/myaccount'); |
|
14 | 14 | |
15 | - $this->assertContains( 'aimeos account-history', $client->getResponse()->getContent() ); |
|
15 | + $this->assertContains('aimeos account-history', $client->getResponse()->getContent()); |
|
16 | 16 | } |
17 | 17 | } |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | { |
12 | 12 | $client = static::createClient(); |
13 | 13 | |
14 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
14 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
15 | 15 | |
16 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
17 | - $crawler = $client->click( $link ); |
|
16 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
17 | + $crawler = $client->click($link); |
|
18 | 18 | |
19 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
20 | - $crawler = $client->submit( $form ); |
|
19 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
20 | + $crawler = $client->submit($form); |
|
21 | 21 | |
22 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() ); |
|
23 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
24 | - $this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
22 | + $this->assertEquals(1, $crawler->filter('.basket-standard')->count()); |
|
23 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
24 | + $this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -29,18 +29,18 @@ discard block |
||
29 | 29 | { |
30 | 30 | $client = static::createClient(); |
31 | 31 | |
32 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
32 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
33 | 33 | |
34 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
35 | - $crawler = $client->click( $link ); |
|
34 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
35 | + $crawler = $client->click($link); |
|
36 | 36 | |
37 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
37 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
38 | 38 | $form['b_prod[0][quantity]'] = 2; |
39 | - $crawler = $client->submit( $form ); |
|
39 | + $crawler = $client->submit($form); |
|
40 | 40 | |
41 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard' )->count() ); |
|
42 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
43 | - $this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
41 | + $this->assertEquals(1, $crawler->filter('.basket-standard')->count()); |
|
42 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
43 | + $this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | { |
49 | 49 | $client = static::createClient(); |
50 | 50 | |
51 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
51 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
52 | 52 | |
53 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
54 | - $crawler = $client->click( $link ); |
|
53 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
54 | + $crawler = $client->click($link); |
|
55 | 55 | |
56 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
57 | - $crawler = $client->submit( $form ); |
|
56 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
57 | + $crawler = $client->submit($form); |
|
58 | 58 | |
59 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
60 | - $this->assertEquals( 1, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
59 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
60 | + $this->assertEquals(1, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
61 | 61 | |
62 | 62 | |
63 | - $link = $crawler->filter( '.basket-standard .btn-back' )->link(); |
|
64 | - $crawler = $client->click( $link ); |
|
63 | + $link = $crawler->filter('.basket-standard .btn-back')->link(); |
|
64 | + $crawler = $client->click($link); |
|
65 | 65 | |
66 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
67 | - $crawler = $client->submit( $form ); |
|
66 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
67 | + $crawler = $client->submit($form); |
|
68 | 68 | |
69 | - $this->assertEquals( 1, $crawler->filter( '.basket:contains("Unittest: Bundle")' )->count() ); |
|
70 | - $this->assertEquals( 2, $crawler->filter( '.basket .product .quantity .value' )->attr('value') ); |
|
69 | + $this->assertEquals(1, $crawler->filter('.basket:contains("Unittest: Bundle")')->count()); |
|
70 | + $this->assertEquals(2, $crawler->filter('.basket .product .quantity .value')->attr('value')); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | { |
76 | 76 | $client = static::createClient(); |
77 | 77 | |
78 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
78 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
79 | 79 | |
80 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
81 | - $crawler = $client->click( $link ); |
|
80 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
81 | + $crawler = $client->click($link); |
|
82 | 82 | |
83 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
84 | - $crawler = $client->submit( $form ); |
|
83 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
84 | + $crawler = $client->submit($form); |
|
85 | 85 | |
86 | 86 | |
87 | - $link = $crawler->filter( '.basket-standard .product .action .change' )->link(); |
|
88 | - $crawler = $client->click( $link ); |
|
87 | + $link = $crawler->filter('.basket-standard .product .action .change')->link(); |
|
88 | + $crawler = $client->click($link); |
|
89 | 89 | |
90 | - $this->assertEquals( 0, $crawler->filter( '.basket-standard .product' )->count() ); |
|
90 | + $this->assertEquals(0, $crawler->filter('.basket-standard .product')->count()); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -95,25 +95,25 @@ discard block |
||
95 | 95 | { |
96 | 96 | $client = static::createClient(); |
97 | 97 | |
98 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
98 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
99 | 99 | |
100 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
101 | - $crawler = $client->click( $link ); |
|
100 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
101 | + $crawler = $client->click($link); |
|
102 | 102 | |
103 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
104 | - $crawler = $client->submit( $form ); |
|
103 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
104 | + $crawler = $client->submit($form); |
|
105 | 105 | |
106 | 106 | |
107 | - $link = $crawler->filter( '.basket-standard .product .quantity .change' )->link(); |
|
108 | - $crawler = $client->click( $link ); |
|
107 | + $link = $crawler->filter('.basket-standard .product .quantity .change')->link(); |
|
108 | + $crawler = $client->click($link); |
|
109 | 109 | |
110 | - $this->assertEquals( 2, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
110 | + $this->assertEquals(2, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
111 | 111 | |
112 | 112 | |
113 | - $link = $crawler->filter( '.basket-standard .product .quantity .change' )->eq( 0 )->link(); |
|
114 | - $crawler = $client->click( $link ); |
|
113 | + $link = $crawler->filter('.basket-standard .product .quantity .change')->eq(0)->link(); |
|
114 | + $crawler = $client->click($link); |
|
115 | 115 | |
116 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
116 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | |
@@ -121,20 +121,20 @@ discard block |
||
121 | 121 | { |
122 | 122 | $client = static::createClient(); |
123 | 123 | |
124 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
124 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
125 | 125 | |
126 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
127 | - $crawler = $client->click( $link ); |
|
126 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
127 | + $crawler = $client->click($link); |
|
128 | 128 | |
129 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
130 | - $crawler = $client->submit( $form ); |
|
129 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
130 | + $crawler = $client->submit($form); |
|
131 | 131 | |
132 | 132 | |
133 | - $form = $crawler->filter( '.basket-standard .btn-update' )->form(); |
|
133 | + $form = $crawler->filter('.basket-standard .btn-update')->form(); |
|
134 | 134 | $form['b_prod[0][quantity]'] = 3; |
135 | - $crawler = $client->submit( $form ); |
|
135 | + $crawler = $client->submit($form); |
|
136 | 136 | |
137 | - $this->assertEquals( 3, $crawler->filter( '.basket-standard .product .quantity .value' )->attr( 'value' ) ); |
|
137 | + $this->assertEquals(3, $crawler->filter('.basket-standard .product .quantity .value')->attr('value')); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -142,26 +142,26 @@ discard block |
||
142 | 142 | { |
143 | 143 | $client = static::createClient(); |
144 | 144 | |
145 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
145 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
146 | 146 | |
147 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
148 | - $crawler = $client->click( $link ); |
|
147 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
148 | + $crawler = $client->click($link); |
|
149 | 149 | |
150 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
151 | - $crawler = $client->submit( $form ); |
|
150 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
151 | + $crawler = $client->submit($form); |
|
152 | 152 | |
153 | 153 | |
154 | - $form = $crawler->filter( '.basket-standard-coupon .coupon-new button' )->form(); |
|
154 | + $form = $crawler->filter('.basket-standard-coupon .coupon-new button')->form(); |
|
155 | 155 | $form['b_coupon'] = '90AB'; |
156 | - $crawler = $client->submit( $form ); |
|
156 | + $crawler = $client->submit($form); |
|
157 | 157 | |
158 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product:contains("Geldwerter Nachlass")' )->count() ); |
|
158 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product:contains("Geldwerter Nachlass")')->count()); |
|
159 | 159 | |
160 | 160 | |
161 | - $link = $crawler->filter( '.basket-standard-coupon .change' )->link(); |
|
162 | - $crawler = $client->click( $link ); |
|
161 | + $link = $crawler->filter('.basket-standard-coupon .change')->link(); |
|
162 | + $crawler = $client->click($link); |
|
163 | 163 | |
164 | - $this->assertEquals( 1, $crawler->filter( '.basket-standard .product' )->count() ); |
|
164 | + $this->assertEquals(1, $crawler->filter('.basket-standard .product')->count()); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | |
@@ -169,15 +169,15 @@ discard block |
||
169 | 169 | { |
170 | 170 | $client = static::createClient(); |
171 | 171 | |
172 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
172 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
173 | 173 | |
174 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Cafe Noire Expresso")' )->link(); |
|
175 | - $crawler = $client->click( $link ); |
|
174 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Cafe Noire Expresso")')->link(); |
|
175 | + $crawler = $client->click($link); |
|
176 | 176 | |
177 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
178 | - $crawler = $client->submit( $form ); |
|
177 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
178 | + $crawler = $client->submit($form); |
|
179 | 179 | |
180 | - $this->assertEquals( 1, $crawler->filter( '.basket-related-bought .bought-item' )->count() ); |
|
180 | + $this->assertEquals(1, $crawler->filter('.basket-related-bought .bought-item')->count()); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | { |
186 | 186 | $client = static::createClient(); |
187 | 187 | |
188 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/list' ); |
|
188 | + $crawler = $client->request('GET', '/unittest/de/EUR/list'); |
|
189 | 189 | |
190 | - $link = $crawler->filter( '.catalog-list-items .product a:contains("Unittest: Bundle")' )->link(); |
|
191 | - $crawler = $client->click( $link ); |
|
190 | + $link = $crawler->filter('.catalog-list-items .product a:contains("Unittest: Bundle")')->link(); |
|
191 | + $crawler = $client->click($link); |
|
192 | 192 | |
193 | - $form = $crawler->filter( '.catalog-detail .addbasket .btn-action' )->form(); |
|
194 | - $crawler = $client->submit( $form ); |
|
193 | + $form = $crawler->filter('.catalog-detail .addbasket .btn-action')->form(); |
|
194 | + $crawler = $client->submit($form); |
|
195 | 195 | |
196 | - $link = $crawler->filter( '.basket-standard .btn-back' )->link(); |
|
197 | - $crawler = $client->click( $link ); |
|
196 | + $link = $crawler->filter('.basket-standard .btn-back')->link(); |
|
197 | + $crawler = $client->click($link); |
|
198 | 198 | |
199 | - $this->assertEquals( 1, $crawler->filter( '.catalog-detail .product:contains("Unittest: Bundle")' )->count() ); |
|
199 | + $this->assertEquals(1, $crawler->filter('.catalog-detail .product:contains("Unittest: Bundle")')->count()); |
|
200 | 200 | } |
201 | 201 | } |
@@ -10,17 +10,17 @@ |
||
10 | 10 | public function testTerms() |
11 | 11 | { |
12 | 12 | $client = static::createClient(); |
13 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/terms' ); |
|
13 | + $crawler = $client->request('GET', '/unittest/de/EUR/terms'); |
|
14 | 14 | |
15 | - $this->assertEquals( 1, $crawler->filter( 'body:contains("Terms")' )->count() ); |
|
15 | + $this->assertEquals(1, $crawler->filter('body:contains("Terms")')->count()); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | public function testPrivacy() |
20 | 20 | { |
21 | 21 | $client = static::createClient(); |
22 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/privacy' ); |
|
22 | + $crawler = $client->request('GET', '/unittest/de/EUR/privacy'); |
|
23 | 23 | |
24 | - $this->assertEquals( 1, $crawler->filter( 'body:contains("Privacy")' )->count() ); |
|
24 | + $this->assertEquals(1, $crawler->filter('body:contains("Privacy")')->count()); |
|
25 | 25 | } |
26 | 26 | } |