Completed
Push — master ( 64aa36...500452 )
by Aimeos
05:35
created
lib/custom/tests/MShop/Customer/Manager/FosUserTest.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
21 21
 	{
22 22
 		$context = \TestHelper::getContext();
23 23
 		$this->editor = $context->getEditor();
24
-		$this->object = new \Aimeos\MShop\Customer\Manager\FosUser( $context );
24
+		$this->object = new \Aimeos\MShop\Customer\Manager\FosUser($context);
25 25
 
26 26
 		$this->fixture = array(
27 27
 			'label' => 'unitTest',
28 28
 			'status' => 2,
29 29
 		);
30 30
 
31
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
31
+		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.');
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->fixture, $this->address );
37
+		unset($this->object, $this->fixture, $this->address);
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testCleanup()
42 42
 	{
43
-		$this->object->cleanup( array( -1 ) );
43
+		$this->object->cleanup(array( -1 ));
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testGetSearchAttributes()
48 48
 	{
49
-		foreach( $this->object->getSearchAttributes() as $attribute )
49
+		foreach ($this->object->getSearchAttributes() as $attribute)
50 50
 		{
51
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
51
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
52 52
 		}
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testCreateItem()
57 57
 	{
58
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() );
58
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem());
59 59
 	}
60 60
 
61 61
 
@@ -63,21 +63,21 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$search = $this->object->createSearch();
65 65
 		$conditions = array(
66
-			$search->compare( '==', 'customer.code', 'UTC003' ),
67
-			$search->compare( '==', 'customer.editor', $this->editor )
66
+			$search->compare('==', 'customer.code', 'UTC003'),
67
+			$search->compare('==', 'customer.editor', $this->editor)
68 68
 		);
69
-		$search->setConditions( $search->combine( '&&', $conditions ) );
70
-		$items = $this->object->searchItems( $search, array( 'text' ) );
69
+		$search->setConditions($search->combine('&&', $conditions));
70
+		$items = $this->object->searchItems($search, array('text'));
71 71
 
72
-		if( ( $expected = reset( $items ) ) === false ) {
73
-			throw new \RuntimeException( 'No customer item with code "UTC003" found' );
72
+		if (($expected = reset($items)) === false) {
73
+			throw new \RuntimeException('No customer item with code "UTC003" found');
74 74
 		}
75 75
 
76
-		$actual = $this->object->getItem( $expected->getId(), array( 'text' ) );
76
+		$actual = $this->object->getItem($expected->getId(), array('text'));
77 77
 
78
-		$this->assertEquals( $expected, $actual );
79
-		$this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) );
80
-		$this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) );
78
+		$this->assertEquals($expected, $actual);
79
+		$this->assertEquals(3, count($actual->getListItems('text')));
80
+		$this->assertEquals(3, count($actual->getRefItems('text')));
81 81
 	}
82 82
 
83 83
 
@@ -85,96 +85,96 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		$item = $this->object->createItem();
87 87
 
88
-		$item->setCode( 'unitTest' );
89
-		$item->setLabel( 'unitTest' );
90
-		$resultSaved = $this->object->saveItem( $item );
91
-		$itemSaved = $this->object->getItem( $item->getId() );
88
+		$item->setCode('unitTest');
89
+		$item->setLabel('unitTest');
90
+		$resultSaved = $this->object->saveItem($item);
91
+		$itemSaved = $this->object->getItem($item->getId());
92 92
 
93 93
 		$itemExp = clone $itemSaved;
94
-		$itemExp->setCode( 'unitTest2' );
95
-		$itemExp->setLabel( 'unitTest2' );
96
-		$resultUpd = $this->object->saveItem( $itemExp );
97
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
98
-
99
-		$this->object->deleteItem( $item->getId() );
100
-
101
-		$this->assertTrue( $item->getId() !== null );
102
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
103
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
104
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
105
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
106
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
107
-		$this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() );
108
-		$this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() );
109
-		$this->assertEquals( $item->getPassword(), $itemSaved->getPassword() );
110
-		$this->assertEquals( $item->getRoles(), $itemSaved->getRoles() );
111
-		$this->assertEquals( $item->getSalt(), $itemSaved->getSalt() );
112
-
113
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
114
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
115
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
116
-
117
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
118
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
119
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
120
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
121
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
122
-		$this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() );
123
-		$this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() );
124
-		$this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() );
125
-		$this->assertEquals( $itemExp->getRoles(), $itemUpd->getRoles() );
126
-		$this->assertEquals( $itemExp->getSalt(), $itemUpd->getSalt() );
127
-
128
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
129
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
130
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
131
-
132
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
133
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
134
-
135
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
136
-		$this->object->getItem( $item->getId() );
94
+		$itemExp->setCode('unitTest2');
95
+		$itemExp->setLabel('unitTest2');
96
+		$resultUpd = $this->object->saveItem($itemExp);
97
+		$itemUpd = $this->object->getItem($itemExp->getId());
98
+
99
+		$this->object->deleteItem($item->getId());
100
+
101
+		$this->assertTrue($item->getId() !== null);
102
+		$this->assertEquals($item->getId(), $itemSaved->getId());
103
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
104
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
105
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
106
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
107
+		$this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress());
108
+		$this->assertEquals($item->getBirthday(), $itemSaved->getBirthday());
109
+		$this->assertEquals($item->getPassword(), $itemSaved->getPassword());
110
+		$this->assertEquals($item->getRoles(), $itemSaved->getRoles());
111
+		$this->assertEquals($item->getSalt(), $itemSaved->getSalt());
112
+
113
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
114
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
115
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
116
+
117
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
118
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
119
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
120
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
121
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
122
+		$this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress());
123
+		$this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday());
124
+		$this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword());
125
+		$this->assertEquals($itemExp->getRoles(), $itemUpd->getRoles());
126
+		$this->assertEquals($itemExp->getSalt(), $itemUpd->getSalt());
127
+
128
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
129
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
130
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
131
+
132
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
133
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
134
+
135
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
136
+		$this->object->getItem($item->getId());
137 137
 	}
138 138
 
139 139
 
140 140
 	public function testGetSaveAddressItems()
141 141
 	{
142
-		$item = $this->object->findItem( 'UTC001', ['customer/address'] );
142
+		$item = $this->object->findItem('UTC001', ['customer/address']);
143 143
 
144
-		$item->setId( null )->setCode( 'xyz' );
145
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
146
-		$item->addAddressItem( new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.' ) );
147
-		$this->object->saveItem( $item );
144
+		$item->setId(null)->setCode('xyz');
145
+		$item->getPaymentAddress()->setEmail('[email protected]');
146
+		$item->addAddressItem(new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.'));
147
+		$this->object->saveItem($item);
148 148
 
149
-		$item2 = $this->object->findItem( 'xyz', ['customer/address'] );
149
+		$item2 = $this->object->findItem('xyz', ['customer/address']);
150 150
 
151
-		$this->object->deleteItem( $item->getId() );
151
+		$this->object->deleteItem($item->getId());
152 152
 
153
-		$this->assertEquals( 2, count( $item->getAddressItems() ) );
154
-		$this->assertEquals( 2, count( $item2->getAddressItems() ) );
153
+		$this->assertEquals(2, count($item->getAddressItems()));
154
+		$this->assertEquals(2, count($item2->getAddressItems()));
155 155
 	}
156 156
 
157 157
 
158 158
 	public function testGetSavePropertyItems()
159 159
 	{
160
-		$item = $this->object->findItem( 'UTC001', ['customer/property'] );
160
+		$item = $this->object->findItem('UTC001', ['customer/property']);
161 161
 
162
-		$item->setId( null )->setCode( 'xyz' );
163
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
164
-		$this->object->saveItem( $item );
162
+		$item->setId(null)->setCode('xyz');
163
+		$item->getPaymentAddress()->setEmail('[email protected]');
164
+		$this->object->saveItem($item);
165 165
 
166
-		$item2 = $this->object->findItem( 'xyz', ['customer/property'] );
166
+		$item2 = $this->object->findItem('xyz', ['customer/property']);
167 167
 
168
-		$this->object->deleteItem( $item->getId() );
168
+		$this->object->deleteItem($item->getId());
169 169
 
170
-		$this->assertEquals( 1, count( $item->getPropertyItems() ) );
171
-		$this->assertEquals( 1, count( $item2->getPropertyItems() ) );
170
+		$this->assertEquals(1, count($item->getPropertyItems()));
171
+		$this->assertEquals(1, count($item2->getPropertyItems()));
172 172
 	}
173 173
 
174 174
 
175 175
 	public function testCreateSearch()
176 176
 	{
177
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
177
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
178 178
 	}
179 179
 
180 180
 
@@ -184,68 +184,68 @@  discard block
 block discarded – undo
184 184
 		$search = $this->object->createSearch();
185 185
 
186 186
 		$expr = [];
187
-		$expr[] = $search->compare( '!=', 'customer.id', null );
188
-		$expr[] = $search->compare( '==', 'customer.label', 'UTC002' );
189
-		$expr[] = $search->compare( '==', 'customer.code', 'UTC002' );
190
-
191
-		$expr[] = $search->compare( '>=', 'customer.salutation', '' );
192
-		$expr[] = $search->compare( '>=', 'customer.company', '' );
193
-		$expr[] = $search->compare( '>=', 'customer.vatid', '' );
194
-		$expr[] = $search->compare( '>=', 'customer.title', '' );
195
-		$expr[] = $search->compare( '>=', 'customer.firstname', '' );
196
-		$expr[] = $search->compare( '>=', 'customer.lastname', '' );
197
-		$expr[] = $search->compare( '>=', 'customer.address1', '' );
198
-		$expr[] = $search->compare( '>=', 'customer.address2', '' );
199
-		$expr[] = $search->compare( '>=', 'customer.address3', '' );
200
-		$expr[] = $search->compare( '>=', 'customer.postal', '' );
201
-		$expr[] = $search->compare( '>=', 'customer.city', '' );
202
-		$expr[] = $search->compare( '>=', 'customer.state', '' );
203
-		$expr[] = $search->compare( '!=', 'customer.languageid', null );
204
-		$expr[] = $search->compare( '>=', 'customer.countryid', '' );
205
-		$expr[] = $search->compare( '>=', 'customer.telephone', '' );
206
-		$expr[] = $search->compare( '>=', 'customer.email', '' );
207
-		$expr[] = $search->compare( '>=', 'customer.telefax', '' );
208
-		$expr[] = $search->compare( '>=', 'customer.website', '' );
209
-		$expr[] = $search->compare( '>=', 'customer.longitude', '10.0' );
210
-		$expr[] = $search->compare( '>=', 'customer.latitude', '50.0' );
211
-
212
-		$expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' );
213
-		$expr[] = $search->compare( '>=', 'customer.password', '' );
214
-		$expr[] = $search->compare( '==', 'customer.status', 0 );
215
-		$expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' );
216
-		$expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' );
217
-		$expr[] = $search->compare( '==', 'customer.editor', $this->editor );
218
-
219
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
220
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
221
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
222
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
223
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
224
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
225
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
226
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
227
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
228
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
229
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
230
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
231
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
232
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
233
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
234
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
235
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
236
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
237
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
238
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
239
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
240
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
241
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
242
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
243
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
244
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
245
-
246
-		$search->setConditions( $search->combine( '&&', $expr ) );
247
-		$result = $this->object->searchItems( $search, [], $total );
248
-		$this->assertEquals( 1, count( $result ) );
187
+		$expr[] = $search->compare('!=', 'customer.id', null);
188
+		$expr[] = $search->compare('==', 'customer.label', 'UTC002');
189
+		$expr[] = $search->compare('==', 'customer.code', 'UTC002');
190
+
191
+		$expr[] = $search->compare('>=', 'customer.salutation', '');
192
+		$expr[] = $search->compare('>=', 'customer.company', '');
193
+		$expr[] = $search->compare('>=', 'customer.vatid', '');
194
+		$expr[] = $search->compare('>=', 'customer.title', '');
195
+		$expr[] = $search->compare('>=', 'customer.firstname', '');
196
+		$expr[] = $search->compare('>=', 'customer.lastname', '');
197
+		$expr[] = $search->compare('>=', 'customer.address1', '');
198
+		$expr[] = $search->compare('>=', 'customer.address2', '');
199
+		$expr[] = $search->compare('>=', 'customer.address3', '');
200
+		$expr[] = $search->compare('>=', 'customer.postal', '');
201
+		$expr[] = $search->compare('>=', 'customer.city', '');
202
+		$expr[] = $search->compare('>=', 'customer.state', '');
203
+		$expr[] = $search->compare('!=', 'customer.languageid', null);
204
+		$expr[] = $search->compare('>=', 'customer.countryid', '');
205
+		$expr[] = $search->compare('>=', 'customer.telephone', '');
206
+		$expr[] = $search->compare('>=', 'customer.email', '');
207
+		$expr[] = $search->compare('>=', 'customer.telefax', '');
208
+		$expr[] = $search->compare('>=', 'customer.website', '');
209
+		$expr[] = $search->compare('>=', 'customer.longitude', '10.0');
210
+		$expr[] = $search->compare('>=', 'customer.latitude', '50.0');
211
+
212
+		$expr[] = $search->compare('==', 'customer.birthday', '1970-01-01');
213
+		$expr[] = $search->compare('>=', 'customer.password', '');
214
+		$expr[] = $search->compare('==', 'customer.status', 0);
215
+		$expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00');
216
+		$expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00');
217
+		$expr[] = $search->compare('==', 'customer.editor', $this->editor);
218
+
219
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
220
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
221
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
222
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
223
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
224
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
225
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
226
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
227
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
228
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
229
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
230
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
231
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
232
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
233
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
234
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
235
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
236
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
237
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
238
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
239
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
240
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
241
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
242
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
243
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
244
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
245
+
246
+		$search->setConditions($search->combine('&&', $expr));
247
+		$result = $this->object->searchItems($search, [], $total);
248
+		$this->assertEquals(1, count($result));
249 249
 	}
250 250
 
251 251
 
@@ -254,60 +254,60 @@  discard block
 block discarded – undo
254 254
 		$total = 0;
255 255
 
256 256
 		$search = $this->object->createSearch();
257
-		$search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) );
258
-		$search->setSlice( 0, 2 );
257
+		$search->setConditions($search->compare('==', 'customer.address.editor', $this->editor));
258
+		$search->setSlice(0, 2);
259 259
 
260
-		$results = $this->object->searchItems( $search, [], $total );
261
-		$this->assertEquals( 2, count( $results ) );
262
-		$this->assertEquals( 3, $total );
260
+		$results = $this->object->searchItems($search, [], $total);
261
+		$this->assertEquals(2, count($results));
262
+		$this->assertEquals(3, $total);
263 263
 
264
-		foreach($results as $itemId => $item) {
265
-			$this->assertEquals( $itemId, $item->getId() );
264
+		foreach ($results as $itemId => $item) {
265
+			$this->assertEquals($itemId, $item->getId());
266 266
 		}
267 267
 	}
268 268
 
269 269
 
270 270
 	public function testSearchItemsCriteria()
271 271
 	{
272
-		$search = $this->object->createSearch( true );
272
+		$search = $this->object->createSearch(true);
273 273
 		$conditions = array(
274
-			$search->compare( '==', 'customer.address.editor', $this->editor ),
274
+			$search->compare('==', 'customer.address.editor', $this->editor),
275 275
 			$search->getConditions()
276 276
 		);
277
-		$search->setConditions( $search->combine( '&&', $conditions ) );
278
-		$this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) );
277
+		$search->setConditions($search->combine('&&', $conditions));
278
+		$this->assertEquals(2, count($this->object->searchItems($search, [], $total)));
279 279
 	}
280 280
 
281 281
 
282 282
 	public function testSearchItemsRef()
283 283
 	{
284 284
 		$search = $this->object->createSearch();
285
-		$search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) );
285
+		$search->setConditions($search->compare('==', 'customer.code', 'UTC001'));
286 286
 
287
-		$results = $this->object->searchItems( $search, ['customer/address', 'text'] );
287
+		$results = $this->object->searchItems($search, ['customer/address', 'text']);
288 288
 
289
-		if( ( $item = reset( $results ) ) === false ) {
290
-			throw new \Exception( 'No customer item for "UTC001" available' );
289
+		if (($item = reset($results)) === false) {
290
+			throw new \Exception('No customer item for "UTC001" available');
291 291
 		}
292 292
 
293
-		$this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) );
294
-		$this->assertEquals( 1, count( $item->getAddressItems() ) );
293
+		$this->assertEquals(1, count($item->getRefItems('text')));
294
+		$this->assertEquals(1, count($item->getAddressItems()));
295 295
 	}
296 296
 
297 297
 
298 298
 	public function testGetSubManager()
299 299
 	{
300
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) );
301
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
300
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address'));
301
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard'));
302 302
 
303
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
304
-		$this->object->getSubManager( 'unknown' );
303
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
304
+		$this->object->getSubManager('unknown');
305 305
 	}
306 306
 
307 307
 
308 308
 	public function testGetSubManagerInvalidName()
309 309
 	{
310
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
311
-		$this->object->getSubManager( 'address', 'unknown' );
310
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
311
+		$this->object->getSubManager('address', 'unknown');
312 312
 	}
313 313
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Address/FosUserTest.php 1 patch
Spacing   +130 added lines, -130 removed lines patch added patch discarded remove patch
@@ -23,18 +23,18 @@  discard block
 block discarded – undo
23 23
 	{
24 24
 		$context = \TestHelper::getContext();
25 25
 		$this->editor = $context->getEditor();
26
-		$customer = new \Aimeos\MShop\Customer\Manager\FosUser( $context );
26
+		$customer = new \Aimeos\MShop\Customer\Manager\FosUser($context);
27 27
 
28 28
 		$search = $customer->createSearch();
29 29
 		$conditions = array(
30
-			$search->compare( '==', 'customer.code', 'UTC001' ),
31
-			$search->compare( '==', 'customer.editor', $this->editor )
30
+			$search->compare('==', 'customer.code', 'UTC001'),
31
+			$search->compare('==', 'customer.editor', $this->editor)
32 32
 		);
33
-		$search->setConditions( $search->combine( '&&', $conditions ) );
34
-		$result = $customer->searchItems( $search );
33
+		$search->setConditions($search->combine('&&', $conditions));
34
+		$result = $customer->searchItems($search);
35 35
 
36
-		if( ( $customerItem = reset( $result ) ) === false ) {
37
-			throw new \RuntimeException( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) );
36
+		if (($customerItem = reset($result)) === false) {
37
+			throw new \RuntimeException(sprintf('No customer item found for code "%1$s"', 'UTC001'));
38 38
 		}
39 39
 
40 40
 		$this->fixture = array(
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			'customer.address.siteid' => $context->getLocale()->getSiteId(),
64 64
 		);
65 65
 
66
-		$this->object = $customer->getSubManager( 'address', 'FosUser' );
66
+		$this->object = $customer->getSubManager('address', 'FosUser');
67 67
 	}
68 68
 
69 69
 
@@ -72,131 +72,131 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	protected function tearDown()
74 74
 	{
75
-		unset( $this->object, $this->fixture );
75
+		unset($this->object, $this->fixture);
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testCleanup()
80 80
 	{
81
-		$this->object->cleanup( array( -1 ) );
81
+		$this->object->cleanup(array( -1 ));
82 82
 	}
83 83
 
84 84
 	public function testGetSearchAttributes()
85 85
 	{
86
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
87
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
86
+		foreach ($this->object->getSearchAttributes() as $attribute) {
87
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
88 88
 		}
89 89
 	}
90 90
 
91 91
 	public function testGetSubManager()
92 92
 	{
93
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
94
-		$this->object->getSubManager( 'unknown' );
93
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
94
+		$this->object->getSubManager('unknown');
95 95
 	}
96 96
 
97 97
 	public function testCreateItem()
98 98
 	{
99
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() );
99
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem());
100 100
 	}
101 101
 
102 102
 	public function testGetItem()
103 103
 	{
104 104
 		$search = $this->object->createSearch();
105
-		$search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) );
105
+		$search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH'));
106 106
 
107
-		$items = $this->object->searchItems( $search );
107
+		$items = $this->object->searchItems($search);
108 108
 
109
-		if( ( $item = reset( $items ) ) === false ) {
110
-			throw new \RuntimeException( 'No address item with company "ABC" found' );
109
+		if (($item = reset($items)) === false) {
110
+			throw new \RuntimeException('No address item with company "ABC" found');
111 111
 		}
112 112
 
113
-		$this->assertEquals( $item, $this->object->getItem( $item->getId() ) );
113
+		$this->assertEquals($item, $this->object->getItem($item->getId()));
114 114
 	}
115 115
 
116 116
 	public function testSaveUpdateDeleteItem()
117 117
 	{
118
-		$item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture );
119
-		$item->setId( null );
120
-		$resultSaved = $this->object->saveItem( $item );
121
-		$itemSaved = $this->object->getItem( $item->getId() );
118
+		$item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture);
119
+		$item->setId(null);
120
+		$resultSaved = $this->object->saveItem($item);
121
+		$itemSaved = $this->object->getItem($item->getId());
122 122
 
123 123
 		$itemExp = clone $itemSaved;
124
-		$itemExp->setPosition( 1 );
125
-		$itemExp->setCity( 'Berlin' );
126
-		$itemExp->setState( 'Berlin' );
127
-		$resultUpd = $this->object->saveItem( $itemExp );
128
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
129
-
130
-		$this->object->deleteItem( $itemSaved->getId() );
131
-
132
-
133
-		$this->assertTrue( $item->getId() !== null );
134
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
135
-		$this->assertEquals( $item->getParentId(), $itemSaved->getParentId());
136
-		$this->assertEquals( $item->getPosition(), $itemSaved->getPosition());
137
-		$this->assertEquals( $item->getCompany(), $itemSaved->getCompany());
138
-		$this->assertEquals( $item->getVatID(), $itemSaved->getVatID());
139
-		$this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation());
140
-		$this->assertEquals( $item->getTitle(), $itemSaved->getTitle());
141
-		$this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname());
142
-		$this->assertEquals( $item->getLastname(), $itemSaved->getLastname());
143
-		$this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1());
144
-		$this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2());
145
-		$this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3());
146
-		$this->assertEquals( $item->getPostal(), $itemSaved->getPostal());
147
-		$this->assertEquals( $item->getCity(), $itemSaved->getCity());
148
-		$this->assertEquals( $item->getState(), $itemSaved->getState());
149
-		$this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId());
150
-		$this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId());
151
-		$this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone());
152
-		$this->assertEquals( $item->getEmail(), $itemSaved->getEmail());
153
-		$this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax());
154
-		$this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite());
155
-		$this->assertEquals( $item->getLongitude(), $itemSaved->getLongitude());
156
-		$this->assertEquals( $item->getLatitude(), $itemSaved->getLatitude());
157
-
158
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
159
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
124
+		$itemExp->setPosition(1);
125
+		$itemExp->setCity('Berlin');
126
+		$itemExp->setState('Berlin');
127
+		$resultUpd = $this->object->saveItem($itemExp);
128
+		$itemUpd = $this->object->getItem($itemExp->getId());
129
+
130
+		$this->object->deleteItem($itemSaved->getId());
131
+
132
+
133
+		$this->assertTrue($item->getId() !== null);
134
+		$this->assertEquals($item->getId(), $itemSaved->getId());
135
+		$this->assertEquals($item->getParentId(), $itemSaved->getParentId());
136
+		$this->assertEquals($item->getPosition(), $itemSaved->getPosition());
137
+		$this->assertEquals($item->getCompany(), $itemSaved->getCompany());
138
+		$this->assertEquals($item->getVatID(), $itemSaved->getVatID());
139
+		$this->assertEquals($item->getSalutation(), $itemSaved->getSalutation());
140
+		$this->assertEquals($item->getTitle(), $itemSaved->getTitle());
141
+		$this->assertEquals($item->getFirstname(), $itemSaved->getFirstname());
142
+		$this->assertEquals($item->getLastname(), $itemSaved->getLastname());
143
+		$this->assertEquals($item->getAddress1(), $itemSaved->getAddress1());
144
+		$this->assertEquals($item->getAddress2(), $itemSaved->getAddress2());
145
+		$this->assertEquals($item->getAddress3(), $itemSaved->getAddress3());
146
+		$this->assertEquals($item->getPostal(), $itemSaved->getPostal());
147
+		$this->assertEquals($item->getCity(), $itemSaved->getCity());
148
+		$this->assertEquals($item->getState(), $itemSaved->getState());
149
+		$this->assertEquals($item->getCountryId(), $itemSaved->getCountryId());
150
+		$this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId());
151
+		$this->assertEquals($item->getTelephone(), $itemSaved->getTelephone());
152
+		$this->assertEquals($item->getEmail(), $itemSaved->getEmail());
153
+		$this->assertEquals($item->getTelefax(), $itemSaved->getTelefax());
154
+		$this->assertEquals($item->getWebsite(), $itemSaved->getWebsite());
155
+		$this->assertEquals($item->getLongitude(), $itemSaved->getLongitude());
156
+		$this->assertEquals($item->getLatitude(), $itemSaved->getLatitude());
157
+
158
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
159
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
160 160
 		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
161 161
 
162
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
163
-		$this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId());
164
-		$this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition());
165
-		$this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany());
166
-		$this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID());
167
-		$this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation());
168
-		$this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle());
169
-		$this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname());
170
-		$this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname());
171
-		$this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1());
172
-		$this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2());
173
-		$this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3());
174
-		$this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal());
175
-		$this->assertEquals( $itemExp->getCity(), $itemUpd->getCity());
176
-		$this->assertEquals( $itemExp->getState(), $itemUpd->getState());
177
-		$this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId());
178
-		$this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId());
179
-		$this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone());
180
-		$this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail());
181
-		$this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax());
182
-		$this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite());
183
-		$this->assertEquals( $itemExp->getLongitude(), $itemUpd->getLongitude());
184
-		$this->assertEquals( $itemExp->getLatitude(), $itemUpd->getLatitude());
185
-
186
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
187
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
188
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
189
-
190
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
191
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
162
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
163
+		$this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId());
164
+		$this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition());
165
+		$this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany());
166
+		$this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID());
167
+		$this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation());
168
+		$this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle());
169
+		$this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname());
170
+		$this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname());
171
+		$this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1());
172
+		$this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2());
173
+		$this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3());
174
+		$this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal());
175
+		$this->assertEquals($itemExp->getCity(), $itemUpd->getCity());
176
+		$this->assertEquals($itemExp->getState(), $itemUpd->getState());
177
+		$this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId());
178
+		$this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId());
179
+		$this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone());
180
+		$this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail());
181
+		$this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax());
182
+		$this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite());
183
+		$this->assertEquals($itemExp->getLongitude(), $itemUpd->getLongitude());
184
+		$this->assertEquals($itemExp->getLatitude(), $itemUpd->getLatitude());
185
+
186
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
187
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
188
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
189
+
190
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
191
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
192 192
 
193 193
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
194
-		$this->object->getItem( $itemSaved->getId() );
194
+		$this->object->getItem($itemSaved->getId());
195 195
 	}
196 196
 
197 197
 	public function testCreateSearch()
198 198
 	{
199
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
199
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
200 200
 	}
201 201
 
202 202
 
@@ -205,35 +205,35 @@  discard block
 block discarded – undo
205 205
 		$search = $this->object->createSearch();
206 206
 
207 207
 		$expr = [];
208
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
209
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
210
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
211
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
212
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
213
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
214
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
215
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
216
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
217
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
218
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
219
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
220
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
221
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
222
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
223
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
224
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
225
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
226
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
227
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
228
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
229
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
230
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
231
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
232
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
233
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
234
-
235
-		$search->setConditions( $search->combine( '&&', $expr ) );
236
-		$this->assertEquals( 1, count( $this->object->searchItems( $search ) ) );
208
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
209
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
210
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
211
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
212
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
213
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
214
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
215
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
216
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
217
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
218
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
219
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
220
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
221
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
222
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
223
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
224
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
225
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
226
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
227
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
228
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
229
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
230
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
231
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
232
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
233
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
234
+
235
+		$search->setConditions($search->combine('&&', $expr));
236
+		$this->assertEquals(1, count($this->object->searchItems($search)));
237 237
 	}
238 238
 
239 239
 
@@ -243,20 +243,20 @@  discard block
 block discarded – undo
243 243
 		$search = $this->object->createSearch();
244 244
 
245 245
 		$conditions = array(
246
-			$search->compare( '~=', 'customer.address.company', 'ABC GmbH' ),
247
-			$search->compare( '==', 'customer.address.editor', $this->editor )
246
+			$search->compare('~=', 'customer.address.company', 'ABC GmbH'),
247
+			$search->compare('==', 'customer.address.editor', $this->editor)
248 248
 		);
249 249
 
250
-		$search->setConditions( $search->combine( '&&', $conditions ) );
251
-		$search->setSlice( 0, 1 );
250
+		$search->setConditions($search->combine('&&', $conditions));
251
+		$search->setSlice(0, 1);
252 252
 
253
-		$results = $this->object->searchItems( $search, [], $total );
253
+		$results = $this->object->searchItems($search, [], $total);
254 254
 
255
-		$this->assertEquals( 1, count( $results ) );
256
-		$this->assertEquals( 2, $total );
255
+		$this->assertEquals(1, count($results));
256
+		$this->assertEquals(2, $total);
257 257
 
258
-		foreach( $results as $id => $item ) {
259
-			$this->assertEquals( $id, $item->getId() );
258
+		foreach ($results as $id => $item) {
259
+			$this->assertEquals($id, $item->getId());
260 260
 		}
261 261
 	}
262 262
 }
Please login to merge, or discard this patch.
lib/custom/setup/default/schema/customer.php 1 patch
Spacing   +183 added lines, -183 removed lines patch added patch discarded remove patch
@@ -8,220 +8,220 @@
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'fos_user' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
-
13
-			$table = $schema->createTable( 'fos_user' );
14
-
15
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
16
-			$table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) );
17
-			$table->addColumn( 'username', 'string', array( 'length' => 180 ) );
18
-			$table->addColumn( 'username_canonical', 'string', array( 'length' => 180 ) );
19
-			$table->addColumn( 'email', 'string', array( 'length' => 180 ) );
20
-			$table->addColumn( 'email_canonical', 'string', array( 'length' => 180 ) );
21
-			$table->addColumn( 'enabled', 'boolean', [] );
22
-			$table->addColumn( 'salt', 'string', array( 'length' => 255, 'notnull' => false ) );
23
-			$table->addColumn( 'password', 'string', array( 'length' => 255 ) );
24
-			$table->addColumn( 'last_login', 'datetime', array( 'notnull' => false ) );
25
-			$table->addColumn( 'confirmation_token', 'string', array( 'length' => 180, 'notnull' => false ) );
26
-			$table->addColumn( 'password_requested_at', 'datetime', array( 'notnull' => false ) );
27
-			$table->addColumn( 'roles', 'text', array( 'length' => 0x7fffffff, 'comment' => '(DC2Type:array)' ) );
28
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
29
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
30
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
31
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
32
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
33
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
34
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
35
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
36
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
37
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
38
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
39
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
40
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
41
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
42
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
43
-			$table->addColumn( 'telefax', 'string', array( 'length' => 32 ) );
44
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
45
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
46
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
47
-			$table->addColumn( 'birthday', 'date', array( 'notnull' => false ) );
48
-			$table->addColumn( 'vdate', 'date', array( 'notnull' => false ) );
49
-			$table->addColumn( 'mtime', 'datetime', array( 'notnull' => false ) );
50
-			$table->addColumn( 'ctime', 'datetime', array( 'notnull' => false ) );
51
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
52
-
53
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosus_id' );
54
-			$table->addUniqueIndex( array( 'confirmation_token' ), 'unq_fosus_confirmtoken' );
55
-			$table->addUniqueIndex( array( 'username_canonical' ), 'unq_fosus_username' );
56
-			$table->addUniqueIndex( array( 'email_canonical' ), 'unq_fosus_email' );
57
-			$table->addIndex( array( 'langid' ), 'idx_fosus_langid' );
58
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosus_last_first' );
59
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_fosus_post_addr1' );
60
-			$table->addIndex( array( 'postal', 'city' ), 'idx_fosus_post_city' );
61
-			$table->addIndex( array( 'lastname' ), 'idx_fosus_lastname' );
62
-			$table->addIndex( array( 'address1' ), 'idx_fosus_address1' );
63
-			$table->addIndex( array( 'city' ), 'idx_fosus_city' );
11
+		'fos_user' => function(\Doctrine\DBAL\Schema\Schema $schema) {
12
+
13
+			$table = $schema->createTable('fos_user');
14
+
15
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
16
+			$table->addColumn('siteid', 'integer', array('notnull' => false));
17
+			$table->addColumn('username', 'string', array('length' => 180));
18
+			$table->addColumn('username_canonical', 'string', array('length' => 180));
19
+			$table->addColumn('email', 'string', array('length' => 180));
20
+			$table->addColumn('email_canonical', 'string', array('length' => 180));
21
+			$table->addColumn('enabled', 'boolean', []);
22
+			$table->addColumn('salt', 'string', array('length' => 255, 'notnull' => false));
23
+			$table->addColumn('password', 'string', array('length' => 255));
24
+			$table->addColumn('last_login', 'datetime', array('notnull' => false));
25
+			$table->addColumn('confirmation_token', 'string', array('length' => 180, 'notnull' => false));
26
+			$table->addColumn('password_requested_at', 'datetime', array('notnull' => false));
27
+			$table->addColumn('roles', 'text', array('length' => 0x7fffffff, 'comment' => '(DC2Type:array)'));
28
+			$table->addColumn('salutation', 'string', array('length' => 8));
29
+			$table->addColumn('company', 'string', array('length' => 100));
30
+			$table->addColumn('vatid', 'string', array('length' => 32));
31
+			$table->addColumn('title', 'string', array('length' => 64));
32
+			$table->addColumn('firstname', 'string', array('length' => 64));
33
+			$table->addColumn('lastname', 'string', array('length' => 64));
34
+			$table->addColumn('address1', 'string', array('length' => 200));
35
+			$table->addColumn('address2', 'string', array('length' => 200));
36
+			$table->addColumn('address3', 'string', array('length' => 200));
37
+			$table->addColumn('postal', 'string', array('length' => 16));
38
+			$table->addColumn('city', 'string', array('length' => 200));
39
+			$table->addColumn('state', 'string', array('length' => 200));
40
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
41
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
42
+			$table->addColumn('telephone', 'string', array('length' => 32));
43
+			$table->addColumn('telefax', 'string', array('length' => 32));
44
+			$table->addColumn('website', 'string', array('length' => 255));
45
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
46
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
47
+			$table->addColumn('birthday', 'date', array('notnull' => false));
48
+			$table->addColumn('vdate', 'date', array('notnull' => false));
49
+			$table->addColumn('mtime', 'datetime', array('notnull' => false));
50
+			$table->addColumn('ctime', 'datetime', array('notnull' => false));
51
+			$table->addColumn('editor', 'string', array('length' => 255));
52
+
53
+			$table->setPrimaryKey(array('id'), 'pk_fosus_id');
54
+			$table->addUniqueIndex(array('confirmation_token'), 'unq_fosus_confirmtoken');
55
+			$table->addUniqueIndex(array('username_canonical'), 'unq_fosus_username');
56
+			$table->addUniqueIndex(array('email_canonical'), 'unq_fosus_email');
57
+			$table->addIndex(array('langid'), 'idx_fosus_langid');
58
+			$table->addIndex(array('lastname', 'firstname'), 'idx_fosus_last_first');
59
+			$table->addIndex(array('postal', 'address1'), 'idx_fosus_post_addr1');
60
+			$table->addIndex(array('postal', 'city'), 'idx_fosus_post_city');
61
+			$table->addIndex(array('lastname'), 'idx_fosus_lastname');
62
+			$table->addIndex(array('address1'), 'idx_fosus_address1');
63
+			$table->addIndex(array('city'), 'idx_fosus_city');
64 64
 
65 65
 			return $schema;
66 66
 		},
67 67
 
68
-		'fos_user_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
69
-
70
-			$table = $schema->createTable( 'fos_user_address' );
71
-
72
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
73
-			$table->addColumn( 'siteid', 'integer', [] );
74
-			$table->addColumn( 'parentid', 'integer', [] );
75
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
76
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
77
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
78
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
79
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
80
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
81
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
82
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
83
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
84
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
85
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
86
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
87
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
88
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
89
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
90
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
91
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
92
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
93
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
94
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
95
-			$table->addColumn( 'pos', 'smallint', [] );
96
-			$table->addColumn( 'mtime', 'datetime', [] );
97
-			$table->addColumn( 'ctime', 'datetime', [] );
98
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
99
-
100
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosad_id' );
101
-			$table->addIndex( array( 'parentid' ), 'idx_fosad_pid' );
102
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosad_last_first' );
103
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_fosad_post_addr1' );
104
-			$table->addIndex( array( 'postal', 'city' ), 'idx_fosad_post_city' );
105
-			$table->addIndex( array( 'address1' ), 'idx_fosad_address1' );
106
-			$table->addIndex( array( 'city' ), 'idx_fosad_city' );
107
-			$table->addIndex( array( 'email' ), 'idx_fosad_email' );
108
-
109
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
110
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosad_pid' );
68
+		'fos_user_address' => function(\Doctrine\DBAL\Schema\Schema $schema) {
69
+
70
+			$table = $schema->createTable('fos_user_address');
71
+
72
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
73
+			$table->addColumn('siteid', 'integer', []);
74
+			$table->addColumn('parentid', 'integer', []);
75
+			$table->addColumn('company', 'string', array('length' => 100));
76
+			$table->addColumn('vatid', 'string', array('length' => 32));
77
+			$table->addColumn('salutation', 'string', array('length' => 8));
78
+			$table->addColumn('title', 'string', array('length' => 64));
79
+			$table->addColumn('firstname', 'string', array('length' => 64));
80
+			$table->addColumn('lastname', 'string', array('length' => 64));
81
+			$table->addColumn('address1', 'string', array('length' => 200));
82
+			$table->addColumn('address2', 'string', array('length' => 200));
83
+			$table->addColumn('address3', 'string', array('length' => 200));
84
+			$table->addColumn('postal', 'string', array('length' => 16));
85
+			$table->addColumn('city', 'string', array('length' => 200));
86
+			$table->addColumn('state', 'string', array('length' => 200));
87
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
88
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
89
+			$table->addColumn('telephone', 'string', array('length' => 32));
90
+			$table->addColumn('email', 'string', array('length' => 255));
91
+			$table->addColumn('telefax', 'string', array('length' => 255));
92
+			$table->addColumn('website', 'string', array('length' => 255));
93
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
94
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
95
+			$table->addColumn('pos', 'smallint', []);
96
+			$table->addColumn('mtime', 'datetime', []);
97
+			$table->addColumn('ctime', 'datetime', []);
98
+			$table->addColumn('editor', 'string', array('length' => 255));
99
+
100
+			$table->setPrimaryKey(array('id'), 'pk_fosad_id');
101
+			$table->addIndex(array('parentid'), 'idx_fosad_pid');
102
+			$table->addIndex(array('lastname', 'firstname'), 'idx_fosad_last_first');
103
+			$table->addIndex(array('postal', 'address1'), 'idx_fosad_post_addr1');
104
+			$table->addIndex(array('postal', 'city'), 'idx_fosad_post_city');
105
+			$table->addIndex(array('address1'), 'idx_fosad_address1');
106
+			$table->addIndex(array('city'), 'idx_fosad_city');
107
+			$table->addIndex(array('email'), 'idx_fosad_email');
108
+
109
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
110
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosad_pid');
111 111
 
112 112
 			return $schema;
113 113
 		},
114 114
 
115
-		'fos_user_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
115
+		'fos_user_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
116 116
 
117
-			$table = $schema->createTable( 'fos_user_list_type' );
117
+			$table = $schema->createTable('fos_user_list_type');
118 118
 
119
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
120
-			$table->addColumn( 'siteid', 'integer', [] );
121
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
122
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
123
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
124
-			$table->addColumn( 'pos', 'integer', ['default' => 0] );
125
-			$table->addColumn( 'status', 'smallint', [] );
126
-			$table->addColumn( 'mtime', 'datetime', [] );
127
-			$table->addColumn( 'ctime', 'datetime', [] );
128
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
119
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
120
+			$table->addColumn('siteid', 'integer', []);
121
+			$table->addColumn('domain', 'string', array('length' => 32));
122
+			$table->addColumn('code', 'string', array('length' => 32));
123
+			$table->addColumn('label', 'string', array('length' => 255));
124
+			$table->addColumn('pos', 'integer', ['default' => 0]);
125
+			$table->addColumn('status', 'smallint', []);
126
+			$table->addColumn('mtime', 'datetime', []);
127
+			$table->addColumn('ctime', 'datetime', []);
128
+			$table->addColumn('editor', 'string', array('length' => 255));
129 129
 
130
-			$table->setPrimaryKey( array( 'id' ), 'pk_foslity_id' );
131
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_foslity_sid_dom_code' );
132
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_foslity_sid_status_pos' );
133
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_foslity_sid_label' );
134
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_foslity_sid_code' );
130
+			$table->setPrimaryKey(array('id'), 'pk_foslity_id');
131
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_foslity_sid_dom_code');
132
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_foslity_sid_status_pos');
133
+			$table->addIndex(array('siteid', 'label'), 'idx_foslity_sid_label');
134
+			$table->addIndex(array('siteid', 'code'), 'idx_foslity_sid_code');
135 135
 
136 136
 			return $schema;
137 137
 		},
138 138
 
139
-		'fos_user_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
140
-
141
-			$table = $schema->createTable( 'fos_user_list' );
142
-
143
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
144
-			$table->addColumn( 'parentid', 'integer', [] );
145
-			$table->addColumn( 'siteid', 'integer', [] );
146
-			$table->addColumn( 'typeid', 'integer', [] );
147
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
148
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
149
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
150
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
151
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
152
-			$table->addColumn( 'pos', 'integer', [] );
153
-			$table->addColumn( 'status', 'smallint', [] );
154
-			$table->addColumn( 'mtime', 'datetime', [] );
155
-			$table->addColumn( 'ctime', 'datetime', [] );
156
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
157
-
158
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosli_id' );
159
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_fosli_sid_dm_rid_tid_pid' );
160
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_fosli_sid_stat_start_end' );
161
-			$table->addIndex( array( 'parentid', 'siteid', 'domain', 'refid', 'typeid' ), 'idx_fosli_pid_sid_dom_rid_tid' );
162
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_fosli_pid_sid_start' );
163
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_fosli_pid_sid_end' );
164
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_fosli_pid_sid_pos' );
165
-
166
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
167
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_pid' );
168
-
169
-			$table->addForeignKeyConstraint( 'fos_user_list_type', array( 'typeid' ), array( 'id' ),
170
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_typeid' );
139
+		'fos_user_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
140
+
141
+			$table = $schema->createTable('fos_user_list');
142
+
143
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
144
+			$table->addColumn('parentid', 'integer', []);
145
+			$table->addColumn('siteid', 'integer', []);
146
+			$table->addColumn('typeid', 'integer', []);
147
+			$table->addColumn('domain', 'string', array('length' => 32));
148
+			$table->addColumn('refid', 'string', array('length' => 32));
149
+			$table->addColumn('start', 'datetime', array('notnull' => false));
150
+			$table->addColumn('end', 'datetime', array('notnull' => false));
151
+			$table->addColumn('config', 'text', array('length' => 0xffff));
152
+			$table->addColumn('pos', 'integer', []);
153
+			$table->addColumn('status', 'smallint', []);
154
+			$table->addColumn('mtime', 'datetime', []);
155
+			$table->addColumn('ctime', 'datetime', []);
156
+			$table->addColumn('editor', 'string', array('length' => 255));
157
+
158
+			$table->setPrimaryKey(array('id'), 'pk_fosli_id');
159
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_fosli_sid_dm_rid_tid_pid');
160
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_fosli_sid_stat_start_end');
161
+			$table->addIndex(array('parentid', 'siteid', 'domain', 'refid', 'typeid'), 'idx_fosli_pid_sid_dom_rid_tid');
162
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_fosli_pid_sid_start');
163
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_fosli_pid_sid_end');
164
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_fosli_pid_sid_pos');
165
+
166
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
167
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_pid');
168
+
169
+			$table->addForeignKeyConstraint('fos_user_list_type', array('typeid'), array('id'),
170
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_typeid');
171 171
 
172 172
 			return $schema;
173 173
 		},
174 174
 
175
-		'fos_user_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
175
+		'fos_user_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
176 176
 
177
-			$table = $schema->createTable( 'fos_user_property_type' );
177
+			$table = $schema->createTable('fos_user_property_type');
178 178
 
179
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
180
-			$table->addColumn( 'siteid', 'integer', [] );
181
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
182
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
183
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
184
-			$table->addColumn( 'pos', 'integer', ['default' => 0] );
185
-			$table->addColumn( 'status', 'smallint', [] );
186
-			$table->addColumn( 'mtime', 'datetime', [] );
187
-			$table->addColumn( 'ctime', 'datetime', [] );
188
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
179
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
180
+			$table->addColumn('siteid', 'integer', []);
181
+			$table->addColumn('domain', 'string', array('length' => 32));
182
+			$table->addColumn('code', 'string', array('length' => 32));
183
+			$table->addColumn('label', 'string', array('length' => 255));
184
+			$table->addColumn('pos', 'integer', ['default' => 0]);
185
+			$table->addColumn('status', 'smallint', []);
186
+			$table->addColumn('mtime', 'datetime', []);
187
+			$table->addColumn('ctime', 'datetime', []);
188
+			$table->addColumn('editor', 'string', array('length' => 255));
189 189
 
190
-			$table->setPrimaryKey( array( 'id' ), 'pk_fosprty_id' );
191
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_fosprty_sid_dom_code' );
192
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_fosprty_sid_status_pos' );
193
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_fosprty_sid_label' );
194
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_fosprty_sid_code' );
190
+			$table->setPrimaryKey(array('id'), 'pk_fosprty_id');
191
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_fosprty_sid_dom_code');
192
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_fosprty_sid_status_pos');
193
+			$table->addIndex(array('siteid', 'label'), 'idx_fosprty_sid_label');
194
+			$table->addIndex(array('siteid', 'code'), 'idx_fosprty_sid_code');
195 195
 
196 196
 			return $schema;
197 197
 		},
198 198
 
199
-		'fos_user_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
199
+		'fos_user_property' => function(\Doctrine\DBAL\Schema\Schema $schema) {
200 200
 
201
-			$table = $schema->createTable( 'fos_user_property' );
201
+			$table = $schema->createTable('fos_user_property');
202 202
 
203
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
204
-			$table->addColumn( 'siteid', 'integer', [] );
205
-			$table->addColumn( 'parentid', 'integer', [] );
206
-			$table->addColumn( 'typeid', 'integer', [] );
207
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
208
-			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
209
-			$table->addColumn( 'mtime', 'datetime', [] );
210
-			$table->addColumn( 'ctime', 'datetime', [] );
211
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
203
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
204
+			$table->addColumn('siteid', 'integer', []);
205
+			$table->addColumn('parentid', 'integer', []);
206
+			$table->addColumn('typeid', 'integer', []);
207
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
208
+			$table->addColumn('value', 'string', array('length' => 255));
209
+			$table->addColumn('mtime', 'datetime', []);
210
+			$table->addColumn('ctime', 'datetime', []);
211
+			$table->addColumn('editor', 'string', array('length' => 255));
212 212
 
213
-			$table->setPrimaryKey( array( 'id' ), 'pk_fospr_id' );
214
-			$table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_fospr_sid_tid_lid_value' );
215
-			$table->addIndex( array( 'siteid', 'langid' ), 'idx_fospr_sid_langid' );
216
-			$table->addIndex( array( 'siteid', 'value' ), 'idx_fospr_sid_value' );
217
-			$table->addIndex( array( 'typeid' ), 'fk_fospr_typeid' );
218
-			$table->addIndex( array( 'parentid' ), 'fk_fospr_pid' );
213
+			$table->setPrimaryKey(array('id'), 'pk_fospr_id');
214
+			$table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_fospr_sid_tid_lid_value');
215
+			$table->addIndex(array('siteid', 'langid'), 'idx_fospr_sid_langid');
216
+			$table->addIndex(array('siteid', 'value'), 'idx_fospr_sid_value');
217
+			$table->addIndex(array('typeid'), 'fk_fospr_typeid');
218
+			$table->addIndex(array('parentid'), 'fk_fospr_pid');
219 219
 
220
-			$table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ),
221
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_pid' );
220
+			$table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'),
221
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_pid');
222 222
 
223
-			$table->addForeignKeyConstraint( 'fos_user_property_type', array( 'typeid' ), array( 'id' ),
224
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_typeid' );
223
+			$table->addForeignKeyConstraint('fos_user_property_type', array('typeid'), array('id'),
224
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_typeid');
225 225
 
226 226
 			return $schema;
227 227
 		},
Please login to merge, or discard this patch.
lib/custom/setup/unittest/data/customer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2014-2018
6 6
  */
7 7
 
8
-return array (
8
+return array(
9 9
 	'customer' => array(
10
-		'customer/UTC001' => array( 'code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ),
11
-		'customer/UTC002' => array( 'code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0','password' =>  'test' ),
12
-		'customer/UTC003' => array( 'code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ),
10
+		'customer/UTC001' => array('code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'),
11
+		'customer/UTC002' => array('code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0', 'password' =>  'test'),
12
+		'customer/UTC003' => array('code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'),
13 13
 	),
14 14
 
15 15
 	'customer/address' => array(
16
-		array( 'parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'pos' => '0' ),
17
-		array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'pos' => '1' ),
18
-		array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'pos' => '1' ),
19
-		array( 'parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'pos' => '2' ),
16
+		array('parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'pos' => '0'),
17
+		array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'pos' => '1'),
18
+		array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'pos' => '1'),
19
+		array('parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'pos' => '2'),
20 20
 	),
21 21
 );
Please login to merge, or discard this patch.