@@ -4,17 +4,17 @@ |
||
4 | 4 | * Set error reporting to maximum |
5 | 5 | */ |
6 | 6 | error_reporting( -1 ); |
7 | -ini_set( 'display_errors', true ); |
|
7 | +ini_set('display_errors', true); |
|
8 | 8 | |
9 | -date_default_timezone_set( 'UTC' ); |
|
9 | +date_default_timezone_set('UTC'); |
|
10 | 10 | |
11 | 11 | /* |
12 | 12 | * Set locale settings to reasonable defaults |
13 | 13 | */ |
14 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
15 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
16 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
17 | -setlocale( LC_TIME, 'POSIX' ); |
|
14 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
15 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
16 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
17 | +setlocale(LC_TIME, 'POSIX'); |
|
18 | 18 | |
19 | 19 | |
20 | 20 | require_once 'TestHelper.php'; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getPostDependencies() |
46 | 46 | { |
47 | - return array( 'TablesCreateFosUser' ); |
|
47 | + return array('TablesCreateFosUser'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -53,23 +53,23 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function migrate() |
55 | 55 | { |
56 | - $this->msg( 'Adding indexes from "fos_user"', 0 ); $this->status( '' ); |
|
56 | + $this->msg('Adding indexes from "fos_user"', 0); $this->status(''); |
|
57 | 57 | |
58 | - $schema = $this->getSchema( 'db-customer' ); |
|
58 | + $schema = $this->getSchema('db-customer'); |
|
59 | 59 | |
60 | - foreach( $this->list as $idx => $stmt ) |
|
60 | + foreach ($this->list as $idx => $stmt) |
|
61 | 61 | { |
62 | - $this->msg( sprintf( 'Checking index "%1$s"', $idx ), 0 ); |
|
62 | + $this->msg(sprintf('Checking index "%1$s"', $idx), 0); |
|
63 | 63 | |
64 | - if( $schema->tableExists( 'fos_user' ) === true |
|
65 | - && $schema->indexExists( 'fos_user', $idx ) === false ) |
|
64 | + if ($schema->tableExists('fos_user') === true |
|
65 | + && $schema->indexExists('fos_user', $idx) === false) |
|
66 | 66 | { |
67 | - $this->execute( $stmt ); |
|
68 | - $this->status( 'done' ); |
|
67 | + $this->execute($stmt); |
|
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 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getPostDependencies() |
42 | 42 | { |
43 | - return array( 'TablesCreateFosUser' ); |
|
43 | + return array('TablesCreateFosUser'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function migrate() |
51 | 51 | { |
52 | - $this->process( $this->mysql ); |
|
52 | + $this->process($this->mysql); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | * |
59 | 59 | * array string $stmts List of SQL statements for changing the columns |
60 | 60 | */ |
61 | - protected function process( array $stmts ) |
|
61 | + protected function process(array $stmts) |
|
62 | 62 | { |
63 | 63 | $table = 'fos_user_address'; |
64 | - $this->msg( sprintf( 'Rename "refid" to "parentid" in table "%1$s"', $table ), 0 ); $this->status( '' ); |
|
64 | + $this->msg(sprintf('Rename "refid" to "parentid" in table "%1$s"', $table), 0); $this->status(''); |
|
65 | 65 | |
66 | - foreach( $stmts as $column => $stmts ) |
|
66 | + foreach ($stmts as $column => $stmts) |
|
67 | 67 | { |
68 | - $this->msg( sprintf( 'Checking column "%1$s"', $column ), 1 ); |
|
68 | + $this->msg(sprintf('Checking column "%1$s"', $column), 1); |
|
69 | 69 | |
70 | - if( $this->schema->tableExists( $table ) |
|
71 | - && $this->schema->columnExists( $table, $column ) === true |
|
70 | + if ($this->schema->tableExists($table) |
|
71 | + && $this->schema->columnExists($table, $column) === true |
|
72 | 72 | ) { |
73 | - $this->executeList( $stmts ); |
|
74 | - $this->status( 'done' ); |
|
73 | + $this->executeList($stmts); |
|
74 | + $this->status('done'); |
|
75 | 75 | } else { |
76 | - $this->status( 'OK' ); |
|
76 | + $this->status('OK'); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
@@ -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 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'label' => 'Customer address ID', |
26 | 26 | 'code' => 'customer.address.id', |
27 | 27 | 'internalcode' => 'fosad."id"', |
28 | - 'internaldeps' => array( 'LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )' ), |
|
28 | + 'internaldeps' => array('LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )'), |
|
29 | 29 | 'type' => 'integer', |
30 | 30 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
31 | 31 | 'public' => false, |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @param array $siteids List of IDs for sites whose entries should be deleted |
224 | 224 | */ |
225 | - public function cleanup( array $siteids ) |
|
225 | + public function cleanup(array $siteids) |
|
226 | 226 | { |
227 | 227 | $path = 'mshop/customer/manager/address/submanagers'; |
228 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
229 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
228 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
229 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
230 | 230 | } |
231 | 231 | |
232 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/lists/fosuser/delete' ); |
|
232 | + $this->cleanupBase($siteids, 'mshop/customer/manager/lists/fosuser/delete'); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | * @param boolean $withsub Return also attributes of sub-managers if true |
240 | 240 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
241 | 241 | */ |
242 | - public function getSearchAttributes( $withsub = true ) |
|
242 | + public function getSearchAttributes($withsub = true) |
|
243 | 243 | { |
244 | 244 | $path = 'mshop/customer/manager/address/submanagers'; |
245 | 245 | |
246 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
246 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
@@ -254,9 +254,9 @@ discard block |
||
254 | 254 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
255 | 255 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
256 | 256 | */ |
257 | - public function getSubManager( $manager, $name = null ) |
|
257 | + public function getSubManager($manager, $name = null) |
|
258 | 258 | { |
259 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'FosUser' : $name ) ); |
|
259 | + return $this->getSubManagerBase('customer', 'address/' . $manager, ($name === null ? 'FosUser' : $name)); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getPreDependencies() |
24 | 24 | { |
25 | - return array( 'TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData', 'TextAddTestData' ); |
|
25 | + return array('TablesCreateFosUser', 'CustomerAddFosUserTestData', 'LocaleAddTestData', 'TextAddTestData'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function migrate() |
33 | 33 | { |
34 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional ); |
|
34 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional); |
|
35 | 35 | |
36 | - $this->msg( 'Adding customer-list Fos user bundle test data', 0 ); |
|
37 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
36 | + $this->msg('Adding customer-list Fos user bundle test data', 0); |
|
37 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
38 | 38 | |
39 | 39 | $ds = DIRECTORY_SEPARATOR; |
40 | - $path = dirname( __FILE__ ) . $ds . 'data' . $ds . 'customer-list.php'; |
|
40 | + $path = dirname(__FILE__) . $ds . 'data' . $ds . 'customer-list.php'; |
|
41 | 41 | |
42 | - if( ( $testdata = include( $path ) ) === false ){ |
|
43 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer list domain', $path ) ); |
|
42 | + if (($testdata = include($path)) === false) { |
|
43 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer list domain', $path)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $refKeys = []; |
47 | - foreach( $testdata['customer/lists'] as $dataset ) { |
|
48 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
47 | + foreach ($testdata['customer/lists'] as $dataset) { |
|
48 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $refIds = []; |
52 | - $refIds['text'] = $this->getTextData( $refKeys['text'] ); |
|
53 | - $this->addCustomerListData( $testdata, $refIds, 'FosUser' ); |
|
52 | + $refIds['text'] = $this->getTextData($refKeys['text']); |
|
53 | + $this->addCustomerListData($testdata, $refIds, 'FosUser'); |
|
54 | 54 | |
55 | - $this->status( 'done' ); |
|
55 | + $this->status('done'); |
|
56 | 56 | } |
57 | 57 | } |
@@ -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 | |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function migrate() |
34 | 34 | { |
35 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional ); |
|
35 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\MShop\\Context\\Item\\Iface', $this->additional); |
|
36 | 36 | |
37 | - $this->msg( 'Adding customer property Fos user bundle test data', 0 ); |
|
38 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
37 | + $this->msg('Adding customer property Fos user bundle test data', 0); |
|
38 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
39 | 39 | |
40 | 40 | $ds = DIRECTORY_SEPARATOR; |
41 | 41 | $path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php'; |
42 | 42 | |
43 | - if( ( $testdata = include( $path ) ) == false ) { |
|
44 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
43 | + if (($testdata = include($path)) == false) { |
|
44 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
45 | 45 | } |
46 | 46 | |
47 | - $this->addCustomerPropertyData( $testdata, 'FosUser' ); |
|
47 | + $this->addCustomerPropertyData($testdata, 'FosUser'); |
|
48 | 48 | |
49 | - $this->status( 'done' ); |
|
49 | + $this->status('done'); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | \ No newline at end of file |
@@ -5,17 +5,17 @@ |
||
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 | ); |
@@ -23,18 +23,18 @@ discard block |
||
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 |
||
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 |
||
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::class, $resultSaved ); |
|
191 | - $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $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::class, $resultSaved); |
|
191 | + $this->assertInstanceOf(\Aimeos\MShop\Common\Item\Iface::class, $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 |
||
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 |
||
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 | } |