@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \Illuminate\Contracts\Cache\Store $cache Laravel cache object |
31 | 31 | */ |
32 | - public function __construct( \Illuminate\Contracts\Cache\Store $cache ) |
|
32 | + public function __construct(\Illuminate\Contracts\Cache\Store $cache) |
|
33 | 33 | { |
34 | 34 | $this->object = $cache; |
35 | 35 | } |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @param string $key Key string that identifies the single cache entry |
44 | 44 | */ |
45 | - public function delete( $key ) |
|
45 | + public function delete($key) |
|
46 | 46 | { |
47 | - $this->object->forget( $key ); |
|
47 | + $this->object->forget($key); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | * @param string[] $keys List of key strings that identify the cache entries |
57 | 57 | * that should be removed |
58 | 58 | */ |
59 | - public function deleteList( array $keys ) |
|
59 | + public function deleteList(array $keys) |
|
60 | 60 | { |
61 | - foreach( $keys as $key ) { |
|
62 | - $this->object->forget( $key ); |
|
61 | + foreach ($keys as $key) { |
|
62 | + $this->object->forget($key); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param string[] $tags List of tag strings that are associated to one or more |
73 | 73 | * cache entries that should be removed |
74 | 74 | */ |
75 | - public function deleteByTags( array $tags ) |
|
75 | + public function deleteByTags(array $tags) |
|
76 | 76 | { |
77 | 77 | // $this->object->tags( $tag )->flush(); |
78 | 78 | $this->object->flush(); |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * @param string $default Value returned if requested key isn't found |
100 | 100 | * @return mixed Value associated to the requested key |
101 | 101 | */ |
102 | - public function get( $name, $default = null ) |
|
102 | + public function get($name, $default = null) |
|
103 | 103 | { |
104 | - if( ( $entry = $this->object->get( $name ) ) !== null ) { |
|
104 | + if (($entry = $this->object->get($name)) !== null) { |
|
105 | 105 | return $entry; |
106 | 106 | } |
107 | 107 | |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | * entries. If a cache entry doesn't exist, neither its key nor a value |
120 | 120 | * will be in the result list |
121 | 121 | */ |
122 | - public function getList( array $keys ) |
|
122 | + public function getList(array $keys) |
|
123 | 123 | { |
124 | 124 | $result = array(); |
125 | 125 | |
126 | - foreach( $keys as $key ) |
|
126 | + foreach ($keys as $key) |
|
127 | 127 | { |
128 | - if( ( $entry = $this->object->get( $key ) ) !== false ) { |
|
128 | + if (($entry = $this->object->get($key)) !== false) { |
|
129 | 129 | $result[$key] = $entry; |
130 | 130 | } |
131 | 131 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * entries. If a tag isn't associated to any cache entry, nothing is returned |
145 | 145 | * for that tag |
146 | 146 | */ |
147 | - public function getListByTags( array $tags ) |
|
147 | + public function getListByTags(array $tags) |
|
148 | 148 | { |
149 | 149 | return array(); |
150 | 150 | } |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | * @param string|null $expires Date/time string in "YYYY-MM-DD HH:mm:ss" |
163 | 163 | * format when the cache entry expires |
164 | 164 | */ |
165 | - public function set( $name, $value, array $tags = array(), $expires = null ) |
|
165 | + public function set($name, $value, array $tags = array(), $expires = null) |
|
166 | 166 | { |
167 | - if( $expires !== null && ( $timestamp = strtotime( $expires ) ) !== false ) { |
|
168 | - $this->object->put( $name, $value, ($timestamp - time())/60 ); |
|
167 | + if ($expires !== null && ($timestamp = strtotime($expires)) !== false) { |
|
168 | + $this->object->put($name, $value, ($timestamp - time())/60); |
|
169 | 169 | } else { |
170 | - $this->object->forever( $name, $value ); |
|
170 | + $this->object->forever($name, $value); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
@@ -185,14 +185,14 @@ discard block |
||
185 | 185 | * to the key can either be a tag string or an array of tag strings |
186 | 186 | * @param array $expires Associative list of key/datetime pairs. |
187 | 187 | */ |
188 | - public function setList( array $pairs, array $tags = array(), array $expires = array() ) |
|
188 | + public function setList(array $pairs, array $tags = array(), array $expires = array()) |
|
189 | 189 | { |
190 | - foreach( $pairs as $key => $value ) |
|
190 | + foreach ($pairs as $key => $value) |
|
191 | 191 | { |
192 | - $tagList = ( isset( $tags[$key] ) ? (array) $tags[$key] : array() ); |
|
193 | - $keyExpire = ( isset( $expires[$key] ) ? $expires[$key] : null ); |
|
192 | + $tagList = (isset($tags[$key]) ? (array) $tags[$key] : array()); |
|
193 | + $keyExpire = (isset($expires[$key]) ? $expires[$key] : null); |
|
194 | 194 | |
195 | - $this->set( $key, $value, $tagList, $keyExpire ); |
|
195 | + $this->set($key, $value, $tagList, $keyExpire); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \Illuminate\\Log\Writer $logger Laravel logger object |
31 | 31 | */ |
32 | - public function __construct( \Illuminate\Log\Writer $logger ) |
|
32 | + public function __construct(\Illuminate\Log\Writer $logger) |
|
33 | 33 | { |
34 | 34 | $this->logger = $logger; |
35 | 35 | } |
@@ -44,38 +44,38 @@ discard block |
||
44 | 44 | * @throws \Aimeos\MW\Logger\Exception If an error occurs in Zend_Log |
45 | 45 | * @see \Aimeos\MW\Logger\Base for available log level constants |
46 | 46 | */ |
47 | - public function log( $message, $priority = \Aimeos\MW\Logger\Base::ERR, $facility = 'message' ) |
|
47 | + public function log($message, $priority = \Aimeos\MW\Logger\Base::ERR, $facility = 'message') |
|
48 | 48 | { |
49 | 49 | try |
50 | 50 | { |
51 | - if( !is_scalar( $message ) ) { |
|
52 | - $message = json_encode( $message ); |
|
51 | + if (!is_scalar($message)) { |
|
52 | + $message = json_encode($message); |
|
53 | 53 | } |
54 | 54 | |
55 | - switch( $priority ) |
|
55 | + switch ($priority) |
|
56 | 56 | { |
57 | 57 | case \Aimeos\MW\Logger\Base::EMERG: |
58 | - $this->logger->emergency( $message ); break; |
|
58 | + $this->logger->emergency($message); break; |
|
59 | 59 | case \Aimeos\MW\Logger\Base::ALERT: |
60 | - $this->logger->alert( $message ); break; |
|
60 | + $this->logger->alert($message); break; |
|
61 | 61 | case \Aimeos\MW\Logger\Base::CRIT: |
62 | - $this->logger->critical( $message ); break; |
|
62 | + $this->logger->critical($message); break; |
|
63 | 63 | case \Aimeos\MW\Logger\Base::ERR: |
64 | - $this->logger->error( $message ); break; |
|
64 | + $this->logger->error($message); break; |
|
65 | 65 | case \Aimeos\MW\Logger\Base::WARN: |
66 | - $this->logger->warning( $message ); break; |
|
66 | + $this->logger->warning($message); break; |
|
67 | 67 | case \Aimeos\MW\Logger\Base::NOTICE: |
68 | - $this->logger->notice( $message ); break; |
|
68 | + $this->logger->notice($message); break; |
|
69 | 69 | case \Aimeos\MW\Logger\Base::INFO: |
70 | - $this->logger->info( $message ); break; |
|
70 | + $this->logger->info($message); break; |
|
71 | 71 | case \Aimeos\MW\Logger\Base::DEBUG: |
72 | - $this->logger->debug( $message ); break; |
|
72 | + $this->logger->debug($message); break; |
|
73 | 73 | default: |
74 | - throw new \Aimeos\MW\Logger\Exception( 'Invalid log level' ); |
|
74 | + throw new \Aimeos\MW\Logger\Exception('Invalid log level'); |
|
75 | 75 | } |
76 | 76 | } |
77 | - catch( \Exception $e ) { |
|
78 | - throw new \Aimeos\MW\Logger\Exception( $e->getMessage(), $e->getCode(), $e ); |
|
77 | + catch (\Exception $e) { |
|
78 | + throw new \Aimeos\MW\Logger\Exception($e->getMessage(), $e->getCode(), $e); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -53,8 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | $this->logger->log( $message, $this->translatePriority( $priority ) ); |
56 | - } |
|
57 | - catch( \Exception $e ) { |
|
56 | + } catch( \Exception $e ) { |
|
58 | 57 | throw new \Aimeos\MW\Logger\Exception( $e->getMessage(), $e->getCode(), $e ); |
59 | 58 | } |
60 | 59 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \Illuminate\Contracts\Logging\Log $logger Laravel logger object |
31 | 31 | */ |
32 | - public function __construct( \Illuminate\Contracts\Logging\Log $logger ) |
|
32 | + public function __construct(\Illuminate\Contracts\Logging\Log $logger) |
|
33 | 33 | { |
34 | 34 | $this->logger = $logger; |
35 | 35 | } |
@@ -44,18 +44,18 @@ discard block |
||
44 | 44 | * @throws \Aimeos\MW\Logger\Exception If an error occurs in Zend_Log |
45 | 45 | * @see \Aimeos\MW\Logger\Base for available log level constants |
46 | 46 | */ |
47 | - public function log( $message, $priority = \Aimeos\MW\Logger\Base::ERR, $facility = 'message' ) |
|
47 | + public function log($message, $priority = \Aimeos\MW\Logger\Base::ERR, $facility = 'message') |
|
48 | 48 | { |
49 | 49 | try |
50 | 50 | { |
51 | - if( !is_scalar( $message ) ) { |
|
52 | - $message = json_encode( $message ); |
|
51 | + if (!is_scalar($message)) { |
|
52 | + $message = json_encode($message); |
|
53 | 53 | } |
54 | 54 | |
55 | - $this->logger->log( $message, $this->translatePriority( $priority ) ); |
|
55 | + $this->logger->log($message, $this->translatePriority($priority)); |
|
56 | 56 | } |
57 | - catch( \Exception $e ) { |
|
58 | - throw new \Aimeos\MW\Logger\Exception( $e->getMessage(), $e->getCode(), $e ); |
|
57 | + catch (\Exception $e) { |
|
58 | + throw new \Aimeos\MW\Logger\Exception($e->getMessage(), $e->getCode(), $e); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | * @return integer Log level from Monolog\Logger |
68 | 68 | * @throws \Aimeos\MW\Logger\Exception If log level is unknown |
69 | 69 | */ |
70 | - protected function translatePriority( $priority ) |
|
70 | + protected function translatePriority($priority) |
|
71 | 71 | { |
72 | - switch( $priority ) |
|
72 | + switch ($priority) |
|
73 | 73 | { |
74 | 74 | case \Aimeos\MW\Logger\Base::EMERG: |
75 | 75 | return 'emergency'; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | case \Aimeos\MW\Logger\Base::DEBUG: |
89 | 89 | return 'debug'; |
90 | 90 | default: |
91 | - throw new \Aimeos\MW\Logger\Exception( 'Invalid log level' ); |
|
91 | + throw new \Aimeos\MW\Logger\Exception('Invalid log level'); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | 95 | \ No newline at end of file |
@@ -53,8 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | $this->logger->log( $message, $this->translatePriority( $priority ) ); |
56 | - } |
|
57 | - catch( \Exception $e ) { |
|
56 | + } catch( \Exception $e ) { |
|
58 | 57 | throw new \Aimeos\MW\Logger\Exception( $e->getMessage(), $e->getCode(), $e ); |
59 | 58 | } |
60 | 59 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param \Illuminate\Session\Store $object Laravel session object |
30 | 30 | */ |
31 | - public function __construct( \Illuminate\Session\Store $object ) |
|
31 | + public function __construct(\Illuminate\Session\Store $object) |
|
32 | 32 | { |
33 | 33 | $this->object = $object; |
34 | 34 | } |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | * @param mixed $default Value returned if requested key isn't found |
44 | 44 | * @return mixed Value associated to the requested key |
45 | 45 | */ |
46 | - public function get( $name, $default = null ) |
|
46 | + public function get($name, $default = null) |
|
47 | 47 | { |
48 | - return $this->object->get( $name, $default ); |
|
48 | + return $this->object->get($name, $default); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * @param mixed $value Value that should be associated with the given key |
59 | 59 | * @return void |
60 | 60 | */ |
61 | - public function set( $name, $value ) |
|
61 | + public function set($name, $value) |
|
62 | 62 | { |
63 | - $this->object->put( $name, $value ); |
|
63 | + $this->object->put($name, $value); |
|
64 | 64 | } |
65 | 65 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param \Illuminate\Session\SessionInterface $object Laravel session object |
30 | 30 | */ |
31 | - public function __construct( \Illuminate\Session\SessionInterface $object ) |
|
31 | + public function __construct(\Illuminate\Session\SessionInterface $object) |
|
32 | 32 | { |
33 | 33 | $this->object = $object; |
34 | 34 | } |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | * @param mixed $default Value returned if requested key isn't found |
44 | 44 | * @return mixed Value associated to the requested key |
45 | 45 | */ |
46 | - public function get( $name, $default = null ) |
|
46 | + public function get($name, $default = null) |
|
47 | 47 | { |
48 | - return $this->object->get( $name, $default ); |
|
48 | + return $this->object->get($name, $default); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | * @param mixed $value Value that should be associated with the given key |
59 | 59 | * @return void |
60 | 60 | */ |
61 | - public function set( $name, $value ) |
|
61 | + public function set($name, $value) |
|
62 | 62 | { |
63 | - $this->object->set( $name, $value ); |
|
63 | + $this->object->set($name, $value); |
|
64 | 64 | } |
65 | 65 | } |
@@ -30,9 +30,9 @@ |
||
30 | 30 | * @param \\Aimeos\MW\View\Iface $view View instance with registered view helpers |
31 | 31 | * @param \Illuminate\Http\Request $request Laravel request object |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\MW\View\Iface $view, \Illuminate\Http\Request $request ) |
|
33 | + public function __construct(\Aimeos\MW\View\Iface $view, \Illuminate\Http\Request $request) |
|
34 | 34 | { |
35 | - parent::__construct( $view ); |
|
35 | + parent::__construct($view); |
|
36 | 36 | |
37 | 37 | $this->request = $request; |
38 | 38 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param \Illuminate\Routing\UrlGenerator $builder Laravel URL builder object |
33 | 33 | * @param array Associative list of fixed parameters that should be available for all routes |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\MW\View\Iface $view, \Illuminate\Routing\UrlGenerator $builder, array $fixed ) |
|
35 | + public function __construct(\Aimeos\MW\View\Iface $view, \Illuminate\Routing\UrlGenerator $builder, array $fixed) |
|
36 | 36 | { |
37 | - parent::__construct( $view ); |
|
37 | + parent::__construct($view); |
|
38 | 38 | |
39 | 39 | $this->builder = $builder; |
40 | 40 | $this->fixed = $fixed; |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | * @param array $config Additional configuration parameter per URL |
53 | 53 | * @return string Complete URL that can be used in the template |
54 | 54 | */ |
55 | - public function transform( $target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array() ) |
|
55 | + public function transform($target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array()) |
|
56 | 56 | { |
57 | - $values = $this->getValues( $config ); |
|
57 | + $values = $this->getValues($config); |
|
58 | 58 | |
59 | - return $this->builder->route( $target, $params + $this->fixed, $values['absoluteUri'] ); |
|
59 | + return $this->builder->route($target, $params + $this->fixed, $values['absoluteUri']); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * @param array $config Associative list of key/value pairs |
67 | 67 | * @return array Associative list of sanitized key/value pairs |
68 | 68 | */ |
69 | - protected function getValues( array $config ) |
|
69 | + protected function getValues(array $config) |
|
70 | 70 | { |
71 | 71 | $values = array( |
72 | 72 | 'absoluteUri' => false, |
73 | 73 | ); |
74 | 74 | |
75 | - if( isset( $config['absoluteUri'] ) ) { |
|
75 | + if (isset($config['absoluteUri'])) { |
|
76 | 76 | $values['absoluteUri'] = (bool) $config['absoluteUri']; |
77 | 77 | } |
78 | 78 |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param \Illuminate\Contracts\Routing\UrlGenerator $builder Laravel URL builder object |
33 | 33 | * @param array Associative list of fixed parameters that should be available for all routes |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\MW\View\Iface $view, \Illuminate\Contracts\Routing\UrlGenerator $builder, array $fixed ) |
|
35 | + public function __construct(\Aimeos\MW\View\Iface $view, \Illuminate\Contracts\Routing\UrlGenerator $builder, array $fixed) |
|
36 | 36 | { |
37 | - parent::__construct( $view ); |
|
37 | + parent::__construct($view); |
|
38 | 38 | |
39 | 39 | $this->builder = $builder; |
40 | 40 | $this->fixed = $fixed; |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | * @param array $config Additional configuration parameter per URL |
53 | 53 | * @return string Complete URL that can be used in the template |
54 | 54 | */ |
55 | - public function transform( $target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array() ) |
|
55 | + public function transform($target = null, $controller = null, $action = null, array $params = array(), array $trailing = array(), array $config = array()) |
|
56 | 56 | { |
57 | - $values = $this->getValues( $config ); |
|
57 | + $values = $this->getValues($config); |
|
58 | 58 | |
59 | - return $this->builder->route( $target, $params + $this->fixed, $values['absoluteUri'] ); |
|
59 | + return $this->builder->route($target, $params + $this->fixed, $values['absoluteUri']); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * @param array $config Associative list of key/value pairs |
67 | 67 | * @return array Associative list of sanitized key/value pairs |
68 | 68 | */ |
69 | - protected function getValues( array $config ) |
|
69 | + protected function getValues(array $config) |
|
70 | 70 | { |
71 | 71 | $values = array( |
72 | 72 | 'absoluteUri' => false, |
73 | 73 | ); |
74 | 74 | |
75 | - if( isset( $config['absoluteUri'] ) ) { |
|
75 | + if (isset($config['absoluteUri'])) { |
|
76 | 76 | $values['absoluteUri'] = (bool) $config['absoluteUri']; |
77 | 77 | } |
78 | 78 |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | { |
22 | 22 | $context = \TestHelper::getContext(); |
23 | 23 | $this->editor = $context->getEditor(); |
24 | - $customer = new \Aimeos\MShop\Customer\Manager\Laravel( $context ); |
|
24 | + $customer = new \Aimeos\MShop\Customer\Manager\Laravel($context); |
|
25 | 25 | |
26 | 26 | $search = $customer->createSearch(); |
27 | 27 | $conditions = array( |
28 | - $search->compare( '==', 'customer.code', 'unitCustomer1' ), |
|
29 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
28 | + $search->compare('==', 'customer.code', 'unitCustomer1'), |
|
29 | + $search->compare('==', 'customer.editor', $this->editor) |
|
30 | 30 | ); |
31 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
32 | - $result = $customer->searchItems( $search ); |
|
31 | + $search->setConditions($search->combine('&&', $conditions)); |
|
32 | + $result = $customer->searchItems($search); |
|
33 | 33 | |
34 | - if( ( $customerItem = reset( $result ) ) === false ) { |
|
35 | - throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'unitCustomer1' ) ); |
|
34 | + if (($customerItem = reset($result)) === false) { |
|
35 | + throw new \Exception(sprintf('No customer item found for code "%1$s"', 'unitCustomer1')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $this->fixture = array( |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
60 | 60 | ); |
61 | 61 | |
62 | - $this->object = $customer->getSubManager( 'address', 'Laravel' ); |
|
62 | + $this->object = $customer->getSubManager('address', 'Laravel'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -68,126 +68,126 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function tearDown() |
70 | 70 | { |
71 | - unset( $this->object, $this->fixture ); |
|
71 | + unset($this->object, $this->fixture); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | public function testCleanup() |
76 | 76 | { |
77 | - $this->object->cleanup( array( -1 ) ); |
|
77 | + $this->object->cleanup(array( -1 )); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | public function testGetSearchAttributes() |
81 | 81 | { |
82 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
83 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
82 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
83 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | public function testCreateItem() |
88 | 88 | { |
89 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
89 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public function testGetItem() |
93 | 93 | { |
94 | 94 | $search = $this->object->createSearch(); |
95 | - $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
95 | + $search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH')); |
|
96 | 96 | |
97 | - $items = $this->object->searchItems( $search ); |
|
97 | + $items = $this->object->searchItems($search); |
|
98 | 98 | |
99 | - if( ( $item = reset( $items ) ) === false ) { |
|
100 | - throw new \Exception( 'No address item with company "ABC" found' ); |
|
99 | + if (($item = reset($items)) === false) { |
|
100 | + throw new \Exception('No address item with company "ABC" found'); |
|
101 | 101 | } |
102 | 102 | |
103 | - $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
103 | + $this->assertEquals($item, $this->object->getItem($item->getId())); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | public function testGetSubManager() |
107 | 107 | { |
108 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
109 | - $this->object->getSubManager( 'unknown' ); |
|
108 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
109 | + $this->object->getSubManager('unknown'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | public function testSaveUpdateDeleteItem() |
113 | 113 | { |
114 | - $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
115 | - $item->setId( null ); |
|
116 | - $this->object->saveItem( $item ); |
|
117 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
114 | + $item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture); |
|
115 | + $item->setId(null); |
|
116 | + $this->object->saveItem($item); |
|
117 | + $itemSaved = $this->object->getItem($item->getId()); |
|
118 | 118 | |
119 | 119 | $itemExp = clone $itemSaved; |
120 | - $itemExp->setPosition( 1 ); |
|
121 | - $itemExp->setCity( 'Berlin' ); |
|
122 | - $itemExp->setState( 'Berlin' ); |
|
123 | - $this->object->saveItem( $itemExp ); |
|
124 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
125 | - |
|
126 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
127 | - |
|
128 | - |
|
129 | - $this->assertTrue( $item->getId() !== null ); |
|
130 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
131 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
132 | - $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
133 | - $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
134 | - $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
135 | - $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
136 | - $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
137 | - $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
138 | - $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
139 | - $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
140 | - $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
141 | - $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
142 | - $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
143 | - $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
144 | - $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
145 | - $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
146 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
147 | - $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
148 | - $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
149 | - $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
150 | - $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
151 | - $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
152 | - |
|
153 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
154 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
120 | + $itemExp->setPosition(1); |
|
121 | + $itemExp->setCity('Berlin'); |
|
122 | + $itemExp->setState('Berlin'); |
|
123 | + $this->object->saveItem($itemExp); |
|
124 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
125 | + |
|
126 | + $this->object->deleteItem($itemSaved->getId()); |
|
127 | + |
|
128 | + |
|
129 | + $this->assertTrue($item->getId() !== null); |
|
130 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
131 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
132 | + $this->assertEquals($item->getPosition(), $itemSaved->getPosition()); |
|
133 | + $this->assertEquals($item->getCompany(), $itemSaved->getCompany()); |
|
134 | + $this->assertEquals($item->getVatID(), $itemSaved->getVatID()); |
|
135 | + $this->assertEquals($item->getSalutation(), $itemSaved->getSalutation()); |
|
136 | + $this->assertEquals($item->getTitle(), $itemSaved->getTitle()); |
|
137 | + $this->assertEquals($item->getFirstname(), $itemSaved->getFirstname()); |
|
138 | + $this->assertEquals($item->getLastname(), $itemSaved->getLastname()); |
|
139 | + $this->assertEquals($item->getAddress1(), $itemSaved->getAddress1()); |
|
140 | + $this->assertEquals($item->getAddress2(), $itemSaved->getAddress2()); |
|
141 | + $this->assertEquals($item->getAddress3(), $itemSaved->getAddress3()); |
|
142 | + $this->assertEquals($item->getPostal(), $itemSaved->getPostal()); |
|
143 | + $this->assertEquals($item->getCity(), $itemSaved->getCity()); |
|
144 | + $this->assertEquals($item->getState(), $itemSaved->getState()); |
|
145 | + $this->assertEquals($item->getCountryId(), $itemSaved->getCountryId()); |
|
146 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
147 | + $this->assertEquals($item->getTelephone(), $itemSaved->getTelephone()); |
|
148 | + $this->assertEquals($item->getEmail(), $itemSaved->getEmail()); |
|
149 | + $this->assertEquals($item->getTelefax(), $itemSaved->getTelefax()); |
|
150 | + $this->assertEquals($item->getWebsite(), $itemSaved->getWebsite()); |
|
151 | + $this->assertEquals($item->getFlag(), $itemSaved->getFlag()); |
|
152 | + |
|
153 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
154 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
155 | 155 | $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
156 | 156 | |
157 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
158 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
159 | - $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
160 | - $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
161 | - $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
162 | - $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
163 | - $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
164 | - $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
165 | - $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
166 | - $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
167 | - $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
168 | - $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
169 | - $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
170 | - $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
171 | - $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
172 | - $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
173 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
174 | - $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
175 | - $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
176 | - $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
177 | - $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
178 | - $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
179 | - |
|
180 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
181 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
182 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
157 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
158 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
159 | + $this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition()); |
|
160 | + $this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany()); |
|
161 | + $this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID()); |
|
162 | + $this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
163 | + $this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle()); |
|
164 | + $this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
165 | + $this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname()); |
|
166 | + $this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
167 | + $this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
168 | + $this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
169 | + $this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal()); |
|
170 | + $this->assertEquals($itemExp->getCity(), $itemUpd->getCity()); |
|
171 | + $this->assertEquals($itemExp->getState(), $itemUpd->getState()); |
|
172 | + $this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
173 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
174 | + $this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
175 | + $this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail()); |
|
176 | + $this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
177 | + $this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
178 | + $this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag()); |
|
179 | + |
|
180 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
181 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
182 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
183 | 183 | |
184 | 184 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
185 | - $this->object->getItem( $itemSaved->getId() ); |
|
185 | + $this->object->getItem($itemSaved->getId()); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | public function testCreateSearch() |
189 | 189 | { |
190 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
190 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | $search = $this->object->createSearch(); |
197 | 197 | |
198 | 198 | $conditions = array( |
199 | - $search->compare( '==', 'customer.address.company', 'ABC' ), |
|
200 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
199 | + $search->compare('==', 'customer.address.company', 'ABC'), |
|
200 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
201 | 201 | ); |
202 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
203 | - $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
202 | + $search->setConditions($search->combine('&&', $conditions)); |
|
203 | + $this->assertEquals(1, count($this->object->searchItems($search))); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -210,20 +210,20 @@ discard block |
||
210 | 210 | $search = $this->object->createSearch(); |
211 | 211 | |
212 | 212 | $conditions = array( |
213 | - $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
214 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
213 | + $search->compare('~=', 'customer.address.company', 'ABC GmbH'), |
|
214 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
215 | 215 | ); |
216 | 216 | |
217 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
218 | - $search->setSlice( 0, 1 ); |
|
217 | + $search->setConditions($search->combine('&&', $conditions)); |
|
218 | + $search->setSlice(0, 1); |
|
219 | 219 | |
220 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
220 | + $results = $this->object->searchItems($search, array(), $total); |
|
221 | 221 | |
222 | - $this->assertEquals( 1, count( $results ) ); |
|
223 | - $this->assertEquals( 2, $total ); |
|
222 | + $this->assertEquals(1, count($results)); |
|
223 | + $this->assertEquals(2, $total); |
|
224 | 224 | |
225 | - foreach( $results as $id => $item ) { |
|
226 | - $this->assertEquals( $id, $item->getId() ); |
|
225 | + foreach ($results as $id => $item) { |
|
226 | + $this->assertEquals($id, $item->getId()); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | } |