Completed
Push — master ( b71140...add649 )
by Aimeos
02:33
created
lib/custom/tests/MShop/Customer/Manager/Lists/Type/LaravelTest.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
 	protected function setUp()
23 23
 	{
24 24
 		$this->editor = \TestHelper::getContext()->getEditor();
25
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelper::getContext(), 'Laravel' );
25
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager(\TestHelper::getContext(), 'Laravel');
26 26
 
27
-		$listManager = $manager->getSubManager( 'lists', 'Laravel' );
28
-		$this->object = $listManager->getSubManager( 'type', 'Laravel' );
27
+		$listManager = $manager->getSubManager('lists', 'Laravel');
28
+		$this->object = $listManager->getSubManager('type', 'Laravel');
29 29
 	}
30 30
 
31 31
 
@@ -37,20 +37,20 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	protected function tearDown()
39 39
 	{
40
-		unset( $this->object );
40
+		unset($this->object);
41 41
 	}
42 42
 
43 43
 
44 44
 	public function testCleanup()
45 45
 	{
46
-		$this->object->cleanup( array( -1 ) );
46
+		$this->object->cleanup(array( -1 ));
47 47
 	}
48 48
 
49 49
 
50 50
 	public function testCreateItem()
51 51
 	{
52 52
 		$item = $this->object->createItem();
53
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item );
53
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Type\\Iface', $item);
54 54
 	}
55 55
 
56 56
 
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
 		$search->setSlice(0, 1);
61 61
 		$results = $this->object->searchItems($search);
62 62
 
63
-		if( ( $expected = reset($results) ) === false ) {
64
-			throw new \RuntimeException( 'No list type item found' );
63
+		if (($expected = reset($results)) === false) {
64
+			throw new \RuntimeException('No list type item found');
65 65
 		}
66 66
 
67
-		$this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) );
67
+		$this->assertEquals($expected, $this->object->getItem($expected->getId()));
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testGetSubManager()
72 72
 	{
73
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
74
-		$this->object->getSubManager( 'unknown' );
73
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
74
+		$this->object->getSubManager('unknown');
75 75
 	}
76 76
 
77 77
 
@@ -81,48 +81,48 @@  discard block
 block discarded – undo
81 81
 		$search->setSlice(0, 1);
82 82
 		$results = $this->object->searchItems($search);
83 83
 
84
-		if( ( $item = reset($results) ) === false ) {
85
-			throw new \RuntimeException( 'No type item found' );
84
+		if (($item = reset($results)) === false) {
85
+			throw new \RuntimeException('No type item found');
86 86
 		}
87 87
 
88 88
 		$item->setId(null);
89
-		$item->setCode( 'unitTestInit' );
90
-		$this->object->saveItem( $item );
91
-		$itemSaved = $this->object->getItem( $item->getId() );
89
+		$item->setCode('unitTestInit');
90
+		$this->object->saveItem($item);
91
+		$itemSaved = $this->object->getItem($item->getId());
92 92
 
93 93
 		$itemExp = clone $itemSaved;
94
-		$itemExp->setCode( 'unitTestSave' );
95
-		$this->object->saveItem( $itemExp );
96
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
94
+		$itemExp->setCode('unitTestSave');
95
+		$this->object->saveItem($itemExp);
96
+		$itemUpd = $this->object->getItem($itemExp->getId());
97 97
 
98
-		$this->object->deleteItem( $itemSaved->getId() );
98
+		$this->object->deleteItem($itemSaved->getId());
99 99
 
100 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->getCode(), $itemSaved->getCode() );
105
-		$this->assertEquals( $item->getDomain(), $itemSaved->getDomain() );
106
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
107
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
101
+		$this->assertTrue($item->getId() !== null);
102
+		$this->assertEquals($item->getId(), $itemSaved->getId());
103
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
104
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
105
+		$this->assertEquals($item->getDomain(), $itemSaved->getDomain());
106
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
107
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
108 108
 
109
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
110
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
111
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
109
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
110
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
111
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
112 112
 
113
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
114
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
115
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
116
-		$this->assertEquals( $itemExp->getDomain(), $itemUpd->getDomain() );
117
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
118
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
113
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
114
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
115
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
116
+		$this->assertEquals($itemExp->getDomain(), $itemUpd->getDomain());
117
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
118
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
119 119
 
120
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
121
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
122
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
120
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
121
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
122
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
123 123
 
124 124
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
125
-		$this->object->getItem( $itemSaved->getId() );
125
+		$this->object->getItem($itemSaved->getId());
126 126
 	}
127 127
 
128 128
 
@@ -132,25 +132,25 @@  discard block
 block discarded – undo
132 132
 		$search = $this->object->createSearch();
133 133
 
134 134
 		$expr = array();
135
-		$expr[] = $search->compare( '!=', 'customer.lists.type.id', 0 );
136
-		$expr[] = $search->compare( '!=', 'customer.lists.type.siteid', null );
137
-		$expr[] = $search->compare( '==', 'customer.lists.type.code', 'default' );
138
-		$expr[] = $search->compare( '==', 'customer.lists.type.domain', 'text' );
139
-		$expr[] = $search->compare( '==', 'customer.lists.type.label', 'Standard' );
140
-		$expr[] = $search->compare( '==', 'customer.lists.type.status', 1 );
141
-		$expr[] = $search->compare( '>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00' );
142
-		$expr[] = $search->compare( '>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00' );
143
-		$expr[] = $search->compare( '==', 'customer.lists.type.editor', $this->editor );
144
-
145
-		$search->setConditions( $search->combine( '&&', $expr ) );
135
+		$expr[] = $search->compare('!=', 'customer.lists.type.id', 0);
136
+		$expr[] = $search->compare('!=', 'customer.lists.type.siteid', null);
137
+		$expr[] = $search->compare('==', 'customer.lists.type.code', 'default');
138
+		$expr[] = $search->compare('==', 'customer.lists.type.domain', 'text');
139
+		$expr[] = $search->compare('==', 'customer.lists.type.label', 'Standard');
140
+		$expr[] = $search->compare('==', 'customer.lists.type.status', 1);
141
+		$expr[] = $search->compare('>=', 'customer.lists.type.mtime', '1970-01-01 00:00:00');
142
+		$expr[] = $search->compare('>=', 'customer.lists.type.ctime', '1970-01-01 00:00:00');
143
+		$expr[] = $search->compare('==', 'customer.lists.type.editor', $this->editor);
144
+
145
+		$search->setConditions($search->combine('&&', $expr));
146 146
 		$search->setSlice(0, 1);
147 147
 
148
-		$results = $this->object->searchItems( $search, array(), $total );
149
-		$this->assertEquals( 1, count( $results ) );
150
-		$this->assertEquals( 1, $total );
148
+		$results = $this->object->searchItems($search, array(), $total);
149
+		$this->assertEquals(1, count($results));
150
+		$this->assertEquals(1, $total);
151 151
 
152
-		foreach($results as $itemId => $item) {
153
-			$this->assertEquals( $itemId, $item->getId() );
152
+		foreach ($results as $itemId => $item) {
153
+			$this->assertEquals($itemId, $item->getId());
154 154
 		}
155 155
 	}
156 156
 
Please login to merge, or discard this patch.
lib/custom/setup/unittest/data/customer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2014
6 6
  */
7 7
 
8
-return array (
9
-	'customer' => array (
10
-		'customer/unitCustomer1' => array( 'label' => 'Max Mustermann', 'code' => 'unitCustomer1', 'status' => 1, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => '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' => 'unittest' ),
11
-		'customer/unitCustomer2' => array( 'label' => 'Erika Mustermann', 'code' => 'unitCustomer2', 'status' => 1, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mrs', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0' ),
12
-		'customer/unitCustomer3' => array( 'label' => 'Franz-Xaver Gabler', 'code' => 'unitCustomer3', 'status' => 0, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => '', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1' ),
8
+return array(
9
+	'customer' => array(
10
+		'customer/unitCustomer1' => array('label' => 'Max Mustermann', 'code' => 'unitCustomer1', 'status' => 1, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => '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' => 'unittest'),
11
+		'customer/unitCustomer2' => array('label' => 'Erika Mustermann', 'code' => 'unitCustomer2', 'status' => 1, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mrs', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'longitude' => '10.5', 'latitude' => '51.0', 'birthday' => '1970-01-01', 'status' => '0'),
12
+		'customer/unitCustomer3' => array('label' => 'Franz-Xaver Gabler', 'code' => 'unitCustomer3', 'status' => 0, 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => '', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'longitude' => '11.0', 'latitude' => '52.0', 'birthday' => '1970-01-01', 'status' => '1'),
13 13
 	),
14 14
 
15
-	'customer/address' => array (
16
-		array ( 'parentid' => 'customer/unitCustomer1', '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/unitCustomer2', '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/unitCustomer2', '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/unitCustomer3', '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' ),
15
+	'customer/address' => array(
16
+		array('parentid' => 'customer/unitCustomer1', '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/unitCustomer2', '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/unitCustomer2', '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/unitCustomer3', '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/default/schema/customer.php 1 patch
Spacing   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -8,152 +8,152 @@
 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( 'label', 'string', array( 'length' => 255 ) );
17
-			$table->addColumn( 'name', 'string', array( 'length' => 255 ) );
18
-			$table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) );
19
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
20
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
21
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
22
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
23
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
24
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
25
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
26
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
27
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
28
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
29
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
30
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
31
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
32
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
33
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
34
-			$table->addColumn( 'telefax', 'string', array( 'length' => 32 ) );
35
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
36
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
37
-			$table->addColumn( 'password', 'string', array( 'length' => 255 ) );
38
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
39
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
40
-			$table->addColumn( 'birthday', 'date', array( 'notnull' => false ) );
41
-			$table->addColumn( 'vdate', 'date', array( 'notnull' => false ) );
42
-			$table->addColumn( 'status', 'smallint', array() );
43
-			$table->addColumn( 'updated_at', 'datetime', array() );
44
-			$table->addColumn( 'created_at', 'datetime', array() );
45
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
46
-
47
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' );
48
-			$table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' );
49
-			$table->addIndex( array( 'langid' ), 'idx_lvusr_langid' );
50
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' );
51
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' );
52
-			$table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' );
53
-			$table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' );
54
-			$table->addIndex( array( 'address1' ), 'idx_lvusr_address1' );
55
-			$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('label', 'string', array('length' => 255));
17
+			$table->addColumn('name', 'string', array('length' => 255));
18
+			$table->addColumn('remember_token', 'string', array('length' => 100, 'notnull' => false));
19
+			$table->addColumn('salutation', 'string', array('length' => 8));
20
+			$table->addColumn('company', 'string', array('length' => 100));
21
+			$table->addColumn('vatid', 'string', array('length' => 32));
22
+			$table->addColumn('title', 'string', array('length' => 64));
23
+			$table->addColumn('firstname', 'string', array('length' => 64));
24
+			$table->addColumn('lastname', 'string', array('length' => 64));
25
+			$table->addColumn('address1', 'string', array('length' => 200));
26
+			$table->addColumn('address2', 'string', array('length' => 200));
27
+			$table->addColumn('address3', 'string', array('length' => 200));
28
+			$table->addColumn('postal', 'string', array('length' => 16));
29
+			$table->addColumn('city', 'string', array('length' => 200));
30
+			$table->addColumn('state', 'string', array('length' => 200));
31
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
32
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
33
+			$table->addColumn('telephone', 'string', array('length' => 32));
34
+			$table->addColumn('telefax', 'string', array('length' => 32));
35
+			$table->addColumn('website', 'string', array('length' => 255));
36
+			$table->addColumn('email', 'string', array('length' => 255));
37
+			$table->addColumn('password', 'string', array('length' => 255));
38
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
39
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
40
+			$table->addColumn('birthday', 'date', array('notnull' => false));
41
+			$table->addColumn('vdate', 'date', array('notnull' => false));
42
+			$table->addColumn('status', 'smallint', array());
43
+			$table->addColumn('updated_at', 'datetime', array());
44
+			$table->addColumn('created_at', 'datetime', array());
45
+			$table->addColumn('editor', 'string', array('length' => 255));
46
+
47
+			$table->setPrimaryKey(array('id'), 'pk_lvusr_id');
48
+			$table->addUniqueIndex(array('email'), 'unq_lvusr_email');
49
+			$table->addIndex(array('langid'), 'idx_lvusr_langid');
50
+			$table->addIndex(array('lastname', 'firstname'), 'idx_lvusr_last_first');
51
+			$table->addIndex(array('postal', 'address1'), 'idx_lvusr_post_addr1');
52
+			$table->addIndex(array('postal', 'city'), 'idx_lvusr_post_city');
53
+			$table->addIndex(array('lastname'), 'idx_lvusr_lastname');
54
+			$table->addIndex(array('address1'), 'idx_lvusr_address1');
55
+			$table->addIndex(array('city'), 'idx_lvusr_city');
56 56
 
57 57
 			return $schema;
58 58
 		},
59 59
 
60
-		'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
61
-
62
-			$table = $schema->createTable( 'users_address' );
63
-
64
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
65
-			$table->addColumn( 'siteid', 'integer', array() );
66
-			$table->addColumn( 'parentid', 'integer', array() );
67
-			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
68
-			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
69
-			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
70
-			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
71
-			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
72
-			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
73
-			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
74
-			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
75
-			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
76
-			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
77
-			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
78
-			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
79
-			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
80
-			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
81
-			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
82
-			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
83
-			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
84
-			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
85
-			$table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
86
-			$table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) );
87
-			$table->addColumn( 'flag', 'integer', array() );
88
-			$table->addColumn( 'pos', 'smallint', array() );
89
-			$table->addColumn( 'mtime', 'datetime', array() );
90
-			$table->addColumn( 'ctime', 'datetime', array() );
91
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
92
-
93
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' );
94
-			$table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' );
95
-			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' );
96
-			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' );
97
-			$table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' );
98
-			$table->addIndex( array( 'address1' ), 'idx_lvusr_address1' );
99
-			$table->addIndex( array( 'city' ), 'idx_lvuad_city' );
100
-			$table->addIndex( array( 'email' ), 'idx_lvuad_email' );
60
+		'users_address' => function(\Doctrine\DBAL\Schema\Schema $schema) {
61
+
62
+			$table = $schema->createTable('users_address');
63
+
64
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
65
+			$table->addColumn('siteid', 'integer', array());
66
+			$table->addColumn('parentid', 'integer', array());
67
+			$table->addColumn('company', 'string', array('length' => 100));
68
+			$table->addColumn('vatid', 'string', array('length' => 32));
69
+			$table->addColumn('salutation', 'string', array('length' => 8));
70
+			$table->addColumn('title', 'string', array('length' => 64));
71
+			$table->addColumn('firstname', 'string', array('length' => 64));
72
+			$table->addColumn('lastname', 'string', array('length' => 64));
73
+			$table->addColumn('address1', 'string', array('length' => 200));
74
+			$table->addColumn('address2', 'string', array('length' => 200));
75
+			$table->addColumn('address3', 'string', array('length' => 200));
76
+			$table->addColumn('postal', 'string', array('length' => 16));
77
+			$table->addColumn('city', 'string', array('length' => 200));
78
+			$table->addColumn('state', 'string', array('length' => 200));
79
+			$table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false));
80
+			$table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true));
81
+			$table->addColumn('telephone', 'string', array('length' => 32));
82
+			$table->addColumn('email', 'string', array('length' => 255));
83
+			$table->addColumn('telefax', 'string', array('length' => 255));
84
+			$table->addColumn('website', 'string', array('length' => 255));
85
+			$table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
86
+			$table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false));
87
+			$table->addColumn('flag', 'integer', array());
88
+			$table->addColumn('pos', 'smallint', array());
89
+			$table->addColumn('mtime', 'datetime', array());
90
+			$table->addColumn('ctime', 'datetime', array());
91
+			$table->addColumn('editor', 'string', array('length' => 255));
92
+
93
+			$table->setPrimaryKey(array('id'), 'pk_lvuad_id');
94
+			$table->addIndex(array('parentid'), 'idx_lvuad_pid');
95
+			$table->addIndex(array('lastname', 'firstname'), 'idx_lvuad_last_first');
96
+			$table->addIndex(array('postal', 'address1'), 'idx_lvuad_post_addr1');
97
+			$table->addIndex(array('postal', 'city'), 'idx_lvuad_post_city');
98
+			$table->addIndex(array('address1'), 'idx_lvusr_address1');
99
+			$table->addIndex(array('city'), 'idx_lvuad_city');
100
+			$table->addIndex(array('email'), 'idx_lvuad_email');
101 101
 
102 102
 			return $schema;
103 103
 		},
104 104
 
105
-		'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
105
+		'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) {
106 106
 
107
-			$table = $schema->createTable( 'users_list_type' );
107
+			$table = $schema->createTable('users_list_type');
108 108
 
109
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
110
-			$table->addColumn( 'siteid', 'integer', array() );
111
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
112
-			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
113
-			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
114
-			$table->addColumn( 'status', 'smallint', array() );
115
-			$table->addColumn( 'mtime', 'datetime', array() );
116
-			$table->addColumn( 'ctime', 'datetime', array() );
117
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
109
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
110
+			$table->addColumn('siteid', 'integer', array());
111
+			$table->addColumn('domain', 'string', array('length' => 32));
112
+			$table->addColumn('code', 'string', array('length' => 32));
113
+			$table->addColumn('label', 'string', array('length' => 255));
114
+			$table->addColumn('status', 'smallint', array());
115
+			$table->addColumn('mtime', 'datetime', array());
116
+			$table->addColumn('ctime', 'datetime', array());
117
+			$table->addColumn('editor', 'string', array('length' => 255));
118 118
 
119
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' );
120
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' );
121
-			$table->addIndex( array( 'siteid', 'status' ), 'idx_lvulity_sid_status' );
122
-			$table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' );
123
-			$table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' );
119
+			$table->setPrimaryKey(array('id'), 'pk_lvulity_id');
120
+			$table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code');
121
+			$table->addIndex(array('siteid', 'status'), 'idx_lvulity_sid_status');
122
+			$table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label');
123
+			$table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code');
124 124
 
125 125
 			return $schema;
126 126
 		},
127 127
 
128
-		'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
129
-
130
-			$table = $schema->createTable( 'users_list' );
131
-
132
-			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
133
-			$table->addColumn( 'parentid', 'integer', array() );
134
-			$table->addColumn( 'siteid', 'integer', array() );
135
-			$table->addColumn( 'typeid', 'integer', array() );
136
-			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
137
-			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
138
-			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
139
-			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
140
-			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
141
-			$table->addColumn( 'pos', 'integer', array() );
142
-			$table->addColumn( 'status', 'smallint', array() );
143
-			$table->addColumn( 'mtime', 'datetime', array() );
144
-			$table->addColumn( 'ctime', 'datetime', array() );
145
-			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
146
-
147
-			$table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' );
148
-			$table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' );
149
-			$table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' );
150
-			$table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' );
151
-			$table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' );
152
-			$table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' );
153
-			$table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' );
154
-
155
-			$table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ),
156
-				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' );
128
+		'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) {
129
+
130
+			$table = $schema->createTable('users_list');
131
+
132
+			$table->addColumn('id', 'integer', array('autoincrement' => true));
133
+			$table->addColumn('parentid', 'integer', array());
134
+			$table->addColumn('siteid', 'integer', array());
135
+			$table->addColumn('typeid', 'integer', array());
136
+			$table->addColumn('domain', 'string', array('length' => 32));
137
+			$table->addColumn('refid', 'string', array('length' => 32));
138
+			$table->addColumn('start', 'datetime', array('notnull' => false));
139
+			$table->addColumn('end', 'datetime', array('notnull' => false));
140
+			$table->addColumn('config', 'text', array('length' => 0xffff));
141
+			$table->addColumn('pos', 'integer', array());
142
+			$table->addColumn('status', 'smallint', array());
143
+			$table->addColumn('mtime', 'datetime', array());
144
+			$table->addColumn('ctime', 'datetime', array());
145
+			$table->addColumn('editor', 'string', array('length' => 255));
146
+
147
+			$table->setPrimaryKey(array('id'), 'pk_lvuli_id');
148
+			$table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid');
149
+			$table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end');
150
+			$table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid');
151
+			$table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start');
152
+			$table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end');
153
+			$table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos');
154
+
155
+			$table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'),
156
+				array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid');
157 157
 
158 158
 			return $schema;
159 159
 		},
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/LaravelTest.php 1 patch
Spacing   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		$context = \TestHelper::getContext();
24 24
 		$this->editor = $context->getEditor();
25
-		$this->object = new \Aimeos\MShop\Customer\Manager\Laravel( $context );
25
+		$this->object = new \Aimeos\MShop\Customer\Manager\Laravel($context);
26 26
 
27 27
 		$this->fixture = array(
28 28
 			'label' => 'unitTest',
29 29
 			'status' => 2,
30 30
 		);
31 31
 
32
-		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard( 'common.address.' );
32
+		$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('common.address.');
33 33
 	}
34 34
 
35 35
 
@@ -38,28 +38,28 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	protected function tearDown()
40 40
 	{
41
-		unset( $this->object, $this->fixture, $this->address );
41
+		unset($this->object, $this->fixture, $this->address);
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCleanup()
46 46
 	{
47
-		$this->object->cleanup( array( -1 ) );
47
+		$this->object->cleanup(array( -1 ));
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testGetSearchAttributes()
52 52
 	{
53
-		foreach( $this->object->getSearchAttributes() as $attribute )
53
+		foreach ($this->object->getSearchAttributes() as $attribute)
54 54
 		{
55
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
55
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
56 56
 		}
57 57
 	}
58 58
 
59 59
 
60 60
 	public function testCreateItem()
61 61
 	{
62
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem() );
62
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Customer\\Item\\Iface', $this->object->createItem());
63 63
 	}
64 64
 
65 65
 
@@ -67,21 +67,21 @@  discard block
 block discarded – undo
67 67
 	{
68 68
 		$search = $this->object->createSearch();
69 69
 		$conditions = array(
70
-			$search->compare( '==', 'customer.code', 'unitCustomer3' ),
71
-			$search->compare( '==', 'customer.editor', $this->editor )
70
+			$search->compare('==', 'customer.code', 'unitCustomer3'),
71
+			$search->compare('==', 'customer.editor', $this->editor)
72 72
 		);
73
-		$search->setConditions( $search->combine( '&&', $conditions ) );
74
-		$items = $this->object->searchItems( $search, array( 'text' ) );
73
+		$search->setConditions($search->combine('&&', $conditions));
74
+		$items = $this->object->searchItems($search, array('text'));
75 75
 
76
-		if( ( $expected = reset( $items ) ) === false ) {
77
-			throw new \RuntimeException( 'No customer item with code "unitCustomer3" found' );
76
+		if (($expected = reset($items)) === false) {
77
+			throw new \RuntimeException('No customer item with code "unitCustomer3" found');
78 78
 		}
79 79
 
80
-		$actual = $this->object->getItem( $expected->getId(), array( 'text' ) );
80
+		$actual = $this->object->getItem($expected->getId(), array('text'));
81 81
 
82
-		$this->assertEquals( $expected, $actual );
83
-		$this->assertEquals( 3, count( $actual->getListItems( 'text' ) ) );
84
-		$this->assertEquals( 3, count( $actual->getRefItems( 'text' ) ) );
82
+		$this->assertEquals($expected, $actual);
83
+		$this->assertEquals(3, count($actual->getListItems('text')));
84
+		$this->assertEquals(3, count($actual->getRefItems('text')));
85 85
 	}
86 86
 
87 87
 
@@ -89,54 +89,54 @@  discard block
 block discarded – undo
89 89
 	{
90 90
 		$item = $this->object->createItem();
91 91
 
92
-		$item->setCode( 'unitTest' );
93
-		$item->setLabel( 'unitTest' );
94
-		$this->object->saveItem( $item );
95
-		$itemSaved = $this->object->getItem( $item->getId() );
92
+		$item->setCode('unitTest');
93
+		$item->setLabel('unitTest');
94
+		$this->object->saveItem($item);
95
+		$itemSaved = $this->object->getItem($item->getId());
96 96
 
97 97
 		$itemExp = clone $itemSaved;
98
-		$itemExp->setCode( 'unitTest2' );
99
-		$itemExp->setLabel( 'unitTest2' );
100
-		$this->object->saveItem( $itemExp );
101
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
102
-
103
-		$this->object->deleteItem( $item->getId() );
104
-
105
-		$this->assertTrue( $item->getId() !== null );
106
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
107
-		$this->assertEquals( $item->getSiteId(), $itemSaved->getSiteId() );
108
-		$this->assertEquals( $item->getStatus(), $itemSaved->getStatus() );
109
-		$this->assertEquals( $item->getCode(), $itemSaved->getCode() );
110
-		$this->assertEquals( $item->getLabel(), $itemSaved->getLabel() );
111
-		$this->assertEquals( $item->getPaymentAddress(), $itemSaved->getPaymentAddress() );
112
-		$this->assertEquals( $item->getBirthday(), $itemSaved->getBirthday() );
113
-		$this->assertEquals( $item->getPassword(), $itemSaved->getPassword() );
114
-
115
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
116
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
117
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() );
118
-
119
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
120
-		$this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() );
121
-		$this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() );
122
-		$this->assertEquals( $itemExp->getCode(), $itemUpd->getCode() );
123
-		$this->assertEquals( $itemExp->getLabel(), $itemUpd->getLabel() );
124
-		$this->assertEquals( $itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress() );
125
-		$this->assertEquals( $itemExp->getBirthday(), $itemUpd->getBirthday() );
126
-		$this->assertEquals( $itemExp->getPassword(), $itemUpd->getPassword() );
127
-
128
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
129
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
130
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
131
-
132
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
133
-		$this->object->getItem( $item->getId() );
98
+		$itemExp->setCode('unitTest2');
99
+		$itemExp->setLabel('unitTest2');
100
+		$this->object->saveItem($itemExp);
101
+		$itemUpd = $this->object->getItem($itemExp->getId());
102
+
103
+		$this->object->deleteItem($item->getId());
104
+
105
+		$this->assertTrue($item->getId() !== null);
106
+		$this->assertEquals($item->getId(), $itemSaved->getId());
107
+		$this->assertEquals($item->getSiteId(), $itemSaved->getSiteId());
108
+		$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
109
+		$this->assertEquals($item->getCode(), $itemSaved->getCode());
110
+		$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
111
+		$this->assertEquals($item->getPaymentAddress(), $itemSaved->getPaymentAddress());
112
+		$this->assertEquals($item->getBirthday(), $itemSaved->getBirthday());
113
+		$this->assertEquals($item->getPassword(), $itemSaved->getPassword());
114
+
115
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
116
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
117
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
118
+
119
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
120
+		$this->assertEquals($itemExp->getSiteId(), $itemUpd->getSiteId());
121
+		$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
122
+		$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
123
+		$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
124
+		$this->assertEquals($itemExp->getPaymentAddress(), $itemUpd->getPaymentAddress());
125
+		$this->assertEquals($itemExp->getBirthday(), $itemUpd->getBirthday());
126
+		$this->assertEquals($itemExp->getPassword(), $itemUpd->getPassword());
127
+
128
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
129
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
130
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
131
+
132
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
133
+		$this->object->getItem($item->getId());
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testCreateSearch()
138 138
 	{
139
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
139
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
140 140
 	}
141 141
 
142 142
 
@@ -146,69 +146,69 @@  discard block
 block discarded – undo
146 146
 		$search = $this->object->createSearch();
147 147
 
148 148
 		$expr = array();
149
-		$expr[] = $search->compare( '!=', 'customer.id', null );
150
-		$expr[] = $search->compare( '==', 'customer.label', 'Erika Mustermann' );
151
-		$expr[] = $search->compare( '==', 'customer.code', 'unitCustomer2' );
152
-
153
-		$expr[] = $search->compare( '>=', 'customer.salutation', '' );
154
-		$expr[] = $search->compare( '>=', 'customer.company', '' );
155
-		$expr[] = $search->compare( '>=', 'customer.vatid', '' );
156
-		$expr[] = $search->compare( '>=', 'customer.title', '' );
157
-		$expr[] = $search->compare( '>=', 'customer.firstname', '' );
158
-		$expr[] = $search->compare( '>=', 'customer.lastname', '' );
159
-		$expr[] = $search->compare( '>=', 'customer.address1', '' );
160
-		$expr[] = $search->compare( '>=', 'customer.address2', '' );
161
-		$expr[] = $search->compare( '>=', 'customer.address3', '' );
162
-		$expr[] = $search->compare( '>=', 'customer.postal', '' );
163
-		$expr[] = $search->compare( '>=', 'customer.city', '' );
164
-		$expr[] = $search->compare( '>=', 'customer.state', '' );
165
-		$expr[] = $search->compare( '!=', 'customer.languageid', null );
166
-		$expr[] = $search->compare( '>=', 'customer.countryid', '' );
167
-		$expr[] = $search->compare( '>=', 'customer.telephone', '' );
168
-		$expr[] = $search->compare( '>=', 'customer.email', '' );
169
-		$expr[] = $search->compare( '>=', 'customer.telefax', '' );
170
-		$expr[] = $search->compare( '>=', 'customer.website', '' );
171
-		$expr[] = $search->compare( '>=', 'customer.longitude', '10.0' );
172
-		$expr[] = $search->compare( '>=', 'customer.latitude', '50.0' );
173
-
174
-		$expr[] = $search->compare( '==', 'customer.birthday', '1970-01-01' );
175
-		$expr[] = $search->compare( '>=', 'customer.password', '' );
176
-		$expr[] = $search->compare( '==', 'customer.status', 0 );
177
-		$expr[] = $search->compare( '!=', 'customer.mtime', '1970-01-01 00:00:00' );
178
-		$expr[] = $search->compare( '!=', 'customer.ctime', '1970-01-01 00:00:00' );
179
-		$expr[] = $search->compare( '==', 'customer.editor', $this->editor );
180
-
181
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
182
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
183
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
184
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
185
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
186
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
187
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
188
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
189
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
190
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
191
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
192
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
193
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
194
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
195
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
196
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
197
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
198
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
199
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
200
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
201
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
202
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
203
-		$expr[] = $search->compare( '==', 'customer.address.flag', 0 );
204
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
205
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
206
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
207
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
208
-
209
-		$search->setConditions( $search->combine( '&&', $expr ) );
210
-		$result = $this->object->searchItems( $search, array(), $total );
211
-		$this->assertEquals( 1, count( $result ) );
149
+		$expr[] = $search->compare('!=', 'customer.id', null);
150
+		$expr[] = $search->compare('==', 'customer.label', 'Erika Mustermann');
151
+		$expr[] = $search->compare('==', 'customer.code', 'unitCustomer2');
152
+
153
+		$expr[] = $search->compare('>=', 'customer.salutation', '');
154
+		$expr[] = $search->compare('>=', 'customer.company', '');
155
+		$expr[] = $search->compare('>=', 'customer.vatid', '');
156
+		$expr[] = $search->compare('>=', 'customer.title', '');
157
+		$expr[] = $search->compare('>=', 'customer.firstname', '');
158
+		$expr[] = $search->compare('>=', 'customer.lastname', '');
159
+		$expr[] = $search->compare('>=', 'customer.address1', '');
160
+		$expr[] = $search->compare('>=', 'customer.address2', '');
161
+		$expr[] = $search->compare('>=', 'customer.address3', '');
162
+		$expr[] = $search->compare('>=', 'customer.postal', '');
163
+		$expr[] = $search->compare('>=', 'customer.city', '');
164
+		$expr[] = $search->compare('>=', 'customer.state', '');
165
+		$expr[] = $search->compare('!=', 'customer.languageid', null);
166
+		$expr[] = $search->compare('>=', 'customer.countryid', '');
167
+		$expr[] = $search->compare('>=', 'customer.telephone', '');
168
+		$expr[] = $search->compare('>=', 'customer.email', '');
169
+		$expr[] = $search->compare('>=', 'customer.telefax', '');
170
+		$expr[] = $search->compare('>=', 'customer.website', '');
171
+		$expr[] = $search->compare('>=', 'customer.longitude', '10.0');
172
+		$expr[] = $search->compare('>=', 'customer.latitude', '50.0');
173
+
174
+		$expr[] = $search->compare('==', 'customer.birthday', '1970-01-01');
175
+		$expr[] = $search->compare('>=', 'customer.password', '');
176
+		$expr[] = $search->compare('==', 'customer.status', 0);
177
+		$expr[] = $search->compare('!=', 'customer.mtime', '1970-01-01 00:00:00');
178
+		$expr[] = $search->compare('!=', 'customer.ctime', '1970-01-01 00:00:00');
179
+		$expr[] = $search->compare('==', 'customer.editor', $this->editor);
180
+
181
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
182
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
183
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
184
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
185
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
186
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
187
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
188
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
189
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
190
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
191
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
192
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
193
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
194
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
195
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
196
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
197
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
198
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
199
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
200
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
201
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
202
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
203
+		$expr[] = $search->compare('==', 'customer.address.flag', 0);
204
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
205
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
206
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
207
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
208
+
209
+		$search->setConditions($search->combine('&&', $expr));
210
+		$result = $this->object->searchItems($search, array(), $total);
211
+		$this->assertEquals(1, count($result));
212 212
 	}
213 213
 
214 214
 
@@ -217,44 +217,44 @@  discard block
 block discarded – undo
217 217
 		$total = 0;
218 218
 
219 219
 		$search = $this->object->createSearch();
220
-		$search->setConditions( $search->compare( '==', 'customer.address.editor', $this->editor ) );
221
-		$search->setSlice( 0, 2 );
220
+		$search->setConditions($search->compare('==', 'customer.address.editor', $this->editor));
221
+		$search->setSlice(0, 2);
222 222
 
223
-		$results = $this->object->searchItems( $search, array(), $total );
224
-		$this->assertEquals( 2, count( $results ) );
225
-		$this->assertEquals( 3, $total );
223
+		$results = $this->object->searchItems($search, array(), $total);
224
+		$this->assertEquals(2, count($results));
225
+		$this->assertEquals(3, $total);
226 226
 
227
-		foreach($results as $itemId => $item) {
228
-			$this->assertEquals( $itemId, $item->getId() );
227
+		foreach ($results as $itemId => $item) {
228
+			$this->assertEquals($itemId, $item->getId());
229 229
 		}
230 230
 	}
231 231
 
232 232
 
233 233
 	public function testSearchItemsBaseCriteria()
234 234
 	{
235
-		$search = $this->object->createSearch( true );
235
+		$search = $this->object->createSearch(true);
236 236
 		$conditions = array(
237
-			$search->compare( '==', 'customer.address.editor', $this->editor ),
237
+			$search->compare('==', 'customer.address.editor', $this->editor),
238 238
 			$search->getConditions()
239 239
 		);
240
-		$search->setConditions( $search->combine( '&&', $conditions ) );
241
-		$this->assertEquals( 2, count( $this->object->searchItems( $search, array(), $total ) ) );
240
+		$search->setConditions($search->combine('&&', $conditions));
241
+		$this->assertEquals(2, count($this->object->searchItems($search, array(), $total)));
242 242
 	}
243 243
 
244 244
 
245 245
 	public function testGetSubManager()
246 246
 	{
247
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address' ) );
248
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'address', 'Standard' ) );
247
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address'));
248
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('address', 'Standard'));
249 249
 
250
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
251
-		$this->object->getSubManager( 'unknown' );
250
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
251
+		$this->object->getSubManager('unknown');
252 252
 	}
253 253
 
254 254
 
255 255
 	public function testGetSubManagerInvalidName()
256 256
 	{
257
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
258
-		$this->object->getSubManager( 'address', 'unknown' );
257
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
258
+		$this->object->getSubManager('address', 'unknown');
259 259
 	}
260 260
 }
Please login to merge, or discard this patch.
lib/custom/tests/MShop/Customer/Manager/Address/LaravelTest.php 1 patch
Spacing   +130 added lines, -130 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 	{
22 22
 		$context = \TestHelper::getContext();
23 23
 		$this->editor = $context->getEditor();
24
-		$customer = new \Aimeos\MShop\Customer\Manager\Laravel( $context );
24
+		$customer = new \Aimeos\MShop\Customer\Manager\Laravel($context);
25 25
 
26 26
 		$search = $customer->createSearch();
27 27
 		$conditions = array(
28
-			$search->compare( '==', 'customer.code', 'unitCustomer1' ),
29
-			$search->compare( '==', 'customer.editor', $this->editor )
28
+			$search->compare('==', 'customer.code', 'unitCustomer1'),
29
+			$search->compare('==', 'customer.editor', $this->editor)
30 30
 		);
31
-		$search->setConditions( $search->combine( '&&', $conditions ) );
32
-		$result = $customer->searchItems( $search );
31
+		$search->setConditions($search->combine('&&', $conditions));
32
+		$result = $customer->searchItems($search);
33 33
 
34
-		if( ( $customerItem = reset( $result ) ) === false ) {
35
-			throw new \RuntimeException( sprintf( 'No customer item found for code "%1$s"', 'unitCustomer1' ) );
34
+		if (($customerItem = reset($result)) === false) {
35
+			throw new \RuntimeException(sprintf('No customer item found for code "%1$s"', 'unitCustomer1'));
36 36
 		}
37 37
 
38 38
 		$this->fixture = array(
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 			'customer.address.siteid' => $context->getLocale()->getSiteId(),
62 62
 		);
63 63
 
64
-		$this->object = $customer->getSubManager( 'address', 'Laravel' );
64
+		$this->object = $customer->getSubManager('address', 'Laravel');
65 65
 	}
66 66
 
67 67
 
@@ -70,130 +70,130 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	protected function tearDown()
72 72
 	{
73
-		unset( $this->object, $this->fixture );
73
+		unset($this->object, $this->fixture);
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testCleanup()
78 78
 	{
79
-		$this->object->cleanup( array( -1 ) );
79
+		$this->object->cleanup(array( -1 ));
80 80
 	}
81 81
 
82 82
 	public function testGetSearchAttributes()
83 83
 	{
84
-		foreach( $this->object->getSearchAttributes() as $attribute ) {
85
-			$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute );
84
+		foreach ($this->object->getSearchAttributes() as $attribute) {
85
+			$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Attribute\\Iface', $attribute);
86 86
 		}
87 87
 	}
88 88
 
89 89
 	public function 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 \RuntimeException( 'No address item with company "ABC" found' );
101
+		if (($item = reset($items)) === false) {
102
+			throw new \RuntimeException('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 testGetSubManager()
109 109
 	{
110
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
111
-		$this->object->getSubManager( 'unknown' );
110
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
111
+		$this->object->getSubManager('unknown');
112 112
 	}
113 113
 
114 114
 	public function testSaveUpdateDeleteItem()
115 115
 	{
116
-		$item = new \Aimeos\MShop\Common\Item\Address\Standard( 'customer.address.', $this->fixture );
117
-		$item->setId( null );
118
-		$this->object->saveItem( $item );
119
-		$itemSaved = $this->object->getItem( $item->getId() );
116
+		$item = new \Aimeos\MShop\Common\Item\Address\Standard('customer.address.', $this->fixture);
117
+		$item->setId(null);
118
+		$this->object->saveItem($item);
119
+		$itemSaved = $this->object->getItem($item->getId());
120 120
 
121 121
 		$itemExp = clone $itemSaved;
122
-		$itemExp->setPosition( 1 );
123
-		$itemExp->setCity( 'Berlin' );
124
-		$itemExp->setState( 'Berlin' );
125
-		$this->object->saveItem( $itemExp );
126
-		$itemUpd = $this->object->getItem( $itemExp->getId() );
127
-
128
-		$this->object->deleteItem( $itemSaved->getId() );
129
-
130
-
131
-		$this->assertTrue( $item->getId() !== null );
132
-		$this->assertEquals( $item->getId(), $itemSaved->getId() );
133
-		$this->assertEquals( $item->getParentId(), $itemSaved->getParentId());
134
-		$this->assertEquals( $item->getPosition(), $itemSaved->getPosition());
135
-		$this->assertEquals( $item->getCompany(), $itemSaved->getCompany());
136
-		$this->assertEquals( $item->getVatID(), $itemSaved->getVatID());
137
-		$this->assertEquals( $item->getSalutation(), $itemSaved->getSalutation());
138
-		$this->assertEquals( $item->getTitle(), $itemSaved->getTitle());
139
-		$this->assertEquals( $item->getFirstname(), $itemSaved->getFirstname());
140
-		$this->assertEquals( $item->getLastname(), $itemSaved->getLastname());
141
-		$this->assertEquals( $item->getAddress1(), $itemSaved->getAddress1());
142
-		$this->assertEquals( $item->getAddress2(), $itemSaved->getAddress2());
143
-		$this->assertEquals( $item->getAddress3(), $itemSaved->getAddress3());
144
-		$this->assertEquals( $item->getPostal(), $itemSaved->getPostal());
145
-		$this->assertEquals( $item->getCity(), $itemSaved->getCity());
146
-		$this->assertEquals( $item->getState(), $itemSaved->getState());
147
-		$this->assertEquals( $item->getCountryId(), $itemSaved->getCountryId());
148
-		$this->assertEquals( $item->getLanguageId(), $itemSaved->getLanguageId());
149
-		$this->assertEquals( $item->getTelephone(), $itemSaved->getTelephone());
150
-		$this->assertEquals( $item->getEmail(), $itemSaved->getEmail());
151
-		$this->assertEquals( $item->getTelefax(), $itemSaved->getTelefax());
152
-		$this->assertEquals( $item->getWebsite(), $itemSaved->getWebsite());
153
-		$this->assertEquals( $item->getLongitude(), $itemSaved->getLongitude());
154
-		$this->assertEquals( $item->getLatitude(), $itemSaved->getLatitude());
155
-		$this->assertEquals( $item->getFlag(), $itemSaved->getFlag());
156
-
157
-		$this->assertEquals( $this->editor, $itemSaved->getEditor() );
158
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() );
122
+		$itemExp->setPosition(1);
123
+		$itemExp->setCity('Berlin');
124
+		$itemExp->setState('Berlin');
125
+		$this->object->saveItem($itemExp);
126
+		$itemUpd = $this->object->getItem($itemExp->getId());
127
+
128
+		$this->object->deleteItem($itemSaved->getId());
129
+
130
+
131
+		$this->assertTrue($item->getId() !== null);
132
+		$this->assertEquals($item->getId(), $itemSaved->getId());
133
+		$this->assertEquals($item->getParentId(), $itemSaved->getParentId());
134
+		$this->assertEquals($item->getPosition(), $itemSaved->getPosition());
135
+		$this->assertEquals($item->getCompany(), $itemSaved->getCompany());
136
+		$this->assertEquals($item->getVatID(), $itemSaved->getVatID());
137
+		$this->assertEquals($item->getSalutation(), $itemSaved->getSalutation());
138
+		$this->assertEquals($item->getTitle(), $itemSaved->getTitle());
139
+		$this->assertEquals($item->getFirstname(), $itemSaved->getFirstname());
140
+		$this->assertEquals($item->getLastname(), $itemSaved->getLastname());
141
+		$this->assertEquals($item->getAddress1(), $itemSaved->getAddress1());
142
+		$this->assertEquals($item->getAddress2(), $itemSaved->getAddress2());
143
+		$this->assertEquals($item->getAddress3(), $itemSaved->getAddress3());
144
+		$this->assertEquals($item->getPostal(), $itemSaved->getPostal());
145
+		$this->assertEquals($item->getCity(), $itemSaved->getCity());
146
+		$this->assertEquals($item->getState(), $itemSaved->getState());
147
+		$this->assertEquals($item->getCountryId(), $itemSaved->getCountryId());
148
+		$this->assertEquals($item->getLanguageId(), $itemSaved->getLanguageId());
149
+		$this->assertEquals($item->getTelephone(), $itemSaved->getTelephone());
150
+		$this->assertEquals($item->getEmail(), $itemSaved->getEmail());
151
+		$this->assertEquals($item->getTelefax(), $itemSaved->getTelefax());
152
+		$this->assertEquals($item->getWebsite(), $itemSaved->getWebsite());
153
+		$this->assertEquals($item->getLongitude(), $itemSaved->getLongitude());
154
+		$this->assertEquals($item->getLatitude(), $itemSaved->getLatitude());
155
+		$this->assertEquals($item->getFlag(), $itemSaved->getFlag());
156
+
157
+		$this->assertEquals($this->editor, $itemSaved->getEditor());
158
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated());
159 159
 		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified());
160 160
 
161
-		$this->assertEquals( $itemExp->getId(), $itemUpd->getId() );
162
-		$this->assertEquals( $itemExp->getParentId(), $itemUpd->getParentId());
163
-		$this->assertEquals( $itemExp->getPosition(), $itemUpd->getPosition());
164
-		$this->assertEquals( $itemExp->getCompany(), $itemUpd->getCompany());
165
-		$this->assertEquals( $itemExp->getVatID(), $itemUpd->getVatID());
166
-		$this->assertEquals( $itemExp->getSalutation(), $itemUpd->getSalutation());
167
-		$this->assertEquals( $itemExp->getTitle(), $itemUpd->getTitle());
168
-		$this->assertEquals( $itemExp->getFirstname(), $itemUpd->getFirstname());
169
-		$this->assertEquals( $itemExp->getLastname(), $itemUpd->getLastname());
170
-		$this->assertEquals( $itemExp->getAddress1(), $itemUpd->getAddress1());
171
-		$this->assertEquals( $itemExp->getAddress2(), $itemUpd->getAddress2());
172
-		$this->assertEquals( $itemExp->getAddress3(), $itemUpd->getAddress3());
173
-		$this->assertEquals( $itemExp->getPostal(), $itemUpd->getPostal());
174
-		$this->assertEquals( $itemExp->getCity(), $itemUpd->getCity());
175
-		$this->assertEquals( $itemExp->getState(), $itemUpd->getState());
176
-		$this->assertEquals( $itemExp->getCountryId(), $itemUpd->getCountryId());
177
-		$this->assertEquals( $itemExp->getLanguageId(), $itemUpd->getLanguageId());
178
-		$this->assertEquals( $itemExp->getTelephone(), $itemUpd->getTelephone());
179
-		$this->assertEquals( $itemExp->getEmail(), $itemUpd->getEmail());
180
-		$this->assertEquals( $itemExp->getTelefax(), $itemUpd->getTelefax());
181
-		$this->assertEquals( $itemExp->getWebsite(), $itemUpd->getWebsite());
182
-		$this->assertEquals( $itemExp->getLongitude(), $itemUpd->getLongitude());
183
-		$this->assertEquals( $itemExp->getLatitude(), $itemUpd->getLatitude());
184
-		$this->assertEquals( $itemExp->getFlag(), $itemUpd->getFlag());
185
-
186
-		$this->assertEquals( $this->editor, $itemUpd->getEditor() );
187
-		$this->assertEquals( $itemExp->getTimeCreated(), $itemUpd->getTimeCreated() );
188
-		$this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified() );
161
+		$this->assertEquals($itemExp->getId(), $itemUpd->getId());
162
+		$this->assertEquals($itemExp->getParentId(), $itemUpd->getParentId());
163
+		$this->assertEquals($itemExp->getPosition(), $itemUpd->getPosition());
164
+		$this->assertEquals($itemExp->getCompany(), $itemUpd->getCompany());
165
+		$this->assertEquals($itemExp->getVatID(), $itemUpd->getVatID());
166
+		$this->assertEquals($itemExp->getSalutation(), $itemUpd->getSalutation());
167
+		$this->assertEquals($itemExp->getTitle(), $itemUpd->getTitle());
168
+		$this->assertEquals($itemExp->getFirstname(), $itemUpd->getFirstname());
169
+		$this->assertEquals($itemExp->getLastname(), $itemUpd->getLastname());
170
+		$this->assertEquals($itemExp->getAddress1(), $itemUpd->getAddress1());
171
+		$this->assertEquals($itemExp->getAddress2(), $itemUpd->getAddress2());
172
+		$this->assertEquals($itemExp->getAddress3(), $itemUpd->getAddress3());
173
+		$this->assertEquals($itemExp->getPostal(), $itemUpd->getPostal());
174
+		$this->assertEquals($itemExp->getCity(), $itemUpd->getCity());
175
+		$this->assertEquals($itemExp->getState(), $itemUpd->getState());
176
+		$this->assertEquals($itemExp->getCountryId(), $itemUpd->getCountryId());
177
+		$this->assertEquals($itemExp->getLanguageId(), $itemUpd->getLanguageId());
178
+		$this->assertEquals($itemExp->getTelephone(), $itemUpd->getTelephone());
179
+		$this->assertEquals($itemExp->getEmail(), $itemUpd->getEmail());
180
+		$this->assertEquals($itemExp->getTelefax(), $itemUpd->getTelefax());
181
+		$this->assertEquals($itemExp->getWebsite(), $itemUpd->getWebsite());
182
+		$this->assertEquals($itemExp->getLongitude(), $itemUpd->getLongitude());
183
+		$this->assertEquals($itemExp->getLatitude(), $itemUpd->getLatitude());
184
+		$this->assertEquals($itemExp->getFlag(), $itemUpd->getFlag());
185
+
186
+		$this->assertEquals($this->editor, $itemUpd->getEditor());
187
+		$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
188
+		$this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemUpd->getTimeModified());
189 189
 
190 190
 		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
191
-		$this->object->getItem( $itemSaved->getId() );
191
+		$this->object->getItem($itemSaved->getId());
192 192
 	}
193 193
 
194 194
 	public function testCreateSearch()
195 195
 	{
196
-		$this->assertInstanceOf( '\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch() );
196
+		$this->assertInstanceOf('\\Aimeos\\MW\\Criteria\\Iface', $this->object->createSearch());
197 197
 	}
198 198
 
199 199
 
@@ -202,36 +202,36 @@  discard block
 block discarded – undo
202 202
 		$search = $this->object->createSearch();
203 203
 
204 204
 		$expr = array();
205
-		$expr[] = $search->compare( '!=', 'customer.address.id', null );
206
-		$expr[] = $search->compare( '!=', 'customer.address.parentid', null );
207
-		$expr[] = $search->compare( '==', 'customer.address.company', 'ABC GmbH' );
208
-		$expr[] = $search->compare( '==', 'customer.address.vatid', 'DE999999999' );
209
-		$expr[] = $search->compare( '==', 'customer.address.salutation', 'mr' );
210
-		$expr[] = $search->compare( '==', 'customer.address.title', 'Dr.' );
211
-		$expr[] = $search->compare( '==', 'customer.address.firstname', 'Good' );
212
-		$expr[] = $search->compare( '==', 'customer.address.lastname', 'Unittest' );
213
-		$expr[] = $search->compare( '==', 'customer.address.address1', 'Pickhuben' );
214
-		$expr[] = $search->compare( '==', 'customer.address.address2', '2-4' );
215
-		$expr[] = $search->compare( '==', 'customer.address.address3', '' );
216
-		$expr[] = $search->compare( '==', 'customer.address.postal', '11099' );
217
-		$expr[] = $search->compare( '==', 'customer.address.city', 'Berlin' );
218
-		$expr[] = $search->compare( '==', 'customer.address.state', 'Berlin' );
219
-		$expr[] = $search->compare( '==', 'customer.address.languageid', 'de' );
220
-		$expr[] = $search->compare( '==', 'customer.address.countryid', 'DE' );
221
-		$expr[] = $search->compare( '==', 'customer.address.telephone', '055544332221' );
222
-		$expr[] = $search->compare( '==', 'customer.address.email', '[email protected]' );
223
-		$expr[] = $search->compare( '==', 'customer.address.telefax', '055544333212' );
224
-		$expr[] = $search->compare( '==', 'customer.address.website', 'unittest.aimeos.org' );
225
-		$expr[] = $search->compare( '>=', 'customer.address.longitude', '10.0' );
226
-		$expr[] = $search->compare( '>=', 'customer.address.latitude', '50.0' );
227
-		$expr[] = $search->compare( '==', 'customer.address.flag', 0 );
228
-		$expr[] = $search->compare( '==', 'customer.address.position', 1 );
229
-		$expr[] = $search->compare( '!=', 'customer.address.mtime', '1970-01-01 00:00:00' );
230
-		$expr[] = $search->compare( '!=', 'customer.address.ctime', '1970-01-01 00:00:00' );
231
-		$expr[] = $search->compare( '==', 'customer.address.editor', $this->editor );
232
-
233
-		$search->setConditions( $search->combine( '&&', $expr ) );
234
-		$this->assertEquals( 1, count( $this->object->searchItems( $search ) ) );
205
+		$expr[] = $search->compare('!=', 'customer.address.id', null);
206
+		$expr[] = $search->compare('!=', 'customer.address.parentid', null);
207
+		$expr[] = $search->compare('==', 'customer.address.company', 'ABC GmbH');
208
+		$expr[] = $search->compare('==', 'customer.address.vatid', 'DE999999999');
209
+		$expr[] = $search->compare('==', 'customer.address.salutation', 'mr');
210
+		$expr[] = $search->compare('==', 'customer.address.title', 'Dr.');
211
+		$expr[] = $search->compare('==', 'customer.address.firstname', 'Good');
212
+		$expr[] = $search->compare('==', 'customer.address.lastname', 'Unittest');
213
+		$expr[] = $search->compare('==', 'customer.address.address1', 'Pickhuben');
214
+		$expr[] = $search->compare('==', 'customer.address.address2', '2-4');
215
+		$expr[] = $search->compare('==', 'customer.address.address3', '');
216
+		$expr[] = $search->compare('==', 'customer.address.postal', '11099');
217
+		$expr[] = $search->compare('==', 'customer.address.city', 'Berlin');
218
+		$expr[] = $search->compare('==', 'customer.address.state', 'Berlin');
219
+		$expr[] = $search->compare('==', 'customer.address.languageid', 'de');
220
+		$expr[] = $search->compare('==', 'customer.address.countryid', 'DE');
221
+		$expr[] = $search->compare('==', 'customer.address.telephone', '055544332221');
222
+		$expr[] = $search->compare('==', 'customer.address.email', '[email protected]');
223
+		$expr[] = $search->compare('==', 'customer.address.telefax', '055544333212');
224
+		$expr[] = $search->compare('==', 'customer.address.website', 'unittest.aimeos.org');
225
+		$expr[] = $search->compare('>=', 'customer.address.longitude', '10.0');
226
+		$expr[] = $search->compare('>=', 'customer.address.latitude', '50.0');
227
+		$expr[] = $search->compare('==', 'customer.address.flag', 0);
228
+		$expr[] = $search->compare('==', 'customer.address.position', 1);
229
+		$expr[] = $search->compare('!=', 'customer.address.mtime', '1970-01-01 00:00:00');
230
+		$expr[] = $search->compare('!=', 'customer.address.ctime', '1970-01-01 00:00:00');
231
+		$expr[] = $search->compare('==', 'customer.address.editor', $this->editor);
232
+
233
+		$search->setConditions($search->combine('&&', $expr));
234
+		$this->assertEquals(1, count($this->object->searchItems($search)));
235 235
 	}
236 236
 
237 237
 
@@ -241,20 +241,20 @@  discard block
 block discarded – undo
241 241
 		$search = $this->object->createSearch();
242 242
 
243 243
 		$conditions = array(
244
-			$search->compare( '~=', 'customer.address.company', 'ABC GmbH' ),
245
-			$search->compare( '==', 'customer.address.editor', $this->editor )
244
+			$search->compare('~=', 'customer.address.company', 'ABC GmbH'),
245
+			$search->compare('==', 'customer.address.editor', $this->editor)
246 246
 		);
247 247
 
248
-		$search->setConditions( $search->combine( '&&', $conditions ) );
249
-		$search->setSlice( 0, 1 );
248
+		$search->setConditions($search->combine('&&', $conditions));
249
+		$search->setSlice(0, 1);
250 250
 
251
-		$results = $this->object->searchItems( $search, array(), $total );
251
+		$results = $this->object->searchItems($search, array(), $total);
252 252
 
253
-		$this->assertEquals( 1, count( $results ) );
254
-		$this->assertEquals( 2, $total );
253
+		$this->assertEquals(1, count($results));
254
+		$this->assertEquals(2, $total);
255 255
 
256
-		foreach( $results as $id => $item ) {
257
-			$this->assertEquals( $id, $item->getId() );
256
+		foreach ($results as $id => $item) {
257
+			$this->assertEquals($id, $item->getId());
258 258
 		}
259 259
 	}
260 260
 }
Please login to merge, or discard this patch.
lib/custom/src/MShop/Customer/Manager/Laravel.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @param array $siteids List of IDs for sites whose entries should be deleted
242 242
 	 */
243
-	public function cleanup( array $siteids )
243
+	public function cleanup(array $siteids)
244 244
 	{
245 245
 		$path = 'mshop/customer/manager/submanagers';
246
-		foreach( $this->getContext()->getConfig()->get( $path, array( 'address', 'lists' ) ) as $domain ) {
247
-			$this->getSubManager( $domain )->cleanup( $siteids );
246
+		foreach ($this->getContext()->getConfig()->get($path, array('address', 'lists')) as $domain) {
247
+			$this->getSubManager($domain)->cleanup($siteids);
248 248
 		}
249 249
 	}
250 250
 
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 	 *
266 266
 	 * @param array $ids List of IDs
267 267
 	 */
268
-	public function deleteItems( array $ids )
268
+	public function deleteItems(array $ids)
269 269
 	{
270 270
 		$path = 'mshop/customer/manager/laravel/delete';
271
-		$this->deleteItemsBase( $ids, $path, false );
271
+		$this->deleteItemsBase($ids, $path, false);
272 272
 	}
273 273
 
274 274
 
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
 	 * @param boolean $withsub Return also attributes of sub-managers if true
279 279
 	 * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface
280 280
 	 */
281
-	public function getSearchAttributes( $withsub = true )
281
+	public function getSearchAttributes($withsub = true)
282 282
 	{
283 283
 		$path = 'mshop/customer/manager/submanagers';
284 284
 
285
-		return $this->getSearchAttributesBase( $this->searchConfig, $path, array( 'address', 'lists' ), $withsub );
285
+		return $this->getSearchAttributesBase($this->searchConfig, $path, array('address', 'lists'), $withsub);
286 286
 	}
287 287
 
288 288
 
@@ -292,27 +292,27 @@  discard block
 block discarded – undo
292 292
 	 * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object
293 293
 	 * @param boolean $fetch True if the new ID should be returned in the item
294 294
 	 */
295
-	public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
295
+	public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true)
296 296
 	{
297 297
 		$iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface';
298
-		if( !( $item instanceof $iface ) ) {
299
-			throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
298
+		if (!($item instanceof $iface)) {
299
+			throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface));
300 300
 		}
301 301
 
302
-		if( !$item->isModified() ) { return; }
302
+		if (!$item->isModified()) { return; }
303 303
 
304 304
 		$context = $this->getContext();
305 305
 		$dbm = $context->getDatabaseManager();
306 306
 		$dbname = $this->getResourceName();
307
-		$conn = $dbm->acquire( $dbname );
307
+		$conn = $dbm->acquire($dbname);
308 308
 
309 309
 		try
310 310
 		{
311 311
 			$id = $item->getId();
312
-			$date = date( 'Y-m-d H:i:s' );
312
+			$date = date('Y-m-d H:i:s');
313 313
 			$billingAddress = $item->getPaymentAddress();
314 314
 
315
-			if( $id === null )
315
+			if ($id === null)
316 316
 			{
317 317
 				/** mshop/customer/manager/laravel/insert
318 318
 				 * Inserts a new customer record into the database table
@@ -376,47 +376,47 @@  discard block
 block discarded – undo
376 376
 				$path = 'mshop/customer/manager/laravel/update';
377 377
 			}
378 378
 
379
-			$stmt = $this->getCachedStatement( $conn, $path );
380
-
381
-			$stmt->bind( 1, $item->getCode() );
382
-			$stmt->bind( 2, $billingAddress->getCompany() );
383
-			$stmt->bind( 3, $billingAddress->getVatID() );
384
-			$stmt->bind( 4, $billingAddress->getSalutation() );
385
-			$stmt->bind( 5, $billingAddress->getTitle() );
386
-			$stmt->bind( 6, $billingAddress->getFirstname() );
387
-			$stmt->bind( 7, $billingAddress->getLastname() );
388
-			$stmt->bind( 8, $billingAddress->getAddress1() );
389
-			$stmt->bind( 9, $billingAddress->getAddress2() );
390
-			$stmt->bind( 10, $billingAddress->getAddress3() );
391
-			$stmt->bind( 11, $billingAddress->getPostal() );
392
-			$stmt->bind( 12, $billingAddress->getCity() );
393
-			$stmt->bind( 13, $billingAddress->getState() );
394
-			$stmt->bind( 14, $billingAddress->getCountryId() );
395
-			$stmt->bind( 15, $billingAddress->getLanguageId() );
396
-			$stmt->bind( 16, $billingAddress->getTelephone() );
397
-			$stmt->bind( 17, $billingAddress->getTelefax() );
398
-			$stmt->bind( 18, $billingAddress->getWebsite() );
399
-			$stmt->bind( 19, $billingAddress->getEmail() );
400
-			$stmt->bind( 20, $billingAddress->getLongitude() );
401
-			$stmt->bind( 21, $billingAddress->getLatitude() );
402
-			$stmt->bind( 22, $item->getLabel() );
403
-			$stmt->bind( 23, $item->getBirthday() );
404
-			$stmt->bind( 24, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT );
405
-			$stmt->bind( 25, $item->getDateVerified() );
406
-			$stmt->bind( 26, $item->getPassword() );
407
-			$stmt->bind( 27, $date ); // Modification time
408
-			$stmt->bind( 28, $context->getEditor() );
409
-
410
-			if( $id !== null ) {
411
-				$stmt->bind( 29, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT );
412
-				$item->setId( $id );
379
+			$stmt = $this->getCachedStatement($conn, $path);
380
+
381
+			$stmt->bind(1, $item->getCode());
382
+			$stmt->bind(2, $billingAddress->getCompany());
383
+			$stmt->bind(3, $billingAddress->getVatID());
384
+			$stmt->bind(4, $billingAddress->getSalutation());
385
+			$stmt->bind(5, $billingAddress->getTitle());
386
+			$stmt->bind(6, $billingAddress->getFirstname());
387
+			$stmt->bind(7, $billingAddress->getLastname());
388
+			$stmt->bind(8, $billingAddress->getAddress1());
389
+			$stmt->bind(9, $billingAddress->getAddress2());
390
+			$stmt->bind(10, $billingAddress->getAddress3());
391
+			$stmt->bind(11, $billingAddress->getPostal());
392
+			$stmt->bind(12, $billingAddress->getCity());
393
+			$stmt->bind(13, $billingAddress->getState());
394
+			$stmt->bind(14, $billingAddress->getCountryId());
395
+			$stmt->bind(15, $billingAddress->getLanguageId());
396
+			$stmt->bind(16, $billingAddress->getTelephone());
397
+			$stmt->bind(17, $billingAddress->getTelefax());
398
+			$stmt->bind(18, $billingAddress->getWebsite());
399
+			$stmt->bind(19, $billingAddress->getEmail());
400
+			$stmt->bind(20, $billingAddress->getLongitude());
401
+			$stmt->bind(21, $billingAddress->getLatitude());
402
+			$stmt->bind(22, $item->getLabel());
403
+			$stmt->bind(23, $item->getBirthday());
404
+			$stmt->bind(24, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT);
405
+			$stmt->bind(25, $item->getDateVerified());
406
+			$stmt->bind(26, $item->getPassword());
407
+			$stmt->bind(27, $date); // Modification time
408
+			$stmt->bind(28, $context->getEditor());
409
+
410
+			if ($id !== null) {
411
+				$stmt->bind(29, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT);
412
+				$item->setId($id);
413 413
 			} else {
414
-				$stmt->bind( 29, $date ); // Creation time
414
+				$stmt->bind(29, $date); // Creation time
415 415
 			}
416 416
 
417 417
 			$stmt->execute()->finish();
418 418
 
419
-			if( $id === null && $fetch === true )
419
+			if ($id === null && $fetch === true)
420 420
 			{
421 421
 				/** mshop/customer/manager/laravel/newid
422 422
 				 * Retrieves the ID generated by the database when inserting a new record
@@ -449,14 +449,14 @@  discard block
 block discarded – undo
449 449
 				 * @see mshop/customer/manager/laravel/count
450 450
 				 */
451 451
 				$path = 'mshop/customer/manager/laravel/newid';
452
-				$item->setId( $this->newId( $conn, $path ) );
452
+				$item->setId($this->newId($conn, $path));
453 453
 			}
454 454
 
455
-			$dbm->release( $conn, $dbname );
455
+			$dbm->release($conn, $dbname);
456 456
 		}
457
-		catch( \Exception $e )
457
+		catch (\Exception $e)
458 458
 		{
459
-			$dbm->release( $conn, $dbname );
459
+			$dbm->release($conn, $dbname);
460 460
 			throw $e;
461 461
 		}
462 462
 	}
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
 	 * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface
471 471
 	 * @throws \Aimeos\MShop\Customer\Exception If creating items failed
472 472
 	 */
473
-	public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null )
473
+	public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null)
474 474
 	{
475 475
 		$dbm = $this->getContext()->getDatabaseManager();
476 476
 		$dbname = $this->getResourceName();
477
-		$conn = $dbm->acquire( $dbname );
477
+		$conn = $dbm->acquire($dbname);
478 478
 		$map = array();
479 479
 
480 480
 		try
@@ -482,22 +482,22 @@  discard block
 block discarded – undo
482 482
 			$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
483 483
 			$cfgPathSearch = 'mshop/customer/manager/laravel/search';
484 484
 			$cfgPathCount = 'mshop/customer/manager/laravel/count';
485
-			$required = array( 'customer' );
485
+			$required = array('customer');
486 486
 
487
-			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level );
488
-			while( ( $row = $results->fetch() ) !== false ) {
489
-				$map[ $row['customer.id'] ] = $row;
487
+			$results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level);
488
+			while (($row = $results->fetch()) !== false) {
489
+				$map[$row['customer.id']] = $row;
490 490
 			}
491 491
 
492
-			$dbm->release( $conn, $dbname );
492
+			$dbm->release($conn, $dbname);
493 493
 		}
494
-		catch( \Exception $e )
494
+		catch (\Exception $e)
495 495
 		{
496
-			$dbm->release( $conn, $dbname  );
496
+			$dbm->release($conn, $dbname);
497 497
 			throw $e;
498 498
 		}
499 499
 
500
-		return $this->buildItems( $map, $ref, 'customer' );
500
+		return $this->buildItems($map, $ref, 'customer');
501 501
 	}
502 502
 
503 503
 
@@ -508,8 +508,8 @@  discard block
 block discarded – undo
508 508
 	 * @param string|null $name Name of the implementation, will be from configuration (or Default) if null
509 509
 	 * @return mixed Manager for different extensions, e.g stock, tags, locations, etc.
510 510
 	 */
511
-	public function getSubManager( $manager, $name = null )
511
+	public function getSubManager($manager, $name = null)
512 512
 	{
513
-		return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Laravel' : $name ) );
513
+		return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Laravel' : $name));
514 514
 	}
515 515
 }
Please login to merge, or discard this patch.
lib/custom/tests/MW/Cache/Laravel5Test.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -17,107 +17,107 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		if( interface_exists( '\\Illuminate\\Contracts\\Cache\\Store' ) === false ) {
21
-			$this->markTestSkipped( 'Class \\Illuminate\\Contracts\\Cache\\Store not found' );
20
+		if (interface_exists('\\Illuminate\\Contracts\\Cache\\Store') === false) {
21
+			$this->markTestSkipped('Class \\Illuminate\\Contracts\\Cache\\Store not found');
22 22
 		}
23 23
 
24
-		$this->mock = $this->getMockBuilder( '\\Illuminate\\Contracts\\Cache\\Store' )->getMock();
25
-		$this->object = new \Aimeos\MW\Cache\Laravel5( $this->mock );
24
+		$this->mock = $this->getMockBuilder('\\Illuminate\\Contracts\\Cache\\Store')->getMock();
25
+		$this->object = new \Aimeos\MW\Cache\Laravel5($this->mock);
26 26
 	}
27 27
 
28 28
 
29 29
 	protected function tearDown()
30 30
 	{
31
-		unset( $this->mock, $this->object );
31
+		unset($this->mock, $this->object);
32 32
 	}
33 33
 
34 34
 
35 35
 	public function testDelete()
36 36
 	{
37
-		$this->mock->expects( $this->once() )->method( 'forget' )->with( $this->equalTo( 'key' ) );
38
-		$this->object->delete( 'key' );
37
+		$this->mock->expects($this->once())->method('forget')->with($this->equalTo('key'));
38
+		$this->object->delete('key');
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testDeleteMultiple()
43 43
 	{
44
-		$this->mock->expects( $this->exactly( 2 ) )->method( 'forget' )->with( $this->equalTo( 'key' ) );
45
-		$this->object->deleteMultiple( array( 'key', 'key' ) );
44
+		$this->mock->expects($this->exactly(2))->method('forget')->with($this->equalTo('key'));
45
+		$this->object->deleteMultiple(array('key', 'key'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testDeleteByTags()
50 50
 	{
51
-		$this->mock->expects( $this->once() )->method( 'flush' );
52
-		$this->object->deleteByTags( array( 'tag', 'tag' ) );
51
+		$this->mock->expects($this->once())->method('flush');
52
+		$this->object->deleteByTags(array('tag', 'tag'));
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testClear()
57 57
 	{
58
-		$this->mock->expects( $this->once() )->method( 'flush' );
58
+		$this->mock->expects($this->once())->method('flush');
59 59
 		$this->object->clear();
60 60
 	}
61 61
 
62 62
 
63 63
 	public function testGet()
64 64
 	{
65
-		$this->mock->expects( $this->once() )->method( 'get' )
66
-			->with( $this->equalTo( 'key' ) )->will( $this->returnValue( 'value' ) );
65
+		$this->mock->expects($this->once())->method('get')
66
+			->with($this->equalTo('key'))->will($this->returnValue('value'));
67 67
 
68
-		$this->assertEquals( 'value', $this->object->get( 'key', 'default' ) );
68
+		$this->assertEquals('value', $this->object->get('key', 'default'));
69 69
 	}
70 70
 
71 71
 
72 72
 	public function testGetDefault()
73 73
 	{
74
-		$this->mock->expects( $this->once() )->method( 'get' )
75
-			->with( $this->equalTo( 'key' ) )->will( $this->returnValue( null ) );
74
+		$this->mock->expects($this->once())->method('get')
75
+			->with($this->equalTo('key'))->will($this->returnValue(null));
76 76
 
77
-		$this->assertEquals( 'default', $this->object->get( 'key', 'default' ) );
77
+		$this->assertEquals('default', $this->object->get('key', 'default'));
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testGetMultiple()
82 82
 	{
83
-		$this->mock->expects( $this->exactly( 2 ) )->method( 'get' )
84
-			->will( $this->returnValue( 'value' ) );
83
+		$this->mock->expects($this->exactly(2))->method('get')
84
+			->will($this->returnValue('value'));
85 85
 
86
-		$expected = array( 'key1' => 'value', 'key2' => 'value' );
87
-		$this->assertEquals( $expected, $this->object->getMultiple( array( 'key1', 'key2' ) ) );
86
+		$expected = array('key1' => 'value', 'key2' => 'value');
87
+		$this->assertEquals($expected, $this->object->getMultiple(array('key1', 'key2')));
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testGetMultipleByTags()
92 92
 	{
93
-		$this->assertEquals( array(), $this->object->getMultipleByTags( array( 'key', 'key' ) ) );
93
+		$this->assertEquals(array(), $this->object->getMultipleByTags(array('key', 'key')));
94 94
 	}
95 95
 
96 96
 
97 97
 	public function testSet()
98 98
 	{
99
-		$this->mock->expects( $this->once() )->method( 'put' )
100
-			->with( $this->equalTo( 'key' ), $this->equalTo( 'value' ), $this->greaterThan( 0 ) );
99
+		$this->mock->expects($this->once())->method('put')
100
+			->with($this->equalTo('key'), $this->equalTo('value'), $this->greaterThan(0));
101 101
 
102
-		$this->object->set( 'key', 'value', '2100-01-01 00:00:00', array( 'tag' ) );
102
+		$this->object->set('key', 'value', '2100-01-01 00:00:00', array('tag'));
103 103
 	}
104 104
 
105 105
 
106 106
 	public function testSetForever()
107 107
 	{
108
-		$this->mock->expects( $this->once() )->method( 'forever' )
109
-			->with( $this->equalTo( 'key' ), $this->equalTo( 'value' ) );
108
+		$this->mock->expects($this->once())->method('forever')
109
+			->with($this->equalTo('key'), $this->equalTo('value'));
110 110
 
111
-		$this->object->set( 'key', 'value', null, array( 'tag' ) );
111
+		$this->object->set('key', 'value', null, array('tag'));
112 112
 	}
113 113
 
114 114
 
115 115
 	public function testSetMultiple()
116 116
 	{
117
-		$this->mock->expects( $this->once() )->method( 'put' )
118
-			->with( $this->equalTo( 'key' ), $this->equalTo( 'value' ), $this->greaterThan( 0 ) );
117
+		$this->mock->expects($this->once())->method('put')
118
+			->with($this->equalTo('key'), $this->equalTo('value'), $this->greaterThan(0));
119 119
 
120
-		$expires = array( 'key' => '2100-01-01 00:00:00' );
121
-		$this->object->setMultiple( array( 'key' => 'value' ), $expires, array( 'key' => array( 'tag' ) ) );
120
+		$expires = array('key' => '2100-01-01 00:00:00');
121
+		$this->object->setMultiple(array('key' => 'value'), $expires, array('key' => array('tag')));
122 122
 	}
123 123
 }
Please login to merge, or discard this patch.
lib/custom/src/MW/Cache/Laravel5.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @param \Illuminate\Contracts\Cache\Store $cache Laravel cache object
31 31
 	 */
32
-	public function __construct( \Illuminate\Contracts\Cache\Store $cache )
32
+	public function __construct(\Illuminate\Contracts\Cache\Store $cache)
33 33
 	{
34 34
 		$this->object = $cache;
35 35
 	}
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @param string $key Key string that identifies the single cache entry
55 55
 	 */
56
-	public function delete( $key )
56
+	public function delete($key)
57 57
 	{
58
-		$this->object->forget( $key );
58
+		$this->object->forget($key);
59 59
 	}
60 60
 
61 61
 
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 	 * @param string[] $keys List of key strings that identify the cache entries
68 68
 	 * 	that should be removed
69 69
 	 */
70
-	public function deleteMultiple( $keys )
70
+	public function deleteMultiple($keys)
71 71
 	{
72
-		foreach( $keys as $key ) {
73
-			$this->object->forget( $key );
72
+		foreach ($keys as $key) {
73
+			$this->object->forget($key);
74 74
 		}
75 75
 	}
76 76
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @param string[] $tags List of tag strings that are associated to one or more
84 84
 	 * 	cache entries that should be removed
85 85
 	 */
86
-	public function deleteByTags( array $tags )
86
+	public function deleteByTags(array $tags)
87 87
 	{
88 88
 		// $this->object->tags( $tag )->flush();
89 89
 		$this->object->flush();
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	 * @param string $default Value returned if requested key isn't found
100 100
 	 * @return mixed Value associated to the requested key
101 101
 	 */
102
-	public function get( $name, $default = null )
102
+	public function get($name, $default = null)
103 103
 	{
104
-		if( ( $entry = $this->object->get( $name ) ) !== null ) {
104
+		if (($entry = $this->object->get($name)) !== null) {
105 105
 			return $entry;
106 106
 		}
107 107
 
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 	 * 	entries. If a cache entry doesn't exist, neither its key nor a value
121 121
 	 * 	will be in the result list
122 122
 	 */
123
-	public function getMultiple( $keys, $default = null )
123
+	public function getMultiple($keys, $default = null)
124 124
 	{
125 125
 		$result = array();
126 126
 
127
-		foreach( $keys as $key )
127
+		foreach ($keys as $key)
128 128
 		{
129
-			if( ( $entry = $this->object->get( $key ) ) !== false ) {
129
+			if (($entry = $this->object->get($key)) !== false) {
130 130
 				$result[$key] = $entry;
131 131
 			} else {
132 132
 				$result[$key] = $default;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * 	entries. If a tag isn't associated to any cache entry, nothing is returned
148 148
 	 * 	for that tag
149 149
 	 */
150
-	public function getMultipleByTags( array $tags )
150
+	public function getMultipleByTags(array $tags)
151 151
 	{
152 152
 		return array();
153 153
 	}
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 	 * @param array $tags List of tag strings that should be assoicated to the
166 166
 	 * 	given value in the cache
167 167
 	 */
168
-	public function set( $key, $value, $expires = null, array $tags = array() )
168
+	public function set($key, $value, $expires = null, array $tags = array())
169 169
 	{
170
-		if( is_string( $expires ) ) {
171
-			$this->object->put( $key, $value, (int) ( date_create( $expires )->getTimestamp() - time() ) / 60 );
172
-		} elseif( is_int( $expires ) ) {
173
-			$this->object->put( $key, $value, (int) $expires / 60 );
170
+		if (is_string($expires)) {
171
+			$this->object->put($key, $value, (int) (date_create($expires)->getTimestamp() - time())/60);
172
+		} elseif (is_int($expires)) {
173
+			$this->object->put($key, $value, (int) $expires/60);
174 174
 		} else {
175
-			$this->object->forever( $key, $value );
175
+			$this->object->forever($key, $value);
176 176
 		}
177 177
 	}
178 178
 
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 	 *  should be associated to the values identified by their key. The value
192 192
 	 *  associated to the key can either be a tag string or an array of tag strings
193 193
 	 */
194
-	public function setMultiple( $pairs, $expires = null, array $tags = array() )
194
+	public function setMultiple($pairs, $expires = null, array $tags = array())
195 195
 	{
196
-		foreach( $pairs as $key => $value )
196
+		foreach ($pairs as $key => $value)
197 197
 		{
198
-			$tagList = ( isset( $tags[$key] ) ? (array) $tags[$key] : array() );
199
-			$keyExpire = ( isset( $expires[$key] ) ? $expires[$key] : null );
198
+			$tagList = (isset($tags[$key]) ? (array) $tags[$key] : array());
199
+			$keyExpire = (isset($expires[$key]) ? $expires[$key] : null);
200 200
 
201
-			$this->set( $key, $value, $keyExpire, $tagList );
201
+			$this->set($key, $value, $keyExpire, $tagList);
202 202
 		}
203 203
 	}
204 204
 }
Please login to merge, or discard this patch.
lib/custom/src/MW/Filesystem/Laravel.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param \Illuminate\Contracts\Filesystem\Filesystem $fs Laravel file system object
30 30
 	 * @param string $tempdir Directory for storing temporary files
31 31
 	 */
32
-	public function __construct( \Illuminate\Contracts\Filesystem\Filesystem $fs, $tempdir )
32
+	public function __construct(\Illuminate\Contracts\Filesystem\Filesystem $fs, $tempdir)
33 33
 	{
34 34
 		$this->fs = $fs;
35 35
 		$this->tempdir = $tempdir;
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	 * @return boolean True if directory, false if not
44 44
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
45 45
 	 */
46
-	public function isdir( $path )
46
+	public function isdir($path)
47 47
 	{
48
-		return in_array( basename( $path ), $this->fs->directories( dirname( $path ) ) );
48
+		return in_array(basename($path), $this->fs->directories(dirname($path)));
49 49
 	}
50 50
 
51 51
 
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
 	 * @return void
57 57
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
58 58
 	*/
59
-	public function mkdir( $path )
59
+	public function mkdir($path)
60 60
 	{
61 61
 		try {
62
-			$this->fs->makeDirectory( $path );
63
-		} catch( \Exception $e ) {
64
-			throw new Exception( $e->getMessage(), 0, $e );
62
+			$this->fs->makeDirectory($path);
63
+		} catch (\Exception $e) {
64
+			throw new Exception($e->getMessage(), 0, $e);
65 65
 		}
66 66
 	}
67 67
 
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
 	 * @return void
74 74
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
75 75
 	*/
76
-	public function rmdir( $path )
76
+	public function rmdir($path)
77 77
 	{
78 78
 		try {
79
-			$this->fs->deleteDirectory( $path );
80
-		} catch( \Exception $e ) {
81
-			throw new Exception( $e->getMessage(), 0, $e );
79
+			$this->fs->deleteDirectory($path);
80
+		} catch (\Exception $e) {
81
+			throw new Exception($e->getMessage(), 0, $e);
82 82
 		}
83 83
 	}
84 84
 
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 	 * @return \Iterator|array Iterator over the entries or array with entries
93 93
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
94 94
 	 */
95
-	public function scan( $path = null )
95
+	public function scan($path = null)
96 96
 	{
97 97
 		try {
98
-			return array_merge( $this->fs->directories( $path ), $this->fs->files( $path ) );
99
-		} catch( \Exception $e ) {
100
-			throw new Exception( $e->getMessage(), 0, $e );
98
+			return array_merge($this->fs->directories($path), $this->fs->files($path));
99
+		} catch (\Exception $e) {
100
+			throw new Exception($e->getMessage(), 0, $e);
101 101
 		}
102 102
 	}
103 103
 
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
 	 * @return integer Size in bytes
110 110
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
111 111
 	 */
112
-	public function size( $path )
112
+	public function size($path)
113 113
 	{
114 114
 		try {
115
-			return $this->fs->size( $path );
116
-		} catch( \Exception $e ) {
117
-			throw new Exception( $e->getMessage(), 0, $e );
115
+			return $this->fs->size($path);
116
+		} catch (\Exception $e) {
117
+			throw new Exception($e->getMessage(), 0, $e);
118 118
 		}
119 119
 	}
120 120
 
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 	 * @return integer Unix time stamp in seconds
127 127
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
128 128
 	 */
129
-	public function time( $path )
129
+	public function time($path)
130 130
 	{
131 131
 		try {
132
-			return $this->fs->lastModified( $path );
133
-		} catch( \Exception $e ) {
134
-			throw new Exception( $e->getMessage(), 0, $e );
132
+			return $this->fs->lastModified($path);
133
+		} catch (\Exception $e) {
134
+			throw new Exception($e->getMessage(), 0, $e);
135 135
 		}
136 136
 	}
137 137
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 	 * @return void
144 144
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
145 145
 	 */
146
-	public function rm( $path )
146
+	public function rm($path)
147 147
 	{
148 148
 		try {
149
-			$this->fs->delete( $path );
150
-		} catch( \Exception $e ) {
151
-			throw new Exception( $e->getMessage(), 0, $e );
149
+			$this->fs->delete($path);
150
+		} catch (\Exception $e) {
151
+			throw new Exception($e->getMessage(), 0, $e);
152 152
 		}
153 153
 	}
154 154
 
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 	 * @param string $path Path to the file
160 160
 	 * @return boolean True if it exists, false if not
161 161
 	 */
162
-	public function has( $path )
162
+	public function has($path)
163 163
 	{
164
-		return $this->fs->exists( $path );
164
+		return $this->fs->exists($path);
165 165
 	}
166 166
 
167 167
 
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 	 * @return string File content
175 175
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
176 176
 	 */
177
-	public function read( $path )
177
+	public function read($path)
178 178
 	{
179 179
 		try {
180
-			return $this->fs->get( $path );
181
-		} catch( \Exception $e ) {
182
-			throw new Exception( $e->getMessage(), 0, $e );
180
+			return $this->fs->get($path);
181
+		} catch (\Exception $e) {
182
+			throw new Exception($e->getMessage(), 0, $e);
183 183
 		}
184 184
 	}
185 185
 
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 	 * @return string Path of the local file
192 192
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
193 193
 	 */
194
-	public function readf( $path )
194
+	public function readf($path)
195 195
 	{
196
-		if( ( $filename = tempnam( $this->tempdir, 'ai-' ) ) === false ) {
197
-			throw new Exception( sprintf( 'Unable to create file in "%1$s"', $this->tempdir ) );
196
+		if (($filename = tempnam($this->tempdir, 'ai-')) === false) {
197
+			throw new Exception(sprintf('Unable to create file in "%1$s"', $this->tempdir));
198 198
 		}
199 199
 
200
-		if( @file_put_contents( $filename, $this->fs->get( $path ) ) === false ) {
201
-			throw new Exception( sprintf( 'Couldn\'t write file "%1$s"', $filename ) );
200
+		if (@file_put_contents($filename, $this->fs->get($path)) === false) {
201
+			throw new Exception(sprintf('Couldn\'t write file "%1$s"', $filename));
202 202
 		}
203 203
 
204 204
 		return $filename;
@@ -214,24 +214,24 @@  discard block
 block discarded – undo
214 214
 	 * @return resource File stream descriptor
215 215
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
216 216
 	 */
217
-	public function reads( $path )
217
+	public function reads($path)
218 218
 	{
219 219
 		try {
220
-			$content = $this->fs->get( $path );
221
-		} catch( \Exception $e ) {
222
-			throw new Exception( $e->getMessage(), 0, $e );
220
+			$content = $this->fs->get($path);
221
+		} catch (\Exception $e) {
222
+			throw new Exception($e->getMessage(), 0, $e);
223 223
 		}
224 224
 
225
-		if( ( $stream = tmpfile() ) === false ) {
226
-			throw new Exception( 'Couldn\'t create temporary file' );
225
+		if (($stream = tmpfile()) === false) {
226
+			throw new Exception('Couldn\'t create temporary file');
227 227
 		}
228 228
 
229
-		if( fwrite( $stream, $content ) === false ) {
230
-			throw new Exception( 'Couldn\'t write to temporary file' );
229
+		if (fwrite($stream, $content) === false) {
230
+			throw new Exception('Couldn\'t write to temporary file');
231 231
 		}
232 232
 
233
-		if( rewind( $stream ) === false ) {
234
-			throw new Exception( 'Couldn\'t rewind temporary file' );
233
+		if (rewind($stream) === false) {
234
+			throw new Exception('Couldn\'t rewind temporary file');
235 235
 		}
236 236
 
237 237
 		return $stream;
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 	 * @return void
249 249
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
250 250
 	 */
251
-	public function write( $path, $content )
251
+	public function write($path, $content)
252 252
 	{
253 253
 		try {
254
-			$this->fs->put( $path, $content );
255
-		} catch( \Exception $e ) {
256
-			throw new Exception( $e->getMessage(), 0, $e );
254
+			$this->fs->put($path, $content);
255
+		} catch (\Exception $e) {
256
+			throw new Exception($e->getMessage(), 0, $e);
257 257
 		}
258 258
 	}
259 259
 
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
 	 * @return void
269 269
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
270 270
 	 */
271
-	public function writef( $path, $local )
271
+	public function writef($path, $local)
272 272
 	{
273
-		if( ( $content = @file_get_contents( $local ) ) === false ) {
274
-			throw new Exception( sprintf( 'Couldn\'t read file "%1$s"', $local ) );
273
+		if (($content = @file_get_contents($local)) === false) {
274
+			throw new Exception(sprintf('Couldn\'t read file "%1$s"', $local));
275 275
 		}
276 276
 
277
-		$this->write( $path, $content );
277
+		$this->write($path, $content);
278 278
 	}
279 279
 
280 280
 
@@ -288,17 +288,17 @@  discard block
 block discarded – undo
288 288
 	 * @return void
289 289
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
290 290
 	 */
291
-	public function writes( $path, $stream )
291
+	public function writes($path, $stream)
292 292
 	{
293
-		if( ( $content = @fread( $stream, 0x7ffffffd ) ) === false ) {
293
+		if (($content = @fread($stream, 0x7ffffffd)) === false) {
294 294
 			$error = error_get_last();
295
-			throw new Exception( $error['message'] );
295
+			throw new Exception($error['message']);
296 296
 		}
297 297
 
298 298
 		try {
299
-			$this->fs->put( $path, $content );
300
-		} catch( \Exception $e ) {
301
-			throw new Exception( $e->getMessage(), 0, $e );
299
+			$this->fs->put($path, $content);
300
+		} catch (\Exception $e) {
301
+			throw new Exception($e->getMessage(), 0, $e);
302 302
 		}
303 303
 	}
304 304
 
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
 	 * @return void
312 312
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
313 313
 	 */
314
-	public function move( $from, $to )
314
+	public function move($from, $to)
315 315
 	{
316 316
 		try {
317
-			$this->fs->move( $from, $to );
318
-		} catch( \Exception $e ) {
319
-			throw new Exception( $e->getMessage(), 0, $e );
317
+			$this->fs->move($from, $to);
318
+		} catch (\Exception $e) {
319
+			throw new Exception($e->getMessage(), 0, $e);
320 320
 		}
321 321
 	}
322 322
 
@@ -329,12 +329,12 @@  discard block
 block discarded – undo
329 329
 	 * @return void
330 330
 	 * @throws \Aimeos\MW\Filesystem\Exception If an error occurs
331 331
 	 */
332
-	public function copy( $from, $to )
332
+	public function copy($from, $to)
333 333
 	{
334 334
 		try {
335
-			$this->fs->copy( $from, $to );
336
-		} catch( \Exception $e ) {
337
-			throw new Exception( $e->getMessage(), 0, $e );
335
+			$this->fs->copy($from, $to);
336
+		} catch (\Exception $e) {
337
+			throw new Exception($e->getMessage(), 0, $e);
338 338
 		}
339 339
 	}
340 340
 }
Please login to merge, or discard this patch.