@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | $context = \TestHelper::getContext(); |
21 | 21 | $this->editor = $context->getEditor(); |
22 | 22 | |
23 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'FosUser' ); |
|
24 | - $this->object = $manager->getSubManager( 'property', 'FosUser' )->getSubManager( 'type', 'FosUser' ); |
|
23 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'FosUser'); |
|
24 | + $this->object = $manager->getSubManager('property', 'FosUser')->getSubManager('type', 'FosUser'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | |
34 | 34 | public function testCleanup() |
35 | 35 | { |
36 | - $this->object->cleanup( array( -1 ) ); |
|
36 | + $this->object->cleanup(array( -1 )); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateItem() |
41 | 41 | { |
42 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem() ); |
|
42 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | { |
48 | 48 | $result = $this->object->getResourceType(); |
49 | 49 | |
50 | - $this->assertContains( 'customer/property/type', $result ); |
|
50 | + $this->assertContains('customer/property/type', $result); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testGetSearchAttributes() |
55 | 55 | { |
56 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
57 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
56 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
57 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -63,82 +63,82 @@ discard block |
||
63 | 63 | { |
64 | 64 | $search = $this->object->createSearch(); |
65 | 65 | $conditions = array( |
66 | - $search->compare( '==', 'customer.property.type.code', 'newsletter' ), |
|
67 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
66 | + $search->compare('==', 'customer.property.type.code', 'newsletter'), |
|
67 | + $search->compare('==', 'customer.property.type.editor', $this->editor) |
|
68 | 68 | ); |
69 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
69 | + $search->setConditions($search->combine('&&', $conditions)); |
|
70 | 70 | |
71 | - $results = $this->object->searchItems( $search ); |
|
71 | + $results = $this->object->searchItems($search); |
|
72 | 72 | |
73 | - if( ($expected = reset($results) ) === false ) |
|
73 | + if (($expected = reset($results)) === false) |
|
74 | 74 | { |
75 | - throw new \RuntimeException( 'No property type item found.' ); |
|
75 | + throw new \RuntimeException('No property type item found.'); |
|
76 | 76 | } |
77 | 77 | |
78 | - $actual = $this->object->getItem( $expected->getId() ); |
|
78 | + $actual = $this->object->getItem($expected->getId()); |
|
79 | 79 | |
80 | - $this->assertEquals( $expected, $actual ); |
|
80 | + $this->assertEquals($expected, $actual); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testSaveInvalid() |
85 | 85 | { |
86 | - $this->setExpectedException( '\Aimeos\MShop\Exception' ); |
|
87 | - $this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() ); |
|
86 | + $this->setExpectedException('\Aimeos\MShop\Exception'); |
|
87 | + $this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard()); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | 91 | public function testSaveUpdateDeleteItem() |
92 | 92 | { |
93 | 93 | $search = $this->object->createSearch(); |
94 | - $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
|
94 | + $search->setConditions($search->compare('==', 'customer.property.type.editor', $this->editor)); |
|
95 | 95 | $results = $this->object->searchItems($search); |
96 | 96 | |
97 | - if( ( $item = reset($results) ) === false ) { |
|
98 | - throw new \RuntimeException( 'No type item found' ); |
|
97 | + if (($item = reset($results)) === false) { |
|
98 | + throw new \RuntimeException('No type item found'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $item->setId(null); |
102 | - $item->setCode( 'unitTestSave' ); |
|
103 | - $resultSaved = $this->object->saveItem( $item ); |
|
104 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
102 | + $item->setCode('unitTestSave'); |
|
103 | + $resultSaved = $this->object->saveItem($item); |
|
104 | + $itemSaved = $this->object->getItem($item->getId()); |
|
105 | 105 | |
106 | 106 | $itemExp = clone $itemSaved; |
107 | - $itemExp->setCode( 'unitTestSave2' ); |
|
108 | - $resultUpd = $this->object->saveItem( $itemExp ); |
|
109 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
107 | + $itemExp->setCode('unitTestSave2'); |
|
108 | + $resultUpd = $this->object->saveItem($itemExp); |
|
109 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
110 | 110 | |
111 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
111 | + $this->object->deleteItem($itemSaved->getId()); |
|
112 | 112 | |
113 | 113 | |
114 | - $this->assertTrue( $item->getId() !== null ); |
|
115 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
116 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
117 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
118 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
119 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
120 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
114 | + $this->assertTrue($item->getId() !== null); |
|
115 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
116 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
117 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
118 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
119 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
120 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
121 | 121 | |
122 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
123 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
124 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
122 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
123 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
124 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
125 | 125 | |
126 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
127 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
128 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
129 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
130 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
131 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
126 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
127 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
128 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
129 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
130 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
131 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
132 | 132 | |
133 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
134 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
135 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
133 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
134 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
135 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
136 | 136 | |
137 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved ); |
|
138 | - $this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd ); |
|
137 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved); |
|
138 | + $this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd); |
|
139 | 139 | |
140 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
141 | - $this->object->getItem( $itemSaved->getId() ); |
|
140 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
141 | + $this->object->getItem($itemSaved->getId()); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -148,36 +148,36 @@ discard block |
||
148 | 148 | $search = $this->object->createSearch(); |
149 | 149 | |
150 | 150 | $expr = []; |
151 | - $expr[] = $search->compare( '!=', 'customer.property.type.id', null ); |
|
152 | - $expr[] = $search->compare( '!=', 'customer.property.type.siteid', null ); |
|
153 | - $expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' ); |
|
154 | - $expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' ); |
|
155 | - $expr[] = $search->compare( '>', 'customer.property.type.label', '' ); |
|
156 | - $expr[] = $search->compare( '==', 'customer.property.type.status', 1 ); |
|
157 | - $expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' ); |
|
158 | - $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
|
159 | - $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
|
151 | + $expr[] = $search->compare('!=', 'customer.property.type.id', null); |
|
152 | + $expr[] = $search->compare('!=', 'customer.property.type.siteid', null); |
|
153 | + $expr[] = $search->compare('==', 'customer.property.type.domain', 'customer'); |
|
154 | + $expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter'); |
|
155 | + $expr[] = $search->compare('>', 'customer.property.type.label', ''); |
|
156 | + $expr[] = $search->compare('==', 'customer.property.type.status', 1); |
|
157 | + $expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00'); |
|
158 | + $expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00'); |
|
159 | + $expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor); |
|
160 | 160 | |
161 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
162 | - $results = $this->object->searchItems( $search, [], $total ); |
|
163 | - $this->assertEquals( 1, count( $results ) ); |
|
161 | + $search->setConditions($search->combine('&&', $expr)); |
|
162 | + $results = $this->object->searchItems($search, [], $total); |
|
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'), |
|
169 | - $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
168 | + $search->compare('=~', 'customer.property.type.code', 'newsletter'), |
|
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' )] ); |
|
171 | + $search->setConditions($search->combine('&&', $conditions)); |
|
172 | + $search->setSortations([$search->sort('-', 'customer.property.type.position')]); |
|
173 | 173 | $search->setSlice(0, 1); |
174 | - $items = $this->object->searchItems( $search, [], $total); |
|
174 | + $items = $this->object->searchItems($search, [], $total); |
|
175 | 175 | |
176 | - $this->assertEquals( 1, count( $items ) ); |
|
177 | - $this->assertEquals( 1, $total ); |
|
176 | + $this->assertEquals(1, count($items)); |
|
177 | + $this->assertEquals(1, $total); |
|
178 | 178 | |
179 | - foreach($items as $itemId => $item) { |
|
180 | - $this->assertEquals( $itemId, $item->getId() ); |
|
179 | + foreach ($items as $itemId => $item) { |
|
180 | + $this->assertEquals($itemId, $item->getId()); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 |
@@ -5,17 +5,17 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2017 |
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', 'flag' => 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', 'flag' => 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', 'flag' => 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', 'flag' => 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', 'flag' => 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', 'flag' => 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', 'flag' => 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', 'flag' => 0, 'pos' => '2'), |
|
20 | 20 | ), |
21 | 21 | ); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function getPreDependencies() |
25 | 25 | { |
26 | - return array( 'TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData' ); |
|
26 | + return array('TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -33,22 +33,22 @@ discard block |
||
33 | 33 | public function migrate() |
34 | 34 | { |
35 | 35 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
36 | - if( !( $this->additional instanceof $iface ) ) { |
|
37 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
36 | + if (!($this->additional instanceof $iface)) { |
|
37 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
38 | 38 | } |
39 | 39 | |
40 | - $this->msg( 'Adding customer property Fos user bundle test data', 0 ); |
|
41 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
40 | + $this->msg('Adding customer property Fos user bundle test data', 0); |
|
41 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
42 | 42 | |
43 | 43 | $ds = DIRECTORY_SEPARATOR; |
44 | 44 | $path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php'; |
45 | 45 | |
46 | - if( ( $testdata = include( $path ) ) == false ) { |
|
47 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
46 | + if (($testdata = include($path)) == false) { |
|
47 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
48 | 48 | } |
49 | 49 | |
50 | - $this->addCustomerPropertyData( $testdata, 'FosUser' ); |
|
50 | + $this->addCustomerPropertyData($testdata, 'FosUser'); |
|
51 | 51 | |
52 | - $this->status( 'done' ); |
|
52 | + $this->status('done'); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -21,41 +21,41 @@ discard block |
||
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 |
||
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 |
||
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,69 +184,69 @@ discard block |
||
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.flag', 0 ); |
|
242 | - $expr[] = $search->compare( '==', 'customer.address.position', 1 ); |
|
243 | - $expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' ); |
|
244 | - $expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' ); |
|
245 | - $expr[] = $search->compare( '==', 'customer.address.editor', $this->editor ); |
|
246 | - |
|
247 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
248 | - $result = $this->object->searchItems( $search, [], $total ); |
|
249 | - $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.flag', 0); |
|
242 | + $expr[] = $search->compare('==', 'customer.address.position', 1); |
|
243 | + $expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00'); |
|
244 | + $expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00'); |
|
245 | + $expr[] = $search->compare('==', 'customer.address.editor', $this->editor); |
|
246 | + |
|
247 | + $search->setConditions($search->combine('&&', $expr)); |
|
248 | + $result = $this->object->searchItems($search, [], $total); |
|
249 | + $this->assertEquals(1, count($result)); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
@@ -255,60 +255,60 @@ discard block |
||
255 | 255 | $total = 0; |
256 | 256 | |
257 | 257 | $search = $this->object->createSearch(); |
258 | - $search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) ); |
|
259 | - $search->setSlice( 0, 2 ); |
|
258 | + $search->setConditions($search->compare('==', 'customer.address.editor', $this->editor)); |
|
259 | + $search->setSlice(0, 2); |
|
260 | 260 | |
261 | - $results = $this->object->searchItems( $search, [], $total ); |
|
262 | - $this->assertEquals( 2, count( $results ) ); |
|
263 | - $this->assertEquals( 3, $total ); |
|
261 | + $results = $this->object->searchItems($search, [], $total); |
|
262 | + $this->assertEquals(2, count($results)); |
|
263 | + $this->assertEquals(3, $total); |
|
264 | 264 | |
265 | - foreach($results as $itemId => $item) { |
|
266 | - $this->assertEquals( $itemId, $item->getId() ); |
|
265 | + foreach ($results as $itemId => $item) { |
|
266 | + $this->assertEquals($itemId, $item->getId()); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
270 | 270 | |
271 | 271 | public function testSearchItemsCriteria() |
272 | 272 | { |
273 | - $search = $this->object->createSearch( true ); |
|
273 | + $search = $this->object->createSearch(true); |
|
274 | 274 | $conditions = array( |
275 | - $search->compare( '==', 'customer.address.editor', $this->editor ), |
|
275 | + $search->compare('==', 'customer.address.editor', $this->editor), |
|
276 | 276 | $search->getConditions() |
277 | 277 | ); |
278 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
279 | - $this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) ); |
|
278 | + $search->setConditions($search->combine('&&', $conditions)); |
|
279 | + $this->assertEquals(2, count($this->object->searchItems($search, [], $total))); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
283 | 283 | public function testSearchItemsRef() |
284 | 284 | { |
285 | 285 | $search = $this->object->createSearch(); |
286 | - $search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) ); |
|
286 | + $search->setConditions($search->compare('==', 'customer.code', 'UTC001')); |
|
287 | 287 | |
288 | - $results = $this->object->searchItems( $search, ['customer/address', 'text'] ); |
|
288 | + $results = $this->object->searchItems($search, ['customer/address', 'text']); |
|
289 | 289 | |
290 | - if( ( $item = reset( $results ) ) === false ) { |
|
291 | - throw new \Exception( 'No customer item for "UTC001" available' ); |
|
290 | + if (($item = reset($results)) === false) { |
|
291 | + throw new \Exception('No customer item for "UTC001" available'); |
|
292 | 292 | } |
293 | 293 | |
294 | - $this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) ); |
|
295 | - $this->assertEquals( 1, count( $item->getAddressItems() ) ); |
|
294 | + $this->assertEquals(1, count($item->getRefItems('text'))); |
|
295 | + $this->assertEquals(1, count($item->getAddressItems())); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
299 | 299 | public function testGetSubManager() |
300 | 300 | { |
301 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) ); |
|
302 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) ); |
|
301 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address')); |
|
302 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard')); |
|
303 | 303 | |
304 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
305 | - $this->object->getSubManager( 'unknown' ); |
|
304 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
305 | + $this->object->getSubManager('unknown'); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | |
309 | 309 | public function testGetSubManagerInvalidName() |
310 | 310 | { |
311 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
312 | - $this->object->getSubManager( 'address', 'unknown' ); |
|
311 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
312 | + $this->object->getSubManager('address', 'unknown'); |
|
313 | 313 | } |
314 | 314 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getPostDependencies() |
40 | 40 | { |
41 | - return array( 'TablesCreateMShop' ); |
|
41 | + return array('TablesCreateMShop'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -47,29 +47,29 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function migrate() |
49 | 49 | { |
50 | - $this->msg( 'Remove left over FOS user address records', 0 ); |
|
50 | + $this->msg('Remove left over FOS user address records', 0); |
|
51 | 51 | |
52 | - if( $this->schema->tableExists( 'fos_user' ) && $this->schema->tableExists( 'fos_user_address' ) ) |
|
52 | + if ($this->schema->tableExists('fos_user') && $this->schema->tableExists('fos_user_address')) |
|
53 | 53 | { |
54 | - $this->execute( $this->sql['address'] ); |
|
55 | - $this->status( 'done' ); |
|
54 | + $this->execute($this->sql['address']); |
|
55 | + $this->status('done'); |
|
56 | 56 | } |
57 | 57 | else |
58 | 58 | { |
59 | - $this->status( 'OK' ); |
|
59 | + $this->status('OK'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | - $this->msg( 'Remove left over FOS user list records', 0 ); |
|
63 | + $this->msg('Remove left over FOS user list records', 0); |
|
64 | 64 | |
65 | - if( $this->schema->tableExists( 'fos_user' ) && $this->schema->tableExists( 'fos_user_list' ) ) |
|
65 | + if ($this->schema->tableExists('fos_user') && $this->schema->tableExists('fos_user_list')) |
|
66 | 66 | { |
67 | - $this->execute( $this->sql['list'] ); |
|
68 | - $this->status( 'done' ); |
|
67 | + $this->execute($this->sql['list']); |
|
68 | + $this->status('done'); |
|
69 | 69 | } |
70 | 70 | else |
71 | 71 | { |
72 | - $this->status( 'OK' ); |
|
72 | + $this->status('OK'); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $this->execute( $this->sql['address'] ); |
55 | 55 | $this->status( 'done' ); |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $this->status( 'OK' ); |
60 | 59 | } |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | { |
67 | 66 | $this->execute( $this->sql['list'] ); |
68 | 67 | $this->status( 'done' ); |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | $this->status( 'OK' ); |
73 | 71 | } |
@@ -8,222 +8,222 @@ |
||
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( 'superuser', 'smallint', array( 'default' => 0 ) ); |
|
17 | - $table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) ); |
|
18 | - $table->addColumn( 'username', 'string', array( 'length' => 180 ) ); |
|
19 | - $table->addColumn( 'username_canonical', 'string', array( 'length' => 180 ) ); |
|
20 | - $table->addColumn( 'email', 'string', array( 'length' => 180 ) ); |
|
21 | - $table->addColumn( 'email_canonical', 'string', array( 'length' => 180 ) ); |
|
22 | - $table->addColumn( 'enabled', 'boolean', [] ); |
|
23 | - $table->addColumn( 'salt', 'string', array( 'length' => 255, 'notnull' => false ) ); |
|
24 | - $table->addColumn( 'password', 'string', array( 'length' => 255 ) ); |
|
25 | - $table->addColumn( 'last_login', 'datetime', array( 'notnull' => false ) ); |
|
26 | - $table->addColumn( 'confirmation_token', 'string', array( 'length' => 180, 'notnull' => false ) ); |
|
27 | - $table->addColumn( 'password_requested_at', 'datetime', array( 'notnull' => false ) ); |
|
28 | - $table->addColumn( 'roles', 'text', array( 'length' => 0x7fffffff, 'comment' => '(DC2Type:array)' ) ); |
|
29 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
30 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
31 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
32 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
33 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
34 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
35 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
36 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
37 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
38 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
39 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
40 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
41 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
42 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
43 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
44 | - $table->addColumn( 'telefax', 'string', array( 'length' => 32 ) ); |
|
45 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
46 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
47 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
48 | - $table->addColumn( 'birthday', 'date', array( 'notnull' => false ) ); |
|
49 | - $table->addColumn( 'vdate', 'date', array( 'notnull' => false ) ); |
|
50 | - $table->addColumn( 'mtime', 'datetime', array( 'notnull' => false ) ); |
|
51 | - $table->addColumn( 'ctime', 'datetime', array( 'notnull' => false ) ); |
|
52 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
53 | - |
|
54 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosus_id' ); |
|
55 | - $table->addUniqueIndex( array( 'confirmation_token' ), 'unq_fosus_confirmtoken' ); |
|
56 | - $table->addUniqueIndex( array( 'username_canonical' ), 'unq_fosus_username' ); |
|
57 | - $table->addUniqueIndex( array( 'email_canonical' ), 'unq_fosus_email' ); |
|
58 | - $table->addIndex( array( 'langid' ), 'idx_fosus_langid' ); |
|
59 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosus_last_first' ); |
|
60 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_fosus_post_addr1' ); |
|
61 | - $table->addIndex( array( 'postal', 'city' ), 'idx_fosus_post_city' ); |
|
62 | - $table->addIndex( array( 'lastname' ), 'idx_fosus_lastname' ); |
|
63 | - $table->addIndex( array( 'address1' ), 'idx_fosus_address1' ); |
|
64 | - $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('superuser', 'smallint', array('default' => 0)); |
|
17 | + $table->addColumn('siteid', 'integer', array('notnull' => false)); |
|
18 | + $table->addColumn('username', 'string', array('length' => 180)); |
|
19 | + $table->addColumn('username_canonical', 'string', array('length' => 180)); |
|
20 | + $table->addColumn('email', 'string', array('length' => 180)); |
|
21 | + $table->addColumn('email_canonical', 'string', array('length' => 180)); |
|
22 | + $table->addColumn('enabled', 'boolean', []); |
|
23 | + $table->addColumn('salt', 'string', array('length' => 255, 'notnull' => false)); |
|
24 | + $table->addColumn('password', 'string', array('length' => 255)); |
|
25 | + $table->addColumn('last_login', 'datetime', array('notnull' => false)); |
|
26 | + $table->addColumn('confirmation_token', 'string', array('length' => 180, 'notnull' => false)); |
|
27 | + $table->addColumn('password_requested_at', 'datetime', array('notnull' => false)); |
|
28 | + $table->addColumn('roles', 'text', array('length' => 0x7fffffff, 'comment' => '(DC2Type:array)')); |
|
29 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
30 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
31 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
32 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
33 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
34 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
35 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
36 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
37 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
38 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
39 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
40 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
41 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
42 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
43 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
44 | + $table->addColumn('telefax', 'string', array('length' => 32)); |
|
45 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
46 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
47 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
48 | + $table->addColumn('birthday', 'date', array('notnull' => false)); |
|
49 | + $table->addColumn('vdate', 'date', array('notnull' => false)); |
|
50 | + $table->addColumn('mtime', 'datetime', array('notnull' => false)); |
|
51 | + $table->addColumn('ctime', 'datetime', array('notnull' => false)); |
|
52 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
53 | + |
|
54 | + $table->setPrimaryKey(array('id'), 'pk_fosus_id'); |
|
55 | + $table->addUniqueIndex(array('confirmation_token'), 'unq_fosus_confirmtoken'); |
|
56 | + $table->addUniqueIndex(array('username_canonical'), 'unq_fosus_username'); |
|
57 | + $table->addUniqueIndex(array('email_canonical'), 'unq_fosus_email'); |
|
58 | + $table->addIndex(array('langid'), 'idx_fosus_langid'); |
|
59 | + $table->addIndex(array('lastname', 'firstname'), 'idx_fosus_last_first'); |
|
60 | + $table->addIndex(array('postal', 'address1'), 'idx_fosus_post_addr1'); |
|
61 | + $table->addIndex(array('postal', 'city'), 'idx_fosus_post_city'); |
|
62 | + $table->addIndex(array('lastname'), 'idx_fosus_lastname'); |
|
63 | + $table->addIndex(array('address1'), 'idx_fosus_address1'); |
|
64 | + $table->addIndex(array('city'), 'idx_fosus_city'); |
|
65 | 65 | |
66 | 66 | return $schema; |
67 | 67 | }, |
68 | 68 | |
69 | - 'fos_user_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
70 | - |
|
71 | - $table = $schema->createTable( 'fos_user_address' ); |
|
72 | - |
|
73 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
74 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
75 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
76 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
77 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
78 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
79 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
80 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
81 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
82 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
83 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
84 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
85 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
86 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
87 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
88 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
89 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
90 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
91 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
92 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
93 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
94 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
95 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
96 | - $table->addColumn( 'flag', 'integer', [] ); |
|
97 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
98 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
99 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
100 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
101 | - |
|
102 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosad_id' ); |
|
103 | - $table->addIndex( array( 'parentid' ), 'idx_fosad_pid' ); |
|
104 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosad_last_first' ); |
|
105 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_fosad_post_addr1' ); |
|
106 | - $table->addIndex( array( 'postal', 'city' ), 'idx_fosad_post_city' ); |
|
107 | - $table->addIndex( array( 'address1' ), 'idx_fosad_address1' ); |
|
108 | - $table->addIndex( array( 'city' ), 'idx_fosad_city' ); |
|
109 | - $table->addIndex( array( 'email' ), 'idx_fosad_email' ); |
|
110 | - |
|
111 | - $table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ), |
|
112 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosad_pid' ); |
|
69 | + 'fos_user_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
70 | + |
|
71 | + $table = $schema->createTable('fos_user_address'); |
|
72 | + |
|
73 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
74 | + $table->addColumn('siteid', 'integer', []); |
|
75 | + $table->addColumn('parentid', 'integer', []); |
|
76 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
77 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
78 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
79 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
80 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
81 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
82 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
83 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
84 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
85 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
86 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
87 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
88 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
89 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
90 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
91 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
92 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
93 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
94 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
95 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
96 | + $table->addColumn('flag', 'integer', []); |
|
97 | + $table->addColumn('pos', 'smallint', []); |
|
98 | + $table->addColumn('mtime', 'datetime', []); |
|
99 | + $table->addColumn('ctime', 'datetime', []); |
|
100 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
101 | + |
|
102 | + $table->setPrimaryKey(array('id'), 'pk_fosad_id'); |
|
103 | + $table->addIndex(array('parentid'), 'idx_fosad_pid'); |
|
104 | + $table->addIndex(array('lastname', 'firstname'), 'idx_fosad_last_first'); |
|
105 | + $table->addIndex(array('postal', 'address1'), 'idx_fosad_post_addr1'); |
|
106 | + $table->addIndex(array('postal', 'city'), 'idx_fosad_post_city'); |
|
107 | + $table->addIndex(array('address1'), 'idx_fosad_address1'); |
|
108 | + $table->addIndex(array('city'), 'idx_fosad_city'); |
|
109 | + $table->addIndex(array('email'), 'idx_fosad_email'); |
|
110 | + |
|
111 | + $table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'), |
|
112 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosad_pid'); |
|
113 | 113 | |
114 | 114 | return $schema; |
115 | 115 | }, |
116 | 116 | |
117 | - 'fos_user_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
117 | + 'fos_user_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
118 | 118 | |
119 | - $table = $schema->createTable( 'fos_user_list_type' ); |
|
119 | + $table = $schema->createTable('fos_user_list_type'); |
|
120 | 120 | |
121 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
122 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
123 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
124 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
125 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
126 | - $table->addColumn( 'pos', 'integer', [] ); |
|
127 | - $table->addColumn( 'status', 'smallint', [] ); |
|
128 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
129 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
130 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
121 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
122 | + $table->addColumn('siteid', 'integer', []); |
|
123 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
124 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
125 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
126 | + $table->addColumn('pos', 'integer', []); |
|
127 | + $table->addColumn('status', 'smallint', []); |
|
128 | + $table->addColumn('mtime', 'datetime', []); |
|
129 | + $table->addColumn('ctime', 'datetime', []); |
|
130 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
131 | 131 | |
132 | - $table->setPrimaryKey( array( 'id' ), 'pk_foslity_id' ); |
|
133 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_foslity_sid_dom_code' ); |
|
134 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_foslity_sid_status_pos' ); |
|
135 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_foslity_sid_label' ); |
|
136 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_foslity_sid_code' ); |
|
132 | + $table->setPrimaryKey(array('id'), 'pk_foslity_id'); |
|
133 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_foslity_sid_dom_code'); |
|
134 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_foslity_sid_status_pos'); |
|
135 | + $table->addIndex(array('siteid', 'label'), 'idx_foslity_sid_label'); |
|
136 | + $table->addIndex(array('siteid', 'code'), 'idx_foslity_sid_code'); |
|
137 | 137 | |
138 | 138 | return $schema; |
139 | 139 | }, |
140 | 140 | |
141 | - 'fos_user_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
142 | - |
|
143 | - $table = $schema->createTable( 'fos_user_list' ); |
|
144 | - |
|
145 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
146 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
147 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
148 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
149 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
150 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
151 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
152 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
153 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
154 | - $table->addColumn( 'pos', 'integer', [] ); |
|
155 | - $table->addColumn( 'status', 'smallint', [] ); |
|
156 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
157 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
158 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
159 | - |
|
160 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosli_id' ); |
|
161 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_fosli_sid_dm_rid_tid_pid' ); |
|
162 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_fosli_sid_stat_start_end' ); |
|
163 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_fosli_pid_sid_rid_dom_tid' ); |
|
164 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_fosli_pid_sid_start' ); |
|
165 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_fosli_pid_sid_end' ); |
|
166 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_fosli_pid_sid_pos' ); |
|
167 | - |
|
168 | - $table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ), |
|
169 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_pid' ); |
|
170 | - |
|
171 | - $table->addForeignKeyConstraint( 'fos_user_list_type', array( 'typeid' ), array( 'id' ), |
|
172 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_typeid' ); |
|
141 | + 'fos_user_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
142 | + |
|
143 | + $table = $schema->createTable('fos_user_list'); |
|
144 | + |
|
145 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
146 | + $table->addColumn('parentid', 'integer', []); |
|
147 | + $table->addColumn('siteid', 'integer', []); |
|
148 | + $table->addColumn('typeid', 'integer', []); |
|
149 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
150 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
151 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
152 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
153 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
154 | + $table->addColumn('pos', 'integer', []); |
|
155 | + $table->addColumn('status', 'smallint', []); |
|
156 | + $table->addColumn('mtime', 'datetime', []); |
|
157 | + $table->addColumn('ctime', 'datetime', []); |
|
158 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
159 | + |
|
160 | + $table->setPrimaryKey(array('id'), 'pk_fosli_id'); |
|
161 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_fosli_sid_dm_rid_tid_pid'); |
|
162 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_fosli_sid_stat_start_end'); |
|
163 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_fosli_pid_sid_rid_dom_tid'); |
|
164 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_fosli_pid_sid_start'); |
|
165 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_fosli_pid_sid_end'); |
|
166 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_fosli_pid_sid_pos'); |
|
167 | + |
|
168 | + $table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'), |
|
169 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_pid'); |
|
170 | + |
|
171 | + $table->addForeignKeyConstraint('fos_user_list_type', array('typeid'), array('id'), |
|
172 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_typeid'); |
|
173 | 173 | |
174 | 174 | return $schema; |
175 | 175 | }, |
176 | 176 | |
177 | - 'fos_user_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
177 | + 'fos_user_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
178 | 178 | |
179 | - $table = $schema->createTable( 'fos_user_property_type' ); |
|
179 | + $table = $schema->createTable('fos_user_property_type'); |
|
180 | 180 | |
181 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
182 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
183 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
184 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
185 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
186 | - $table->addColumn( 'pos', 'integer', [] ); |
|
187 | - $table->addColumn( 'status', 'smallint', [] ); |
|
188 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
189 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
190 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
181 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
182 | + $table->addColumn('siteid', 'integer', []); |
|
183 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
184 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
185 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
186 | + $table->addColumn('pos', 'integer', []); |
|
187 | + $table->addColumn('status', 'smallint', []); |
|
188 | + $table->addColumn('mtime', 'datetime', []); |
|
189 | + $table->addColumn('ctime', 'datetime', []); |
|
190 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
191 | 191 | |
192 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosprty_id' ); |
|
193 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_fosprty_sid_dom_code' ); |
|
194 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_fosprty_sid_status_pos' ); |
|
195 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_fosprty_sid_label' ); |
|
196 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_fosprty_sid_code' ); |
|
192 | + $table->setPrimaryKey(array('id'), 'pk_fosprty_id'); |
|
193 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_fosprty_sid_dom_code'); |
|
194 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_fosprty_sid_status_pos'); |
|
195 | + $table->addIndex(array('siteid', 'label'), 'idx_fosprty_sid_label'); |
|
196 | + $table->addIndex(array('siteid', 'code'), 'idx_fosprty_sid_code'); |
|
197 | 197 | |
198 | 198 | return $schema; |
199 | 199 | }, |
200 | 200 | |
201 | - 'fos_user_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
201 | + 'fos_user_property' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
202 | 202 | |
203 | - $table = $schema->createTable( 'fos_user_property' ); |
|
203 | + $table = $schema->createTable('fos_user_property'); |
|
204 | 204 | |
205 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
206 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
207 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
208 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
209 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
210 | - $table->addColumn( 'value', 'string', array( 'length' => 255 ) ); |
|
211 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
212 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
213 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
205 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
206 | + $table->addColumn('siteid', 'integer', []); |
|
207 | + $table->addColumn('parentid', 'integer', []); |
|
208 | + $table->addColumn('typeid', 'integer', []); |
|
209 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
210 | + $table->addColumn('value', 'string', array('length' => 255)); |
|
211 | + $table->addColumn('mtime', 'datetime', []); |
|
212 | + $table->addColumn('ctime', 'datetime', []); |
|
213 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
214 | 214 | |
215 | - $table->setPrimaryKey( array( 'id' ), 'pk_fospr_id' ); |
|
216 | - $table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_fospr_sid_tid_lid_value' ); |
|
217 | - $table->addIndex( array( 'siteid', 'langid' ), 'idx_fospr_sid_langid' ); |
|
218 | - $table->addIndex( array( 'siteid', 'value' ), 'idx_fospr_sid_value' ); |
|
219 | - $table->addIndex( array( 'typeid' ), 'fk_fospr_typeid' ); |
|
220 | - $table->addIndex( array( 'parentid' ), 'fk_fospr_pid' ); |
|
215 | + $table->setPrimaryKey(array('id'), 'pk_fospr_id'); |
|
216 | + $table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_fospr_sid_tid_lid_value'); |
|
217 | + $table->addIndex(array('siteid', 'langid'), 'idx_fospr_sid_langid'); |
|
218 | + $table->addIndex(array('siteid', 'value'), 'idx_fospr_sid_value'); |
|
219 | + $table->addIndex(array('typeid'), 'fk_fospr_typeid'); |
|
220 | + $table->addIndex(array('parentid'), 'fk_fospr_pid'); |
|
221 | 221 | |
222 | - $table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ), |
|
223 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_pid' ); |
|
222 | + $table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'), |
|
223 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_pid'); |
|
224 | 224 | |
225 | - $table->addForeignKeyConstraint( 'fos_user_property_type', array( 'typeid' ), array( 'id' ), |
|
226 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fospr_typeid' ); |
|
225 | + $table->addForeignKeyConstraint('fos_user_property_type', array('typeid'), array('id'), |
|
226 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fospr_typeid'); |
|
227 | 227 | |
228 | 228 | return $schema; |
229 | 229 | }, |