@@ -220,13 +220,13 @@ |
||
220 | 220 | $expr[] = $search->compare( '==', 'customer.longitude', '10.0' ); |
221 | 221 | $expr[] = $search->compare( '==', 'customer.latitude', '50.0' ); |
222 | 222 | |
223 | - $param = ['text','default', 0]; |
|
223 | + $param = ['text', 'default', 0]; |
|
224 | 224 | $expr[] = $search->compare( '==', $search->createFunction( 'customer:has', $param ), null ); |
225 | 225 | |
226 | - $param = ['text','default', $listItem->getRefId()]; |
|
226 | + $param = ['text', 'default', $listItem->getRefId()]; |
|
227 | 227 | $expr[] = $search->compare( '!=', $search->createFunction( 'customer:has', $param ), null ); |
228 | 228 | |
229 | - $param = ['text','default']; |
|
229 | + $param = ['text', 'default']; |
|
230 | 230 | $expr[] = $search->compare( '!=', $search->createFunction( 'customer:has', $param ), null ); |
231 | 231 | |
232 | 232 | $param = ['text']; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset($this->object); |
|
30 | + unset( $this->object ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $results = $this->object->searchItems( $search ); |
72 | 72 | |
73 | - if( ($expected = reset($results) ) === false ) |
|
73 | + if( ( $expected = reset( $results ) ) === false ) |
|
74 | 74 | { |
75 | 75 | throw new \RuntimeException( 'No property type item found.' ); |
76 | 76 | } |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | { |
93 | 93 | $search = $this->object->createSearch(); |
94 | 94 | $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
95 | - $results = $this->object->searchItems($search); |
|
95 | + $results = $this->object->searchItems( $search ); |
|
96 | 96 | |
97 | - if( ( $item = reset($results) ) === false ) { |
|
97 | + if( ( $item = reset( $results ) ) === false ) { |
|
98 | 98 | throw new \RuntimeException( 'No type item found' ); |
99 | 99 | } |
100 | 100 | |
101 | - $item->setId(null); |
|
101 | + $item->setId( null ); |
|
102 | 102 | $item->setCode( 'unitTestSave' ); |
103 | 103 | $resultSaved = $this->object->saveItem( $item ); |
104 | 104 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -158,20 +158,20 @@ discard block |
||
158 | 158 | $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
159 | 159 | $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
160 | 160 | |
161 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
161 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
162 | 162 | $results = $this->object->searchItems( $search, [], $total ); |
163 | 163 | $this->assertEquals( 1, count( $results ) ); |
164 | 164 | |
165 | 165 | |
166 | 166 | $search = $this->object->createSearch(); |
167 | 167 | $conditions = array( |
168 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
168 | + $search->compare( '=~', 'customer.property.type.code', 'newsletter' ), |
|
169 | 169 | $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
170 | 170 | ); |
171 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
172 | - $search->setSortations( [$search->sort('-', 'customer.property.type.position' )] ); |
|
173 | - $search->setSlice(0, 1); |
|
174 | - $items = $this->object->searchItems( $search, [], $total); |
|
171 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
172 | + $search->setSortations( [$search->sort( '-', 'customer.property.type.position' )] ); |
|
173 | + $search->setSlice( 0, 1 ); |
|
174 | + $items = $this->object->searchItems( $search, [], $total ); |
|
175 | 175 | |
176 | 176 | $this->assertEquals( 1, count( $items ) ); |
177 | 177 | $this->assertEquals( 1, $total ); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | public function testGetSubManager() |
186 | 186 | { |
187 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
188 | - $this->object->getSubManager('unknown'); |
|
187 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
188 | + $this->object->getSubManager( 'unknown' ); |
|
189 | 189 | } |
190 | 190 | } |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | public function testGetItem() |
61 | 61 | { |
62 | 62 | $search = $this->object->createSearch(); |
63 | - $search->setSlice(0, 1); |
|
64 | - $results = $this->object->searchItems($search); |
|
63 | + $search->setSlice( 0, 1 ); |
|
64 | + $results = $this->object->searchItems( $search ); |
|
65 | 65 | |
66 | - if( ( $expected = reset($results) ) === false ) { |
|
66 | + if( ( $expected = reset( $results ) ) === false ) { |
|
67 | 67 | throw new \RuntimeException( 'No list type item found' ); |
68 | 68 | } |
69 | 69 | |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | public function testSaveUpdateDeleteItem() |
75 | 75 | { |
76 | 76 | $search = $this->object->createSearch(); |
77 | - $search->setSlice(0, 1); |
|
78 | - $results = $this->object->searchItems($search); |
|
77 | + $search->setSlice( 0, 1 ); |
|
78 | + $results = $this->object->searchItems( $search ); |
|
79 | 79 | |
80 | - if( ( $item = reset($results) ) === false ) { |
|
80 | + if( ( $item = reset( $results ) ) === false ) { |
|
81 | 81 | throw new \RuntimeException( 'No type item found' ); |
82 | 82 | } |
83 | 83 | |
84 | - $item->setId(null); |
|
84 | + $item->setId( null ); |
|
85 | 85 | $item->setCode( 'unitTestInit' ); |
86 | 86 | $resultSaved = $this->object->saveItem( $item ); |
87 | 87 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultSaved ); |
121 | 121 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultUpd ); |
122 | 122 | |
123 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
123 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
124 | 124 | $this->object->getItem( $itemSaved->getId() ); |
125 | 125 | } |
126 | 126 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
143 | 143 | |
144 | 144 | $search->setConditions( $search->combine( '&&', $expr ) ); |
145 | - $search->setSlice(0, 1); |
|
145 | + $search->setSlice( 0, 1 ); |
|
146 | 146 | |
147 | 147 | $results = $this->object->searchItems( $search, [], $total ); |
148 | 148 | $this->assertEquals( 1, count( $results ) ); |