@@ -6,15 +6,15 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array ( |
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', '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', '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', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
13 | - ), |
|
14 | - 'customer/address' => array( |
|
15 | - 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', 'flag' => 0, 'pos' => '0' ), |
|
16 | - 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', 'flag' => 0, 'pos' => '1' ), |
|
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' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
18 | - 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', 'flag' => 0, 'pos' => '2' ), |
|
19 | - ), |
|
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', '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', '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', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
13 | + ), |
|
14 | + 'customer/address' => array( |
|
15 | + 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', 'flag' => 0, 'pos' => '0' ), |
|
16 | + 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', 'flag' => 0, 'pos' => '1' ), |
|
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' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
18 | + 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', 'flag' => 0, 'pos' => '2' ), |
|
19 | + ), |
|
20 | 20 | ); |
@@ -5,16 +5,16 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2016 |
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', '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', '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', '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', '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', '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', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
13 | 13 | ), |
14 | 14 | 'customer/address' => array( |
15 | - 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', 'flag' => 0, 'pos' => '0' ), |
|
16 | - 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', 'flag' => 0, 'pos' => '1' ), |
|
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' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
18 | - 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', 'flag' => 0, 'pos' => '2' ), |
|
15 | + 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', 'flag' => 0, 'pos' => '0'), |
|
16 | + 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', 'flag' => 0, 'pos' => '1'), |
|
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' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1'), |
|
18 | + 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', 'flag' => 0, 'pos' => '2'), |
|
19 | 19 | ), |
20 | 20 | ); |
@@ -6,14 +6,14 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array ( |
9 | - 'customer/lists/type' => array ( |
|
10 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
11 | - ), |
|
9 | + 'customer/lists/type' => array ( |
|
10 | + 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
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' => array(), 'pos' => 0, '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' => array(), 'pos' => 1, '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' => array(), 'pos' => 2, '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' => array(), 'pos' => 3, 'status' => 1 ), |
|
18 | - ), |
|
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' => array(), 'pos' => 0, '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' => array(), 'pos' => 1, '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' => array(), 'pos' => 2, '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' => array(), 'pos' => 3, 'status' => 1 ), |
|
18 | + ), |
|
19 | 19 | ); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 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' => array(), 'pos' => 0, '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' => array(), 'pos' => 1, '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' => array(), 'pos' => 2, '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' => array(), 'pos' => 3, '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' => array(), 'pos' => 0, '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' => array(), 'pos' => 1, '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' => array(), 'pos' => 2, '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' => array(), 'pos' => 3, 'status' => 1), |
|
18 | 18 | ), |
19 | 19 | ); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPreDependencies() |
23 | 23 | { |
24 | - return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' ); |
|
24 | + return array('TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -31,41 +31,41 @@ 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 | - $context = $this->getEzContext( $this->additional ); |
|
38 | + $context = $this->getEzContext($this->additional); |
|
39 | 39 | |
40 | - $this->msg( 'Adding ezPublish customer test data', 0 ); |
|
40 | + $this->msg('Adding ezPublish customer test data', 0); |
|
41 | 41 | |
42 | 42 | $parentIds = array(); |
43 | 43 | $ds = DIRECTORY_SEPARATOR; |
44 | - $context->setEditor( 'ai-ezpublish:unittest' ); |
|
45 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
|
44 | + $context->setEditor('ai-ezpublish:unittest'); |
|
45 | + $path = __DIR__.$ds.'data'.$ds.'customer.php'; |
|
46 | 46 | |
47 | - if( ( $testdata = include( $path ) ) === false ){ |
|
48 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
47 | + if (($testdata = include($path)) === false) { |
|
48 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | - $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' ); |
|
53 | - $customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' ); |
|
52 | + $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Ezpublish'); |
|
53 | + $customerAddressManager = $customerManager->getSubManager('address', 'Ezpublish'); |
|
54 | 54 | |
55 | 55 | $search = $customerManager->createSearch(); |
56 | - $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) ); |
|
57 | - $items = $customerManager->searchItems( $search ); |
|
56 | + $search->setConditions($search->compare('==', 'customer.code', array('UTC001', 'UTC002', 'UTC003'))); |
|
57 | + $items = $customerManager->searchItems($search); |
|
58 | 58 | |
59 | 59 | $this->conn->begin(); |
60 | 60 | |
61 | - $customerManager->deleteItems( array_keys( $items ) ); |
|
62 | - $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
63 | - $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
61 | + $customerManager->deleteItems(array_keys($items)); |
|
62 | + $parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem()); |
|
63 | + $this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds); |
|
64 | 64 | |
65 | 65 | $this->conn->commit(); |
66 | 66 | |
67 | 67 | |
68 | - $this->status( 'done' ); |
|
68 | + $this->status('done'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,52 +75,52 @@ discard block |
||
75 | 75 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
76 | 76 | * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object |
77 | 77 | */ |
78 | - protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context ) |
|
78 | + protected function getEzContext(\Aimeos\MShop\Context\Item\Iface $context) |
|
79 | 79 | { |
80 | 80 | $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
81 | - if( is_a( $context, $class ) ) { |
|
81 | + if (is_a($context, $class)) { |
|
82 | 82 | return $context; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $ezContext = new \Aimeos\MShop\Context\Item\Ezpublish(); |
86 | - $ezContext->setDatabaseManager( clone $context->getDatabaseManager() ); |
|
87 | - $ezContext->setSession( clone $context->getSession() ); |
|
88 | - $ezContext->setLogger( clone $context->getLogger() ); |
|
89 | - $ezContext->setLocale( clone $context->getLocale() ); |
|
90 | - $ezContext->setConfig( clone $context->getConfig() ); |
|
91 | - $ezContext->setCache( clone $context->getCache() ); |
|
86 | + $ezContext->setDatabaseManager(clone $context->getDatabaseManager()); |
|
87 | + $ezContext->setSession(clone $context->getSession()); |
|
88 | + $ezContext->setLogger(clone $context->getLogger()); |
|
89 | + $ezContext->setLocale(clone $context->getLocale()); |
|
90 | + $ezContext->setConfig(clone $context->getConfig()); |
|
91 | + $ezContext->setCache(clone $context->getCache()); |
|
92 | 92 | |
93 | 93 | $task = $this; |
94 | 94 | |
95 | - $ezContext->setEzUser( function( $code, $email, $password ) use ( $context ) { |
|
95 | + $ezContext->setEzUser(function($code, $email, $password) use ($context) { |
|
96 | 96 | |
97 | - $id = mt_rand( -0x7fffffff,-1 ); |
|
97 | + $id = mt_rand( -0x7fffffff, -1 ); |
|
98 | 98 | $dbm = $context->getDatabaseManager(); |
99 | - $dbconf = $context->getConfig()->get( 'resource/db-customer' ); |
|
100 | - $dbname = ( $dbconf ? 'db-customer' : 'db' ); |
|
101 | - $conn = $dbm->acquire( $dbname ); |
|
99 | + $dbconf = $context->getConfig()->get('resource/db-customer'); |
|
100 | + $dbname = ($dbconf ? 'db-customer' : 'db'); |
|
101 | + $conn = $dbm->acquire($dbname); |
|
102 | 102 | |
103 | 103 | try |
104 | 104 | { |
105 | - $stmt = $conn->create( 'INSERT INTO "ezuser" ( |
|
105 | + $stmt = $conn->create('INSERT INTO "ezuser" ( |
|
106 | 106 | "contentobject_id", "email", "login", "login_normalized", "password_hash", "password_hash_type" |
107 | 107 | ) VALUES ( |
108 | 108 | ?, ?, ?, ?, ?, 5 |
109 | 109 | )' ); |
110 | 110 | |
111 | - $stmt->bind( 1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
112 | - $stmt->bind( 2, $email ); |
|
113 | - $stmt->bind( 3, $code ); |
|
114 | - $stmt->bind( 4, $code ); |
|
115 | - $stmt->bind( 5, $password ); |
|
111 | + $stmt->bind(1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
112 | + $stmt->bind(2, $email); |
|
113 | + $stmt->bind(3, $code); |
|
114 | + $stmt->bind(4, $code); |
|
115 | + $stmt->bind(5, $password); |
|
116 | 116 | |
117 | 117 | $stmt->execute()->finish(); |
118 | 118 | |
119 | - $dbm->release( $conn, $dbname ); |
|
119 | + $dbm->release($conn, $dbname); |
|
120 | 120 | } |
121 | - catch( \Exception $e ) |
|
121 | + catch (\Exception $e) |
|
122 | 122 | { |
123 | - $dbm->release( $conn, $dbname ); |
|
123 | + $dbm->release($conn, $dbname); |
|
124 | 124 | throw $e; |
125 | 125 | } |
126 | 126 |
@@ -117,8 +117,7 @@ |
||
117 | 117 | $stmt->execute()->finish(); |
118 | 118 | |
119 | 119 | $dbm->release( $conn, $dbname ); |
120 | - } |
|
121 | - catch( \Exception $e ) |
|
120 | + } catch( \Exception $e ) |
|
122 | 121 | { |
123 | 122 | $dbm->release( $conn, $dbname ); |
124 | 123 | throw $e; |
@@ -14,119 +14,119 @@ |
||
14 | 14 | */ |
15 | 15 | class CustomerAddEzpublishTestData extends \Aimeos\MW\Setup\Task\CustomerAddTestData |
16 | 16 | { |
17 | - /** |
|
18 | - * Returns the list of task names which this task depends on. |
|
19 | - * |
|
20 | - * @return string[] List of task names |
|
21 | - */ |
|
22 | - public function getPreDependencies() |
|
23 | - { |
|
24 | - return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' ); |
|
25 | - } |
|
26 | - |
|
27 | - |
|
28 | - /** |
|
29 | - * Adds attribute test data. |
|
30 | - */ |
|
31 | - public function migrate() |
|
32 | - { |
|
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 ) ); |
|
36 | - } |
|
37 | - |
|
38 | - $context = $this->getEzContext( $this->additional ); |
|
39 | - |
|
40 | - $this->msg( 'Adding ezPublish customer test data', 0 ); |
|
41 | - |
|
42 | - $parentIds = array(); |
|
43 | - $ds = DIRECTORY_SEPARATOR; |
|
44 | - $context->setEditor( 'ai-ezpublish:unittest' ); |
|
45 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
|
46 | - |
|
47 | - if( ( $testdata = include( $path ) ) === false ){ |
|
48 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
49 | - } |
|
50 | - |
|
51 | - |
|
52 | - $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' ); |
|
53 | - $customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' ); |
|
54 | - |
|
55 | - $search = $customerManager->createSearch(); |
|
56 | - $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) ); |
|
57 | - $items = $customerManager->searchItems( $search ); |
|
58 | - |
|
59 | - $this->conn->begin(); |
|
60 | - |
|
61 | - $customerManager->deleteItems( array_keys( $items ) ); |
|
62 | - $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
63 | - $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
64 | - |
|
65 | - $this->conn->commit(); |
|
66 | - |
|
67 | - |
|
68 | - $this->status( 'done' ); |
|
69 | - } |
|
70 | - |
|
71 | - |
|
72 | - /** |
|
73 | - * Returns the Ezpublish context |
|
74 | - * |
|
75 | - * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
|
76 | - * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object |
|
77 | - */ |
|
78 | - protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context ) |
|
79 | - { |
|
80 | - $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
|
81 | - if( is_a( $context, $class ) ) { |
|
82 | - return $context; |
|
83 | - } |
|
84 | - |
|
85 | - $ezContext = new \Aimeos\MShop\Context\Item\Ezpublish(); |
|
86 | - $ezContext->setDatabaseManager( clone $context->getDatabaseManager() ); |
|
87 | - $ezContext->setSession( clone $context->getSession() ); |
|
88 | - $ezContext->setLogger( clone $context->getLogger() ); |
|
89 | - $ezContext->setLocale( clone $context->getLocale() ); |
|
90 | - $ezContext->setConfig( clone $context->getConfig() ); |
|
91 | - $ezContext->setCache( clone $context->getCache() ); |
|
92 | - |
|
93 | - |
|
94 | - $ezContext->setEzUser( function( $code, $email, $password ) use ( $context ) { |
|
95 | - |
|
96 | - $id = mt_rand( -0x7fffffff,-1 ); |
|
97 | - $dbm = $context->getDatabaseManager(); |
|
98 | - $dbconf = $context->getConfig()->get( 'resource/db-customer' ); |
|
99 | - $dbname = ( $dbconf ? 'db-customer' : 'db' ); |
|
100 | - $conn = $dbm->acquire( $dbname ); |
|
101 | - |
|
102 | - try |
|
103 | - { |
|
104 | - $stmt = $conn->create( 'INSERT INTO "ezuser" ( |
|
17 | + /** |
|
18 | + * Returns the list of task names which this task depends on. |
|
19 | + * |
|
20 | + * @return string[] List of task names |
|
21 | + */ |
|
22 | + public function getPreDependencies() |
|
23 | + { |
|
24 | + return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' ); |
|
25 | + } |
|
26 | + |
|
27 | + |
|
28 | + /** |
|
29 | + * Adds attribute test data. |
|
30 | + */ |
|
31 | + public function migrate() |
|
32 | + { |
|
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 ) ); |
|
36 | + } |
|
37 | + |
|
38 | + $context = $this->getEzContext( $this->additional ); |
|
39 | + |
|
40 | + $this->msg( 'Adding ezPublish customer test data', 0 ); |
|
41 | + |
|
42 | + $parentIds = array(); |
|
43 | + $ds = DIRECTORY_SEPARATOR; |
|
44 | + $context->setEditor( 'ai-ezpublish:unittest' ); |
|
45 | + $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
|
46 | + |
|
47 | + if( ( $testdata = include( $path ) ) === false ){ |
|
48 | + throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
49 | + } |
|
50 | + |
|
51 | + |
|
52 | + $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' ); |
|
53 | + $customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' ); |
|
54 | + |
|
55 | + $search = $customerManager->createSearch(); |
|
56 | + $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) ); |
|
57 | + $items = $customerManager->searchItems( $search ); |
|
58 | + |
|
59 | + $this->conn->begin(); |
|
60 | + |
|
61 | + $customerManager->deleteItems( array_keys( $items ) ); |
|
62 | + $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
63 | + $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
64 | + |
|
65 | + $this->conn->commit(); |
|
66 | + |
|
67 | + |
|
68 | + $this->status( 'done' ); |
|
69 | + } |
|
70 | + |
|
71 | + |
|
72 | + /** |
|
73 | + * Returns the Ezpublish context |
|
74 | + * |
|
75 | + * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
|
76 | + * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object |
|
77 | + */ |
|
78 | + protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context ) |
|
79 | + { |
|
80 | + $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
|
81 | + if( is_a( $context, $class ) ) { |
|
82 | + return $context; |
|
83 | + } |
|
84 | + |
|
85 | + $ezContext = new \Aimeos\MShop\Context\Item\Ezpublish(); |
|
86 | + $ezContext->setDatabaseManager( clone $context->getDatabaseManager() ); |
|
87 | + $ezContext->setSession( clone $context->getSession() ); |
|
88 | + $ezContext->setLogger( clone $context->getLogger() ); |
|
89 | + $ezContext->setLocale( clone $context->getLocale() ); |
|
90 | + $ezContext->setConfig( clone $context->getConfig() ); |
|
91 | + $ezContext->setCache( clone $context->getCache() ); |
|
92 | + |
|
93 | + |
|
94 | + $ezContext->setEzUser( function( $code, $email, $password ) use ( $context ) { |
|
95 | + |
|
96 | + $id = mt_rand( -0x7fffffff,-1 ); |
|
97 | + $dbm = $context->getDatabaseManager(); |
|
98 | + $dbconf = $context->getConfig()->get( 'resource/db-customer' ); |
|
99 | + $dbname = ( $dbconf ? 'db-customer' : 'db' ); |
|
100 | + $conn = $dbm->acquire( $dbname ); |
|
101 | + |
|
102 | + try |
|
103 | + { |
|
104 | + $stmt = $conn->create( 'INSERT INTO "ezuser" ( |
|
105 | 105 | "contentobject_id", "email", "login", "login_normalized", "password_hash", "password_hash_type" |
106 | 106 | ) VALUES ( |
107 | 107 | ?, ?, ?, ?, ?, 5 |
108 | 108 | )' ); |
109 | 109 | |
110 | - $stmt->bind( 1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
111 | - $stmt->bind( 2, $email ); |
|
112 | - $stmt->bind( 3, $code ); |
|
113 | - $stmt->bind( 4, $code ); |
|
114 | - $stmt->bind( 5, $password ); |
|
110 | + $stmt->bind( 1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
111 | + $stmt->bind( 2, $email ); |
|
112 | + $stmt->bind( 3, $code ); |
|
113 | + $stmt->bind( 4, $code ); |
|
114 | + $stmt->bind( 5, $password ); |
|
115 | 115 | |
116 | - $stmt->execute()->finish(); |
|
116 | + $stmt->execute()->finish(); |
|
117 | 117 | |
118 | - $dbm->release( $conn, $dbname ); |
|
119 | - } |
|
120 | - catch( \Exception $e ) |
|
121 | - { |
|
122 | - $dbm->release( $conn, $dbname ); |
|
123 | - throw $e; |
|
124 | - } |
|
118 | + $dbm->release( $conn, $dbname ); |
|
119 | + } |
|
120 | + catch( \Exception $e ) |
|
121 | + { |
|
122 | + $dbm->release( $conn, $dbname ); |
|
123 | + throw $e; |
|
124 | + } |
|
125 | 125 | |
126 | - return $id; |
|
127 | - } ); |
|
126 | + return $id; |
|
127 | + } ); |
|
128 | 128 | |
129 | 129 | |
130 | - return $ezContext; |
|
131 | - } |
|
130 | + return $ezContext; |
|
131 | + } |
|
132 | 132 | } |
@@ -11,215 +11,215 @@ |
||
11 | 11 | |
12 | 12 | class EzpublishTest extends \PHPUnit_Framework_TestCase |
13 | 13 | { |
14 | - private $fixture = null; |
|
15 | - private $object = null; |
|
16 | - private $editor = ''; |
|
17 | - |
|
18 | - |
|
19 | - protected function setUp() |
|
20 | - { |
|
21 | - $context = \TestHelper::getContext(); |
|
22 | - $this->editor = $context->getEditor(); |
|
23 | - $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context ); |
|
24 | - |
|
25 | - $search = $customer->createSearch(); |
|
26 | - $conditions = array( |
|
27 | - $search->compare( '==', 'customer.code', 'UTC001' ), |
|
28 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
29 | - ); |
|
30 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
31 | - $result = $customer->searchItems( $search ); |
|
32 | - |
|
33 | - if( ( $customerItem = reset( $result ) ) === false ) { |
|
34 | - throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) ); |
|
35 | - } |
|
36 | - |
|
37 | - $this->fixture = array( |
|
38 | - 'customer.address.parentid' => $customerItem->getId(), |
|
39 | - 'customer.address.company' => 'ABC GmbH', |
|
40 | - 'customer.address.vatid' => 'DE999999999', |
|
41 | - 'customer.address.salutation' => \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, |
|
42 | - 'customer.address.title' => 'Herr', |
|
43 | - 'customer.address.firstname' => 'firstunit', |
|
44 | - 'customer.address.lastname' => 'lastunit', |
|
45 | - 'customer.address.address1' => 'unit str.', |
|
46 | - 'customer.address.address2' => ' 166', |
|
47 | - 'customer.address.address3' => '4.OG', |
|
48 | - 'customer.address.postal' => '22769', |
|
49 | - 'customer.address.city' => 'Hamburg', |
|
50 | - 'customer.address.state' => 'Hamburg', |
|
51 | - 'customer.address.countryid' => 'de', |
|
52 | - 'customer.address.languageid' => 'de', |
|
53 | - 'customer.address.telephone' => '05554433221', |
|
54 | - 'customer.address.email' => '[email protected]', |
|
55 | - 'customer.address.telefax' => '05554433222', |
|
56 | - 'customer.address.website' => 'unittest.aimeos.org', |
|
57 | - 'customer.address.position' => 1, |
|
58 | - 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
|
59 | - ); |
|
60 | - |
|
61 | - $this->object = $customer->getSubManager( 'address', 'Ezpublish' ); |
|
62 | - } |
|
63 | - |
|
64 | - |
|
65 | - protected function tearDown() |
|
66 | - { |
|
67 | - unset( $this->object, $this->fixture ); |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - public function testCleanup() |
|
72 | - { |
|
73 | - $this->object->cleanup( array( -1 ) ); |
|
74 | - } |
|
75 | - |
|
76 | - public function testGetSearchAttributes() |
|
77 | - { |
|
78 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
79 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
80 | - } |
|
81 | - } |
|
82 | - |
|
83 | - public function testGetSubManager() |
|
84 | - { |
|
85 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
86 | - $this->object->getSubManager( 'unknown' ); |
|
87 | - } |
|
88 | - |
|
89 | - public function testCreateItem() |
|
90 | - { |
|
91 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
92 | - } |
|
93 | - |
|
94 | - public function testGetItem() |
|
95 | - { |
|
96 | - $search = $this->object->createSearch(); |
|
97 | - $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
98 | - |
|
99 | - $items = $this->object->searchItems( $search ); |
|
100 | - |
|
101 | - if( ( $item = reset( $items ) ) === false ) { |
|
102 | - throw new \Exception( 'No address item with company "ABC" found' ); |
|
103 | - } |
|
104 | - |
|
105 | - $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
106 | - } |
|
107 | - |
|
108 | - public function testSaveUpdateDeleteItem() |
|
109 | - { |
|
110 | - $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
111 | - $item->setId( null ); |
|
112 | - $this->object->saveItem( $item ); |
|
113 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
114 | - |
|
115 | - $itemExp = clone $itemSaved; |
|
116 | - $itemExp->setPosition( 1 ); |
|
117 | - $itemExp->setCity( 'Berlin' ); |
|
118 | - $itemExp->setState( 'Berlin' ); |
|
119 | - $this->object->saveItem( $itemExp ); |
|
120 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
121 | - |
|
122 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
123 | - |
|
124 | - |
|
125 | - $this->assertTrue( $item->getId() !== null ); |
|
126 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
127 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
128 | - $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
129 | - $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
130 | - $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
131 | - $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | - $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
133 | - $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | - $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
135 | - $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | - $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | - $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | - $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
139 | - $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
140 | - $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
141 | - $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | - $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | - $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
145 | - $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | - $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | - $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
148 | - |
|
149 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
150 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
151 | - $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
152 | - |
|
153 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
154 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | - $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | - $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | - $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | - $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | - $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | - $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | - $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | - $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | - $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | - $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | - $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | - $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
167 | - $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
168 | - $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | - $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | - $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | - $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | - $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | - $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | - |
|
176 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
177 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
178 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
179 | - |
|
180 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
181 | - $this->object->getItem( $itemSaved->getId() ); |
|
182 | - } |
|
183 | - |
|
184 | - public function testCreateSearch() |
|
185 | - { |
|
186 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
187 | - } |
|
188 | - |
|
189 | - |
|
190 | - public function testSearchItem() |
|
191 | - { |
|
192 | - $search = $this->object->createSearch(); |
|
193 | - |
|
194 | - $conditions = array( |
|
195 | - $search->compare( '==', 'customer.address.company', 'ABC' ), |
|
196 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
197 | - ); |
|
198 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
199 | - $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - public function testSearchItemTotal() |
|
204 | - { |
|
205 | - $total = 0; |
|
206 | - $search = $this->object->createSearch(); |
|
207 | - |
|
208 | - $conditions = array( |
|
209 | - $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
210 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
211 | - ); |
|
212 | - |
|
213 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
214 | - $search->setSlice( 0, 1 ); |
|
215 | - |
|
216 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
217 | - |
|
218 | - $this->assertEquals( 1, count( $results ) ); |
|
219 | - $this->assertEquals( 2, $total ); |
|
220 | - |
|
221 | - foreach( $results as $id => $item ) { |
|
222 | - $this->assertEquals( $id, $item->getId() ); |
|
223 | - } |
|
224 | - } |
|
14 | + private $fixture = null; |
|
15 | + private $object = null; |
|
16 | + private $editor = ''; |
|
17 | + |
|
18 | + |
|
19 | + protected function setUp() |
|
20 | + { |
|
21 | + $context = \TestHelper::getContext(); |
|
22 | + $this->editor = $context->getEditor(); |
|
23 | + $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context ); |
|
24 | + |
|
25 | + $search = $customer->createSearch(); |
|
26 | + $conditions = array( |
|
27 | + $search->compare( '==', 'customer.code', 'UTC001' ), |
|
28 | + $search->compare( '==', 'customer.editor', $this->editor ) |
|
29 | + ); |
|
30 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
31 | + $result = $customer->searchItems( $search ); |
|
32 | + |
|
33 | + if( ( $customerItem = reset( $result ) ) === false ) { |
|
34 | + throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) ); |
|
35 | + } |
|
36 | + |
|
37 | + $this->fixture = array( |
|
38 | + 'customer.address.parentid' => $customerItem->getId(), |
|
39 | + 'customer.address.company' => 'ABC GmbH', |
|
40 | + 'customer.address.vatid' => 'DE999999999', |
|
41 | + 'customer.address.salutation' => \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, |
|
42 | + 'customer.address.title' => 'Herr', |
|
43 | + 'customer.address.firstname' => 'firstunit', |
|
44 | + 'customer.address.lastname' => 'lastunit', |
|
45 | + 'customer.address.address1' => 'unit str.', |
|
46 | + 'customer.address.address2' => ' 166', |
|
47 | + 'customer.address.address3' => '4.OG', |
|
48 | + 'customer.address.postal' => '22769', |
|
49 | + 'customer.address.city' => 'Hamburg', |
|
50 | + 'customer.address.state' => 'Hamburg', |
|
51 | + 'customer.address.countryid' => 'de', |
|
52 | + 'customer.address.languageid' => 'de', |
|
53 | + 'customer.address.telephone' => '05554433221', |
|
54 | + 'customer.address.email' => '[email protected]', |
|
55 | + 'customer.address.telefax' => '05554433222', |
|
56 | + 'customer.address.website' => 'unittest.aimeos.org', |
|
57 | + 'customer.address.position' => 1, |
|
58 | + 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
|
59 | + ); |
|
60 | + |
|
61 | + $this->object = $customer->getSubManager( 'address', 'Ezpublish' ); |
|
62 | + } |
|
63 | + |
|
64 | + |
|
65 | + protected function tearDown() |
|
66 | + { |
|
67 | + unset( $this->object, $this->fixture ); |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + public function testCleanup() |
|
72 | + { |
|
73 | + $this->object->cleanup( array( -1 ) ); |
|
74 | + } |
|
75 | + |
|
76 | + public function testGetSearchAttributes() |
|
77 | + { |
|
78 | + foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
79 | + $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
80 | + } |
|
81 | + } |
|
82 | + |
|
83 | + public function testGetSubManager() |
|
84 | + { |
|
85 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
86 | + $this->object->getSubManager( 'unknown' ); |
|
87 | + } |
|
88 | + |
|
89 | + public function testCreateItem() |
|
90 | + { |
|
91 | + $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
92 | + } |
|
93 | + |
|
94 | + public function testGetItem() |
|
95 | + { |
|
96 | + $search = $this->object->createSearch(); |
|
97 | + $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
98 | + |
|
99 | + $items = $this->object->searchItems( $search ); |
|
100 | + |
|
101 | + if( ( $item = reset( $items ) ) === false ) { |
|
102 | + throw new \Exception( 'No address item with company "ABC" found' ); |
|
103 | + } |
|
104 | + |
|
105 | + $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
106 | + } |
|
107 | + |
|
108 | + public function testSaveUpdateDeleteItem() |
|
109 | + { |
|
110 | + $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
111 | + $item->setId( null ); |
|
112 | + $this->object->saveItem( $item ); |
|
113 | + $itemSaved = $this->object->getItem( $item->getId() ); |
|
114 | + |
|
115 | + $itemExp = clone $itemSaved; |
|
116 | + $itemExp->setPosition( 1 ); |
|
117 | + $itemExp->setCity( 'Berlin' ); |
|
118 | + $itemExp->setState( 'Berlin' ); |
|
119 | + $this->object->saveItem( $itemExp ); |
|
120 | + $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
121 | + |
|
122 | + $this->object->deleteItem( $itemSaved->getId() ); |
|
123 | + |
|
124 | + |
|
125 | + $this->assertTrue( $item->getId() !== null ); |
|
126 | + $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
127 | + $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
128 | + $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
129 | + $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
130 | + $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
131 | + $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | + $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
133 | + $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | + $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
135 | + $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | + $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | + $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | + $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
139 | + $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
140 | + $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
141 | + $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | + $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | + $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | + $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
145 | + $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | + $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | + $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
148 | + |
|
149 | + $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
150 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
151 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
152 | + |
|
153 | + $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
154 | + $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | + $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | + $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | + $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | + $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | + $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | + $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | + $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | + $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | + $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | + $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | + $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | + $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
167 | + $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
168 | + $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | + $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | + $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | + $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | + $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | + $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | + $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | + |
|
176 | + $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
177 | + $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
178 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
179 | + |
|
180 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
181 | + $this->object->getItem( $itemSaved->getId() ); |
|
182 | + } |
|
183 | + |
|
184 | + public function testCreateSearch() |
|
185 | + { |
|
186 | + $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
187 | + } |
|
188 | + |
|
189 | + |
|
190 | + public function testSearchItem() |
|
191 | + { |
|
192 | + $search = $this->object->createSearch(); |
|
193 | + |
|
194 | + $conditions = array( |
|
195 | + $search->compare( '==', 'customer.address.company', 'ABC' ), |
|
196 | + $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
197 | + ); |
|
198 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
199 | + $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + public function testSearchItemTotal() |
|
204 | + { |
|
205 | + $total = 0; |
|
206 | + $search = $this->object->createSearch(); |
|
207 | + |
|
208 | + $conditions = array( |
|
209 | + $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
210 | + $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
211 | + ); |
|
212 | + |
|
213 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
214 | + $search->setSlice( 0, 1 ); |
|
215 | + |
|
216 | + $results = $this->object->searchItems( $search, array(), $total ); |
|
217 | + |
|
218 | + $this->assertEquals( 1, count( $results ) ); |
|
219 | + $this->assertEquals( 2, $total ); |
|
220 | + |
|
221 | + foreach( $results as $id => $item ) { |
|
222 | + $this->assertEquals( $id, $item->getId() ); |
|
223 | + } |
|
224 | + } |
|
225 | 225 | } |
@@ -20,18 +20,18 @@ discard block |
||
20 | 20 | { |
21 | 21 | $context = \TestHelper::getContext(); |
22 | 22 | $this->editor = $context->getEditor(); |
23 | - $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish( $context ); |
|
23 | + $customer = new \Aimeos\MShop\Customer\Manager\Ezpublish($context); |
|
24 | 24 | |
25 | 25 | $search = $customer->createSearch(); |
26 | 26 | $conditions = array( |
27 | - $search->compare( '==', 'customer.code', 'UTC001' ), |
|
28 | - $search->compare( '==', 'customer.editor', $this->editor ) |
|
27 | + $search->compare('==', 'customer.code', 'UTC001'), |
|
28 | + $search->compare('==', 'customer.editor', $this->editor) |
|
29 | 29 | ); |
30 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
31 | - $result = $customer->searchItems( $search ); |
|
30 | + $search->setConditions($search->combine('&&', $conditions)); |
|
31 | + $result = $customer->searchItems($search); |
|
32 | 32 | |
33 | - if( ( $customerItem = reset( $result ) ) === false ) { |
|
34 | - throw new \Exception( sprintf( 'No customer item found for code "%1$s"', 'UTC001' ) ); |
|
33 | + if (($customerItem = reset($result)) === false) { |
|
34 | + throw new \Exception(sprintf('No customer item found for code "%1$s"', 'UTC001')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $this->fixture = array( |
@@ -58,132 +58,132 @@ discard block |
||
58 | 58 | 'customer.address.siteid' => $context->getLocale()->getSiteId(), |
59 | 59 | ); |
60 | 60 | |
61 | - $this->object = $customer->getSubManager( 'address', 'Ezpublish' ); |
|
61 | + $this->object = $customer->getSubManager('address', 'Ezpublish'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | protected function tearDown() |
66 | 66 | { |
67 | - unset( $this->object, $this->fixture ); |
|
67 | + unset($this->object, $this->fixture); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testCleanup() |
72 | 72 | { |
73 | - $this->object->cleanup( array( -1 ) ); |
|
73 | + $this->object->cleanup(array( -1 )); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function testGetSearchAttributes() |
77 | 77 | { |
78 | - foreach( $this->object->getSearchAttributes() as $attribute ) { |
|
79 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute ); |
|
78 | + foreach ($this->object->getSearchAttributes() as $attribute) { |
|
79 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | public function testGetSubManager() |
84 | 84 | { |
85 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
86 | - $this->object->getSubManager( 'unknown' ); |
|
85 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
86 | + $this->object->getSubManager('unknown'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function testCreateItem() |
90 | 90 | { |
91 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
91 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem()); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | public function testGetItem() |
95 | 95 | { |
96 | 96 | $search = $this->object->createSearch(); |
97 | - $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
97 | + $search->setConditions($search->compare('~=', 'customer.address.company', 'ABC GmbH')); |
|
98 | 98 | |
99 | - $items = $this->object->searchItems( $search ); |
|
99 | + $items = $this->object->searchItems($search); |
|
100 | 100 | |
101 | - if( ( $item = reset( $items ) ) === false ) { |
|
102 | - throw new \Exception( 'No address item with company "ABC" found' ); |
|
101 | + if (($item = reset($items)) === false) { |
|
102 | + throw new \Exception('No address item with company "ABC" found'); |
|
103 | 103 | } |
104 | 104 | |
105 | - $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
105 | + $this->assertEquals($item, $this->object->getItem($item->getId())); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public function testSaveUpdateDeleteItem() |
109 | 109 | { |
110 | - $item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture ); |
|
111 | - $item->setId( null ); |
|
112 | - $this->object->saveItem( $item ); |
|
113 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
110 | + $item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture); |
|
111 | + $item->setId(null); |
|
112 | + $this->object->saveItem($item); |
|
113 | + $itemSaved = $this->object->getItem($item->getId()); |
|
114 | 114 | |
115 | 115 | $itemExp = clone $itemSaved; |
116 | - $itemExp->setPosition( 1 ); |
|
117 | - $itemExp->setCity( 'Berlin' ); |
|
118 | - $itemExp->setState( 'Berlin' ); |
|
119 | - $this->object->saveItem( $itemExp ); |
|
120 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
121 | - |
|
122 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
123 | - |
|
124 | - |
|
125 | - $this->assertTrue( $item->getId() !== null ); |
|
126 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
127 | - $this->assertEquals( $item->getParentId(), $itemSaved->getParentId()); |
|
128 | - $this->assertEquals( $item->getPosition(), $itemSaved->getPosition()); |
|
129 | - $this->assertEquals( $item->getCompany(), $itemSaved->getCompany()); |
|
130 | - $this->assertEquals( $item->getVatID(), $itemSaved->getVatID()); |
|
131 | - $this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | - $this->assertEquals( $item->getTitle(), $itemSaved->getTitle()); |
|
133 | - $this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | - $this->assertEquals( $item->getLastname(), $itemSaved->getLastname()); |
|
135 | - $this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | - $this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | - $this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | - $this->assertEquals( $item->getPostal(), $itemSaved->getPostal()); |
|
139 | - $this->assertEquals( $item->getCity(), $itemSaved->getCity()); |
|
140 | - $this->assertEquals( $item->getState(), $itemSaved->getState()); |
|
141 | - $this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | - $this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | - $this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | - $this->assertEquals( $item->getEmail(), $itemSaved->getEmail()); |
|
145 | - $this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | - $this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | - $this->assertEquals( $item->getFlag(), $itemSaved->getFlag()); |
|
148 | - |
|
149 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
150 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
116 | + $itemExp->setPosition(1); |
|
117 | + $itemExp->setCity('Berlin'); |
|
118 | + $itemExp->setState('Berlin'); |
|
119 | + $this->object->saveItem($itemExp); |
|
120 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
121 | + |
|
122 | + $this->object->deleteItem($itemSaved->getId()); |
|
123 | + |
|
124 | + |
|
125 | + $this->assertTrue($item->getId() !== null); |
|
126 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
127 | + $this->assertEquals($item->getParentId(), $itemSaved->getParentId()); |
|
128 | + $this->assertEquals($item->getPosition(), $itemSaved->getPosition()); |
|
129 | + $this->assertEquals($item->getCompany(), $itemSaved->getCompany()); |
|
130 | + $this->assertEquals($item->getVatID(), $itemSaved->getVatID()); |
|
131 | + $this->assertEquals($item->getSalutation(), $itemSaved->getSalutation()); |
|
132 | + $this->assertEquals($item->getTitle(), $itemSaved->getTitle()); |
|
133 | + $this->assertEquals($item->getFirstname(), $itemSaved->getFirstname()); |
|
134 | + $this->assertEquals($item->getLastname(), $itemSaved->getLastname()); |
|
135 | + $this->assertEquals($item->getAddress1(), $itemSaved->getAddress1()); |
|
136 | + $this->assertEquals($item->getAddress2(), $itemSaved->getAddress2()); |
|
137 | + $this->assertEquals($item->getAddress3(), $itemSaved->getAddress3()); |
|
138 | + $this->assertEquals($item->getPostal(), $itemSaved->getPostal()); |
|
139 | + $this->assertEquals($item->getCity(), $itemSaved->getCity()); |
|
140 | + $this->assertEquals($item->getState(), $itemSaved->getState()); |
|
141 | + $this->assertEquals($item->getCountryId(), $itemSaved->getCountryId()); |
|
142 | + $this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId()); |
|
143 | + $this->assertEquals($item->getTelephone(), $itemSaved->getTelephone()); |
|
144 | + $this->assertEquals($item->getEmail(), $itemSaved->getEmail()); |
|
145 | + $this->assertEquals($item->getTelefax(), $itemSaved->getTelefax()); |
|
146 | + $this->assertEquals($item->getWebsite(), $itemSaved->getWebsite()); |
|
147 | + $this->assertEquals($item->getFlag(), $itemSaved->getFlag()); |
|
148 | + |
|
149 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
150 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
151 | 151 | $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
152 | 152 | |
153 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
154 | - $this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | - $this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | - $this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | - $this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | - $this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | - $this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | - $this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | - $this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | - $this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | - $this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | - $this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | - $this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | - $this->assertEquals( $itemExp->getCity(), $itemUpd->getCity()); |
|
167 | - $this->assertEquals( $itemExp->getState(), $itemUpd->getState()); |
|
168 | - $this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | - $this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | - $this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | - $this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | - $this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | - $this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | - $this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | - |
|
176 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
177 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
178 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
153 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
154 | + $this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId()); |
|
155 | + $this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition()); |
|
156 | + $this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany()); |
|
157 | + $this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID()); |
|
158 | + $this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation()); |
|
159 | + $this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle()); |
|
160 | + $this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname()); |
|
161 | + $this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname()); |
|
162 | + $this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1()); |
|
163 | + $this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2()); |
|
164 | + $this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3()); |
|
165 | + $this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal()); |
|
166 | + $this->assertEquals($itemExp->getCity(), $itemUpd->getCity()); |
|
167 | + $this->assertEquals($itemExp->getState(), $itemUpd->getState()); |
|
168 | + $this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId()); |
|
169 | + $this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId()); |
|
170 | + $this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone()); |
|
171 | + $this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail()); |
|
172 | + $this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax()); |
|
173 | + $this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite()); |
|
174 | + $this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag()); |
|
175 | + |
|
176 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
177 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
178 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
179 | 179 | |
180 | 180 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
181 | - $this->object->getItem( $itemSaved->getId() ); |
|
181 | + $this->object->getItem($itemSaved->getId()); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public function testCreateSearch() |
185 | 185 | { |
186 | - $this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() ); |
|
186 | + $this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch()); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $search = $this->object->createSearch(); |
193 | 193 | |
194 | 194 | $conditions = array( |
195 | - $search->compare( '==', 'customer.address.company', 'ABC' ), |
|
196 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
195 | + $search->compare('==', 'customer.address.company', 'ABC'), |
|
196 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
197 | 197 | ); |
198 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
199 | - $this->assertEquals( 1, count( $this->object->searchItems( $search ) ) ); |
|
198 | + $search->setConditions($search->combine('&&', $conditions)); |
|
199 | + $this->assertEquals(1, count($this->object->searchItems($search))); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -206,20 +206,20 @@ discard block |
||
206 | 206 | $search = $this->object->createSearch(); |
207 | 207 | |
208 | 208 | $conditions = array( |
209 | - $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ), |
|
210 | - $search->compare( '==', 'customer.address.editor', $this->editor ) |
|
209 | + $search->compare('~=', 'customer.address.company', 'ABC GmbH'), |
|
210 | + $search->compare('==', 'customer.address.editor', $this->editor) |
|
211 | 211 | ); |
212 | 212 | |
213 | - $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
214 | - $search->setSlice( 0, 1 ); |
|
213 | + $search->setConditions($search->combine('&&', $conditions)); |
|
214 | + $search->setSlice(0, 1); |
|
215 | 215 | |
216 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
216 | + $results = $this->object->searchItems($search, array(), $total); |
|
217 | 217 | |
218 | - $this->assertEquals( 1, count( $results ) ); |
|
219 | - $this->assertEquals( 2, $total ); |
|
218 | + $this->assertEquals(1, count($results)); |
|
219 | + $this->assertEquals(2, $total); |
|
220 | 220 | |
221 | - foreach( $results as $id => $item ) { |
|
222 | - $this->assertEquals( $id, $item->getId() ); |
|
221 | + foreach ($results as $id => $item) { |
|
222 | + $this->assertEquals($id, $item->getId()); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | } |
@@ -11,137 +11,137 @@ |
||
11 | 11 | |
12 | 12 | class EzpublishTest extends \PHPUnit_Framework_TestCase |
13 | 13 | { |
14 | - private $object; |
|
15 | - private $editor = ''; |
|
14 | + private $object; |
|
15 | + private $editor = ''; |
|
16 | 16 | |
17 | 17 | |
18 | - protected function setUp() |
|
19 | - { |
|
20 | - $this->editor = \TestHelper::getContext()->getEditor(); |
|
21 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
18 | + protected function setUp() |
|
19 | + { |
|
20 | + $this->editor = \TestHelper::getContext()->getEditor(); |
|
21 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
22 | 22 | |
23 | - $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
24 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
25 | - } |
|
23 | + $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
24 | + $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | - protected function tearDown() |
|
29 | - { |
|
30 | - unset( $this->object ); |
|
31 | - } |
|
28 | + protected function tearDown() |
|
29 | + { |
|
30 | + unset( $this->object ); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - public function testCleanup() |
|
35 | - { |
|
36 | - $this->object->cleanup( array( -1 ) ); |
|
37 | - } |
|
34 | + public function testCleanup() |
|
35 | + { |
|
36 | + $this->object->cleanup( array( -1 ) ); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | |
40 | - public function testGetSubManager() |
|
41 | - { |
|
42 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
43 | - $this->object->getSubManager( 'unknown' ); |
|
44 | - } |
|
40 | + public function testGetSubManager() |
|
41 | + { |
|
42 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
43 | + $this->object->getSubManager( 'unknown' ); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | - public function testCreateItem() |
|
48 | - { |
|
49 | - $item = $this->object->createItem(); |
|
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
51 | - } |
|
47 | + public function testCreateItem() |
|
48 | + { |
|
49 | + $item = $this->object->createItem(); |
|
50 | + $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
51 | + } |
|
52 | 52 | |
53 | 53 | |
54 | - public function testGetItem() |
|
55 | - { |
|
56 | - $search = $this->object->createSearch(); |
|
57 | - $search->setSlice(0, 1); |
|
58 | - $results = $this->object->searchItems($search); |
|
54 | + public function testGetItem() |
|
55 | + { |
|
56 | + $search = $this->object->createSearch(); |
|
57 | + $search->setSlice(0, 1); |
|
58 | + $results = $this->object->searchItems($search); |
|
59 | 59 | |
60 | - if( ( $expected = reset($results) ) === false ) { |
|
61 | - throw new \Exception( 'No list type item found' ); |
|
62 | - } |
|
60 | + if( ( $expected = reset($results) ) === false ) { |
|
61 | + throw new \Exception( 'No list type item found' ); |
|
62 | + } |
|
63 | 63 | |
64 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
65 | - } |
|
64 | + $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
65 | + } |
|
66 | 66 | |
67 | 67 | |
68 | - public function testSaveUpdateDeleteItem() |
|
69 | - { |
|
70 | - $search = $this->object->createSearch(); |
|
71 | - $search->setSlice(0, 1); |
|
72 | - $results = $this->object->searchItems($search); |
|
68 | + public function testSaveUpdateDeleteItem() |
|
69 | + { |
|
70 | + $search = $this->object->createSearch(); |
|
71 | + $search->setSlice(0, 1); |
|
72 | + $results = $this->object->searchItems($search); |
|
73 | 73 | |
74 | - if( ( $item = reset($results) ) === false ) { |
|
75 | - throw new \Exception( 'No type item found' ); |
|
76 | - } |
|
74 | + if( ( $item = reset($results) ) === false ) { |
|
75 | + throw new \Exception( 'No type item found' ); |
|
76 | + } |
|
77 | 77 | |
78 | - $item->setId(null); |
|
79 | - $item->setCode( 'unitTestInit' ); |
|
80 | - $this->object->saveItem( $item ); |
|
81 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
78 | + $item->setId(null); |
|
79 | + $item->setCode( 'unitTestInit' ); |
|
80 | + $this->object->saveItem( $item ); |
|
81 | + $itemSaved = $this->object->getItem( $item->getId() ); |
|
82 | 82 | |
83 | - $itemExp = clone $itemSaved; |
|
84 | - $itemExp->setCode( 'unitTestSave' ); |
|
85 | - $this->object->saveItem( $itemExp ); |
|
86 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
83 | + $itemExp = clone $itemSaved; |
|
84 | + $itemExp->setCode( 'unitTestSave' ); |
|
85 | + $this->object->saveItem( $itemExp ); |
|
86 | + $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
87 | 87 | |
88 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
88 | + $this->object->deleteItem( $itemSaved->getId() ); |
|
89 | 89 | |
90 | 90 | |
91 | - $this->assertTrue( $item->getId() !== null ); |
|
92 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
93 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
94 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
95 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
96 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
97 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
91 | + $this->assertTrue( $item->getId() !== null ); |
|
92 | + $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
93 | + $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
94 | + $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
95 | + $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
96 | + $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
97 | + $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
98 | 98 | |
99 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
100 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
101 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
99 | + $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
100 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
101 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
102 | 102 | |
103 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
104 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
105 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
106 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
107 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
108 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
103 | + $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
104 | + $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
105 | + $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
106 | + $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
107 | + $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
108 | + $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
109 | 109 | |
110 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
111 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
112 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
110 | + $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
111 | + $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
112 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
113 | 113 | |
114 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
115 | - $this->object->getItem( $itemSaved->getId() ); |
|
116 | - } |
|
114 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
115 | + $this->object->getItem( $itemSaved->getId() ); |
|
116 | + } |
|
117 | 117 | |
118 | 118 | |
119 | - public function testSearchItems() |
|
120 | - { |
|
121 | - $total = 0; |
|
122 | - $search = $this->object->createSearch(); |
|
123 | - |
|
124 | - $expr = array(); |
|
125 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
126 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
127 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
128 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
129 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
130 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
131 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
132 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
133 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
134 | - |
|
135 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
136 | - $search->setSlice(0, 1); |
|
137 | - |
|
138 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
139 | - $this->assertEquals( 1, count( $results ) ); |
|
140 | - $this->assertEquals( 1, $total ); |
|
141 | - |
|
142 | - foreach($results as $itemId => $item) { |
|
143 | - $this->assertEquals( $itemId, $item->getId() ); |
|
144 | - } |
|
145 | - } |
|
119 | + public function testSearchItems() |
|
120 | + { |
|
121 | + $total = 0; |
|
122 | + $search = $this->object->createSearch(); |
|
123 | + |
|
124 | + $expr = array(); |
|
125 | + $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
126 | + $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
127 | + $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
128 | + $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
129 | + $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
130 | + $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
131 | + $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
132 | + $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
133 | + $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
134 | + |
|
135 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
136 | + $search->setSlice(0, 1); |
|
137 | + |
|
138 | + $results = $this->object->searchItems( $search, array(), $total ); |
|
139 | + $this->assertEquals( 1, count( $results ) ); |
|
140 | + $this->assertEquals( 1, $total ); |
|
141 | + |
|
142 | + foreach($results as $itemId => $item) { |
|
143 | + $this->assertEquals( $itemId, $item->getId() ); |
|
144 | + } |
|
145 | + } |
|
146 | 146 | |
147 | 147 | } |
@@ -18,36 +18,36 @@ discard block |
||
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | 20 | $this->editor = \TestHelper::getContext()->getEditor(); |
21 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Ezpublish' ); |
|
21 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Ezpublish'); |
|
22 | 22 | |
23 | - $listManager = $manager->getSubManager( 'lists', 'Ezpublish' ); |
|
24 | - $this->object = $listManager->getSubManager( 'type', 'Ezpublish' ); |
|
23 | + $listManager = $manager->getSubManager('lists', 'Ezpublish'); |
|
24 | + $this->object = $listManager->getSubManager('type', 'Ezpublish'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object ); |
|
30 | + unset($this->object); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testCleanup() |
35 | 35 | { |
36 | - $this->object->cleanup( array( -1 ) ); |
|
36 | + $this->object->cleanup(array( -1 )); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testGetSubManager() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
43 | - $this->object->getSubManager( 'unknown' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
43 | + $this->object->getSubManager('unknown'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testCreateItem() |
48 | 48 | { |
49 | 49 | $item = $this->object->createItem(); |
50 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item ); |
|
50 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $search->setSlice(0, 1); |
58 | 58 | $results = $this->object->searchItems($search); |
59 | 59 | |
60 | - if( ( $expected = reset($results) ) === false ) { |
|
61 | - throw new \Exception( 'No list type item found' ); |
|
60 | + if (($expected = reset($results)) === false) { |
|
61 | + throw new \Exception('No list type item found'); |
|
62 | 62 | } |
63 | 63 | |
64 | - $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
64 | + $this->assertEquals($expected, $this->object->getItem($expected->getId())); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -71,48 +71,48 @@ discard block |
||
71 | 71 | $search->setSlice(0, 1); |
72 | 72 | $results = $this->object->searchItems($search); |
73 | 73 | |
74 | - if( ( $item = reset($results) ) === false ) { |
|
75 | - throw new \Exception( 'No type item found' ); |
|
74 | + if (($item = reset($results)) === false) { |
|
75 | + throw new \Exception('No type item found'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $item->setId(null); |
79 | - $item->setCode( 'unitTestInit' ); |
|
80 | - $this->object->saveItem( $item ); |
|
81 | - $itemSaved = $this->object->getItem( $item->getId() ); |
|
79 | + $item->setCode('unitTestInit'); |
|
80 | + $this->object->saveItem($item); |
|
81 | + $itemSaved = $this->object->getItem($item->getId()); |
|
82 | 82 | |
83 | 83 | $itemExp = clone $itemSaved; |
84 | - $itemExp->setCode( 'unitTestSave' ); |
|
85 | - $this->object->saveItem( $itemExp ); |
|
86 | - $itemUpd = $this->object->getItem( $itemExp->getId() ); |
|
84 | + $itemExp->setCode('unitTestSave'); |
|
85 | + $this->object->saveItem($itemExp); |
|
86 | + $itemUpd = $this->object->getItem($itemExp->getId()); |
|
87 | 87 | |
88 | - $this->object->deleteItem( $itemSaved->getId() ); |
|
88 | + $this->object->deleteItem($itemSaved->getId()); |
|
89 | 89 | |
90 | 90 | |
91 | - $this->assertTrue( $item->getId() !== null ); |
|
92 | - $this->assertEquals( $item->getId(), $itemSaved->getId() ); |
|
93 | - $this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() ); |
|
94 | - $this->assertEquals( $item->getCode(), $itemSaved->getCode() ); |
|
95 | - $this->assertEquals( $item->getDomain(), $itemSaved->getDomain() ); |
|
96 | - $this->assertEquals( $item->getLabel(), $itemSaved->getLabel() ); |
|
97 | - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); |
|
91 | + $this->assertTrue($item->getId() !== null); |
|
92 | + $this->assertEquals($item->getId(), $itemSaved->getId()); |
|
93 | + $this->assertEquals($item->getSiteId(), $itemSaved->getSiteId()); |
|
94 | + $this->assertEquals($item->getCode(), $itemSaved->getCode()); |
|
95 | + $this->assertEquals($item->getDomain(), $itemSaved->getDomain()); |
|
96 | + $this->assertEquals($item->getLabel(), $itemSaved->getLabel()); |
|
97 | + $this->assertEquals($item->getStatus(), $itemSaved->getStatus()); |
|
98 | 98 | |
99 | - $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
|
100 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
|
101 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
99 | + $this->assertEquals($this->editor, $itemSaved->getEditor()); |
|
100 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated()); |
|
101 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified()); |
|
102 | 102 | |
103 | - $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
|
104 | - $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
|
105 | - $this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() ); |
|
106 | - $this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() ); |
|
107 | - $this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() ); |
|
108 | - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); |
|
103 | + $this->assertEquals($itemExp->getId(), $itemUpd->getId()); |
|
104 | + $this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId()); |
|
105 | + $this->assertEquals($itemExp->getCode(), $itemUpd->getCode()); |
|
106 | + $this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain()); |
|
107 | + $this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel()); |
|
108 | + $this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus()); |
|
109 | 109 | |
110 | - $this->assertEquals( $this->editor, $itemUpd->getEditor() ); |
|
111 | - $this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() ); |
|
112 | - $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() ); |
|
110 | + $this->assertEquals($this->editor, $itemUpd->getEditor()); |
|
111 | + $this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated()); |
|
112 | + $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified()); |
|
113 | 113 | |
114 | 114 | $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
115 | - $this->object->getItem( $itemSaved->getId() ); |
|
115 | + $this->object->getItem($itemSaved->getId()); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -122,25 +122,25 @@ discard block |
||
122 | 122 | $search = $this->object->createSearch(); |
123 | 123 | |
124 | 124 | $expr = array(); |
125 | - $expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 ); |
|
126 | - $expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null ); |
|
127 | - $expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' ); |
|
128 | - $expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' ); |
|
129 | - $expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' ); |
|
130 | - $expr[] = $search->compare( '==', 'customer.lists.type.status', 1 ); |
|
131 | - $expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' ); |
|
132 | - $expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' ); |
|
133 | - $expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor ); |
|
134 | - |
|
135 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
125 | + $expr[] = $search->compare('!=', 'customer.lists.type.id', 0); |
|
126 | + $expr[] = $search->compare('!=', 'customer.lists.type.siteid', null); |
|
127 | + $expr[] = $search->compare('==', 'customer.lists.type.code', 'default'); |
|
128 | + $expr[] = $search->compare('==', 'customer.lists.type.domain', 'text'); |
|
129 | + $expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard'); |
|
130 | + $expr[] = $search->compare('==', 'customer.lists.type.status', 1); |
|
131 | + $expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00'); |
|
132 | + $expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00'); |
|
133 | + $expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor); |
|
134 | + |
|
135 | + $search->setConditions($search->combine('&&', $expr)); |
|
136 | 136 | $search->setSlice(0, 1); |
137 | 137 | |
138 | - $results = $this->object->searchItems( $search, array(), $total ); |
|
139 | - $this->assertEquals( 1, count( $results ) ); |
|
140 | - $this->assertEquals( 1, $total ); |
|
138 | + $results = $this->object->searchItems($search, array(), $total); |
|
139 | + $this->assertEquals(1, count($results)); |
|
140 | + $this->assertEquals(1, $total); |
|
141 | 141 | |
142 | - foreach($results as $itemId => $item) { |
|
143 | - $this->assertEquals( $itemId, $item->getId() ); |
|
142 | + foreach ($results as $itemId => $item) { |
|
143 | + $this->assertEquals($itemId, $item->getId()); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 |