Completed
Push — master ( 384616...e3d84b )
by Aimeos
03:42
created
lib/custom/setup/unittest/CustomerAddLaravelTestData.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function getPreDependencies()
23 23
 	{
24
-		return array( 'TablesAddLaravelTestData' );
24
+		return array('TablesAddLaravelTestData');
25 25
 	}
26 26
 
27 27
 
@@ -31,36 +31,36 @@  discard block
 block discarded – undo
31 31
 	public function migrate()
32 32
 	{
33 33
 		$iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
34
-		if( !( $this->additional instanceof $iface ) ) {
35
-			throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
34
+		if (!($this->additional instanceof $iface)) {
35
+			throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface));
36 36
 		}
37 37
 
38
-		$this->msg( 'Adding Laravel customer test data', 0 );
39
-		$this->additional->setEditor( 'ai-laravel:unittest' );
38
+		$this->msg('Adding Laravel customer test data', 0);
39
+		$this->additional->setEditor('ai-laravel:unittest');
40 40
 
41 41
 		$parentIds = [];
42 42
 		$ds = DIRECTORY_SEPARATOR;
43
-		$path = __DIR__ . $ds . 'data' . $ds . 'customer.php';
43
+		$path = __DIR__.$ds.'data'.$ds.'customer.php';
44 44
 
45
-		if( ( $testdata = include( $path ) ) == false ){
46
-			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
45
+		if (($testdata = include($path)) == false) {
46
+			throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path));
47 47
 		}
48 48
 
49 49
 
50
-		$customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $this->additional, 'Laravel' );
51
-		$customerAddressManager = $customerManager->getSubManager( 'address', 'Laravel' );
50
+		$customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($this->additional, 'Laravel');
51
+		$customerAddressManager = $customerManager->getSubManager('address', 'Laravel');
52 52
 
53
-		$this->cleanupCustomerData( $customerManager, $customerAddressManager );
53
+		$this->cleanupCustomerData($customerManager, $customerAddressManager);
54 54
 
55 55
 		$this->conn->begin();
56 56
 
57
-		$parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() );
58
-		$this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds );
57
+		$parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem());
58
+		$this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds);
59 59
 
60 60
 		$this->conn->commit();
61 61
 
62 62
 
63
-		$this->status( 'done' );
63
+		$this->status('done');
64 64
 	}
65 65
 
66 66
 
@@ -70,17 +70,17 @@  discard block
 block discarded – undo
70 70
 	 * @param \Aimeos\MShop\Common\Manager\Iface $customerManager Customer manager
71 71
 	 * @param \Aimeos\MShop\Common\Manager\Iface $customerAddressManager Customer address manager
72 72
 	 */
73
-	protected function cleanupCustomerData( \Aimeos\MShop\Common\Manager\Iface $customerManager, \Aimeos\MShop\Common\Manager\Iface $customerAddressManager )
73
+	protected function cleanupCustomerData(\Aimeos\MShop\Common\Manager\Iface $customerManager, \Aimeos\MShop\Common\Manager\Iface $customerAddressManager)
74 74
 	{
75 75
 		$search = $customerManager->createSearch();
76
-		$search->setConditions( $search->compare( '=~', 'customer.code', 'UTC00' ) );
77
-		$customerItems = $customerManager->searchItems( $search );
76
+		$search->setConditions($search->compare('=~', 'customer.code', 'UTC00'));
77
+		$customerItems = $customerManager->searchItems($search);
78 78
 
79 79
 		$search = $customerAddressManager->createSearch();
80
-		$search->setConditions( $search->compare( '=~', 'customer.address.email', 'unitCustomer' ) );
81
-		$addressItems = $customerAddressManager->searchItems( $search );
80
+		$search->setConditions($search->compare('=~', 'customer.address.email', 'unitCustomer'));
81
+		$addressItems = $customerAddressManager->searchItems($search);
82 82
 
83
-		$customerAddressManager->deleteItems( array_keys( $addressItems ) );
84
-		$customerManager->deleteItems( array_keys( $customerItems ) );
83
+		$customerAddressManager->deleteItems(array_keys($addressItems));
84
+		$customerManager->deleteItems(array_keys($customerItems));
85 85
 	}
86 86
 }
Please login to merge, or discard this patch.
lib/custom/setup/unittest/CustomerPropertyAddLaravelTestData.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	public function getPreDependencies()
25 25
 	{
26
-		return array( 'TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData' );
26
+		return array('TablesCreateLaravel', 'CustomerAddLaravelTestData', 'LocaleAddTestData');
27 27
 	}
28 28
 
29 29
 
@@ -33,22 +33,22 @@  discard block
 block discarded – undo
33 33
 	public function migrate()
34 34
 	{
35 35
 		$iface = '\\Aimeos\\MShop\\Context\\Item\\Iface';
36
-		if( !( $this->additional instanceof $iface ) ) {
37
-			throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) );
36
+		if (!($this->additional instanceof $iface)) {
37
+			throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface));
38 38
 		}
39 39
 
40
-		$this->msg( 'Adding customer-property Laravel test data', 0 );
41
-		$this->additional->setEditor( 'ai-laravel:unittest' );
40
+		$this->msg('Adding customer-property Laravel test data', 0);
41
+		$this->additional->setEditor('ai-laravel:unittest');
42 42
 
43 43
 		$ds = DIRECTORY_SEPARATOR;
44
-		$path = __DIR__ . $ds . 'data' . $ds . 'customer-property.php';
44
+		$path = __DIR__.$ds.'data'.$ds.'customer-property.php';
45 45
 
46
-		if( ( $testdata = include( $path ) ) == false ) {
47
-			throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) );
46
+		if (($testdata = include($path)) == false) {
47
+			throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path));
48 48
 		}
49 49
 
50
-		$this->addCustomerPropertyData( $testdata, 'Laravel' );
50
+		$this->addCustomerPropertyData($testdata, 'Laravel');
51 51
 
52
-		$this->status( 'done' );
52
+		$this->status('done');
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
lib/custom/setup/unittest/data/customer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2014-2017
6 6
  */
7 7
 
8
-return array (
8
+return array(
9 9
 	'customer' => array(
10
-		'customer/UTC001' => array( 'code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ),
11
-		'customer/UTC002' => array( 'code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0','password' =>  'test' ),
12
-		'customer/UTC003' => array( 'code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ),
10
+		'customer/UTC001' => array('code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'),
11
+		'customer/UTC002' => array('code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0', 'password' =>  'test'),
12
+		'customer/UTC003' => array('code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'),
13 13
 	),
14 14
 
15 15
 	'customer/address' => array(
16
-		array( 'parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0' ),
17
-		array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1' ),
18
-		array( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1' ),
19
-		array( 'parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2' ),
16
+		array('parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '0'),
17
+		array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'flag' => 0, 'pos' => '1'),
18
+		array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'flag' => 0, 'pos' => '1'),
19
+		array('parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'longitude' => '10.0', 'latitude' => '50.0', 'flag' => 0, 'pos' => '2'),
20 20
 	),
21 21
 );
Please login to merge, or discard this patch.
lib/custom/setup/unittest/data/customer-property.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2018
6 6
  */
7 7
 
8
-return array (
8
+return array(
9 9
 	'customer/property/type' => array(
10
-		'customer/property/type/newsletter' => array( 'domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1 ),
10
+		'customer/property/type/newsletter' => array('domain' => 'customer', 'code' => 'newsletter', 'label' => 'Newsletter', 'status' => 1),
11 11
 	),
12 12
 
13 13
 	'customer/property' => array(
14
-		'customer/property/UTC001/newsletter' => array( 'parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1' ),
14
+		'customer/property/UTC001/newsletter' => array('parentid' => 'customer/UTC001', 'typeid' => 'customer/property/type/newsletter', 'langid' => null, 'value' => '1'),
15 15
 	),
16 16
 );
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
lib/custom/setup/unittest/data/customer-list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2014-2017
6 6
  */
7 7
 
8
-return array (
9
-	'customer/lists/type' => array (
10
-		'customer/group/default' => array( 'domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ),
11
-		'order/download' => array( 'domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1 ),
12
-		'product/favorite' => array( 'domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1 ),
13
-		'product/watch' => array( 'domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1 ),
14
-		'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ),
8
+return array(
9
+	'customer/lists/type' => array(
10
+		'customer/group/default' => array('domain' => 'customer/group', 'code' => 'default', 'label' => 'Standard', 'status' => 1),
11
+		'order/download' => array('domain' => 'order', 'code' => 'download', 'label' => 'Download', 'status' => 1),
12
+		'product/favorite' => array('domain' => 'product', 'code' => 'favorite', 'label' => 'Favorite', 'status' => 1),
13
+		'product/watch' => array('domain' => 'product', 'code' => 'watch', 'label' => 'Watch list', 'status' => 1),
14
+		'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1),
15 15
 	),
16 16
 
17
-	'customer/lists' => array (
18
-		array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ),
19
-		array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1 ),
20
-		array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1 ),
21
-		array( 'parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1 ),
17
+	'customer/lists' => array(
18
+		array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1),
19
+		array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 2, 'status' => 1),
20
+		array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 3, 'status' => 1),
21
+		array('parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => [], 'pos' => 1, 'status' => 1),
22 22
 	),
23 23
 );
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Property/Type/LaravelTest.php 1 patch
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 		$context = \TestHelper::getContext();
21 21
 		$this->editor = $context->getEditor();
22 22
 
23
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Laravel' );
24
-		$this->object = $manager->getSubManager( 'property', 'Laravel' )->getSubManager( 'type', 'Laravel' );
23
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Laravel');
24
+		$this->object = $manager->getSubManager('property', 'Laravel')->getSubManager('type', 'Laravel');
25 25
 	}
26 26
 
27 27
 
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 
34 34
 	public function testCleanup()
35 35
 	{
36
-		$this->object->cleanup( array( -1 ) );
36
+		$this->object->cleanup(array( -1 ));
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateItem()
41 41
 	{
42
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem() );
42
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $this->object->createItem());
43 43
 	}
44 44
 
45 45
 
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		$result = $this->object->getResourceType();
49 49
 
50
-		$this->assertContains( 'customer/property/type', $result );
50
+		$this->assertContains('customer/property/type', $result);
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testGetSearchAttributes()
55 55
 	{
56
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
57
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
56
+		foreach ($this->object->getSearchAttributes() as $attribute) {
57
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
58 58
 		}
59 59
 	}
60 60
 
@@ -63,82 +63,82 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$search = $this->object->createSearch();
65 65
 		$conditions = array(
66
-			$search->compare( '==', 'customer.property.type.code', 'newsletter' ),
67
-			$search->compare( '==', 'customer.property.type.editor', $this->editor )
66
+			$search->compare('==', 'customer.property.type.code', 'newsletter'),
67
+			$search->compare('==', 'customer.property.type.editor', $this->editor)
68 68
 		);
69
-		$search->setConditions( $search->combine( '&&', $conditions ) );
69
+		$search->setConditions($search->combine('&&', $conditions));
70 70
 
71
-		$results = $this->object->searchItems( $search );
71
+		$results = $this->object->searchItems($search);
72 72
 
73
-		if( ($expected = reset($results) ) === false )
73
+		if (($expected = reset($results)) === false)
74 74
 		{
75
-			throw new \RuntimeException( 'No property type item found.' );
75
+			throw new \RuntimeException('No property type item found.');
76 76
 		}
77 77
 
78
-		$actual = $this->object->getItem( $expected->getId() );
78
+		$actual = $this->object->getItem($expected->getId());
79 79
 
80
-		$this->assertEquals( $expected, $actual );
80
+		$this->assertEquals($expected, $actual);
81 81
 	}
82 82
 
83 83
 
84 84
 	public function testSaveInvalid()
85 85
 	{
86
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
87
-		$this->object->saveItem( new \Aimeos\MShop\Locale\Item\Standard() );
86
+		$this->setExpectedException('\Aimeos\MShop\Exception');
87
+		$this->object->saveItem(new \Aimeos\MShop\Locale\Item\Standard());
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testSaveUpdateDeleteItem()
92 92
 	{
93 93
 		$search = $this->object->createSearch();
94
-		$search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) );
94
+		$search->setConditions($search->compare('==', 'customer.property.type.editor', $this->editor));
95 95
 		$results = $this->object->searchItems($search);
96 96
 
97
-		if( ( $item = reset($results) ) === false ) {
98
-			throw new \RuntimeException( 'No type item found' );
97
+		if (($item = reset($results)) === false) {
98
+			throw new \RuntimeException('No type item found');
99 99
 		}
100 100
 
101 101
 		$item->setId(null);
102
-		$item->setCode( 'unitTestSave' );
103
-		$resultSaved = $this->object->saveItem( $item );
104
-		$itemSaved = $this->object->getItem( $item->getId() );
102
+		$item->setCode('unitTestSave');
103
+		$resultSaved = $this->object->saveItem($item);
104
+		$itemSaved = $this->object->getItem($item->getId());
105 105
 
106 106
 		$itemExp = clone $itemSaved;
107
-		$itemExp->setCode( 'unitTestSave2' );
108
-		$resultUpd = $this->object->saveItem( $itemExp );
109
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
107
+		$itemExp->setCode('unitTestSave2');
108
+		$resultUpd = $this->object->saveItem($itemExp);
109
+		$itemUpd = $this->object->getItem($itemExp->getId());
110 110
 
111
-		$this->object->deleteItem( $itemSaved->getId() );
111
+		$this->object->deleteItem($itemSaved->getId());
112 112
 
113 113
 
114
-		$this->assertTrue( $item->getId() !== null );
115
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
116
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
117
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
118
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
119
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
120
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
114
+		$this->assertTrue($item->getId() !== null);
115
+		$this->assertEquals($item->getId(), $itemSaved->getId());
116
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
117
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
118
+		$this->assertEquals($item->getDomain(), $itemSaved->getDomain());
119
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
120
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
121 121
 
122
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
123
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
124
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
122
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
123
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
124
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
125 125
 
126
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
127
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
128
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
129
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
130
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
131
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
126
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
127
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
128
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
129
+		$this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain());
130
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
131
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
132 132
 
133
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
134
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
135
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
133
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
134
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
135
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
136 136
 
137
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
138
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
137
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
138
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
139 139
 
140
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
141
-		$this->object->getItem( $itemSaved->getId() );
140
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
141
+		$this->object->getItem($itemSaved->getId());
142 142
 	}
143 143
 
144 144
 
@@ -148,36 +148,36 @@  discard block
 block discarded – undo
148 148
 		$search = $this->object->createSearch();
149 149
 
150 150
 		$expr = [];
151
-		$expr[] = $search->compare( '!=', 'customer.property.type.id', null );
152
-		$expr[] = $search->compare( '!=', 'customer.property.type.siteid', null );
153
-		$expr[] = $search->compare( '==', 'customer.property.type.domain', 'customer' );
154
-		$expr[] = $search->compare( '==', 'customer.property.type.code', 'newsletter' );
155
-		$expr[] = $search->compare( '>', 'customer.property.type.label', '' );
156
-		$expr[] = $search->compare( '>=', 'customer.property.type.position', 0 );
157
-		$expr[] = $search->compare( '==', 'customer.property.type.status', 1 );
158
-		$expr[] = $search->compare( '>=', 'customer.property.type.mtime', '1970-01-01 00:00:00' );
159
-		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
160
-		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
161
-
162
-		$search->setConditions( $search->combine('&&', $expr) );
163
-		$results = $this->object->searchItems( $search, [], $total );
164
-		$this->assertEquals( 1, count( $results ) );
151
+		$expr[] = $search->compare('!=', 'customer.property.type.id', null);
152
+		$expr[] = $search->compare('!=', 'customer.property.type.siteid', null);
153
+		$expr[] = $search->compare('==', 'customer.property.type.domain', 'customer');
154
+		$expr[] = $search->compare('==', 'customer.property.type.code', 'newsletter');
155
+		$expr[] = $search->compare('>', 'customer.property.type.label', '');
156
+		$expr[] = $search->compare('>=', 'customer.property.type.position', 0);
157
+		$expr[] = $search->compare('==', 'customer.property.type.status', 1);
158
+		$expr[] = $search->compare('>=', 'customer.property.type.mtime', '1970-01-01 00:00:00');
159
+		$expr[] = $search->compare('>=', 'customer.property.type.ctime', '1970-01-01 00:00:00');
160
+		$expr[] = $search->compare('==', 'customer.property.type.editor', $this->editor);
161
+
162
+		$search->setConditions($search->combine('&&', $expr));
163
+		$results = $this->object->searchItems($search, [], $total);
164
+		$this->assertEquals(1, count($results));
165 165
 
166 166
 
167 167
 		$search = $this->object->createSearch();
168 168
 		$conditions = array(
169
-			$search->compare( '=~', 'customer.property.type.code', 'newsletter'),
170
-			$search->compare( '==', 'customer.property.type.editor', $this->editor )
169
+			$search->compare('=~', 'customer.property.type.code', 'newsletter'),
170
+			$search->compare('==', 'customer.property.type.editor', $this->editor)
171 171
 		);
172
-		$search->setConditions( $search->combine('&&', $conditions ) );
172
+		$search->setConditions($search->combine('&&', $conditions));
173 173
 		$search->setSlice(0, 1);
174
-		$items = $this->object->searchItems( $search, [], $total);
174
+		$items = $this->object->searchItems($search, [], $total);
175 175
 
176
-		$this->assertEquals( 1, count( $items ) );
177
-		$this->assertEquals( 1, $total );
176
+		$this->assertEquals(1, count($items));
177
+		$this->assertEquals(1, $total);
178 178
 
179
-		foreach($items as $itemId => $item) {
180
-			$this->assertEquals( $itemId, $item->getId() );
179
+		foreach ($items as $itemId => $item) {
180
+			$this->assertEquals($itemId, $item->getId());
181 181
 		}
182 182
 	}
183 183
 
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Lists/Type/LaravelTest.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -16,29 +16,29 @@  discard block
 block discarded – undo
16 16
 	protected function setUp()
17 17
 	{
18 18
 		$this->editor = \TestHelper::getContext()->getEditor();
19
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Laravel' );
19
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Laravel');
20 20
 
21
-		$listManager = $manager->getSubManager( 'lists', 'Laravel' );
22
-		$this->object = $listManager->getSubManager( 'type', 'Laravel' );
21
+		$listManager = $manager->getSubManager('lists', 'Laravel');
22
+		$this->object = $listManager->getSubManager('type', 'Laravel');
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset( $this->object );
28
+		unset($this->object);
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCleanup()
33 33
 	{
34
-		$this->object->cleanup( array( -1 ) );
34
+		$this->object->cleanup(array( -1 ));
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateItem()
39 39
 	{
40 40
 		$item = $this->object->createItem();
41
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item );
41
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item);
42 42
 	}
43 43
 
44 44
 
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 		$search->setSlice(0, 1);
49 49
 		$results = $this->object->searchItems($search);
50 50
 
51
-		if( ( $expected = reset($results) ) === false ) {
52
-			throw new \RuntimeException( 'No list type item found' );
51
+		if (($expected = reset($results)) === false) {
52
+			throw new \RuntimeException('No list type item found');
53 53
 		}
54 54
 
55
-		$this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) );
55
+		$this->assertEquals($expected, $this->object->getItem($expected->getId()));
56 56
 	}
57 57
 
58 58
 
59 59
 	public function testGetSubManager()
60 60
 	{
61
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
62
-		$this->object->getSubManager( 'unknown' );
61
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
62
+		$this->object->getSubManager('unknown');
63 63
 	}
64 64
 
65 65
 
@@ -69,51 +69,51 @@  discard block
 block discarded – undo
69 69
 		$search->setSlice(0, 1);
70 70
 		$results = $this->object->searchItems($search);
71 71
 
72
-		if( ( $item = reset($results) ) === false ) {
73
-			throw new \RuntimeException( 'No type item found' );
72
+		if (($item = reset($results)) === false) {
73
+			throw new \RuntimeException('No type item found');
74 74
 		}
75 75
 
76 76
 		$item->setId(null);
77
-		$item->setCode( 'unitTestInit' );
78
-		$resultSaved = $this->object->saveItem( $item );
79
-		$itemSaved = $this->object->getItem( $item->getId() );
77
+		$item->setCode('unitTestInit');
78
+		$resultSaved = $this->object->saveItem($item);
79
+		$itemSaved = $this->object->getItem($item->getId());
80 80
 
81 81
 		$itemExp = clone $itemSaved;
82
-		$itemExp->setCode( 'unitTestSave' );
83
-		$resultUpd = $this->object->saveItem( $itemExp );
84
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
82
+		$itemExp->setCode('unitTestSave');
83
+		$resultUpd = $this->object->saveItem($itemExp);
84
+		$itemUpd = $this->object->getItem($itemExp->getId());
85 85
 
86
-		$this->object->deleteItem( $itemSaved->getId() );
86
+		$this->object->deleteItem($itemSaved->getId());
87 87
 
88 88
 
89
-		$this->assertTrue( $item->getId() !== null );
90
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
91
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
92
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
93
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
94
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
95
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
89
+		$this->assertTrue($item->getId() !== null);
90
+		$this->assertEquals($item->getId(), $itemSaved->getId());
91
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
92
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
93
+		$this->assertEquals($item->getDomain(), $itemSaved->getDomain());
94
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
95
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
96 96
 
97
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
98
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
99
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
97
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
98
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
99
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
100 100
 
101
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
102
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
103
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
104
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
105
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
106
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
101
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
102
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
103
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
104
+		$this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain());
105
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
106
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
107 107
 
108
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
109
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
110
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
108
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
109
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
110
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
111 111
 
112
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
113
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
112
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
113
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
114 114
 
115 115
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
116
-		$this->object->getItem( $itemSaved->getId() );
116
+		$this->object->getItem($itemSaved->getId());
117 117
 	}
118 118
 
119 119
 
@@ -123,26 +123,26 @@  discard block
 block discarded – undo
123 123
 		$search = $this->object->createSearch();
124 124
 
125 125
 		$expr = [];
126
-		$expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 );
127
-		$expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null );
128
-		$expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' );
129
-		$expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' );
130
-		$expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' );
131
-		$expr[] = $search->compare( '>=', 'customer.lists.type.position', 0 );
132
-		$expr[] = $search->compare( '==', 'customer.lists.type.status', 1 );
133
-		$expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' );
134
-		$expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' );
135
-		$expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor );
136
-
137
-		$search->setConditions( $search->combine( '&&', $expr ) );
126
+		$expr[] = $search->compare('!=', 'customer.lists.type.id', 0);
127
+		$expr[] = $search->compare('!=', 'customer.lists.type.siteid', null);
128
+		$expr[] = $search->compare('==', 'customer.lists.type.code', 'default');
129
+		$expr[] = $search->compare('==', 'customer.lists.type.domain', 'text');
130
+		$expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard');
131
+		$expr[] = $search->compare('>=', 'customer.lists.type.position', 0);
132
+		$expr[] = $search->compare('==', 'customer.lists.type.status', 1);
133
+		$expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00');
134
+		$expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00');
135
+		$expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor);
136
+
137
+		$search->setConditions($search->combine('&&', $expr));
138 138
 		$search->setSlice(0, 1);
139 139
 
140
-		$results = $this->object->searchItems( $search, [], $total );
141
-		$this->assertEquals( 1, count( $results ) );
142
-		$this->assertEquals( 1, $total );
140
+		$results = $this->object->searchItems($search, [], $total);
141
+		$this->assertEquals(1, count($results));
142
+		$this->assertEquals(1, $total);
143 143
 
144
-		foreach($results as $itemId => $item) {
145
-			$this->assertEquals( $itemId, $item->getId() );
144
+		foreach ($results as $itemId => $item) {
145
+			$this->assertEquals($itemId, $item->getId());
146 146
 		}
147 147
 	}
148 148
 
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/LaravelTest.php 1 patch
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
21 21
 	{
22 22
 		$context = \TestHelper::getContext();
23 23
 		$this->editor = $context->getEditor();
24
-		$this->object = new \Aimeos\MShop\Customer\Manager\Laravel( $context );
24
+		$this->object = new \Aimeos\MShop\Customer\Manager\Laravel($context);
25 25
 
26 26
 		$this->fixture = array(
27 27
 			'label' => 'unitTest',
28 28
 			'status' => 2,
29 29
 		);
30 30
 
31
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
31
+		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.');
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->fixture, $this->address );
37
+		unset($this->object, $this->fixture, $this->address);
38 38
 	}
39 39
 
40 40
 
41 41
 	public function testCleanup()
42 42
 	{
43
-		$this->object->cleanup( array( -1 ) );
43
+		$this->object->cleanup(array( -1 ));
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testGetSearchAttributes()
48 48
 	{
49
-		foreach( $this->object->getSearchAttributes() as $attribute )
49
+		foreach ($this->object->getSearchAttributes() as $attribute)
50 50
 		{
51
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
51
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
52 52
 		}
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testCreateItem()
57 57
 	{
58
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() );
58
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem());
59 59
 	}
60 60
 
61 61
 
@@ -63,21 +63,21 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$search = $this->object->createSearch();
65 65
 		$conditions = array(
66
-			$search->compare( '==', 'customer.code', 'UTC003' ),
67
-			$search->compare( '==', 'customer.editor', $this->editor )
66
+			$search->compare('==', 'customer.code', 'UTC003'),
67
+			$search->compare('==', 'customer.editor', $this->editor)
68 68
 		);
69
-		$search->setConditions( $search->combine( '&&', $conditions ) );
70
-		$items = $this->object->searchItems( $search, array( 'text' ) );
69
+		$search->setConditions($search->combine('&&', $conditions));
70
+		$items = $this->object->searchItems($search, array('text'));
71 71
 
72
-		if( ( $expected = reset( $items ) ) === false ) {
73
-			throw new \RuntimeException( 'No customer item with code "UTC003" found' );
72
+		if (($expected = reset($items)) === false) {
73
+			throw new \RuntimeException('No customer item with code "UTC003" found');
74 74
 		}
75 75
 
76
-		$actual = $this->object->getItem( $expected->getId(), array( 'text' ) );
76
+		$actual = $this->object->getItem($expected->getId(), array('text'));
77 77
 
78
-		$this->assertEquals( $expected, $actual );
79
-		$this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) );
80
-		$this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) );
78
+		$this->assertEquals($expected, $actual);
79
+		$this->assertEquals(3, count($actual->getListItems('text')));
80
+		$this->assertEquals(3, count($actual->getRefItems('text')));
81 81
 	}
82 82
 
83 83
 
@@ -85,92 +85,92 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		$item = $this->object->createItem();
87 87
 
88
-		$item->setCode( 'unitTest' );
89
-		$item->setLabel( 'unitTest' );
90
-		$resultSaved = $this->object->saveItem( $item );
91
-		$itemSaved = $this->object->getItem( $item->getId() );
88
+		$item->setCode('unitTest');
89
+		$item->setLabel('unitTest');
90
+		$resultSaved = $this->object->saveItem($item);
91
+		$itemSaved = $this->object->getItem($item->getId());
92 92
 
93 93
 		$itemExp = clone $itemSaved;
94
-		$itemExp->setCode( 'unitTest2' );
95
-		$itemExp->setLabel( 'unitTest2' );
96
-		$resultUpd = $this->object->saveItem( $itemExp );
97
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
98
-
99
-		$this->object->deleteItem( $item->getId() );
100
-
101
-		$this->assertTrue( $item->getId() !== null );
102
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
103
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
104
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
105
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
106
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
107
-		$this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() );
108
-		$this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() );
109
-		$this->assertEquals( $item->getPassword(), $itemSaved->getPassword() );
110
-
111
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
112
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
113
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
114
-
115
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
116
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
117
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
118
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
119
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
120
-		$this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() );
121
-		$this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() );
122
-		$this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() );
123
-
124
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
125
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
126
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
127
-
128
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultSaved );
129
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Iface', $resultUpd );
130
-
131
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
132
-		$this->object->getItem( $item->getId() );
94
+		$itemExp->setCode('unitTest2');
95
+		$itemExp->setLabel('unitTest2');
96
+		$resultUpd = $this->object->saveItem($itemExp);
97
+		$itemUpd = $this->object->getItem($itemExp->getId());
98
+
99
+		$this->object->deleteItem($item->getId());
100
+
101
+		$this->assertTrue($item->getId() !== null);
102
+		$this->assertEquals($item->getId(), $itemSaved->getId());
103
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
104
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
105
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
106
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
107
+		$this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress());
108
+		$this->assertEquals($item->getBirthday(), $itemSaved->getBirthday());
109
+		$this->assertEquals($item->getPassword(), $itemSaved->getPassword());
110
+
111
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
112
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
113
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
114
+
115
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
116
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
117
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
118
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
119
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
120
+		$this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress());
121
+		$this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday());
122
+		$this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword());
123
+
124
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
125
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
126
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
127
+
128
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultSaved);
129
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Iface', $resultUpd);
130
+
131
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
132
+		$this->object->getItem($item->getId());
133 133
 	}
134 134
 
135 135
 
136 136
 	public function testGetSaveAddressItems()
137 137
 	{
138
-		$item = $this->object->findItem( 'UTC001', ['customer/address'] );
138
+		$item = $this->object->findItem('UTC001', ['customer/address']);
139 139
 
140
-		$item->setId( null )->setCode( 'xyz' );
141
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
142
-		$item->addAddressItem( new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.' ) );
143
-		$this->object->saveItem( $item );
140
+		$item->setId(null)->setCode('xyz');
141
+		$item->getPaymentAddress()->setEmail('[email protected]');
142
+		$item->addAddressItem(new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.'));
143
+		$this->object->saveItem($item);
144 144
 
145
-		$item2 = $this->object->findItem( 'xyz', ['customer/address'] );
145
+		$item2 = $this->object->findItem('xyz', ['customer/address']);
146 146
 
147
-		$this->object->deleteItem( $item->getId() );
147
+		$this->object->deleteItem($item->getId());
148 148
 
149
-		$this->assertEquals( 2, count( $item->getAddressItems() ) );
150
-		$this->assertEquals( 2, count( $item2->getAddressItems() ) );
149
+		$this->assertEquals(2, count($item->getAddressItems()));
150
+		$this->assertEquals(2, count($item2->getAddressItems()));
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testGetSavePropertyItems()
155 155
 	{
156
-		$item = $this->object->findItem( 'UTC001', ['customer/property'] );
156
+		$item = $this->object->findItem('UTC001', ['customer/property']);
157 157
 
158
-		$item->setId( null )->setCode( 'xyz' );
159
-		$item->getPaymentAddress()->setEmail( '[email protected]' );
160
-		$this->object->saveItem( $item );
158
+		$item->setId(null)->setCode('xyz');
159
+		$item->getPaymentAddress()->setEmail('[email protected]');
160
+		$this->object->saveItem($item);
161 161
 
162
-		$item2 = $this->object->findItem( 'xyz', ['customer/property'] );
162
+		$item2 = $this->object->findItem('xyz', ['customer/property']);
163 163
 
164
-		$this->object->deleteItem( $item->getId() );
164
+		$this->object->deleteItem($item->getId());
165 165
 
166
-		$this->assertEquals( 1, count( $item->getPropertyItems() ) );
167
-		$this->assertEquals( 1, count( $item2->getPropertyItems() ) );
166
+		$this->assertEquals(1, count($item->getPropertyItems()));
167
+		$this->assertEquals(1, count($item2->getPropertyItems()));
168 168
 	}
169 169
 
170 170
 
171 171
 	public function testCreateSearch()
172 172
 	{
173
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
173
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
174 174
 	}
175 175
 
176 176
 
@@ -180,69 +180,69 @@  discard block
 block discarded – undo
180 180
 		$search = $this->object->createSearch();
181 181
 
182 182
 		$expr = [];
183
-		$expr[] = $search->compare( '!=', 'customer.id', null );
184
-		$expr[] = $search->compare( '==', 'customer.label', 'unitCustomer2' );
185
-		$expr[] = $search->compare( '==', 'customer.code', 'UTC002' );
186
-
187
-		$expr[] = $search->compare( '>=', 'customer.salutation', '' );
188
-		$expr[] = $search->compare( '>=', 'customer.company', '' );
189
-		$expr[] = $search->compare( '>=', 'customer.vatid', '' );
190
-		$expr[] = $search->compare( '>=', 'customer.title', '' );
191
-		$expr[] = $search->compare( '>=', 'customer.firstname', '' );
192
-		$expr[] = $search->compare( '>=', 'customer.lastname', '' );
193
-		$expr[] = $search->compare( '>=', 'customer.address1', '' );
194
-		$expr[] = $search->compare( '>=', 'customer.address2', '' );
195
-		$expr[] = $search->compare( '>=', 'customer.address3', '' );
196
-		$expr[] = $search->compare( '>=', 'customer.postal', '' );
197
-		$expr[] = $search->compare( '>=', 'customer.city', '' );
198
-		$expr[] = $search->compare( '>=', 'customer.state', '' );
199
-		$expr[] = $search->compare( '!=', 'customer.languageid', null );
200
-		$expr[] = $search->compare( '>=', 'customer.countryid', '' );
201
-		$expr[] = $search->compare( '>=', 'customer.telephone', '' );
202
-		$expr[] = $search->compare( '>=', 'customer.email', '' );
203
-		$expr[] = $search->compare( '>=', 'customer.telefax', '' );
204
-		$expr[] = $search->compare( '>=', 'customer.website', '' );
205
-		$expr[] = $search->compare( '>=', 'customer.longitude', '10.0' );
206
-		$expr[] = $search->compare( '>=', 'customer.latitude', '50.0' );
207
-
208
-		$expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' );
209
-		$expr[] = $search->compare( '>=', 'customer.password', '' );
210
-		$expr[] = $search->compare( '==', 'customer.status', 0 );
211
-		$expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' );
212
-		$expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' );
213
-		$expr[] = $search->compare( '==', 'customer.editor', $this->editor );
214
-
215
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
216
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
217
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
218
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
219
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
220
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
221
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
222
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
223
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
224
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
225
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
226
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
227
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
228
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
229
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
230
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
231
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
232
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
233
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
234
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
235
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
236
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
237
-		$expr[] = $search->compare( '==', 'customer.address.flag', 0 );
238
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
239
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
240
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
241
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
242
-
243
-		$search->setConditions( $search->combine( '&&', $expr ) );
244
-		$result = $this->object->searchItems( $search, [], $total );
245
-		$this->assertEquals( 1, count( $result ) );
183
+		$expr[] = $search->compare('!=', 'customer.id', null);
184
+		$expr[] = $search->compare('==', 'customer.label', 'unitCustomer2');
185
+		$expr[] = $search->compare('==', 'customer.code', 'UTC002');
186
+
187
+		$expr[] = $search->compare('>=', 'customer.salutation', '');
188
+		$expr[] = $search->compare('>=', 'customer.company', '');
189
+		$expr[] = $search->compare('>=', 'customer.vatid', '');
190
+		$expr[] = $search->compare('>=', 'customer.title', '');
191
+		$expr[] = $search->compare('>=', 'customer.firstname', '');
192
+		$expr[] = $search->compare('>=', 'customer.lastname', '');
193
+		$expr[] = $search->compare('>=', 'customer.address1', '');
194
+		$expr[] = $search->compare('>=', 'customer.address2', '');
195
+		$expr[] = $search->compare('>=', 'customer.address3', '');
196
+		$expr[] = $search->compare('>=', 'customer.postal', '');
197
+		$expr[] = $search->compare('>=', 'customer.city', '');
198
+		$expr[] = $search->compare('>=', 'customer.state', '');
199
+		$expr[] = $search->compare('!=', 'customer.languageid', null);
200
+		$expr[] = $search->compare('>=', 'customer.countryid', '');
201
+		$expr[] = $search->compare('>=', 'customer.telephone', '');
202
+		$expr[] = $search->compare('>=', 'customer.email', '');
203
+		$expr[] = $search->compare('>=', 'customer.telefax', '');
204
+		$expr[] = $search->compare('>=', 'customer.website', '');
205
+		$expr[] = $search->compare('>=', 'customer.longitude', '10.0');
206
+		$expr[] = $search->compare('>=', 'customer.latitude', '50.0');
207
+
208
+		$expr[] = $search->compare('==', 'customer.birthday', '1970-01-01');
209
+		$expr[] = $search->compare('>=', 'customer.password', '');
210
+		$expr[] = $search->compare('==', 'customer.status', 0);
211
+		$expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00');
212
+		$expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00');
213
+		$expr[] = $search->compare('==', 'customer.editor', $this->editor);
214
+
215
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
216
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
217
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
218
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
219
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
220
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
221
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
222
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
223
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
224
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
225
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
226
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
227
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
228
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
229
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
230
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
231
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
232
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
233
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
234
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
235
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
236
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
237
+		$expr[] = $search->compare('==', 'customer.address.flag', 0);
238
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
239
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
240
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
241
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
242
+
243
+		$search->setConditions($search->combine('&&', $expr));
244
+		$result = $this->object->searchItems($search, [], $total);
245
+		$this->assertEquals(1, count($result));
246 246
 	}
247 247
 
248 248
 
@@ -251,60 +251,60 @@  discard block
 block discarded – undo
251 251
 		$total = 0;
252 252
 
253 253
 		$search = $this->object->createSearch();
254
-		$search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) );
255
-		$search->setSlice( 0, 2 );
254
+		$search->setConditions($search->compare('==', 'customer.address.editor', $this->editor));
255
+		$search->setSlice(0, 2);
256 256
 
257
-		$results = $this->object->searchItems( $search, [], $total );
258
-		$this->assertEquals( 2, count( $results ) );
259
-		$this->assertEquals( 3, $total );
257
+		$results = $this->object->searchItems($search, [], $total);
258
+		$this->assertEquals(2, count($results));
259
+		$this->assertEquals(3, $total);
260 260
 
261
-		foreach($results as $itemId => $item) {
262
-			$this->assertEquals( $itemId, $item->getId() );
261
+		foreach ($results as $itemId => $item) {
262
+			$this->assertEquals($itemId, $item->getId());
263 263
 		}
264 264
 	}
265 265
 
266 266
 
267 267
 	public function testSearchItemsCriteria()
268 268
 	{
269
-		$search = $this->object->createSearch( true );
269
+		$search = $this->object->createSearch(true);
270 270
 		$conditions = array(
271
-			$search->compare( '==', 'customer.address.editor', $this->editor ),
271
+			$search->compare('==', 'customer.address.editor', $this->editor),
272 272
 			$search->getConditions()
273 273
 		);
274
-		$search->setConditions( $search->combine( '&&', $conditions ) );
275
-		$this->assertEquals( 2, count( $this->object->searchItems( $search, [], $total ) ) );
274
+		$search->setConditions($search->combine('&&', $conditions));
275
+		$this->assertEquals(2, count($this->object->searchItems($search, [], $total)));
276 276
 	}
277 277
 
278 278
 
279 279
 	public function testSearchItemsRef()
280 280
 	{
281 281
 		$search = $this->object->createSearch();
282
-		$search->setConditions( $search->compare( '==', 'customer.code', 'UTC001' ) );
282
+		$search->setConditions($search->compare('==', 'customer.code', 'UTC001'));
283 283
 
284
-		$results = $this->object->searchItems( $search, ['customer/address', 'text'] );
284
+		$results = $this->object->searchItems($search, ['customer/address', 'text']);
285 285
 
286
-		if( ( $item = reset( $results ) ) === false ) {
287
-			throw new \Exception( 'No customer item for "UTC001" available' );
286
+		if (($item = reset($results)) === false) {
287
+			throw new \Exception('No customer item for "UTC001" available');
288 288
 		}
289 289
 
290
-		$this->assertEquals( 1, count( $item->getRefItems( 'text' ) ) );
291
-		$this->assertEquals( 1, count( $item->getAddressItems() ) );
290
+		$this->assertEquals(1, count($item->getRefItems('text')));
291
+		$this->assertEquals(1, count($item->getAddressItems()));
292 292
 	}
293 293
 
294 294
 
295 295
 	public function testGetSubManager()
296 296
 	{
297
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) );
298
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
297
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address'));
298
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard'));
299 299
 
300
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
301
-		$this->object->getSubManager( 'unknown' );
300
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
301
+		$this->object->getSubManager('unknown');
302 302
 	}
303 303
 
304 304
 
305 305
 	public function testGetSubManagerInvalidName()
306 306
 	{
307
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
308
-		$this->object->getSubManager( 'address', 'unknown' );
307
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
308
+		$this->object->getSubManager('address', 'unknown');
309 309
 	}
310 310
 }
Please login to merge, or discard this patch.
lib/custom/setup/default/schema/customer.php 1 patch
Spacing   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -8,215 +8,215 @@
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'users' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
-
13
-			$table = $schema->createTable( 'users' );
14
-
15
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
16
-			$table->addColumn( 'superuser', 'smallint', array( 'default' => 0 ) );
17
-			$table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) );
18
-			$table->addColumn( 'label', 'string', array( 'length' => 255, 'default' => '' ) );
19
-			$table->addColumn( 'name', 'string', array( 'length' => 255 ) );
20
-			$table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) );
21
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8, 'default' => '' ) );
22
-			$table->addColumn( 'company', 'string', array( 'length' => 100, 'default' => '' ) );
23
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32, 'default' => '' ) );
24
-			$table->addColumn( 'title', 'string', array( 'length' => 64, 'default' => '' ) );
25
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64, 'default' => '' ) );
26
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64, 'default' => '' ) );
27
-			$table->addColumn( 'address1', 'string', array( 'length' => 200, 'default' => '' ) );
28
-			$table->addColumn( 'address2', 'string', array( 'length' => 200, 'default' => '' ) );
29
-			$table->addColumn( 'address3', 'string', array( 'length' => 200, 'default' => '' ) );
30
-			$table->addColumn( 'postal', 'string', array( 'length' => 16, 'default' => '' ) );
31
-			$table->addColumn( 'city', 'string', array( 'length' => 200, 'default' => '' ) );
32
-			$table->addColumn( 'state', 'string', array( 'length' => 200, 'default' => '' ) );
33
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
34
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
35
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32, 'default' => '' ) );
36
-			$table->addColumn( 'telefax', 'string', array( 'length' => 32, 'default' => '' ) );
37
-			$table->addColumn( 'website', 'string', array( 'length' => 255, 'default' => '' ) );
38
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
39
-			$table->addColumn( 'password', 'string', array( 'length' => 255 ) );
40
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
41
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
42
-			$table->addColumn( 'birthday', 'date', array( 'notnull' => false ) );
43
-			$table->addColumn( 'vdate', 'date', array( 'notnull' => false ) );
44
-			$table->addColumn( 'status', 'smallint', array( 'default' => 1 ) );
45
-			$table->addColumn( 'updated_at', 'datetime', [] );
46
-			$table->addColumn( 'created_at', 'datetime', [] );
47
-			$table->addColumn( 'editor', 'string', array('length' => 255, 'default' => '' ) );
48
-
49
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' );
50
-			$table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' );
51
-			$table->addIndex( array( 'langid' ), 'idx_lvusr_langid' );
52
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' );
53
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' );
54
-			$table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' );
55
-			$table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' );
56
-			$table->addIndex( array( 'address1' ), 'idx_lvusr_address1' );
57
-			$table->addIndex( array( 'city' ), 'idx_lvusr_city' );
11
+		'users' => function(\Doctrine\DBAL\Schema\Schema $schema) {
12
+
13
+			$table = $schema->createTable('users');
14
+
15
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
16
+			$table->addColumn('superuser', 'smallint', array('default' => 0));
17
+			$table->addColumn('siteid', 'integer', array('notnull' => false));
18
+			$table->addColumn('label', 'string', array('length' => 255, 'default' => ''));
19
+			$table->addColumn('name', 'string', array('length' => 255));
20
+			$table->addColumn('remember_token', 'string', array('length' => 100, 'notnull' => false));
21
+			$table->addColumn('salutation', 'string', array('length' => 8, 'default' => ''));
22
+			$table->addColumn('company', 'string', array('length' => 100, 'default' => ''));
23
+			$table->addColumn('vatid', 'string', array('length' => 32, 'default' => ''));
24
+			$table->addColumn('title', 'string', array('length' => 64, 'default' => ''));
25
+			$table->addColumn('firstname', 'string', array('length' => 64, 'default' => ''));
26
+			$table->addColumn('lastname', 'string', array('length' => 64, 'default' => ''));
27
+			$table->addColumn('address1', 'string', array('length' => 200, 'default' => ''));
28
+			$table->addColumn('address2', 'string', array('length' => 200, 'default' => ''));
29
+			$table->addColumn('address3', 'string', array('length' => 200, 'default' => ''));
30
+			$table->addColumn('postal', 'string', array('length' => 16, 'default' => ''));
31
+			$table->addColumn('city', 'string', array('length' => 200, 'default' => ''));
32
+			$table->addColumn('state', 'string', array('length' => 200, 'default' => ''));
33
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
34
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
35
+			$table->addColumn('telephone', 'string', array('length' => 32, 'default' => ''));
36
+			$table->addColumn('telefax', 'string', array('length' => 32, 'default' => ''));
37
+			$table->addColumn('website', 'string', array('length' => 255, 'default' => ''));
38
+			$table->addColumn('email', 'string', array('length' => 255));
39
+			$table->addColumn('password', 'string', array('length' => 255));
40
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
41
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
42
+			$table->addColumn('birthday', 'date', array('notnull' => false));
43
+			$table->addColumn('vdate', 'date', array('notnull' => false));
44
+			$table->addColumn('status', 'smallint', array('default' => 1));
45
+			$table->addColumn('updated_at', 'datetime', []);
46
+			$table->addColumn('created_at', 'datetime', []);
47
+			$table->addColumn('editor', 'string', array('length' => 255, 'default' => ''));
48
+
49
+			$table->setPrimaryKey(array('id'), 'pk_lvusr_id');
50
+			$table->addUniqueIndex(array('email'), 'unq_lvusr_email');
51
+			$table->addIndex(array('langid'), 'idx_lvusr_langid');
52
+			$table->addIndex(array('lastname', 'firstname'), 'idx_lvusr_last_first');
53
+			$table->addIndex(array('postal', 'address1'), 'idx_lvusr_post_addr1');
54
+			$table->addIndex(array('postal', 'city'), 'idx_lvusr_post_city');
55
+			$table->addIndex(array('lastname'), 'idx_lvusr_lastname');
56
+			$table->addIndex(array('address1'), 'idx_lvusr_address1');
57
+			$table->addIndex(array('city'), 'idx_lvusr_city');
58 58
 
59 59
 			return $schema;
60 60
 		},
61 61
 
62
-		'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
63
-
64
-			$table = $schema->createTable( 'users_address' );
65
-
66
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
67
-			$table->addColumn( 'siteid', 'integer', [] );
68
-			$table->addColumn( 'parentid', 'integer', [] );
69
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
70
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
71
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
72
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
73
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
74
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
75
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
76
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
77
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
78
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
79
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
80
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
81
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
82
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
83
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
84
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
85
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
86
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
87
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
88
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
89
-			$table->addColumn( 'flag', 'integer', [] );
90
-			$table->addColumn( 'pos', 'smallint', [] );
91
-			$table->addColumn( 'mtime', 'datetime', [] );
92
-			$table->addColumn( 'ctime', 'datetime', [] );
93
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
94
-
95
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' );
96
-			$table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' );
97
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' );
98
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' );
99
-			$table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' );
100
-			$table->addIndex( array( 'address1' ), 'idx_lvuad_address1' );
101
-			$table->addIndex( array( 'city' ), 'idx_lvuad_city' );
102
-			$table->addIndex( array( 'email' ), 'idx_lvuad_email' );
103
-
104
-			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
105
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuad_pid' );
62
+		'users_address' => function(\Doctrine\DBAL\Schema\Schema $schema) {
63
+
64
+			$table = $schema->createTable('users_address');
65
+
66
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
67
+			$table->addColumn('siteid', 'integer', []);
68
+			$table->addColumn('parentid', 'integer', []);
69
+			$table->addColumn('company', 'string', array('length' => 100));
70
+			$table->addColumn('vatid', 'string', array('length' => 32));
71
+			$table->addColumn('salutation', 'string', array('length' => 8));
72
+			$table->addColumn('title', 'string', array('length' => 64));
73
+			$table->addColumn('firstname', 'string', array('length' => 64));
74
+			$table->addColumn('lastname', 'string', array('length' => 64));
75
+			$table->addColumn('address1', 'string', array('length' => 200));
76
+			$table->addColumn('address2', 'string', array('length' => 200));
77
+			$table->addColumn('address3', 'string', array('length' => 200));
78
+			$table->addColumn('postal', 'string', array('length' => 16));
79
+			$table->addColumn('city', 'string', array('length' => 200));
80
+			$table->addColumn('state', 'string', array('length' => 200));
81
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
82
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
83
+			$table->addColumn('telephone', 'string', array('length' => 32));
84
+			$table->addColumn('email', 'string', array('length' => 255));
85
+			$table->addColumn('telefax', 'string', array('length' => 255));
86
+			$table->addColumn('website', 'string', array('length' => 255));
87
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
88
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
89
+			$table->addColumn('flag', 'integer', []);
90
+			$table->addColumn('pos', 'smallint', []);
91
+			$table->addColumn('mtime', 'datetime', []);
92
+			$table->addColumn('ctime', 'datetime', []);
93
+			$table->addColumn('editor', 'string', array('length' => 255));
94
+
95
+			$table->setPrimaryKey(array('id'), 'pk_lvuad_id');
96
+			$table->addIndex(array('parentid'), 'idx_lvuad_pid');
97
+			$table->addIndex(array('lastname', 'firstname'), 'idx_lvuad_last_first');
98
+			$table->addIndex(array('postal', 'address1'), 'idx_lvuad_post_addr1');
99
+			$table->addIndex(array('postal', 'city'), 'idx_lvuad_post_city');
100
+			$table->addIndex(array('address1'), 'idx_lvuad_address1');
101
+			$table->addIndex(array('city'), 'idx_lvuad_city');
102
+			$table->addIndex(array('email'), 'idx_lvuad_email');
103
+
104
+			$table->addForeignKeyConstraint('users', array('parentid'), array('id'),
105
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuad_pid');
106 106
 
107 107
 			return $schema;
108 108
 		},
109 109
 
110
-		'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
110
+		'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
111 111
 
112
-			$table = $schema->createTable( 'users_list_type' );
112
+			$table = $schema->createTable('users_list_type');
113 113
 
114
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
115
-			$table->addColumn( 'siteid', 'integer', [] );
116
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
117
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
118
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
119
-			$table->addColumn( 'pos', 'integer', [] );
120
-			$table->addColumn( 'status', 'smallint', [] );
121
-			$table->addColumn( 'mtime', 'datetime', [] );
122
-			$table->addColumn( 'ctime', 'datetime', [] );
123
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
114
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
115
+			$table->addColumn('siteid', 'integer', []);
116
+			$table->addColumn('domain', 'string', array('length' => 32));
117
+			$table->addColumn('code', 'string', array('length' => 32));
118
+			$table->addColumn('label', 'string', array('length' => 255));
119
+			$table->addColumn('pos', 'integer', []);
120
+			$table->addColumn('status', 'smallint', []);
121
+			$table->addColumn('mtime', 'datetime', []);
122
+			$table->addColumn('ctime', 'datetime', []);
123
+			$table->addColumn('editor', 'string', array('length' => 255));
124 124
 
125
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' );
126
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' );
127
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvulity_sid_status_pos' );
128
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' );
129
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' );
125
+			$table->setPrimaryKey(array('id'), 'pk_lvulity_id');
126
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code');
127
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvulity_sid_status_pos');
128
+			$table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label');
129
+			$table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code');
130 130
 
131 131
 			return $schema;
132 132
 		},
133 133
 
134
-		'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
135
-
136
-			$table = $schema->createTable( 'users_list' );
137
-
138
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
139
-			$table->addColumn( 'parentid', 'integer', [] );
140
-			$table->addColumn( 'siteid', 'integer', [] );
141
-			$table->addColumn( 'typeid', 'integer', [] );
142
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
143
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
144
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
145
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
146
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
147
-			$table->addColumn( 'pos', 'integer', [] );
148
-			$table->addColumn( 'status', 'smallint', [] );
149
-			$table->addColumn( 'mtime', 'datetime', [] );
150
-			$table->addColumn( 'ctime', 'datetime', [] );
151
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
152
-
153
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' );
154
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' );
155
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' );
156
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' );
157
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' );
158
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' );
159
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' );
160
-
161
-			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
162
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_pid' );
163
-
164
-			$table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ),
165
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' );
134
+		'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
135
+
136
+			$table = $schema->createTable('users_list');
137
+
138
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
139
+			$table->addColumn('parentid', 'integer', []);
140
+			$table->addColumn('siteid', 'integer', []);
141
+			$table->addColumn('typeid', 'integer', []);
142
+			$table->addColumn('domain', 'string', array('length' => 32));
143
+			$table->addColumn('refid', 'string', array('length' => 32));
144
+			$table->addColumn('start', 'datetime', array('notnull' => false));
145
+			$table->addColumn('end', 'datetime', array('notnull' => false));
146
+			$table->addColumn('config', 'text', array('length' => 0xffff));
147
+			$table->addColumn('pos', 'integer', []);
148
+			$table->addColumn('status', 'smallint', []);
149
+			$table->addColumn('mtime', 'datetime', []);
150
+			$table->addColumn('ctime', 'datetime', []);
151
+			$table->addColumn('editor', 'string', array('length' => 255));
152
+
153
+			$table->setPrimaryKey(array('id'), 'pk_lvuli_id');
154
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid');
155
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end');
156
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid');
157
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start');
158
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end');
159
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos');
160
+
161
+			$table->addForeignKeyConstraint('users', array('parentid'), array('id'),
162
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_pid');
163
+
164
+			$table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'),
165
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid');
166 166
 
167 167
 			return $schema;
168 168
 		},
169 169
 
170
-		'users_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
170
+		'users_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
171 171
 
172
-			$table = $schema->createTable( 'users_property_type' );
172
+			$table = $schema->createTable('users_property_type');
173 173
 
174
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
175
-			$table->addColumn( 'siteid', 'integer', [] );
176
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
177
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
178
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
179
-			$table->addColumn( 'pos', 'integer', [] );
180
-			$table->addColumn( 'status', 'smallint', [] );
181
-			$table->addColumn( 'mtime', 'datetime', [] );
182
-			$table->addColumn( 'ctime', 'datetime', [] );
183
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
174
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
175
+			$table->addColumn('siteid', 'integer', []);
176
+			$table->addColumn('domain', 'string', array('length' => 32));
177
+			$table->addColumn('code', 'string', array('length' => 32));
178
+			$table->addColumn('label', 'string', array('length' => 255));
179
+			$table->addColumn('pos', 'integer', []);
180
+			$table->addColumn('status', 'smallint', []);
181
+			$table->addColumn('mtime', 'datetime', []);
182
+			$table->addColumn('ctime', 'datetime', []);
183
+			$table->addColumn('editor', 'string', array('length' => 255));
184 184
 
185
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvuprty_id' );
186
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvuprty_sid_dom_code' );
187
-			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvuprty_sid_status_pos' );
188
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_lvuprty_sid_label' );
189
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_lvuprty_sid_code' );
185
+			$table->setPrimaryKey(array('id'), 'pk_lvuprty_id');
186
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvuprty_sid_dom_code');
187
+			$table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvuprty_sid_status_pos');
188
+			$table->addIndex(array('siteid', 'label'), 'idx_lvuprty_sid_label');
189
+			$table->addIndex(array('siteid', 'code'), 'idx_lvuprty_sid_code');
190 190
 
191 191
 			return $schema;
192 192
 		},
193 193
 
194
-		'users_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
194
+		'users_property' => function(\Doctrine\DBAL\Schema\Schema $schema) {
195 195
 
196
-			$table = $schema->createTable( 'users_property' );
196
+			$table = $schema->createTable('users_property');
197 197
 
198
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
199
-			$table->addColumn( 'siteid', 'integer', [] );
200
-			$table->addColumn( 'parentid', 'integer', [] );
201
-			$table->addColumn( 'typeid', 'integer', [] );
202
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
203
-			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
204
-			$table->addColumn( 'mtime', 'datetime', [] );
205
-			$table->addColumn( 'ctime', 'datetime', [] );
206
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
198
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
199
+			$table->addColumn('siteid', 'integer', []);
200
+			$table->addColumn('parentid', 'integer', []);
201
+			$table->addColumn('typeid', 'integer', []);
202
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
203
+			$table->addColumn('value', 'string', array('length' => 255));
204
+			$table->addColumn('mtime', 'datetime', []);
205
+			$table->addColumn('ctime', 'datetime', []);
206
+			$table->addColumn('editor', 'string', array('length' => 255));
207 207
 
208
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvupr_id' );
209
-			$table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_lvupr_sid_tid_lid_value' );
210
-			$table->addIndex( array( 'siteid', 'langid' ), 'idx_lvupr_sid_langid' );
211
-			$table->addIndex( array( 'siteid', 'value' ), 'idx_lvupr_sid_value' );
212
-			$table->addIndex( array( 'typeid' ), 'fk_lvupr_typeid' );
213
-			$table->addIndex( array( 'parentid' ), 'fk_lvupr_pid' );
208
+			$table->setPrimaryKey(array('id'), 'pk_lvupr_id');
209
+			$table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_lvupr_sid_tid_lid_value');
210
+			$table->addIndex(array('siteid', 'langid'), 'idx_lvupr_sid_langid');
211
+			$table->addIndex(array('siteid', 'value'), 'idx_lvupr_sid_value');
212
+			$table->addIndex(array('typeid'), 'fk_lvupr_typeid');
213
+			$table->addIndex(array('parentid'), 'fk_lvupr_pid');
214 214
 
215
-			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
216
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_pid' );
215
+			$table->addForeignKeyConstraint('users', array('parentid'), array('id'),
216
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_pid');
217 217
 
218
-			$table->addForeignKeyConstraint( 'users_property_type', array( 'typeid' ), array( 'id' ),
219
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_typeid' );
218
+			$table->addForeignKeyConstraint('users_property_type', array('typeid'), array('id'),
219
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_typeid');
220 220
 
221 221
 			return $schema;
222 222
 		},
Please login to merge, or discard this patch.