@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2014-2016 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'customer/lists/type' => array ( |
|
10 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
8 | +return array( |
|
9 | + 'customer/lists/type' => array( |
|
10 | + 'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
11 | 11 | ), |
12 | 12 | |
13 | - 'customer/lists' => array ( |
|
14 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
|
15 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1 ), |
|
16 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1 ), |
|
17 | - array( 'parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ), |
|
13 | + 'customer/lists' => array( |
|
14 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1), |
|
15 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1), |
|
16 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1), |
|
17 | + array('parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1), |
|
18 | 18 | ), |
19 | 19 | ); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPreDependencies() |
23 | 23 | { |
24 | - return array( 'TablesCreateFosUser' ); |
|
24 | + return array('TablesCreateFosUser'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -31,38 +31,38 @@ discard block |
||
31 | 31 | public function migrate() |
32 | 32 | { |
33 | 33 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
34 | - if( !( $this->additional instanceof $iface ) ) { |
|
35 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
34 | + if (!($this->additional instanceof $iface)) { |
|
35 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
36 | 36 | } |
37 | 37 | |
38 | - $this->msg( 'Adding Fos user bundle customer test data', 0 ); |
|
38 | + $this->msg('Adding Fos user bundle customer test data', 0); |
|
39 | 39 | |
40 | 40 | $parentIds = []; |
41 | 41 | $ds = DIRECTORY_SEPARATOR; |
42 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
42 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
43 | 43 | $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
44 | 44 | |
45 | - if( ( $testdata = include( $path ) ) === false ){ |
|
46 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
45 | + if (($testdata = include($path)) === false) { |
|
46 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $this->additional, 'FosUser' ); |
|
51 | - $customerAddressManager = $customerManager->getSubManager( 'address', 'FosUser' ); |
|
50 | + $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->additional, 'FosUser'); |
|
51 | + $customerAddressManager = $customerManager->getSubManager('address', 'FosUser'); |
|
52 | 52 | |
53 | 53 | $search = $customerManager->createSearch(); |
54 | - $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) ); |
|
55 | - $items = $customerManager->searchItems( $search ); |
|
54 | + $search->setConditions($search->compare('==', 'customer.code', array('UTC001', 'UTC002', 'UTC003'))); |
|
55 | + $items = $customerManager->searchItems($search); |
|
56 | 56 | |
57 | 57 | $this->conn->begin(); |
58 | 58 | |
59 | - $customerManager->deleteItems( array_keys( $items ) ); |
|
60 | - $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
61 | - $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
59 | + $customerManager->deleteItems(array_keys($items)); |
|
60 | + $parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem()); |
|
61 | + $this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds); |
|
62 | 62 | |
63 | 63 | $this->conn->commit(); |
64 | 64 | |
65 | 65 | |
66 | - $this->status( 'done' ); |
|
66 | + $this->status('done'); |
|
67 | 67 | } |
68 | 68 | } |
@@ -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 | |
@@ -32,29 +32,29 @@ discard block |
||
32 | 32 | public function migrate() |
33 | 33 | { |
34 | 34 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
35 | - if( !( $this->additional instanceof $iface ) ) { |
|
36 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
35 | + if (!($this->additional instanceof $iface)) { |
|
36 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
37 | 37 | } |
38 | 38 | |
39 | - $this->msg( 'Adding customer-list Fos user bundle test data', 0 ); |
|
40 | - $this->additional->setEditor( 'ai-fosuser:unittest' ); |
|
39 | + $this->msg('Adding customer-list Fos user bundle test data', 0); |
|
40 | + $this->additional->setEditor('ai-fosuser:unittest'); |
|
41 | 41 | |
42 | 42 | $ds = DIRECTORY_SEPARATOR; |
43 | - $path = dirname( __FILE__ ) . $ds . 'data' . $ds . 'customer-list.php'; |
|
43 | + $path = dirname(__FILE__) . $ds . 'data' . $ds . 'customer-list.php'; |
|
44 | 44 | |
45 | - if( ( $testdata = include( $path ) ) === false ){ |
|
46 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer list domain', $path ) ); |
|
45 | + if (($testdata = include($path)) === false) { |
|
46 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer list domain', $path)); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $refKeys = []; |
50 | - foreach( $testdata['customer/lists'] as $dataset ) { |
|
51 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
50 | + foreach ($testdata['customer/lists'] as $dataset) { |
|
51 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $refIds = []; |
55 | - $refIds['text'] = $this->getTextData( $refKeys['text'] ); |
|
56 | - $this->addCustomerListData( $testdata, $refIds, 'FosUser' ); |
|
55 | + $refIds['text'] = $this->getTextData($refKeys['text']); |
|
56 | + $this->addCustomerListData($testdata, $refIds, 'FosUser'); |
|
57 | 57 | |
58 | - $this->status( 'done' ); |
|
58 | + $this->status('done'); |
|
59 | 59 | } |
60 | 60 | } |
@@ -8,169 +8,169 @@ |
||
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( 'username', 'string', array( 'length' => 255 ) ); |
|
17 | - $table->addColumn( 'username_canonical', 'string', array( 'length' => 255 ) ); |
|
18 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
19 | - $table->addColumn( 'email_canonical', 'string', array( 'length' => 255 ) ); |
|
20 | - $table->addColumn( 'enabled', 'smallint', [] ); |
|
21 | - $table->addColumn( 'salt', 'string', array( 'length' => 255 ) ); |
|
22 | - $table->addColumn( 'password', 'string', array( 'length' => 255 ) ); |
|
23 | - $table->addColumn( 'last_login', 'datetime', array( 'notnull' => false ) ); |
|
24 | - $table->addColumn( 'locked', 'smallint', [] ); |
|
25 | - $table->addColumn( 'expired', 'smallint', [] ); |
|
26 | - $table->addColumn( 'expires_at', 'datetime', array( 'notnull' => false ) ); |
|
27 | - $table->addColumn( 'confirmation_token', 'string', array( 'length' => 255, 'notnull' => false ) ); |
|
28 | - $table->addColumn( 'password_requested_at', 'datetime', array( 'notnull' => false ) ); |
|
29 | - $table->addColumn( 'roles', 'text', array( 'length' => 0x7fffffff, 'comment' => '(DC2Type:array)' ) ); |
|
30 | - $table->addColumn( 'credentials_expired', 'smallint', [] ); |
|
31 | - $table->addColumn( 'credentials_expire_at', 'datetime', array( 'notnull' => false ) ); |
|
32 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8, 'default' => '' ) ); |
|
33 | - $table->addColumn( 'company', 'string', array( 'length' => 100, 'default' => '' ) ); |
|
34 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
35 | - $table->addColumn( 'title', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
36 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
37 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
38 | - $table->addColumn( 'address1', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
39 | - $table->addColumn( 'address2', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
40 | - $table->addColumn( 'address3', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
41 | - $table->addColumn( 'postal', 'string', array( 'length' => 16, 'default' => '' ) ); |
|
42 | - $table->addColumn( 'city', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
43 | - $table->addColumn( 'state', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
44 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
45 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
46 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
47 | - $table->addColumn( 'telefax', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
48 | - $table->addColumn( 'website', 'string', array( 'length' => 255, 'default' => '' ) ); |
|
49 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
50 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
51 | - $table->addColumn( 'birthday', 'date', array( 'notnull' => false ) ); |
|
52 | - $table->addColumn( 'vdate', 'date', array( 'notnull' => false ) ); |
|
53 | - $table->addColumn( 'mtime', 'datetime', array( 'notnull' => false ) ); |
|
54 | - $table->addColumn( 'ctime', 'datetime', array( 'notnull' => false ) ); |
|
55 | - $table->addColumn( 'editor', 'string', array('length' => 255, 'default' => '' ) ); |
|
56 | - |
|
57 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosus_id' ); |
|
58 | - $table->addUniqueIndex( array( 'username_canonical' ), 'unq_fosus_username' ); |
|
59 | - $table->addUniqueIndex( array( 'email_canonical' ), 'unq_fosus_email' ); |
|
60 | - $table->addIndex( array( 'langid' ), 'idx_fosus_langid' ); |
|
61 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosus_last_first' ); |
|
62 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_fosus_post_addr1' ); |
|
63 | - $table->addIndex( array( 'postal', 'city' ), 'idx_fosus_post_city' ); |
|
64 | - $table->addIndex( array( 'lastname' ), 'idx_fosus_lastname' ); |
|
65 | - $table->addIndex( array( 'address1' ), 'idx_fosus_address1' ); |
|
66 | - $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('username', 'string', array('length' => 255)); |
|
17 | + $table->addColumn('username_canonical', 'string', array('length' => 255)); |
|
18 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
19 | + $table->addColumn('email_canonical', 'string', array('length' => 255)); |
|
20 | + $table->addColumn('enabled', 'smallint', []); |
|
21 | + $table->addColumn('salt', 'string', array('length' => 255)); |
|
22 | + $table->addColumn('password', 'string', array('length' => 255)); |
|
23 | + $table->addColumn('last_login', 'datetime', array('notnull' => false)); |
|
24 | + $table->addColumn('locked', 'smallint', []); |
|
25 | + $table->addColumn('expired', 'smallint', []); |
|
26 | + $table->addColumn('expires_at', 'datetime', array('notnull' => false)); |
|
27 | + $table->addColumn('confirmation_token', 'string', array('length' => 255, 'notnull' => false)); |
|
28 | + $table->addColumn('password_requested_at', 'datetime', array('notnull' => false)); |
|
29 | + $table->addColumn('roles', 'text', array('length' => 0x7fffffff, 'comment' => '(DC2Type:array)')); |
|
30 | + $table->addColumn('credentials_expired', 'smallint', []); |
|
31 | + $table->addColumn('credentials_expire_at', 'datetime', array('notnull' => false)); |
|
32 | + $table->addColumn('salutation', 'string', array('length' => 8, 'default' => '')); |
|
33 | + $table->addColumn('company', 'string', array('length' => 100, 'default' => '')); |
|
34 | + $table->addColumn('vatid', 'string', array('length' => 32, 'default' => '')); |
|
35 | + $table->addColumn('title', 'string', array('length' => 64, 'default' => '')); |
|
36 | + $table->addColumn('firstname', 'string', array('length' => 64, 'default' => '')); |
|
37 | + $table->addColumn('lastname', 'string', array('length' => 64, 'default' => '')); |
|
38 | + $table->addColumn('address1', 'string', array('length' => 200, 'default' => '')); |
|
39 | + $table->addColumn('address2', 'string', array('length' => 200, 'default' => '')); |
|
40 | + $table->addColumn('address3', 'string', array('length' => 200, 'default' => '')); |
|
41 | + $table->addColumn('postal', 'string', array('length' => 16, 'default' => '')); |
|
42 | + $table->addColumn('city', 'string', array('length' => 200, 'default' => '')); |
|
43 | + $table->addColumn('state', 'string', array('length' => 200, 'default' => '')); |
|
44 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
45 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
46 | + $table->addColumn('telephone', 'string', array('length' => 32, 'default' => '')); |
|
47 | + $table->addColumn('telefax', 'string', array('length' => 32, 'default' => '')); |
|
48 | + $table->addColumn('website', 'string', array('length' => 255, 'default' => '')); |
|
49 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
50 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
51 | + $table->addColumn('birthday', 'date', array('notnull' => false)); |
|
52 | + $table->addColumn('vdate', 'date', array('notnull' => false)); |
|
53 | + $table->addColumn('mtime', 'datetime', array('notnull' => false)); |
|
54 | + $table->addColumn('ctime', 'datetime', array('notnull' => false)); |
|
55 | + $table->addColumn('editor', 'string', array('length' => 255, 'default' => '')); |
|
56 | + |
|
57 | + $table->setPrimaryKey(array('id'), 'pk_fosus_id'); |
|
58 | + $table->addUniqueIndex(array('username_canonical'), 'unq_fosus_username'); |
|
59 | + $table->addUniqueIndex(array('email_canonical'), 'unq_fosus_email'); |
|
60 | + $table->addIndex(array('langid'), 'idx_fosus_langid'); |
|
61 | + $table->addIndex(array('lastname', 'firstname'), 'idx_fosus_last_first'); |
|
62 | + $table->addIndex(array('postal', 'address1'), 'idx_fosus_post_addr1'); |
|
63 | + $table->addIndex(array('postal', 'city'), 'idx_fosus_post_city'); |
|
64 | + $table->addIndex(array('lastname'), 'idx_fosus_lastname'); |
|
65 | + $table->addIndex(array('address1'), 'idx_fosus_address1'); |
|
66 | + $table->addIndex(array('city'), 'idx_fosus_city'); |
|
67 | 67 | |
68 | 68 | return $schema; |
69 | 69 | }, |
70 | 70 | |
71 | - 'fos_user_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
72 | - |
|
73 | - $table = $schema->createTable( 'fos_user_address' ); |
|
74 | - |
|
75 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
76 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
77 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
78 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
79 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
81 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
82 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
83 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
84 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
85 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
86 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
87 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
88 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
89 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
90 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
91 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
92 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
93 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
94 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
95 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
96 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
97 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
98 | - $table->addColumn( 'flag', 'integer', [] ); |
|
99 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
100 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
101 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
102 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
103 | - |
|
104 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosad_id' ); |
|
105 | - $table->addIndex( array( 'parentid' ), 'idx_fosad_pid' ); |
|
106 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_fosad_last_first' ); |
|
107 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_fosad_post_addr1' ); |
|
108 | - $table->addIndex( array( 'postal', 'city' ), 'idx_fosad_post_city' ); |
|
109 | - $table->addIndex( array( 'address1' ), 'idx_fosad_address1' ); |
|
110 | - $table->addIndex( array( 'city' ), 'idx_fosad_city' ); |
|
111 | - $table->addIndex( array( 'email' ), 'idx_fosad_email' ); |
|
112 | - |
|
113 | - $table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ), |
|
114 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosad_pid' ); |
|
71 | + 'fos_user_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
72 | + |
|
73 | + $table = $schema->createTable('fos_user_address'); |
|
74 | + |
|
75 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
76 | + $table->addColumn('siteid', 'integer', []); |
|
77 | + $table->addColumn('parentid', 'integer', []); |
|
78 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
79 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
80 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
81 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
82 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
83 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
84 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
85 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
86 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
87 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
88 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
89 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
90 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
91 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
92 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
93 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
94 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
95 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
96 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
97 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
98 | + $table->addColumn('flag', 'integer', []); |
|
99 | + $table->addColumn('pos', 'smallint', []); |
|
100 | + $table->addColumn('mtime', 'datetime', []); |
|
101 | + $table->addColumn('ctime', 'datetime', []); |
|
102 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
103 | + |
|
104 | + $table->setPrimaryKey(array('id'), 'pk_fosad_id'); |
|
105 | + $table->addIndex(array('parentid'), 'idx_fosad_pid'); |
|
106 | + $table->addIndex(array('lastname', 'firstname'), 'idx_fosad_last_first'); |
|
107 | + $table->addIndex(array('postal', 'address1'), 'idx_fosad_post_addr1'); |
|
108 | + $table->addIndex(array('postal', 'city'), 'idx_fosad_post_city'); |
|
109 | + $table->addIndex(array('address1'), 'idx_fosad_address1'); |
|
110 | + $table->addIndex(array('city'), 'idx_fosad_city'); |
|
111 | + $table->addIndex(array('email'), 'idx_fosad_email'); |
|
112 | + |
|
113 | + $table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'), |
|
114 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosad_pid'); |
|
115 | 115 | |
116 | 116 | return $schema; |
117 | 117 | }, |
118 | 118 | |
119 | - 'fos_user_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
119 | + 'fos_user_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
120 | 120 | |
121 | - $table = $schema->createTable( 'fos_user_list_type' ); |
|
121 | + $table = $schema->createTable('fos_user_list_type'); |
|
122 | 122 | |
123 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
124 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
125 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
126 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
127 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
128 | - $table->addColumn( 'status', 'smallint', [] ); |
|
129 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
130 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
131 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
123 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
124 | + $table->addColumn('siteid', 'integer', []); |
|
125 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
126 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
127 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
128 | + $table->addColumn('status', 'smallint', []); |
|
129 | + $table->addColumn('mtime', 'datetime', []); |
|
130 | + $table->addColumn('ctime', 'datetime', []); |
|
131 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
132 | 132 | |
133 | - $table->setPrimaryKey( array( 'id' ), 'pk_foslity_id' ); |
|
134 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_foslity_sid_dom_code' ); |
|
135 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_foslity_sid_status' ); |
|
136 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_foslity_sid_label' ); |
|
137 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_foslity_sid_code' ); |
|
133 | + $table->setPrimaryKey(array('id'), 'pk_foslity_id'); |
|
134 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_foslity_sid_dom_code'); |
|
135 | + $table->addIndex(array('siteid', 'status'), 'idx_foslity_sid_status'); |
|
136 | + $table->addIndex(array('siteid', 'label'), 'idx_foslity_sid_label'); |
|
137 | + $table->addIndex(array('siteid', 'code'), 'idx_foslity_sid_code'); |
|
138 | 138 | |
139 | 139 | return $schema; |
140 | 140 | }, |
141 | 141 | |
142 | - 'fos_user_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
143 | - |
|
144 | - $table = $schema->createTable( 'fos_user_list' ); |
|
145 | - |
|
146 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
147 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
148 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
149 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
150 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
151 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
152 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
153 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
154 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
155 | - $table->addColumn( 'pos', 'integer', [] ); |
|
156 | - $table->addColumn( 'status', 'smallint', [] ); |
|
157 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
158 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
159 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
160 | - |
|
161 | - $table->setPrimaryKey( array( 'id' ), 'pk_fosli_id' ); |
|
162 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_fosli_sid_dm_rid_tid_pid' ); |
|
163 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_fosli_sid_stat_start_end' ); |
|
164 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_fosli_pid_sid_rid_dom_tid' ); |
|
165 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_fosli_pid_sid_start' ); |
|
166 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_fosli_pid_sid_end' ); |
|
167 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_fosli_pid_sid_pos' ); |
|
168 | - |
|
169 | - $table->addForeignKeyConstraint( 'fos_user', array( 'parentid' ), array( 'id' ), |
|
170 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_pid' ); |
|
171 | - |
|
172 | - $table->addForeignKeyConstraint( 'fos_user_list_type', array( 'typeid' ), array( 'id' ), |
|
173 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_fosli_typeid' ); |
|
142 | + 'fos_user_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
143 | + |
|
144 | + $table = $schema->createTable('fos_user_list'); |
|
145 | + |
|
146 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
147 | + $table->addColumn('parentid', 'integer', []); |
|
148 | + $table->addColumn('siteid', 'integer', []); |
|
149 | + $table->addColumn('typeid', 'integer', []); |
|
150 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
151 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
152 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
153 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
154 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
155 | + $table->addColumn('pos', 'integer', []); |
|
156 | + $table->addColumn('status', 'smallint', []); |
|
157 | + $table->addColumn('mtime', 'datetime', []); |
|
158 | + $table->addColumn('ctime', 'datetime', []); |
|
159 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
160 | + |
|
161 | + $table->setPrimaryKey(array('id'), 'pk_fosli_id'); |
|
162 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_fosli_sid_dm_rid_tid_pid'); |
|
163 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_fosli_sid_stat_start_end'); |
|
164 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_fosli_pid_sid_rid_dom_tid'); |
|
165 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_fosli_pid_sid_start'); |
|
166 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_fosli_pid_sid_end'); |
|
167 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_fosli_pid_sid_pos'); |
|
168 | + |
|
169 | + $table->addForeignKeyConstraint('fos_user', array('parentid'), array('id'), |
|
170 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_pid'); |
|
171 | + |
|
172 | + $table->addForeignKeyConstraint('fos_user_list_type', array('typeid'), array('id'), |
|
173 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_fosli_typeid'); |
|
174 | 174 | |
175 | 175 | return $schema; |
176 | 176 | }, |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'label' => 'Customer address ID', |
27 | 27 | 'code' => 'customer.address.id', |
28 | 28 | 'internalcode' => 'fosad."id"', |
29 | - 'internaldeps' => array( 'LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )' ), |
|
29 | + 'internaldeps' => array('LEFT JOIN "fos_user_address" AS fosad ON ( fos."id" = fosad."parentid" )'), |
|
30 | 30 | 'type' => 'integer', |
31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
32 | 32 | 'public' => false, |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @param array $siteids List of IDs for sites whose entries should be deleted |
225 | 225 | */ |
226 | - public function cleanup( array $siteids ) |
|
226 | + public function cleanup(array $siteids) |
|
227 | 227 | { |
228 | 228 | $path = 'mshop/customer/manager/address/submanagers'; |
229 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
230 | - $this->getSubManager( $domain )->cleanup( $siteids ); |
|
229 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
230 | + $this->getSubManager($domain)->cleanup($siteids); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
@@ -237,10 +237,10 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @param array $ids List of IDs |
239 | 239 | */ |
240 | - public function deleteItems( array $ids ) |
|
240 | + public function deleteItems(array $ids) |
|
241 | 241 | { |
242 | 242 | $path = 'mshop/customer/manager/address/fosuser/delete'; |
243 | - $this->deleteItemsBase( $ids, $path, false ); |
|
243 | + $this->deleteItemsBase($ids, $path, false); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | |
@@ -250,11 +250,11 @@ discard block |
||
250 | 250 | * @param boolean $withsub Return also attributes of sub-managers if true |
251 | 251 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
252 | 252 | */ |
253 | - public function getSearchAttributes( $withsub = true ) |
|
253 | + public function getSearchAttributes($withsub = true) |
|
254 | 254 | { |
255 | 255 | $path = 'mshop/customer/manager/address/submanagers'; |
256 | 256 | |
257 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
257 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
266 | 266 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
267 | 267 | */ |
268 | - public function getSubManager( $manager, $name = null ) |
|
268 | + public function getSubManager($manager, $name = null) |
|
269 | 269 | { |
270 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'FosUser' : $name ) ); |
|
270 | + return $this->getSubManagerBase('customer', 'address/' . $manager, ($name === null ? 'FosUser' : $name)); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'customer.lists.type.id' => array( |
26 | 26 | 'code'=>'customer.lists.type.id', |
27 | 27 | 'internalcode'=>'foslity."id"', |
28 | - 'internaldeps'=>array( 'LEFT JOIN "fos_user_list_type" AS foslity ON ( fosli."typeid" = foslity."id" )' ), |
|
28 | + 'internaldeps'=>array('LEFT JOIN "fos_user_list_type" AS foslity ON ( fosli."typeid" = foslity."id" )'), |
|
29 | 29 | 'label'=>'Customer list type ID', |
30 | 30 | 'type'=> 'integer', |
31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param array $siteids List of IDs for sites whose entries should be deleted |
98 | 98 | */ |
99 | - public function cleanup( array $siteids ) |
|
99 | + public function cleanup(array $siteids) |
|
100 | 100 | { |
101 | 101 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
102 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
103 | - $this->getSubManager( $domain )->cleanup( $siteids ); |
|
102 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
103 | + $this->getSubManager($domain)->cleanup($siteids); |
|
104 | 104 | } |
105 | 105 | |
106 | - $this->cleanupBase( $siteids, 'mshop/customer/manager/lists/type/fosuser/delete' ); |
|
106 | + $this->cleanupBase($siteids, 'mshop/customer/manager/lists/type/fosuser/delete'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | * @param boolean $withsub Return also attributes of sub-managers if true |
114 | 114 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
115 | 115 | */ |
116 | - public function getSearchAttributes( $withsub = true ) |
|
116 | + public function getSearchAttributes($withsub = true) |
|
117 | 117 | { |
118 | 118 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
119 | 119 | |
120 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); |
|
120 | + return $this->getSearchAttributesBase($this->searchConfig, $path, [], $withsub); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
129 | 129 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
130 | 130 | */ |
131 | - public function getSubManager( $manager, $name = null ) |
|
131 | + public function getSubManager($manager, $name = null) |
|
132 | 132 | { |
133 | - return $this->getSubManagerBase( 'customer', 'lists/type/' . $manager, ( $name === null ? 'FosUser' : $name ) ); |
|
133 | + return $this->getSubManagerBase('customer', 'lists/type/' . $manager, ($name === null ? 'FosUser' : $name)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $includepaths = $aimeos->getIncludePaths(); |
20 | 20 | $includepaths[] = get_include_path(); |
21 | - set_include_path( implode( PATH_SEPARATOR, $includepaths ) ); |
|
21 | + set_include_path(implode(PATH_SEPARATOR, $includepaths)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | - public static function getContext( $site = 'unittest' ) |
|
25 | + public static function getContext($site = 'unittest') |
|
26 | 26 | { |
27 | - if( !isset( self::$context[$site] ) ) { |
|
28 | - self::$context[$site] = self::createContext( $site ); |
|
27 | + if (!isset(self::$context[$site])) { |
|
28 | + self::$context[$site] = self::createContext($site); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return clone self::$context[$site]; |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | private static function getAimeos() |
36 | 36 | { |
37 | - if( !isset( self::$aimeos ) ) |
|
37 | + if (!isset(self::$aimeos)) |
|
38 | 38 | { |
39 | 39 | require_once 'Bootstrap.php'; |
40 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
40 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
41 | 41 | |
42 | - $extdir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
43 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
42 | + $extdir = dirname(dirname(dirname(__DIR__))); |
|
43 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return self::$aimeos; |
@@ -50,45 +50,45 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @param string $site |
52 | 52 | */ |
53 | - private static function createContext( $site ) |
|
53 | + private static function createContext($site) |
|
54 | 54 | { |
55 | 55 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
56 | 56 | $aimeos = self::getAimeos(); |
57 | 57 | |
58 | 58 | |
59 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
59 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
60 | 60 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
61 | 61 | |
62 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $paths ); |
|
63 | - $ctx->setConfig( $conf ); |
|
62 | + $conf = new \Aimeos\MW\Config\PHPArray([], $paths); |
|
63 | + $ctx->setConfig($conf); |
|
64 | 64 | |
65 | 65 | |
66 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
67 | - $ctx->setDatabaseManager( $dbm ); |
|
66 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
67 | + $ctx->setDatabaseManager($dbm); |
|
68 | 68 | |
69 | 69 | |
70 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
71 | - $ctx->setLogger( $logger ); |
|
70 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
71 | + $ctx->setLogger($logger); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | $cache = new \Aimeos\MW\Cache\None(); |
75 | - $ctx->setCache( $cache ); |
|
75 | + $ctx->setCache($cache); |
|
76 | 76 | |
77 | 77 | |
78 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
79 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
78 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
79 | + $ctx->setI18n(array('de' => $i18n)); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | $session = new \Aimeos\MW\Session\None(); |
83 | - $ctx->setSession( $session ); |
|
83 | + $ctx->setSession($session); |
|
84 | 84 | |
85 | 85 | |
86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
87 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
87 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
88 | 88 | |
89 | - $ctx->setLocale( $localeItem ); |
|
89 | + $ctx->setLocale($localeItem); |
|
90 | 90 | |
91 | - $ctx->setEditor( 'ai-fosuser:unittest' ); |
|
91 | + $ctx->setEditor('ai-fosuser:unittest'); |
|
92 | 92 | |
93 | 93 | return $ctx; |
94 | 94 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | 'customer.address.position' => 1, |
23 | 23 | ); |
24 | 24 | |
25 | - $this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.', $addressValues ); |
|
25 | + $this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.', $addressValues); |
|
26 | 26 | |
27 | 27 | $values = array( |
28 | 28 | 'customer.id' => 541, |
@@ -54,71 +54,71 @@ discard block |
||
54 | 54 | 'customer.mtime'=> '2010-01-05 00:00:05', |
55 | 55 | 'customer.ctime'=> '2010-01-01 00:00:00', |
56 | 56 | 'customer.editor' => 'unitTestUser', |
57 | - 'roles' => array( 'ROLE_ADMIN' ), |
|
57 | + 'roles' => array('ROLE_ADMIN'), |
|
58 | 58 | 'salt' => 'test', |
59 | 59 | ); |
60 | 60 | |
61 | - $this->object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, $values ); |
|
61 | + $this->object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, $values); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | protected function tearDown() |
65 | 65 | { |
66 | - unset( $this->object ); |
|
66 | + unset($this->object); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function testGetPassword() |
70 | 70 | { |
71 | - $this->assertEquals( 'testpwd', $this->object->getPassword() ); |
|
71 | + $this->assertEquals('testpwd', $this->object->getPassword()); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function testSetPassword() |
75 | 75 | { |
76 | - $this->object->setPassword( 'new' ); |
|
77 | - $this->assertTrue( $this->object->isModified() ); |
|
78 | - $this->assertEquals( 'new', $this->object->getPassword() ); |
|
76 | + $this->object->setPassword('new'); |
|
77 | + $this->assertTrue($this->object->isModified()); |
|
78 | + $this->assertEquals('new', $this->object->getPassword()); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testSetPasswordGenerated() |
82 | 82 | { |
83 | - $helper = new \Aimeos\MShop\Common\Item\Helper\Password\Standard( array( 'format' => '%1$s{%2$s}' ) ); |
|
84 | - $object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, [], [], [], null, $helper ); |
|
83 | + $helper = new \Aimeos\MShop\Common\Item\Helper\Password\Standard(array('format' => '%1$s{%2$s}')); |
|
84 | + $object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, [], [], [], null, $helper); |
|
85 | 85 | |
86 | - $object->setPassword( 'newpwd' ); |
|
87 | - $this->assertEquals( sha1( 'newpwd{' . $object->getSalt() . '}' ), $object->getPassword() ); |
|
86 | + $object->setPassword('newpwd'); |
|
87 | + $this->assertEquals(sha1('newpwd{' . $object->getSalt() . '}'), $object->getPassword()); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function testGetRoles() |
91 | 91 | { |
92 | - $this->assertEquals( array( 'ROLE_ADMIN' ), $this->object->getRoles() ); |
|
92 | + $this->assertEquals(array('ROLE_ADMIN'), $this->object->getRoles()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function testSetRoles() |
96 | 96 | { |
97 | - $this->object->setRoles( array( 'ROLE_USER' ) ); |
|
98 | - $this->assertTrue( $this->object->isModified() ); |
|
99 | - $this->assertEquals( array( 'ROLE_USER' ), $this->object->getRoles() ); |
|
97 | + $this->object->setRoles(array('ROLE_USER')); |
|
98 | + $this->assertTrue($this->object->isModified()); |
|
99 | + $this->assertEquals(array('ROLE_USER'), $this->object->getRoles()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function testGetSalt() |
103 | 103 | { |
104 | - $this->assertEquals( 'test', $this->object->getSalt() ); |
|
104 | + $this->assertEquals('test', $this->object->getSalt()); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function testGetSaltGenerated() |
108 | 108 | { |
109 | - $object = new \Aimeos\MShop\Customer\Item\FosUser( $this->address, [] ); |
|
110 | - $this->assertEquals( 'mshop', $object->getSalt() ); |
|
109 | + $object = new \Aimeos\MShop\Customer\Item\FosUser($this->address, []); |
|
110 | + $this->assertEquals('mshop', $object->getSalt()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | public function testSetSalt() |
114 | 114 | { |
115 | - $this->object->setSalt( 'new' ); |
|
116 | - $this->assertTrue( $this->object->isModified() ); |
|
117 | - $this->assertEquals( 'new', $this->object->getSalt() ); |
|
115 | + $this->object->setSalt('new'); |
|
116 | + $this->assertTrue($this->object->isModified()); |
|
117 | + $this->assertEquals('new', $this->object->getSalt()); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | public function testIsModified() |
121 | 121 | { |
122 | - $this->assertFalse( $this->object->isModified() ); |
|
122 | + $this->assertFalse($this->object->isModified()); |
|
123 | 123 | } |
124 | 124 | } |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | { |
22 | 22 | $context = \TestHelper::getContext(); |
23 | 23 | $this->editor = $context->getEditor(); |
24 | - $customer = new \Aimeos\MShop\Customer\Manager\FosUser( $context ); |
|
24 | + $customer = new \Aimeos\MShop\Customer\Manager\FosUser($context); |
|
25 | 25 | |
26 | 26 | $search = $customer->createSearch(); |
27 | 27 | $conditions = array( |
28 | - $search->compare( '==', 'customer.code', 'UTC001' ), |
|
29 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
28 | + $search->compare('==', 'customer.code', 'UTC001'), |
|
29 | + $search->compare('==', 'customer.editor', $this->editor) |
|
30 | 30 | ); |
31 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
32 | - $result = $customer->searchItems( $search ); |
|
31 | + $search->setConditions($search->combine('&&', $conditions)); |
|
32 | + $result = $customer->searchItems($search); |
|
33 | 33 | |
34 | - if( ( $customerItem = reset( $result ) ) === false ) { |
|
35 | - throw new \RuntimeException( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) ); |
|
34 | + if (($customerItem = reset($result)) === false) { |
|
35 | + throw new \RuntimeException(sprintf('No customer item found for code "%1$s"', 'UTC001')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $this->fixture = array( |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
62 | 62 | ); |
63 | 63 | |
64 | - $this->object = $customer->getSubManager( 'address', 'FosUser' ); |
|
64 | + $this->object = $customer->getSubManager('address', 'FosUser'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -70,130 +70,130 @@ discard block |
||
70 | 70 | */ |
71 | 71 | protected function tearDown() |
72 | 72 | { |
73 | - unset( $this->object, $this->fixture ); |
|
73 | + unset($this->object, $this->fixture); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testCleanup() |
78 | 78 | { |
79 | - $this->object->cleanup( array( -1 ) ); |
|
79 | + $this->object->cleanup(array( -1 )); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function testGetSearchAttributes() |
83 | 83 | { |
84 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
85 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
84 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
85 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | 89 | public function testGetSubManager() |
90 | 90 | { |
91 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
92 | - $this->object->getSubManager( 'unknown' ); |
|
91 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
92 | + $this->object->getSubManager('unknown'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function testCreateItem() |
96 | 96 | { |
97 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
97 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem()); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function testGetItem() |
101 | 101 | { |
102 | 102 | $search = $this->object->createSearch(); |
103 | - $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
103 | + $search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH')); |
|
104 | 104 | |
105 | - $items = $this->object->searchItems( $search ); |
|
105 | + $items = $this->object->searchItems($search); |
|
106 | 106 | |
107 | - if( ( $item = reset( $items ) ) === false ) { |
|
108 | - throw new \RuntimeException( 'No address item with company "ABC" found' ); |
|
107 | + if (($item = reset($items)) === false) { |
|
108 | + throw new \RuntimeException('No address item with company "ABC" found'); |
|
109 | 109 | } |
110 | 110 | |
111 | - $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
111 | + $this->assertEquals($item, $this->object->getItem($item->getId())); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function testSaveUpdateDeleteItem() |
115 | 115 | { |
116 | - $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
117 | - $item->setId( null ); |
|
118 | - $this->object->saveItem( $item ); |
|
119 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
116 | + $item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture); |
|
117 | + $item->setId(null); |
|
118 | + $this->object->saveItem($item); |
|
119 | + $itemSaved = $this->object->getItem($item->getId()); |
|
120 | 120 | |
121 | 121 | $itemExp = clone $itemSaved; |
122 | - $itemExp->setPosition( 1 ); |
|
123 | - $itemExp->setCity( 'Berlin' ); |
|
124 | - $itemExp->setState( 'Berlin' ); |
|
125 | - $this->object->saveItem( $itemExp ); |
|
126 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
127 | - |
|
128 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
129 | - |
|
130 | - |
|
131 | - $this->assertTrue( $item->getId() !== null ); |
|
132 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
133 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
134 | - $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
135 | - $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
136 | - $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
137 | - $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
138 | - $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
139 | - $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
140 | - $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
141 | - $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
142 | - $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
143 | - $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
144 | - $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
145 | - $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
146 | - $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
147 | - $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
148 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
149 | - $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
150 | - $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
151 | - $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
152 | - $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
153 | - $this->assertEquals( $item->getLongitude(), $itemSaved->getLongitude()); |
|
154 | - $this->assertEquals( $item->getLatitude(), $itemSaved->getLatitude()); |
|
155 | - $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
156 | - |
|
157 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
158 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
122 | + $itemExp->setPosition(1); |
|
123 | + $itemExp->setCity('Berlin'); |
|
124 | + $itemExp->setState('Berlin'); |
|
125 | + $this->object->saveItem($itemExp); |
|
126 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
127 | + |
|
128 | + $this->object->deleteItem($itemSaved->getId()); |
|
129 | + |
|
130 | + |
|
131 | + $this->assertTrue($item->getId() !== null); |
|
132 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
133 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
134 | + $this->assertEquals($item->getPosition(), $itemSaved->getPosition()); |
|
135 | + $this->assertEquals($item->getCompany(), $itemSaved->getCompany()); |
|
136 | + $this->assertEquals($item->getVatID(), $itemSaved->getVatID()); |
|
137 | + $this->assertEquals($item->getSalutation(), $itemSaved->getSalutation()); |
|
138 | + $this->assertEquals($item->getTitle(), $itemSaved->getTitle()); |
|
139 | + $this->assertEquals($item->getFirstname(), $itemSaved->getFirstname()); |
|
140 | + $this->assertEquals($item->getLastname(), $itemSaved->getLastname()); |
|
141 | + $this->assertEquals($item->getAddress1(), $itemSaved->getAddress1()); |
|
142 | + $this->assertEquals($item->getAddress2(), $itemSaved->getAddress2()); |
|
143 | + $this->assertEquals($item->getAddress3(), $itemSaved->getAddress3()); |
|
144 | + $this->assertEquals($item->getPostal(), $itemSaved->getPostal()); |
|
145 | + $this->assertEquals($item->getCity(), $itemSaved->getCity()); |
|
146 | + $this->assertEquals($item->getState(), $itemSaved->getState()); |
|
147 | + $this->assertEquals($item->getCountryId(), $itemSaved->getCountryId()); |
|
148 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
149 | + $this->assertEquals($item->getTelephone(), $itemSaved->getTelephone()); |
|
150 | + $this->assertEquals($item->getEmail(), $itemSaved->getEmail()); |
|
151 | + $this->assertEquals($item->getTelefax(), $itemSaved->getTelefax()); |
|
152 | + $this->assertEquals($item->getWebsite(), $itemSaved->getWebsite()); |
|
153 | + $this->assertEquals($item->getLongitude(), $itemSaved->getLongitude()); |
|
154 | + $this->assertEquals($item->getLatitude(), $itemSaved->getLatitude()); |
|
155 | + $this->assertEquals($item->getFlag(), $itemSaved->getFlag()); |
|
156 | + |
|
157 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
158 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
159 | 159 | $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
160 | 160 | |
161 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
162 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
163 | - $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
164 | - $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
165 | - $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
166 | - $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
167 | - $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
168 | - $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
169 | - $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
170 | - $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
171 | - $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
172 | - $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
173 | - $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
174 | - $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
175 | - $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
176 | - $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
177 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
178 | - $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
179 | - $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
180 | - $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
181 | - $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
182 | - $this->assertEquals( $itemExp->getLongitude(), $itemUpd->getLongitude()); |
|
183 | - $this->assertEquals( $itemExp->getLatitude(), $itemUpd->getLatitude()); |
|
184 | - $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
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() ); |
|
161 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
162 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
163 | + $this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition()); |
|
164 | + $this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany()); |
|
165 | + $this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID()); |
|
166 | + $this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
167 | + $this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle()); |
|
168 | + $this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
169 | + $this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname()); |
|
170 | + $this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
171 | + $this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
172 | + $this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
173 | + $this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal()); |
|
174 | + $this->assertEquals($itemExp->getCity(), $itemUpd->getCity()); |
|
175 | + $this->assertEquals($itemExp->getState(), $itemUpd->getState()); |
|
176 | + $this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
177 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
178 | + $this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
179 | + $this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail()); |
|
180 | + $this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
181 | + $this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
182 | + $this->assertEquals($itemExp->getLongitude(), $itemUpd->getLongitude()); |
|
183 | + $this->assertEquals($itemExp->getLatitude(), $itemUpd->getLatitude()); |
|
184 | + $this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag()); |
|
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 | 189 | |
190 | 190 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
191 | - $this->object->getItem( $itemSaved->getId() ); |
|
191 | + $this->object->getItem($itemSaved->getId()); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | public function testCreateSearch() |
195 | 195 | { |
196 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
196 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | |
@@ -202,36 +202,36 @@ discard block |
||
202 | 202 | $search = $this->object->createSearch(); |
203 | 203 | |
204 | 204 | $expr = []; |
205 | - $expr[] = $search->compare( '!=', 'customer.address.id', null ); |
|
206 | - $expr[] = $search->compare( '!=', 'customer.address.parentid', null ); |
|
207 | - $expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' ); |
|
208 | - $expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' ); |
|
209 | - $expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' ); |
|
210 | - $expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' ); |
|
211 | - $expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' ); |
|
212 | - $expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' ); |
|
213 | - $expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' ); |
|
214 | - $expr[] = $search->compare( '==', 'customer.address.address2', '2-4' ); |
|
215 | - $expr[] = $search->compare( '==', 'customer.address.address3', '' ); |
|
216 | - $expr[] = $search->compare( '==', 'customer.address.postal', '11099' ); |
|
217 | - $expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' ); |
|
218 | - $expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' ); |
|
219 | - $expr[] = $search->compare( '==', 'customer.address.languageid', 'de' ); |
|
220 | - $expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' ); |
|
221 | - $expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' ); |
|
222 | - $expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' ); |
|
223 | - $expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' ); |
|
224 | - $expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' ); |
|
225 | - $expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' ); |
|
226 | - $expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' ); |
|
227 | - $expr[] = $search->compare( '==', 'customer.address.flag', 0 ); |
|
228 | - $expr[] = $search->compare( '==', 'customer.address.position', 1 ); |
|
229 | - $expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' ); |
|
230 | - $expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' ); |
|
231 | - $expr[] = $search->compare( '==', 'customer.address.editor', $this->editor ); |
|
232 | - |
|
233 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
234 | - $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
205 | + $expr[] = $search->compare('!=', 'customer.address.id', null); |
|
206 | + $expr[] = $search->compare('!=', 'customer.address.parentid', null); |
|
207 | + $expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH'); |
|
208 | + $expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999'); |
|
209 | + $expr[] = $search->compare('==', 'customer.address.salutation', 'mr'); |
|
210 | + $expr[] = $search->compare('==', 'customer.address.title', 'Dr.'); |
|
211 | + $expr[] = $search->compare('==', 'customer.address.firstname', 'Good'); |
|
212 | + $expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest'); |
|
213 | + $expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben'); |
|
214 | + $expr[] = $search->compare('==', 'customer.address.address2', '2-4'); |
|
215 | + $expr[] = $search->compare('==', 'customer.address.address3', ''); |
|
216 | + $expr[] = $search->compare('==', 'customer.address.postal', '11099'); |
|
217 | + $expr[] = $search->compare('==', 'customer.address.city', 'Berlin'); |
|
218 | + $expr[] = $search->compare('==', 'customer.address.state', 'Berlin'); |
|
219 | + $expr[] = $search->compare('==', 'customer.address.languageid', 'de'); |
|
220 | + $expr[] = $search->compare('==', 'customer.address.countryid', 'DE'); |
|
221 | + $expr[] = $search->compare('==', 'customer.address.telephone', '055544332221'); |
|
222 | + $expr[] = $search->compare('==', 'customer.address.email', '[email protected]'); |
|
223 | + $expr[] = $search->compare('==', 'customer.address.telefax', '055544333212'); |
|
224 | + $expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org'); |
|
225 | + $expr[] = $search->compare('>=', 'customer.address.longitude', '10.0'); |
|
226 | + $expr[] = $search->compare('>=', 'customer.address.latitude', '50.0'); |
|
227 | + $expr[] = $search->compare('==', 'customer.address.flag', 0); |
|
228 | + $expr[] = $search->compare('==', 'customer.address.position', 1); |
|
229 | + $expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00'); |
|
230 | + $expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00'); |
|
231 | + $expr[] = $search->compare('==', 'customer.address.editor', $this->editor); |
|
232 | + |
|
233 | + $search->setConditions($search->combine('&&', $expr)); |
|
234 | + $this->assertEquals(1, count($this->object->searchItems($search))); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
@@ -241,20 +241,20 @@ discard block |
||
241 | 241 | $search = $this->object->createSearch(); |
242 | 242 | |
243 | 243 | $conditions = array( |
244 | - $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
245 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
244 | + $search->compare('~=', 'customer.address.company', 'ABC GmbH'), |
|
245 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
246 | 246 | ); |
247 | 247 | |
248 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
249 | - $search->setSlice( 0, 1 ); |
|
248 | + $search->setConditions($search->combine('&&', $conditions)); |
|
249 | + $search->setSlice(0, 1); |
|
250 | 250 | |
251 | - $results = $this->object->searchItems( $search, [], $total ); |
|
251 | + $results = $this->object->searchItems($search, [], $total); |
|
252 | 252 | |
253 | - $this->assertEquals( 1, count( $results ) ); |
|
254 | - $this->assertEquals( 2, $total ); |
|
253 | + $this->assertEquals(1, count($results)); |
|
254 | + $this->assertEquals(2, $total); |
|
255 | 255 | |
256 | - foreach( $results as $id => $item ) { |
|
257 | - $this->assertEquals( $id, $item->getId() ); |
|
256 | + foreach ($results as $id => $item) { |
|
257 | + $this->assertEquals($id, $item->getId()); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | } |