Passed
Push — master ( 50e989...69e622 )
by Aimeos
05:21
created
lib/mshoplib/tests/MShop/Coupon/Provider/VoucherTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 	public function testCheckVoucher()
82 82
 	{
83 83
 		$this->setExpectedException( \Aimeos\MShop\Coupon\Exception::class );
84
-		$this->access( 'checkVoucher' )->invokeArgs( $this->object, [-1, [5,6]] );
84
+		$this->access( 'checkVoucher' )->invokeArgs( $this->object, [-1, [5, 6]] );
85 85
 	}
86 86
 
87 87
 
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Customer/Manager/Property/StandardTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 		$search->setConditions( $search->compare( '==', 'customer.property.editor', $this->editor ) );
55 55
 		$results = $this->object->searchItems( $search );
56 56
 
57
-		if( ( $item = reset($results) ) === false ) {
57
+		if( ( $item = reset( $results ) ) === false ) {
58 58
 			throw new \RuntimeException( 'No property item found' );
59 59
 		}
60 60
 
61
-		$item->setId(null);
61
+		$item->setId( null );
62 62
 		$item->setLanguageId( 'en' );
63 63
 		$resultSaved = $this->object->saveItem( $item );
64 64
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	{
110 110
 		$search = $this->object->createSearch();
111 111
 		$conditions = array(
112
-			$search->compare( '~=', 'customer.property.value', '1'),
112
+			$search->compare( '~=', 'customer.property.value', '1' ),
113 113
 			$search->compare( '==', 'customer.property.editor', $this->editor )
114 114
 		);
115 115
 		$search->setConditions( $search->combine( '&&', $conditions ) );
116 116
 		$results = $this->object->searchItems( $search );
117 117
 
118
-		if( ($expected = reset($results)) === false ) {
118
+		if( ( $expected = reset( $results ) ) === false ) {
119 119
 			throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) );
120 120
 		}
121 121
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
167 167
 		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
168 168
 
169
-		$search->setConditions( $search->combine('&&', $expr) );
169
+		$search->setConditions( $search->combine( '&&', $expr ) );
170 170
 		$results = $this->object->searchItems( $search, [], $total );
171 171
 		$this->assertEquals( 1, count( $results ) );
172 172
 
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
 			$search->compare( '==', 'customer.property.editor', $this->editor )
178 178
 		);
179 179
 		$search->setConditions( $search->combine( '&&', $conditions ) );
180
-		$search->setSlice(0, 1);
180
+		$search->setSlice( 0, 1 );
181 181
 		$items = $this->object->searchItems( $search, [], $total );
182 182
 
183 183
 		$this->assertEquals( 1, count( $items ) );
184 184
 		$this->assertEquals( 1, $total );
185 185
 
186
-		foreach($items as $itemId => $item) {
186
+		foreach( $items as $itemId => $item ) {
187 187
 			$this->assertEquals( $itemId, $item->getId() );
188 188
 		}
189 189
 	}
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
 
192 192
 	public function testGetSubManager()
193 193
 	{
194
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') );
195
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') );
194
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) );
195
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) );
196 196
 
197 197
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
198
-		$this->object->getSubManager('unknown');
198
+		$this->object->getSubManager( 'unknown' );
199 199
 	}
200 200
 
201 201
 
202 202
 	public function testGetSubManagerInvalidName()
203 203
 	{
204 204
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
205
-		$this->object->getSubManager('type', 'unknown');
205
+		$this->object->getSubManager( 'type', 'unknown' );
206 206
 	}
207 207
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Customer/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor = \TestHelperMShop::getContext()->getEditor();
21 21
 		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( \TestHelperMShop::getContext() );
22
-		$this->object = $manager->getSubManager( 'property' )->getSubManager('type');
22
+		$this->object = $manager->getSubManager( 'property' )->getSubManager( 'type' );
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset($this->object);
28
+		unset( $this->object );
29 29
 	}
30 30
 
31 31
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		$results = $this->object->searchItems( $search );
70 70
 
71
-		if( ($expected = reset($results) ) === false )
71
+		if( ( $expected = reset( $results ) ) === false )
72 72
 		{
73 73
 			throw new \RuntimeException( 'No property type item found.' );
74 74
 		}
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$search = $this->object->createSearch();
92 92
 		$search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) );
93
-		$results = $this->object->searchItems($search);
93
+		$results = $this->object->searchItems( $search );
94 94
 
95
-		if( ( $item = reset($results) ) === false ) {
95
+		if( ( $item = reset( $results ) ) === false ) {
96 96
 			throw new \RuntimeException( 'No type item found' );
97 97
 		}
98 98
 
99
-		$item->setId(null);
99
+		$item->setId( null );
100 100
 		$item->setCode( 'unitTestSave' );
101 101
 		$resultSaved = $this->object->saveItem( $item );
102 102
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -157,25 +157,25 @@  discard block
 block discarded – undo
157 157
 		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
158 158
 		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
159 159
 
160
-		$search->setConditions( $search->combine('&&', $expr) );
160
+		$search->setConditions( $search->combine( '&&', $expr ) );
161 161
 		$results = $this->object->searchItems( $search, [], $total );
162 162
 		$this->assertEquals( 1, count( $results ) );
163 163
 
164 164
 
165 165
 		$search = $this->object->createSearch();
166 166
 		$conditions = array(
167
-			$search->compare( '=~', 'customer.property.type.code', 'newsletter'),
167
+			$search->compare( '=~', 'customer.property.type.code', 'newsletter' ),
168 168
 			$search->compare( '==', 'customer.property.type.editor', $this->editor )
169 169
 		);
170
-		$search->setConditions( $search->combine('&&', $conditions ) );
170
+		$search->setConditions( $search->combine( '&&', $conditions ) );
171 171
 		$search->setSortations( [$search->sort( '-', 'customer.property.type.position' )] );
172
-		$search->setSlice(0, 1);
173
-		$items = $this->object->searchItems( $search, [], $total);
172
+		$search->setSlice( 0, 1 );
173
+		$items = $this->object->searchItems( $search, [], $total );
174 174
 
175 175
 		$this->assertEquals( 1, count( $items ) );
176 176
 		$this->assertEquals( 1, $total );
177 177
 
178
-		foreach($items as $itemId => $item) {
178
+		foreach( $items as $itemId => $item ) {
179 179
 			$this->assertEquals( $itemId, $item->getId() );
180 180
 		}
181 181
 	}
@@ -184,6 +184,6 @@  discard block
 block discarded – undo
184 184
 	public function testGetSubManager()
185 185
 	{
186 186
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
187
-		$this->object->getSubManager('unknown');
187
+		$this->object->getSubManager( 'unknown' );
188 188
 	}
189 189
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Common/Item/Property/StandardTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 	public function testSetLanguageId()
70 70
 	{
71
-		$return = $this->object->setLanguageId('fr');
71
+		$return = $this->object->setLanguageId( 'fr' );
72 72
 
73 73
 		$this->assertInstanceOf( \Aimeos\MShop\Common\Item\Property\Iface::class, $return );
74 74
 		$this->assertEquals( 'fr', $this->object->getLanguageId() );
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 	public function testSetTypeId()
98 98
 	{
99
-		$return = $this->object->setTypeId(33);
99
+		$return = $this->object->setTypeId( 33 );
100 100
 
101 101
 		$this->assertInstanceOf( \Aimeos\MShop\Common\Item\Property\Iface::class, $return );
102 102
 		$this->assertEquals( 33, $this->object->getTypeId() );
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 			'common.property.value' => 'value',
163 163
 		);
164 164
 
165
-		$unknown = $item->fromArray($list);
165
+		$unknown = $item->fromArray( $list );
166 166
 
167
-		$this->assertEquals([], $unknown);
167
+		$this->assertEquals( [], $unknown );
168 168
 
169
-		$this->assertEquals($list['common.property.parentid'], $item->getParentId());
170
-		$this->assertEquals($list['common.property.typeid'], $item->getTypeId());
171
-		$this->assertEquals($list['common.property.languageid'], $item->getLanguageId());
172
-		$this->assertEquals($list['common.property.value'], $item->getValue());
169
+		$this->assertEquals( $list['common.property.parentid'], $item->getParentId() );
170
+		$this->assertEquals( $list['common.property.typeid'], $item->getTypeId() );
171
+		$this->assertEquals( $list['common.property.languageid'], $item->getLanguageId() );
172
+		$this->assertEquals( $list['common.property.value'], $item->getValue() );
173 173
 		$this->assertNull( $item->getSiteId() );
174 174
 		$this->assertNull( $item->getTypeName() );
175 175
 		$this->assertNull( $item->getType() );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Supplier/Manager/Factory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,14 +66,14 @@
 block discarded – undo
66 66
 		 * @since 2014.03
67 67
 		 * @category Developer
68 68
 		 */
69
-		if ( $name === null ) {
70
-			$name = $context->getConfig()->get('mshop/supplier/manager/name', 'Standard');
69
+		if( $name === null ) {
70
+			$name = $context->getConfig()->get( 'mshop/supplier/manager/name', 'Standard' );
71 71
 		}
72 72
 
73
-		if ( ctype_alnum($name) === false )
73
+		if( ctype_alnum( $name ) === false )
74 74
 		{
75
-			$classname = is_string($name) ? '\Aimeos\MShop\Supplier\Manager\\' . $name : '<not a string>';
76
-			throw new \Aimeos\MShop\Supplier\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
75
+			$classname = is_string( $name ) ? '\Aimeos\MShop\Supplier\Manager\\' . $name : '<not a string>';
76
+			throw new \Aimeos\MShop\Supplier\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
77 77
 		}
78 78
 
79 79
 		$iface = \Aimeos\MShop\Supplier\Manager\Iface::class;
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Item/ListRef/Traits.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@
 block discarded – undo
209 209
 				$refItem = $item->getRefItem();
210 210
 				$iface = \Aimeos\MShop\Common\Item\Typeid\Iface::class;
211 211
 
212
-				if( $type && ( !$refItem || !($refItem instanceof $iface) || !in_array( $refItem->getType(), $types ) ) ) {
212
+				if( $type && ( !$refItem || !( $refItem instanceof $iface ) || !in_array( $refItem->getType(), $types ) ) ) {
213 213
 					continue;
214 214
 				}
215 215
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Tree/Manager/DBNestedSetTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	public function testConstructorNoDatabaseManager()
180 180
 	{
181 181
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
182
-		new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, null);
182
+		new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, null );
183 183
 	}
184 184
 
185 185
 
186 186
 	public function testConstructorNoConfig()
187 187
 	{
188 188
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
189
-		new \Aimeos\MW\Tree\Manager\DBNestedSet([], self::$dbm);
189
+		new \Aimeos\MW\Tree\Manager\DBNestedSet( [], self::$dbm );
190 190
 	}
191 191
 
192 192
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		unset( $this->config['sql'] );
196 196
 
197 197
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
198
-		new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
198
+		new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
199 199
 	}
200 200
 
201 201
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		unset( $this->config['sql']['newid'] );
205 205
 
206 206
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
207
-		new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
207
+		new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
208 208
 	}
209 209
 
210 210
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		unset( $this->config['search']['id'] );
214 214
 
215 215
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
216
-		new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
216
+		new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
217 217
 	}
218 218
 
219 219
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
 
262 262
 		if( ( $node = reset( $nodes ) ) === false ) {
263
-			throw new \RuntimeException('No node found');
263
+			throw new \RuntimeException( 'No node found' );
264 264
 		}
265 265
 
266 266
 		$search->setConditions( $search->compare( '==', 'tree.level', 3 ) );
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$this->setExpectedException( \Aimeos\MW\DB\Exception::class );
286 286
 
287
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
287
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
288 288
 		$manager->searchNodes( $manager->createSearch() );
289 289
 	}
290 290
 
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
 		$this->setExpectedException( \Aimeos\MW\DB\Exception::class );
322 322
 
323 323
 		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
324
-		$root = $manager->getNode( null, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE  );
325
-		$manager->deleteNode($root->getId());
324
+		$root = $manager->getNode( null, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE );
325
+		$manager->deleteNode( $root->getId() );
326 326
 	}
327 327
 
328 328
 
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
 
393 393
 	public function testGetLevelFromConstantException()
394 394
 	{
395
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
395
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
396 396
 
397 397
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
398
-		$manager->getNode( null, 0);
398
+		$manager->getNode( null, 0 );
399 399
 	}
400 400
 
401 401
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 	public function testInsertNodeException()
434 434
 	{
435
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
435
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
436 436
 		$newNode = $manager->createNode();
437 437
 
438 438
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 		';
1024 1024
 
1025 1025
 
1026
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
1026
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
1027 1027
 
1028 1028
 		$root = $manager->getNode( null, \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );
1029 1029
 
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 		$node = $manager->createNode();
1056 1056
 
1057 1057
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
1058
-		$manager->saveNode($node);
1058
+		$manager->saveNode( $node );
1059 1059
 	}
1060 1060
 
1061 1061
 
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 			UPDATE "mw_tree_test" SET label123 = ?, status = ? WHERE id = ?
1066 1066
 		';
1067 1067
 
1068
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
1068
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
1069 1069
 		$root = $manager->getNode( null, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE );
1070 1070
 
1071 1071
 		$root->setLabel( 'rooot' );
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 		$method = $class->getMethod( 'setReadOnly' );
1082 1082
 		$method->setAccessible( true );
1083 1083
 
1084
-		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet($this->config, self::$dbm);
1084
+		$manager = new \Aimeos\MW\Tree\Manager\DBNestedSet( $this->config, self::$dbm );
1085 1085
 
1086 1086
 		$method->invokeArgs( $manager, [] );
1087 1087
 
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Tree/Node/DBNestedSetTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@
 block discarded – undo
52 52
 
53 53
 	public function testSetId()
54 54
 	{
55
-		$this->object->setId(null);
55
+		$this->object->setId( null );
56 56
 		$this->assertEquals( true, $this->object->isModified() );
57 57
 	}
58 58
 
59 59
 	public function testGetChild()
60 60
 	{
61 61
 		$this->setExpectedException( \Aimeos\MW\Tree\Exception::class );
62
-		$this->object->getChild(null);
62
+		$this->object->getChild( null );
63 63
 	}
64 64
 
65 65
 	public function testMagicGet()
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Media/FactoryTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	public function testGetImage()
16 16
 	{
17 17
 		$ds = DIRECTORY_SEPARATOR;
18
-		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds .'_testfiles' . $ds . 'image.png' );
18
+		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds . '_testfiles' . $ds . 'image.png' );
19 19
 
20 20
 		$this->assertInstanceOf( \Aimeos\MW\Media\Iface::class, $object );
21 21
 		$this->assertInstanceOf( \Aimeos\MW\Media\Image\Iface::class, $object );
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	public function testGetImageAsResource()
26 26
 	{
27 27
 		$ds = DIRECTORY_SEPARATOR;
28
-		$resource = fopen( __DIR__ . $ds .'_testfiles' . $ds . 'image.png', 'rw' );
28
+		$resource = fopen( __DIR__ . $ds . '_testfiles' . $ds . 'image.png', 'rw' );
29 29
 		$object = \Aimeos\MW\Media\Factory::get( $resource );
30 30
 
31 31
 		$this->assertInstanceOf( \Aimeos\MW\Media\Iface::class, $object );
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	public function testGetImageAsString()
37 37
 	{
38 38
 		$ds = DIRECTORY_SEPARATOR;
39
-		$content = file_get_contents( __DIR__ . $ds .'_testfiles' . $ds . 'image.png' );
39
+		$content = file_get_contents( __DIR__ . $ds . '_testfiles' . $ds . 'image.png' );
40 40
 		$object = \Aimeos\MW\Media\Factory::get( $content );
41 41
 
42 42
 		$this->assertInstanceOf( \Aimeos\MW\Media\Iface::class, $object );
Please login to merge, or discard this patch.